mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-27 17:57:22 -04:00
Advancement towards PUP Application
A few PUPS can now be applied. Some effect names do not match the buff.iff table yet
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import sys
|
||||
from java.lang import Float
|
||||
|
||||
def setup(core, actor, buff):
|
||||
|
||||
#powerup = actor.getUseTarget()
|
||||
powerupID = actor.getAttachment('LastUsedPUP')
|
||||
powerup = core.objectService.getObject(long(powerupID))
|
||||
effectName = powerup.getAttachment("effectName");
|
||||
powerValue = powerup.getAttachment("powerValue");
|
||||
effectName = effectName.replace('@stat_n:', '')
|
||||
actor.sendSystemMessage('en %s' % effectName, 0)
|
||||
actor.sendSystemMessage('pv %s' % powerValue, 0)
|
||||
buff.setDuration(Float(1800.0))
|
||||
if effectName:
|
||||
buff.setEffect1Name(effectName)
|
||||
if powerValue:
|
||||
buff.setEffect1Value(Float(powerValue))
|
||||
return
|
||||
|
||||
def add(core, actor, buff):
|
||||
|
||||
return
|
||||
|
||||
def remove(core, actor, buff):
|
||||
|
||||
return
|
||||
@@ -0,0 +1,11 @@
|
||||
import sys
|
||||
from java.lang import Long
|
||||
|
||||
def setup():
|
||||
return
|
||||
|
||||
def run(core, actor, target, objectid):
|
||||
object = core.objectService.getObject(long(objectid))
|
||||
target.setAttachment('UsedObjectID',Long(objectid))
|
||||
core.objectService.useObject(actor, target)
|
||||
return
|
||||
@@ -44,6 +44,8 @@ import protocol.swg.PlayClientEffectObjectTransformMessage;
|
||||
import protocol.swg.StopClientEffectObjectByLabel;
|
||||
import resources.common.OutOfBand;
|
||||
import resources.datatables.DisplayType;
|
||||
import resources.datatables.Options;
|
||||
import resources.datatables.WeaponType;
|
||||
import resources.loot.LootGroup;
|
||||
import resources.loot.LootRollSession;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
@@ -2854,6 +2856,38 @@ public class LootService implements INetworkDispatch {
|
||||
skillEnhancingAttachment2.setAttachment("SEAmodifierValueList", effectValueList);
|
||||
playerInventory.add(skillEnhancingAttachment2);
|
||||
|
||||
WeaponObject sword1 = (WeaponObject) core.objectService.createObject("object/weapon/melee/sword/shared_sword_01.iff", player.getPlanet());
|
||||
sword1.setIntAttribute("required_combat_level", 90);
|
||||
sword1.setAttackSpeed(1);
|
||||
sword1.setMaxRange(5);
|
||||
sword1.setDamageType("kinetic");
|
||||
sword1.setMinDamage(1100);
|
||||
sword1.setMaxDamage(1200);
|
||||
sword1.setOptions(Options.SOCKETED, true);
|
||||
sword1.setOptions(Options.USABLE, true);
|
||||
sword1.setWeaponType(WeaponType.ONEHANDEDMELEE);
|
||||
playerInventory.add(sword1);
|
||||
System.err.println("MIX " + sword1.getObjectID());
|
||||
|
||||
|
||||
String powerUpLabel = "item_reverse_engineering_powerup_weapon_02_01";
|
||||
String powerUpDescription = "item_reverse_engineering_powerup_weapon_02_01";
|
||||
String powerUpTemplate = "object/tangible/powerup/base/shared_weapon_base.iff";
|
||||
|
||||
int powerValue = 12;
|
||||
TangibleObject powerUp = (TangibleObject) core.objectService.createObject(powerUpTemplate, player.getPlanet());
|
||||
|
||||
powerUp.setStfFilename("static_item_n");
|
||||
powerUp.setStfName(powerUpLabel);
|
||||
powerUp.setDetailFilename("static_item_d");
|
||||
powerUp.setDetailName(powerUpDescription);
|
||||
powerUp.setIntAttribute("@stat_n:droid_experimentation", powerValue);
|
||||
powerUp.setAttachment("effectName","droid_experimentation");
|
||||
powerUp.setAttachment("powerValue",powerValue);
|
||||
powerUp.setIntAttribute("num_in_stack", 250);
|
||||
powerUp.setAttachment("radial_filename", "item/item");
|
||||
playerInventory.add(powerUp);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -675,6 +675,8 @@ public class ObjectService implements INetworkDispatch {
|
||||
}
|
||||
|
||||
public void useObject(CreatureObject creature, final SWGObject object) {
|
||||
System.out.println("creature " + creature);
|
||||
System.out.println("object " + object);
|
||||
if (creature == null || object == null) {
|
||||
return;
|
||||
}
|
||||
@@ -764,37 +766,25 @@ public class ObjectService implements INetworkDispatch {
|
||||
}
|
||||
if (object.getTemplate().equals(powerUpTemplate3)){
|
||||
// weapon
|
||||
SWGObject usedObject = null;
|
||||
if (object.getAttachment("UsedObjectID")!=null){
|
||||
long usedObjectid = (long)object.getAttachment("UsedObjectID");
|
||||
usedObject = core.objectService.getObject(usedObjectid);
|
||||
}
|
||||
|
||||
String effectName = (String) object.getAttachment("effectName");
|
||||
int powerValue = (int) object.getAttachment("powerValue");
|
||||
creature.setAttachment("LastUsedPUP",object.getObjectID());
|
||||
|
||||
Long weaponID = (Long) creature.getAttachment("EquippedWeapon");
|
||||
if (weaponID==null)
|
||||
return;
|
||||
|
||||
WeaponObject weapon = (WeaponObject) core.objectService.getObject(weaponID);
|
||||
//weapon.setIntAttribute(effectName, powerValue);
|
||||
weapon.setAttachment("PUPEffectName", effectName);
|
||||
weapon.setAttachment("PUPEffectValue", powerValue);
|
||||
if (usedObject==null){
|
||||
Long weaponID = (Long) creature.getAttachment("EquippedWeapon");
|
||||
System.out.println("weaponID " + weaponID);
|
||||
if (weaponID==null)
|
||||
return;
|
||||
|
||||
WeaponObject weapon = (WeaponObject) core.objectService.getObject(weaponID);
|
||||
usedObject = (SWGObject) weapon;
|
||||
}
|
||||
|
||||
List<String> statList = new ArrayList<String>();
|
||||
statList.add("constitution_modified");
|
||||
statList.add("agility_modified");
|
||||
statList.add("precision_modified");
|
||||
statList.add("strength_modified");
|
||||
statList.add("stamina_modified");
|
||||
statList.add("luck_modified");
|
||||
if (statList.contains(effectName)){
|
||||
// Probably this has to be done preferably via the buff service or a new power up service
|
||||
// Problem : Some of the effect names do NOT occur in buff.iff
|
||||
// So Light or Treeku better look into this
|
||||
weapon.setIntAttribute("cat_stat_mod_bonus."+effectName, powerValue);
|
||||
core.skillModService.addSkillMod(creature, "cat_stat_mod_bonus."+effectName, powerValue);
|
||||
} else {
|
||||
// assume skillmod then
|
||||
weapon.setIntAttribute("cat_skill_mod_bonus."+effectName, powerValue);
|
||||
core.skillModService.addSkillMod(creature, "cat_skill_mod_bonus."+effectName, powerValue);
|
||||
}
|
||||
core.buffService.addBuffToCreature(creature, "powerup_weapon", creature);
|
||||
|
||||
int amount = object.getIntAttribute("num_in_stack");
|
||||
if (amount==1)
|
||||
|
||||
@@ -31,6 +31,7 @@ import java.util.Vector;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import resources.datatables.Options;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
import resources.objects.player.PlayerObject;
|
||||
import resources.objects.tangible.TangibleObject;
|
||||
@@ -3313,6 +3314,8 @@ public class ReverseEngineeringService implements INetworkDispatch {
|
||||
skillEnhancingAttachment.setAttachment("SEAeffectNameList", effectNameList);
|
||||
skillEnhancingAttachment.setAttachment("SEAmodifierValueList", effectValueList);
|
||||
skillEnhancingAttachment.setAttachment("radial_filename", "item/item");
|
||||
//skillEnhancingAttachment.setOptions(Options.SOCKETED, true);
|
||||
skillEnhancingAttachment.setOptions(Options.USABLE, true);
|
||||
engineerInventory.add(skillEnhancingAttachment);
|
||||
}
|
||||
}
|
||||
@@ -3454,11 +3457,18 @@ public class ReverseEngineeringService implements INetworkDispatch {
|
||||
skillEnhancingAttachment.setAttachment("SEAeffectNameList", effectNameList);
|
||||
skillEnhancingAttachment.setAttachment("SEAmodifierValueList", effectValueList);
|
||||
skillEnhancingAttachment.setAttachment("radial_filename", "item/item");
|
||||
//skillEnhancingAttachment.setOptions(Options.SOCKETED, true);
|
||||
skillEnhancingAttachment.setOptions(Options.USABLE, true);
|
||||
engineerInventory.add(skillEnhancingAttachment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void applyPowerUp(TangibleObject powerUpObject, long objectID){
|
||||
TangibleObject object = (TangibleObject)core.objectService.getObject(objectID);
|
||||
|
||||
}
|
||||
|
||||
public int getHighestStat(TangibleObject piece){
|
||||
int highestStat = 0;
|
||||
Map<String,String> attributesMap = piece.getAttributes();
|
||||
|
||||
Reference in New Issue
Block a user