Ejemplo n.º 1
0
        public string generateEqRareUpgradeForPacket()
        {
            short WeaponRare    = 0;
            short WeaponUpgrade = 0;
            short ArmorRare     = 0;
            short ArmorUpgrade  = 0;

            for (short i = 0; i < 15; i++)
            {
                Inventory inv = EquipmentList.LoadBySlotAndType(i, (short)InventoryType.Equipment);
                if (inv != null)
                {
                    Item iteminfo = ServerManager.GetItem(inv.InventoryItem.ItemVNum);

                    if (iteminfo.EquipmentSlot == (short)EquipmentType.Armor)
                    {
                        ArmorRare    = inv.InventoryItem.Rare;
                        ArmorUpgrade = inv.InventoryItem.Upgrade;
                    }
                    else if (iteminfo.EquipmentSlot == (short)EquipmentType.MainWeapon)
                    {
                        WeaponRare    = inv.InventoryItem.Rare;
                        WeaponUpgrade = inv.InventoryItem.Upgrade;
                    }
                }
            }
            return(String.Format("{0}{1} {2}{3}", WeaponUpgrade, WeaponRare, ArmorUpgrade, ArmorRare));
        }
Ejemplo n.º 2
0
        public string GenerateEquipment()
        {
            //equip 86 0 0.4903.6.8.0 2.340.0.0.0 3.4931.0.5.0 4.4845.3.5.0 5.4912.7.9.0 6.4848.1.0.0 7.4849.3.0.0 8.4850.2.0.0 9.227.0.0.0 10.281.0.0.0 11.347.0.0.0 13.4150.0.0.0 14.4076.0.0.0
            string eqlist        = String.Empty;
            short  WeaponRare    = 0;
            short  WeaponUpgrade = 0;
            short  ArmorRare     = 0;
            short  ArmorUpgrade  = 0;

            for (short i = 0; i < 15; i++)
            {
                Inventory inv = EquipmentList.LoadBySlotAndType(i, (short)InventoryType.Equipment);
                if (inv != null)
                {
                    Item iteminfo = ServerManager.GetItem(inv.InventoryItem.ItemVNum);
                    if (iteminfo.EquipmentSlot == (short)EquipmentType.Armor)
                    {
                        ArmorRare    = inv.InventoryItem.Rare;
                        ArmorUpgrade = inv.InventoryItem.Upgrade;
                    }
                    else if (iteminfo.EquipmentSlot == (short)EquipmentType.MainWeapon)
                    {
                        WeaponRare    = inv.InventoryItem.Rare;
                        WeaponUpgrade = inv.InventoryItem.Upgrade;
                    }
                    eqlist += String.Format(" {0}.{1}.{2}.{3}.{4}", i, iteminfo.VNum, inv.InventoryItem.Rare, iteminfo.Colored ? inv.InventoryItem.Color : inv.InventoryItem.Upgrade, 0);
                }
            }
            return(String.Format("equip {0}{1} {2}{3}{4}", WeaponUpgrade, WeaponRare, ArmorUpgrade, ArmorRare, eqlist));
        }
Ejemplo n.º 3
0
        public string GenerateEq()
        {
            int       color = HairColor;
            Inventory head  = EquipmentList.LoadBySlotAndType((short)EquipmentType.Hat, (short)InventoryType.Equipment);

            if (head != null && ServerManager.GetItem(head.InventoryItem.ItemVNum).Colored)
            {
                color = head.InventoryItem.Color;
            }

            return(String.Format("eq {0} {1} {2} {3} {4} {5} {6} {7}", CharacterId, (Authority == 2 ? 2 : 0), Gender, HairStyle, color, Class, generateEqListForPacket(), generateEqRareUpgradeForPacket()));
        }
Ejemplo n.º 4
0
        public string GeneratePairy()
        {
            Inventory fairy = EquipmentList.LoadBySlotAndType((short)EquipmentType.Fairy, (short)InventoryType.Equipment);

            if (fairy != null)
            {
                return(String.Format("pairy 1 {0} 4 {1} {2} {3}", CharacterId, ServerManager.GetItem(fairy.InventoryItem.ItemVNum).Element, fairy.InventoryItem.ElementRate, ServerManager.GetItem(fairy.InventoryItem.ItemVNum).Morph));
            }
            else
            {
                return(String.Format("pairy 1 {0} 0 0 0 40", CharacterId));
            }
        }
Ejemplo n.º 5
0
        public string GenerateReqInfo()
        {
            Inventory Fairy   = EquipmentList.LoadBySlotAndType((short)EquipmentType.Fairy, (short)InventoryType.Equipment);
            Inventory Armor   = EquipmentList.LoadBySlotAndType((short)EquipmentType.Armor, (short)InventoryType.Equipment);
            Inventory Weapon2 = EquipmentList.LoadBySlotAndType((short)EquipmentType.SecondaryWeapon, (short)InventoryType.Equipment);
            Inventory Weapon  = EquipmentList.LoadBySlotAndType((short)EquipmentType.MainWeapon, (short)InventoryType.Equipment);

            return(String.Format("tc_info {0} {1} {2} {3} {4} {9} 0 {8} {5} {6} {10} {11} {12} {13} {14} {15} {16} {17} {18} 0 0 {20} 0 0 0 {19} 0 0 0 0 0 {21} 0 0 0 0 {7}", Level, Name, Fairy != null ? ServerManager.GetItem(Fairy.InventoryItem.ItemVNum).Element : 0, Fairy != null ? Fairy.InventoryItem.ElementRate : 0, Class, GetReputIco(), GetDigniteIco(),
                                 Language.Instance.GetMessageFromKey("NO_PREZ_MESSAGE"), Language.Instance.GetMessageFromKey("NO_FAMILY"),
                                 Gender, Weapon != null ? 1 : 0, Weapon != null ? Weapon.InventoryItem.Rare : 0, Weapon != null ? Weapon.InventoryItem.Upgrade : 0,
                                 Weapon2 != null ? 1 : 0, Weapon2 != null ? Weapon2.InventoryItem.Rare : 0, Weapon2 != null ? Weapon2.InventoryItem.Upgrade : 0,
                                 Armor != null ? 1 : 0, Armor != null ? Armor.InventoryItem.Rare : 0, Armor != null ? Armor.InventoryItem.Upgrade : 0, UseSp ? Morph : 0, Reput, Compliment));
        }
Ejemplo n.º 6
0
        public string GenerateIn()
        {
            int       Color = HairColor;
            Inventory head  = EquipmentList.LoadBySlotAndType((short)EquipmentType.Hat, (short)InventoryType.Equipment);

            if (head != null && ServerManager.GetItem(head.InventoryItem.ItemVNum).Colored)
            {
                Color = head.InventoryItem.Color;
            }
            Inventory fairy = EquipmentList.LoadBySlotAndType((short)EquipmentType.Fairy, (short)InventoryType.Equipment);


            return(String.Format("in 1 {0} - {1} {2} {3} {4} {5} {6} {7} {8} {9} {17} {10} {11} {12} -1 {25} {22} 0 {23} 0 {19} {18} -1 - {13} {16} {20} 0 {21} {14} 0 {15} {26} {24}", Name, CharacterId, MapX, MapY, Direction, (Authority == 2 ? 2 : 0), Gender, HairStyle, Color, Class, (int)((Hp / HPLoad()) * 100), (int)((Mp / MPLoad()) * 100), _rested, (GetDigniteIco() == 1) ? GetReputIco() : -GetDigniteIco(), 0, ArenaWinner, _invisible, generateEqListForPacket(), generateEqRareUpgradeForPacket(), (UseSp ? Morph : 0), (UseSp ? MorphUpgrade : 0), (UseSp ? MorphUpgrade2 : 0), fairy != null ? ServerManager.GetItem(fairy.InventoryItem.ItemVNum).Element : 0, fairy != null ? ServerManager.GetItem(fairy.InventoryItem.ItemVNum).Morph : 0, Size, fairy != null ? 2 : 0, Compliment));
        }
Ejemplo n.º 7
0
        public string generateEqListForPacket()
        {
            string[] invarray = new string[15];
            for (short i = 0; i < 15; i++)
            {
                Inventory inv = EquipmentList.LoadBySlotAndType(i, (short)InventoryType.Equipment);
                if (inv != null)
                {
                    invarray[i] = inv.InventoryItem.ItemVNum.ToString();
                }
                else
                {
                    invarray[i] = "-1";
                }
            }

            return(String.Format("{0}.{1}.{2}.{3}.{4}.{5}.{6}.{7}", invarray[(short)EquipmentType.Hat], invarray[(short)EquipmentType.Armor], invarray[(short)EquipmentType.MainWeapon], invarray[(short)EquipmentType.SecondaryWeapon], invarray[(short)EquipmentType.Mask], invarray[(short)EquipmentType.Fairy], invarray[(short)EquipmentType.CostumeSuite], invarray[(short)EquipmentType.CostumeHat]));
        }
Ejemplo n.º 8
0
        public string GenerateStatChar()
        {
            int type  = 0;
            int type2 = 0;

            switch (Class)
            {
            case (byte)ClassType.Adventurer:
                type  = 0;
                type2 = 1;
                break;

            case (byte)ClassType.Magician:
                type  = 2;
                type2 = 1;
                break;

            case (byte)ClassType.Swordman:
                type  = 0;
                type2 = 1;
                break;

            case (byte)ClassType.Archer:
                type  = 1;
                type2 = 0;
                break;
            }

            int WeaponUpgrade    = 0;
            int MinHit           = 0;
            int MaxHit           = 0;
            int HitRate          = 0;
            int HitCCRate        = 0;
            int HitCC            = 0;
            int SecondaryUpgrade = 0;
            int MinDist          = 0;
            int MaxDist          = 0;
            int DistRate         = 0;
            int DistCCRate       = 0;
            int DistCC           = 0;
            int ArmorUpgrade     = 0;
            int def         = 0;
            int defrate     = 0;
            int distdefrate = 0;
            int distdef     = 0;
            int magic       = 0;
            int fire        = 0;
            int water       = 0;
            int light       = 0;
            int dark        = 0;

            Inventory weapon = EquipmentList.LoadBySlotAndType((short)EquipmentType.MainWeapon, (short)InventoryType.Equipment);

            if (weapon != null)
            {
                Item iteminfo = ServerManager.GetItem(weapon.InventoryItem.ItemVNum);
                WeaponUpgrade = weapon.InventoryItem.Upgrade;
                MinHit        = weapon.InventoryItem.DamageMinimum + iteminfo.DamageMinimum;
                MaxHit        = weapon.InventoryItem.DamageMaximum + iteminfo.DamageMaximum;
                HitRate       = weapon.InventoryItem.HitRate + iteminfo.HitRate;
                HitCCRate     = weapon.InventoryItem.CriticalLuckRate + iteminfo.CriticalLuckRate;
                HitCC         = weapon.InventoryItem.CriticalRate + iteminfo.CriticalRate;
            }

            Inventory weapon2 = EquipmentList.LoadBySlotAndType((short)EquipmentType.SecondaryWeapon, (short)InventoryType.Equipment);

            if (weapon2 != null)
            {
                Item iteminfo = ServerManager.GetItem(weapon2.InventoryItem.ItemVNum);
                SecondaryUpgrade = weapon2.InventoryItem.Upgrade;
                MinDist          = weapon2.InventoryItem.DamageMinimum + iteminfo.DamageMinimum;
                MaxDist          = weapon2.InventoryItem.DamageMaximum + iteminfo.DamageMaximum;
                DistRate         = weapon2.InventoryItem.HitRate + iteminfo.HitRate;
                DistCCRate       = weapon2.InventoryItem.CriticalLuckRate + iteminfo.CriticalLuckRate;
                DistCC           = weapon2.InventoryItem.CriticalRate + iteminfo.CriticalRate;
            }

            Inventory armor = EquipmentList.LoadBySlotAndType((short)EquipmentType.Armor, (short)InventoryType.Equipment);

            if (armor != null)
            {//TODO add base stats
                Item iteminfo = ServerManager.GetItem(armor.InventoryItem.ItemVNum);
                ArmorUpgrade = armor.InventoryItem.Upgrade;
                def          = armor.InventoryItem.RangeDefence + iteminfo.RangeDefence;
                defrate      = armor.InventoryItem.DefenceDodge + iteminfo.DefenceDodge;
                distdef      = armor.InventoryItem.DistanceDefence + iteminfo.DistanceDefence;
                distdefrate  = armor.InventoryItem.DistanceDefenceDodge + iteminfo.DistanceDefenceDodge;
                magic        = armor.InventoryItem.MagicDefence + iteminfo.MagicDefence;
            }

            Inventory gloves = EquipmentList.LoadBySlotAndType((short)EquipmentType.Gloves, (short)InventoryType.Equipment);
            Inventory boots  = EquipmentList.LoadBySlotAndType((short)EquipmentType.Boots, (short)InventoryType.Equipment);

            if (gloves != null)
            {
                fire  += gloves.InventoryItem.FireElement;
                light += gloves.InventoryItem.LightElement;
                water += gloves.InventoryItem.WaterElement;
                dark  += gloves.InventoryItem.DarkElement;
            }
            if (boots != null)
            {
                fire  += boots.InventoryItem.FireElement;
                light += boots.InventoryItem.LightElement;
                water += boots.InventoryItem.WaterElement;
                dark  += boots.InventoryItem.DarkElement;
            }

            return(String.Format("sc {0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16} {17} {18} {19} {20} {21} {22} {23}", type, WeaponUpgrade, MinHit, MaxHit, HitRate, HitCCRate, HitCC, type2, SecondaryUpgrade, MinDist, MaxDist, DistRate, DistCCRate, DistCC, ArmorUpgrade, def, defrate, distdef, distdefrate, magic, fire, water, light, dark));
        }
Ejemplo n.º 9
0
        public string GenerateLev()
        {
            Inventory specialist = EquipmentList.LoadBySlotAndType((short)EquipmentType.Sp, (short)InventoryType.Equipment);

            return(String.Format("lev {0} {1} {2} {3} {4} {5} {6} 2", Level, LevelXp, !UseSp || specialist == null ? JobLevel : specialist.InventoryItem.SpLevel, !UseSp || specialist == null ? JobLevelXp : specialist.InventoryItem.SpXp, XPLoad(), JobXPLoad(), Reput));
        }