Item enchant level should not be negative.
This commit is contained in:
@@ -914,17 +914,18 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -919,17 +919,18 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -919,17 +919,18 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -919,17 +919,18 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -617,15 +617,17 @@ public class Item extends WorldObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the level of enchantment of the item.
|
* Sets the level of enchantment of the item.
|
||||||
* @param enchantLevel the new enchant level
|
* @param level the new enchant level
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_enchantLevel = enchantLevel;
|
|
||||||
|
_enchantLevel = newLevel;
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -619,15 +619,17 @@ public class Item extends WorldObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the level of enchantment of the item.
|
* Sets the level of enchantment of the item.
|
||||||
* @param enchantLevel the new enchant level
|
* @param level the new enchant level
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_enchantLevel = enchantLevel;
|
|
||||||
|
_enchantLevel = newLevel;
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -858,16 +858,18 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -861,16 +861,18 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -861,16 +861,18 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -919,17 +919,18 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -919,17 +919,18 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -923,11 +923,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -955,7 +956,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -965,7 +966,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -981,7 +982,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -923,11 +923,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -955,7 +956,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -965,7 +966,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -981,7 +982,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -923,11 +923,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -955,7 +956,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -965,7 +966,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -981,7 +982,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -923,11 +923,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -955,7 +956,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -965,7 +966,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -981,7 +982,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -914,16 +914,18 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEnchantStats();
|
clearEnchantStats();
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
@@ -926,11 +926,12 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param enchantLevel the enchant value to set
|
* @param level the enchant value to set
|
||||||
*/
|
*/
|
||||||
public void setEnchantLevel(int enchantLevel)
|
public void setEnchantLevel(int level)
|
||||||
{
|
{
|
||||||
if (_enchantLevel == enchantLevel)
|
final int newLevel = Math.max(0, level);
|
||||||
|
if (_enchantLevel == newLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -958,7 +959,7 @@ public class Item extends WorldObject
|
|||||||
// Add new skills.
|
// Add new skills.
|
||||||
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1)
|
||||||
{
|
{
|
||||||
for (Skill skill : agathionSkills.getMainSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getMainSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -968,7 +969,7 @@ public class Item extends WorldObject
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Skill skill : agathionSkills.getSubSkills(enchantLevel))
|
for (Skill skill : agathionSkills.getSubSkills(newLevel))
|
||||||
{
|
{
|
||||||
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
if (skill.isPassive() && !skill.checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer()))
|
||||||
{
|
{
|
||||||
@@ -984,7 +985,7 @@ public class Item extends WorldObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchantLevel = enchantLevel;
|
_enchantLevel = newLevel;
|
||||||
applyEnchantStats();
|
applyEnchantStats();
|
||||||
_storedInDb = false;
|
_storedInDb = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user