mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-27 17:57:22 -04:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user