Refactored WeaponObject

The scripting of weapons should be much, much easier now. See the
included examples in DevService.

Attributes such as attack speed and range are now being read/written to
the actual items attributes.
This commit is contained in:
Ziggeh
2014-04-13 19:15:17 +02:00
parent b1f413e382
commit cbefc25121
7 changed files with 141 additions and 155 deletions
+2 -8
View File
@@ -278,14 +278,8 @@ public class EquipmentService implements INetworkDispatch {
private int getWeaponCriticalChance(CreatureObject actor, SWGObject item) {
int weaponCriticalChance = 0;
String weaponCriticalSkillMod = (core.scriptService.getMethod("scripts/equipment/", "weapon_critical", item.getStringAttribute("cat_wpn_damage.wpn_category")).__call__().asString());
if(weaponCriticalSkillMod.contains(" "))
weaponCriticalSkillMod.replace(" ", "");
if(weaponCriticalSkillMod.contains("-"))
weaponCriticalSkillMod.replace("-", "");
String weaponCriticalSkillMod = (core.scriptService.getMethod("scripts/equipment/", "weapon_critical", "weap_" + item.getStringAttribute("cat_wpn_damage.wpn_category").replace("@obj_attr_n:wpn_category_", "")).__call__().asString());
if(actor.getSkillMod(weaponCriticalSkillMod) != null)
weaponCriticalChance = actor.getSkillModBase(weaponCriticalSkillMod);