Exemplo n.º 1
0
        public void dropMe(int x, int y, int z, L2Character dropper, L2Character killer, int seconds)
        {
            X = x;
            Y = y;
            Z = z;
            L2dotNET.Game.network.l2send.DropItem pk = new L2dotNET.Game.network.l2send.DropItem(this);
            if (dropper != null)
            {
                _dropper = dropper.ObjID;
            }

            Location = L2ItemLocation.ground;

            if (killer != null)
            {
                killer.addKnownObject(this, pk, true);
            }

            L2World.Instance.RealiseEntry(this, pk, true);
        }
Exemplo n.º 2
0
        public L2Item(ItemTemplate template)
        {
            ObjID      = IdFactory.Instance.nextId();
            Template   = template;
            Count      = 1;
            Durability = template.Durability;
            Location   = L2ItemLocation.none;

            if (template.LimitedMinutes > 0)
            {
                LifeTimeEndEnabled = true;
                LifeTimeEndTime    = DateTime.Now.AddMinutes(template.LimitedMinutes);
                //    lifeTimeEnd = DateTime.Now.AddHours(template.LimitedHours).ToString("yyyy-MM-dd HH-mm-ss");
            }

            if (template.enchanted > 0)
            {
                Enchant = template.enchanted;
            }
        }
Exemplo n.º 3
0
        public void unequip(L2Player owner)
        {
            _isEquipped    = 0;
            _paperdollSlot = -1;

            if (Template.AbnormalMaskEvent > 0)
            {
                owner.AbnormalBitMaskEvent &= ~Template.AbnormalMaskEvent;
            }

            bool upsend = false;

            if (Template.item_skill != null)
            {
                upsend = true;
                owner.removeSkill(Template.item_skill.skill_id, false, false);
            }

            if (Template.item_skill_ench4 != null)
            {
                upsend = true;
                owner.removeSkill(Template.item_skill_ench4.skill_id, false, false);
            }

            if (Template.unequip_skill != null)
            {
                owner.addEffect(owner, Template.unequip_skill, true, false);
            }

            Location = L2ItemLocation.inventory;

            if (upsend)
            {
                owner.updateSkillList();
            }

            if (Template.WeaponType == ItemTemplate.L2ItemWeaponType.bow || Template.WeaponType == ItemTemplate.L2ItemWeaponType.crossbow)
            {
                owner.Inventory.setPaperdoll(InvPC.EQUIPITEM_LHand, null, true);
                owner.SecondaryWeaponSupport = null;
            }

            if (Template.SetItem)
            {
                ItemTable.getInstance().NotifyKeySetItem(owner, this, false);
            }

            if (Template.Type == ItemTemplate.L2ItemType.armor && owner.setKeyItems != null && owner.setKeyItems.Contains(Template.ItemID))
            {
                ItemTable.getInstance().NotifySetItemEquip(owner, this, false);
            }

            if (Template.Type == ItemTemplate.L2ItemType.armor || Template.Type == ItemTemplate.L2ItemType.weapon || Template.Type == ItemTemplate.L2ItemType.accessary)
            {
                if (Enchant == 0)
                {
                    owner.sendPacket(new SystemMessage(417).addItemName(Template.ItemID));//$s1 has been disarmed.
                }
                else
                {
                    owner.sendPacket(new SystemMessage(1064).addNumber(Enchant).addItemName(Template.ItemID));//The equipment, +$s1 $s2, has been removed.
                }
            }

            owner.removeStats(this);
        }
Exemplo n.º 4
0
        public void equip(L2Player owner)
        {
            _isEquipped = 1;

            if (Template.AbnormalMaskEvent > 0)
            {
                owner.AbnormalBitMaskEvent |= Template.AbnormalMaskEvent;
            }

            bool upsend = false;

            if (Template.item_skill != null)
            {
                upsend = true;
                owner.addSkill(Template.item_skill, false, false);
            }

            if (Template.item_skill_ench4 != null && Enchant >= 4)
            {
                upsend = true;
                owner.addSkill(Template.item_skill_ench4, false, false);
            }

            Location = L2ItemLocation.paperdoll;

            if (Template.Bodypart == ItemTemplate.L2ItemBodypart.lhand && Template.WeaponType == ItemTemplate.L2ItemWeaponType.shield)
            {
                L2Item weapon = owner.Inventory.getWeapon();
                if (weapon != null && weapon.Template.Bodypart == ItemTemplate.L2ItemBodypart.lrhand)
                {
                    owner.Inventory.setPaperdoll(InvPC.EQUIPITEM_RHand, null, true);
                }
            }

            if (upsend)
            {
                owner.updateSkillList();
            }

            if (Template.WeaponType == ItemTemplate.L2ItemWeaponType.bow || Template.WeaponType == ItemTemplate.L2ItemWeaponType.crossbow)
            {
                tryEquipSecondary(owner);
            }

            if (Template.SetItem)
            {
                ItemTable.getInstance().NotifyKeySetItem(owner, this, true);
            }

            if (Template.Type == ItemTemplate.L2ItemType.armor && owner.setKeyItems != null && owner.setKeyItems.Contains(Template.ItemID))
            {
                ItemTable.getInstance().NotifySetItemEquip(owner, this, true);
            }

            if (Template.Type == ItemTemplate.L2ItemType.armor || Template.Type == ItemTemplate.L2ItemType.weapon || Template.Type == ItemTemplate.L2ItemType.accessary)
            {
                if (Enchant == 0)
                {
                    owner.sendPacket(new SystemMessage(49).addItemName(Template.ItemID));//You have equipped your $s1.
                }
                else
                {
                    owner.sendPacket(new SystemMessage(368).addNumber(Enchant).addItemName(Template.ItemID));//Equipped +$s1 $s2.
                }
            }

            owner.addStats(this);
        }