diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/94800-94899.xml b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/94800-94899.xml index da1313ca23..4bdd8b2f80 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/94800-94899.xml +++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/94800-94899.xml @@ -681,7 +681,7 @@ - + @@ -878,7 +878,7 @@ - + @@ -897,7 +897,7 @@ - + @@ -918,7 +918,7 @@ - + @@ -939,7 +939,7 @@ - + @@ -960,7 +960,7 @@ - + @@ -981,7 +981,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1023,7 +1023,7 @@ - + @@ -1044,7 +1044,7 @@ - + @@ -1064,7 +1064,7 @@ - + @@ -1085,7 +1085,7 @@ - + @@ -1106,9 +1106,13 @@ + + + + @@ -1116,10 +1120,14 @@ + + + + @@ -1127,10 +1135,14 @@ + + + + @@ -1138,10 +1150,14 @@ + + + + @@ -1149,10 +1165,14 @@ + + + + @@ -1175,7 +1195,7 @@ - + diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/95400-95499.xml b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/95400-95499.xml index 968744763f..20154e4ecc 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/95400-95499.xml +++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/95400-95499.xml @@ -181,7 +181,7 @@ - + @@ -233,7 +233,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -278,7 +278,7 @@ - + @@ -301,7 +301,7 @@ - + @@ -325,7 +325,7 @@ - + @@ -349,7 +349,7 @@ - + @@ -373,7 +373,7 @@ - + @@ -397,7 +397,7 @@ - + @@ -421,7 +421,7 @@ - + @@ -445,7 +445,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -760,7 +760,7 @@ - + @@ -1096,7 +1096,7 @@ - + diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/95600-95699.xml b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/95600-95699.xml index 882a214d7d..c80e26147a 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/95600-95699.xml +++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/stats/items/95600-95699.xml @@ -1025,7 +1025,7 @@ - + diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java index fdf1213cfd..4e05ad4963 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1042,12 +1042,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe if (isPlayer()) { // Check if there are arrows to use or else cancel the attack. - if (!checkAndEquipAmmunition(weaponItem.getItemType().isCrossbow() ? EtcItemType.BOLT : EtcItemType.ARROW)) + if (!checkAndEquipAmmunition(weaponItem.getItemType().isPistols() ? EtcItemType.ELEMENTAL_ORB : weaponItem.getItemType().isCrossbow() ? EtcItemType.BOLT : EtcItemType.ARROW)) { // Cancel the action because the PlayerInstance have no arrow getAI().setIntention(AI_INTENTION_ACTIVE); sendPacket(ActionFailed.STATIC_PACKET); - sendPacket(SystemMessageId.YOU_HAVE_RUN_OUT_OF_ARROWS); + if (weaponItem.getItemType().isPistols()) + { + sendPacket(SystemMessageId.YOU_CANNOT_ATTACK_BECAUSE_YOU_DON_T_HAVE_AN_ELEMENTAL_ORB); + } + else + { + sendPacket(SystemMessageId.YOU_HAVE_RUN_OUT_OF_ARROWS); + } return; } diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index eb9e096868..3370cfdcce 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -5789,6 +5789,10 @@ public class PlayerInstance extends Playable { arrows = _inventory.findBoltForCrossBow(weapon); } + else if (type == EtcItemType.ELEMENTAL_ORB) + { + arrows = _inventory.findElementalOrbForPistols(weapon); + } if (arrows != null) { // Equip arrows needed in left hand diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index cc36465e75..ae9b8824b2 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -2132,6 +2132,27 @@ public abstract class Inventory extends ItemContainer return bolt; } + /** + * Return the ItemInstance of the bolts needed for these pistols. + * @param pistols : Item designating the pistols + * @return ItemInstance pointing out elemental orb for pistols + */ + public ItemInstance findElementalOrbForPistols(Item pistols) + { + ItemInstance orb = null; + for (ItemInstance item : getItems()) + { + if (item.isEtcItem() && (item.getItem().getCrystalTypePlus() == pistols.getCrystalTypePlus()) && (item.getEtcItem().getItemType() == EtcItemType.ELEMENTAL_ORB)) + { + orb = item; + break; + } + } + + // Get the ItemInstance corresponding to the item identifier and return it + return orb; + } + /** * Get back items in inventory from database */ diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index b352bd7fc0..00ee1d30ed 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -92,7 +92,8 @@ public enum EtcItemType implements ItemType MULTI_INC_PROB_ENCHT_WP, MULTI_INC_PROB_ENCHT_AM, SOUL_CRYSTAL, - ENSOUL_STONE; + ENSOUL_STONE, + ELEMENTAL_ORB; /** * @return the ID of the item after applying the mask. diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/items/type/WeaponType.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/items/type/WeaponType.java index f50a13d010..74b59f572a 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/items/type/WeaponType.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/items/type/WeaponType.java @@ -42,7 +42,8 @@ public enum WeaponType implements ItemType DUALDAGGER(TraitType.DUALDAGGER), OWNTHING(TraitType.NONE), // 0 items with that type TWOHANDCROSSBOW(TraitType.TWOHANDCROSSBOW), - DUALBLUNT(TraitType.DUALBLUNT); + DUALBLUNT(TraitType.DUALBLUNT), + PISTOLS(TraitType.PISTOLS); private final int _mask; private final TraitType _traitType; @@ -76,7 +77,7 @@ public enum WeaponType implements ItemType public boolean isRanged() { - return (this == BOW) || (this == CROSSBOW) || (this == TWOHANDCROSSBOW); + return (this == BOW) || (this == CROSSBOW) || (this == TWOHANDCROSSBOW) || (this == PISTOLS); } public boolean isCrossbow() @@ -84,6 +85,11 @@ public enum WeaponType implements ItemType return (this == CROSSBOW) || (this == TWOHANDCROSSBOW); } + public boolean isPistols() + { + return (this == PISTOLS); + } + public boolean isDual() { return (this == DUALFIST) || (this == DUAL) || (this == DUALDAGGER) || (this == DUALBLUNT); diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/stats/TraitType.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/stats/TraitType.java index 8ce741f33b..06986f7ab3 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/stats/TraitType.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/stats/TraitType.java @@ -88,7 +88,8 @@ public enum TraitType ZONE(3), PSYCHIC(3), EMBRYO_WEAKNESS(2), - SPIRIT_WEAKNESS(2); + SPIRIT_WEAKNESS(2), + PISTOLS(1); private final int _type; // 1 = weapon, 2 = weakness, 3 = resistance private static final List _weaknesses = new ArrayList<>();