mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-14 04:13:14 -04:00
Fixed an issue where equipping an item on top of a set-bonus item wouldn't remove the set buff.
This commit is contained in:
@@ -84,20 +84,7 @@ public class EquipmentService implements INetworkDispatch {
|
||||
for (Equipment equipment : replacedEquipment) {
|
||||
SWGObject replacedItem = core.objectService.getObject(equipment.getObjectId());
|
||||
|
||||
if (actor.isWearing(replacedItem)) {
|
||||
String template = ((replacedItem.getAttachment("customServerTemplate") == null) ? replacedItem.getTemplate() : (replacedItem.getTemplate().split("shared_")[0] + "shared_" + ((String) replacedItem.getAttachment("customServerTemplate")) + ".iff"));
|
||||
String serverTemplate = template.replace(".iff", "");
|
||||
|
||||
PyObject func = core.scriptService.getMethod("scripts/" + serverTemplate.split("shared_" , 2)[0].replace("shared_", ""), serverTemplate.split("shared_" , 2)[1], "unequip");
|
||||
|
||||
if (func != null) {
|
||||
func.__call__(Py.java2py(core), Py.java2py(actor), Py.java2py(replacedItem));
|
||||
}
|
||||
|
||||
processItemAtrributes(actor, replacedItem, false);
|
||||
} else {
|
||||
replacedEquipment.remove(equipment);
|
||||
}
|
||||
unequip(actor, replacedItem);
|
||||
}
|
||||
|
||||
String template = ((item.getAttachment("customServerTemplate") == null) ? item.getTemplate() : (item.getTemplate().split("shared_")[0] + "shared_" + ((String) item.getAttachment("customServerTemplate")) + ".iff"));
|
||||
@@ -120,7 +107,7 @@ public class EquipmentService implements INetworkDispatch {
|
||||
actor.setWeaponId(item.getObjectID());
|
||||
}
|
||||
|
||||
processItemAtrributes(actor, item, true);//FIXME: If item bonuses stop working this might need to be moved back to the line before "actor.addObjectToEquipList(item);"
|
||||
processItemAtrributes(actor, item, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +133,7 @@ public class EquipmentService implements INetworkDispatch {
|
||||
|
||||
actor.removeObjectFromEquipList(item);
|
||||
|
||||
processItemAtrributes(actor, item, false);//FIXME: If item bonuses stop working this might need to be moved back to the line before "actor.removeObjectFromEquipList(item);"
|
||||
processItemAtrributes(actor, item, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,7 +393,7 @@ public class EquipmentService implements INetworkDispatch {
|
||||
creature.setMaxAction(creature.getMaxAction() + Integer.parseInt((String) e.getValue()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else {//FIXME: 0000248_2 Whenever a player equips an item that isn't part of the set then the set bonus doesn't get removed.
|
||||
if (item.getStringAttribute("cat_wpn_damage.wpn_category") != null) {
|
||||
core.skillModService.deductSkillMod(creature, "display_only_critical", getWeaponCriticalChance(creature, item));
|
||||
creature.setAttachment("EquippedWeapon", null);
|
||||
@@ -445,7 +432,7 @@ public class EquipmentService implements INetworkDispatch {
|
||||
|
||||
calculateArmorProtection(creature, equipping);
|
||||
|
||||
if (item.getAttachment("setBonus") != null) {
|
||||
if (item.getAttachment("setBonus") != null) {//FIXME: 0000248_2 Whenever a player equips an item that isn't part of the set then the set bonus doesn't get removed.
|
||||
BonusSetTemplate bonus = bonusSetTemplates.get((String)item.getAttachment("setBonus"));
|
||||
bonus.callScript(creature);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user