Fixed talisman display on login.
This commit is contained in:
@@ -371,6 +371,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-7
@@ -1356,6 +1356,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1418,21 +1419,33 @@ public abstract class Inventory extends ItemContainer
|
|||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -373,6 +373,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-7
@@ -1362,6 +1362,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1424,21 +1425,33 @@ public abstract class Inventory extends ItemContainer
|
|||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -373,6 +373,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-7
@@ -1362,6 +1362,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1424,21 +1425,33 @@ public abstract class Inventory extends ItemContainer
|
|||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -372,6 +372,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-7
@@ -1362,6 +1362,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1424,21 +1425,33 @@ public abstract class Inventory extends ItemContainer
|
|||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -364,6 +364,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1405,6 +1405,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1442,25 +1443,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1490,57 +1492,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -364,6 +364,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1487,6 +1487,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1524,25 +1525,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1572,57 +1574,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -364,6 +364,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1487,6 +1487,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1524,25 +1525,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1572,57 +1574,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -362,6 +362,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1481,6 +1481,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1518,25 +1519,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1566,57 +1568,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -362,6 +362,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1463,6 +1463,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1500,25 +1501,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1548,57 +1550,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -362,6 +362,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1463,6 +1463,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1500,25 +1501,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1548,57 +1550,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -362,6 +362,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1474,6 +1474,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1511,25 +1512,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1559,57 +1561,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -362,6 +362,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1476,6 +1476,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1513,25 +1514,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1561,57 +1563,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -366,6 +366,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-7
@@ -1358,6 +1358,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1420,21 +1421,33 @@ public abstract class Inventory extends ItemContainer
|
|||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -366,6 +366,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-7
@@ -1358,6 +1358,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1420,21 +1421,33 @@ public abstract class Inventory extends ItemContainer
|
|||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -368,6 +368,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-7
@@ -1364,6 +1364,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1426,21 +1427,33 @@ public abstract class Inventory extends ItemContainer
|
|||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -372,6 +372,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-7
@@ -1364,6 +1364,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1426,21 +1427,33 @@ public abstract class Inventory extends ItemContainer
|
|||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -372,6 +372,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1407,6 +1407,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1444,25 +1445,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1492,57 +1494,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -373,6 +373,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1489,6 +1489,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1526,25 +1527,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1574,57 +1576,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -373,6 +373,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1489,6 +1489,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1526,25 +1527,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1574,57 +1576,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -373,6 +373,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1489,6 +1489,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1526,25 +1527,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1574,57 +1576,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -371,6 +371,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1483,6 +1483,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1520,25 +1521,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1568,57 +1570,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -372,6 +372,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-7
@@ -1356,6 +1356,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1418,21 +1419,33 @@ public abstract class Inventory extends ItemContainer
|
|||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -371,6 +371,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1609,6 +1609,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1646,25 +1647,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1694,57 +1696,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -371,6 +371,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1618,6 +1618,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1655,25 +1656,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1703,57 +1705,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -373,6 +373,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1618,6 +1618,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1655,25 +1656,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1703,57 +1705,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
@@ -373,6 +373,11 @@ public class PlayerStat extends PlayableStat
|
|||||||
*/
|
*/
|
||||||
public int getTalismanSlots()
|
public int getTalismanSlots()
|
||||||
{
|
{
|
||||||
|
if (!getActiveChar().hasEnteredWorld())
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
return _talismanSlots.get();
|
return _talismanSlots.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-17
@@ -1620,6 +1620,7 @@ public abstract class Inventory extends ItemContainer
|
|||||||
*/
|
*/
|
||||||
public synchronized Item setPaperdollItem(int slot, Item item)
|
public synchronized Item setPaperdollItem(int slot, Item item)
|
||||||
{
|
{
|
||||||
|
final Creature owner = getOwner();
|
||||||
final Item old = _paperdoll[slot];
|
final Item old = _paperdoll[slot];
|
||||||
if (old != item)
|
if (old != item)
|
||||||
{
|
{
|
||||||
@@ -1657,25 +1658,26 @@ public abstract class Inventory extends ItemContainer
|
|||||||
old.updateDatabase();
|
old.updateDatabase();
|
||||||
|
|
||||||
// Remove agathion skills.
|
// Remove agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(old.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().removeSkill(skill, false, skill.isPassive());
|
player.removeSkill(skill, false, skill.isPassive());
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1705,57 +1707,70 @@ public abstract class Inventory extends ItemContainer
|
|||||||
item.updateDatabase();
|
item.updateDatabase();
|
||||||
|
|
||||||
// Add agathion skills.
|
// Add agathion skills.
|
||||||
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer())
|
if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && owner.isPlayer())
|
||||||
{
|
{
|
||||||
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId());
|
||||||
if (agathionSkills != null)
|
if (agathionSkills != null)
|
||||||
{
|
{
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
if (slot == PAPERDOLL_AGATHION1)
|
if (slot == PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getMainSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
for (Skill skill : agathionSkills.getSubSkills(item.getEnchantLevel()))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, player, player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getOwner().getActingPlayer().addSkill(skill, false);
|
player.addSkill(skill, false);
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
getOwner().getActingPlayer().sendSkillList();
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_paperdollCache.clearCachedStats();
|
_paperdollCache.clearCachedStats();
|
||||||
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
|
owner.getStat().recalculateStats(!owner.isPlayer());
|
||||||
|
|
||||||
if (getOwner().isPlayer())
|
if (owner.isPlayer())
|
||||||
{
|
{
|
||||||
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));
|
owner.sendPacket(new ExUserInfoEquipSlot(owner.getActingPlayer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify to scripts
|
|
||||||
if (old != null)
|
if (old != null)
|
||||||
{
|
{
|
||||||
final Creature owner = getOwner();
|
if ((owner != null) && owner.isPlayer())
|
||||||
if ((owner != null) && owner.isPlayer() && EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(owner.getActingPlayer(), old), old.getTemplate());
|
// Proper talisman display on login.
|
||||||
|
final Player player = owner.getActingPlayer();
|
||||||
|
if ((slot == PAPERDOLL_RBRACELET) && !player.hasEnteredWorld())
|
||||||
|
{
|
||||||
|
for (ItemSkillHolder skill : old.getTemplate().getAllSkills())
|
||||||
|
{
|
||||||
|
player.addSkill(skill.getSkill(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify to scripts.
|
||||||
|
if (EventDispatcher.getInstance().hasListener(EventType.ON_PLAYER_ITEM_UNEQUIP, old.getTemplate()))
|
||||||
|
{
|
||||||
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerItemUnequip(player, old), old.getTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user