diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java index 2213caf3ec..219593b776 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java index 2b90533cc5..0891b22986 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java index 2b90533cc5..0891b22986 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java index 2b90533cc5..0891b22986 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java index 2b90533cc5..0891b22986 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java index 2b90533cc5..0891b22986 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java index 2b90533cc5..0891b22986 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java index 2b90533cc5..0891b22986 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java index 7d5bb7aa02..613e935f41 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java @@ -237,16 +237,28 @@ public class NpcInstance extends Creature setName(template.getName()); } + /** + * Receive the stored int value for this {@link NpcInstance}. + * @return stored script value + */ public int getScriptValue() { return _scriptValue; } + /** + * Sets the script value related with this {@link NpcInstance}. + * @param value value to store + */ public void setScriptValue(int value) { _scriptValue = value; } + /** + * @param value value to store + * @return {@code true} if stored script value equals given value, {@code false} otherwise + */ public boolean isScriptValue(int value) { return _scriptValue == value; @@ -2964,8 +2976,7 @@ public class NpcInstance extends Creature } /** - * Set the spawn of the NpcInstance.
- *
+ * Set the spawn of the NpcInstance. * @param spawn The Spawn that manage the NpcInstance */ public void setSpawn(Spawn spawn) @@ -3014,6 +3025,9 @@ public class NpcInstance extends Creature { _spawn.decreaseCount(this); } + + // Clear script value + _scriptValue = 0; } /** diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Npc.java index 2cea26b82a..42a8e91664 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -150,6 +150,9 @@ public class Npc extends Creature private int _shotsMask = 0; private int _killingBlowWeaponId; + + private int _scriptValue = 0; + /** Map of summoned NPCs by this NPC. */ private Map _summonedNpcs = null; @@ -1331,6 +1334,9 @@ public class Npc extends Creature { ((Npc) summoner).removeSummonedNpc(getObjectId()); } + + // Clear script value + _scriptValue = 0; } /** @@ -1661,31 +1667,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Npc.java index 2cea26b82a..42a8e91664 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -150,6 +150,9 @@ public class Npc extends Creature private int _shotsMask = 0; private int _killingBlowWeaponId; + + private int _scriptValue = 0; + /** Map of summoned NPCs by this NPC. */ private Map _summonedNpcs = null; @@ -1331,6 +1334,9 @@ public class Npc extends Creature { ((Npc) summoner).removeSummonedNpc(getObjectId()); } + + // Clear script value + _scriptValue = 0; } /** @@ -1661,31 +1667,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Npc.java index 9efcc7d9c8..90502209f8 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Npc.java index 9efcc7d9c8..90502209f8 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Npc.java index 9efcc7d9c8..90502209f8 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Npc.java index f74f986666..7111695c0a 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -150,6 +150,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1148,6 +1149,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1418,31 +1422,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Npc.java index f74f986666..7111695c0a 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -150,6 +150,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1148,6 +1149,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1418,31 +1422,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java index f74f986666..7111695c0a 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -150,6 +150,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1148,6 +1149,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1418,31 +1422,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /** diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Npc.java index 9efcc7d9c8..90502209f8 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Npc.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Npc.java @@ -149,6 +149,7 @@ public class Npc extends Creature private NpcStringId _nameString; private StatSet _params; + private int _scriptValue = 0; private RaidBossStatus _raidStatus; /** Contains information about local tax payments. */ @@ -1136,6 +1137,9 @@ public class Npc extends Creature { instance.removeNpc(this); } + + // Clear script value + _scriptValue = 0; } /** @@ -1406,31 +1410,30 @@ public class Npc extends Creature } /** - * Short wrapper for backward compatibility + * Receive the stored int value for this {@link Npc} instance. * @return stored script value */ public int getScriptValue() { - return getVariables().getInt("SCRIPT_VAL"); + return _scriptValue; } /** - * Short wrapper for backward compatibility. Stores script value + * Sets the script value related with this {@link Npc} instance. * @param value value to store */ public void setScriptValue(int value) { - getVariables().set("SCRIPT_VAL", value); + _scriptValue = value; } /** - * Short wrapper for backward compatibility. * @param value value to store * @return {@code true} if stored script value equals given value, {@code false} otherwise */ public boolean isScriptValue(int value) { - return getVariables().getInt("SCRIPT_VAL") == value; + return _scriptValue == value; } /**