Player NPE check for Item setEnchantLevel.
This commit is contained in:
@@ -1035,7 +1035,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1040,7 +1040,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1040,7 +1040,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1040,7 +1040,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+18
-9
@@ -1044,48 +1044,54 @@ public class Item extends WorldObject
|
|||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
|
|
||||||
// Agathion skills.
|
// Agathion skills.
|
||||||
|
final Player player = getActingPlayer();
|
||||||
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
// Remove old skills.
|
// Remove old skills.
|
||||||
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,12 +1100,15 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
|
||||||
// Notify to Scripts
|
// Notify to Scripts
|
||||||
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(getActingPlayer(), this));
|
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(player, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-9
@@ -1044,48 +1044,54 @@ public class Item extends WorldObject
|
|||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
|
|
||||||
// Agathion skills.
|
// Agathion skills.
|
||||||
|
final Player player = getActingPlayer();
|
||||||
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
// Remove old skills.
|
// Remove old skills.
|
||||||
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,12 +1100,15 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
|
||||||
// Notify to Scripts
|
// Notify to Scripts
|
||||||
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(getActingPlayer(), this));
|
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(player, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-9
@@ -1044,48 +1044,54 @@ public class Item extends WorldObject
|
|||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
|
|
||||||
// Agathion skills.
|
// Agathion skills.
|
||||||
|
final Player player = getActingPlayer();
|
||||||
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
// Remove old skills.
|
// Remove old skills.
|
||||||
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,12 +1100,15 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
|
||||||
// Notify to Scripts
|
// Notify to Scripts
|
||||||
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(getActingPlayer(), this));
|
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(player, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-9
@@ -1044,48 +1044,54 @@ public class Item extends WorldObject
|
|||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
|
|
||||||
// Agathion skills.
|
// Agathion skills.
|
||||||
|
final Player player = getActingPlayer();
|
||||||
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
// Remove old skills.
|
// Remove old skills.
|
||||||
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,12 +1100,15 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
|
||||||
// Notify to Scripts
|
// Notify to Scripts
|
||||||
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(getActingPlayer(), this));
|
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(player, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-9
@@ -1044,48 +1044,54 @@ public class Item extends WorldObject
|
|||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
|
|
||||||
// Agathion skills.
|
// Agathion skills.
|
||||||
|
final Player player = getActingPlayer();
|
||||||
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
// Remove old skills.
|
// Remove old skills.
|
||||||
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,12 +1100,15 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
|
||||||
// Notify to Scripts
|
// Notify to Scripts
|
||||||
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(getActingPlayer(), this));
|
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(player, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-9
@@ -1044,48 +1044,54 @@ public class Item extends WorldObject
|
|||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
|
|
||||||
// Agathion skills.
|
// Agathion skills.
|
||||||
|
final Player player = getActingPlayer();
|
||||||
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
// Remove old skills.
|
// Remove old skills.
|
||||||
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,12 +1100,15 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
|
||||||
// Notify to Scripts
|
// Notify to Scripts
|
||||||
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(getActingPlayer(), this));
|
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(player, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-9
@@ -1044,48 +1044,54 @@ public class Item extends WorldObject
|
|||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
|
|
||||||
// Agathion skills.
|
// Agathion skills.
|
||||||
|
final Player player = getActingPlayer();
|
||||||
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
// Remove old skills.
|
// Remove old skills.
|
||||||
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,12 +1100,15 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
|
||||||
// Notify to Scripts
|
// Notify to Scripts
|
||||||
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(getActingPlayer(), this));
|
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(player, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-9
@@ -1044,48 +1044,54 @@ public class Item extends WorldObject
|
|||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
|
|
||||||
// Agathion skills.
|
// Agathion skills.
|
||||||
|
final Player player = getActingPlayer();
|
||||||
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
// Remove old skills.
|
// Remove old skills.
|
||||||
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,12 +1100,15 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
|
||||||
// Notify to Scripts
|
// Notify to Scripts
|
||||||
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(getActingPlayer(), this));
|
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(player, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-9
@@ -1044,48 +1044,54 @@ public class Item extends WorldObject
|
|||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
|
|
||||||
// Agathion skills.
|
// Agathion skills.
|
||||||
|
final Player player = getActingPlayer();
|
||||||
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
// Remove old skills.
|
// Remove old skills.
|
||||||
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,12 +1100,15 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
|
||||||
// Notify to Scripts
|
// Notify to Scripts
|
||||||
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(getActingPlayer(), this));
|
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(player, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-9
@@ -1044,48 +1044,54 @@ public class Item extends WorldObject
|
|||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
|
|
||||||
// Agathion skills.
|
// Agathion skills.
|
||||||
|
final Player player = getActingPlayer();
|
||||||
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
if (isEquipped() && (_itemTemplate.getBodyPart() == ItemTemplate.SLOT_AGATHION))
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
// Remove old skills.
|
// Remove old skills.
|
||||||
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(_enchantLevel))
|
||||||
{
|
{
|
||||||
getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getActingPlayer().addSkill(skill, false);
|
|
||||||
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,12 +1100,15 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
|
||||||
// Notify to Scripts
|
// Notify to Scripts
|
||||||
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_ITEM_ENCHANT_ADD))
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(getActingPlayer(), this));
|
EventDispatcher.getInstance().notifyEventAsync(new OnItemEnchantAdd(player, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1035,7 +1035,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1035,7 +1035,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1040,7 +1040,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1040,7 +1040,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1091,7 +1091,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1091,7 +1091,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1091,7 +1091,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1091,7 +1091,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1091,7 +1091,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1035,7 +1035,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1094,7 +1094,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1094,7 +1094,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1095,7 +1095,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1095,7 +1095,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1095,7 +1095,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+5
-1
@@ -1095,7 +1095,11 @@ public class Item extends WorldObject
|
|||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
getActingPlayer().getInventory().getPaperdollCache().clearArmorSetEnchant();
|
final Player player = getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.getInventory().getPaperdollCache().clearArmorSetEnchant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user