weapon enchants used as self buff
This commit is contained in:
@@ -850,9 +850,14 @@ public enum PowersManager {
|
||||
// return;
|
||||
//}
|
||||
|
||||
if(HandleItemEnchantments(playerCharacter, msg))
|
||||
if(HandleItemEnchantments(playerCharacter, msg)) {
|
||||
playerCharacter.setIsCasting(false);
|
||||
PerformActionMsg castMsg = new PerformActionMsg(msg);
|
||||
castMsg.setNumTrains(9999);
|
||||
castMsg.setUnknown04(2);
|
||||
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, castMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
return;
|
||||
|
||||
}
|
||||
PerformActionMsg performActionMsg;
|
||||
Dispatch dispatch;
|
||||
|
||||
@@ -3134,13 +3139,39 @@ public enum PowersManager {
|
||||
return false;
|
||||
for (ActionsBase action : pb.getActions()){
|
||||
try {
|
||||
if(msg.getNumTrains() > action.maxTrains)
|
||||
continue;
|
||||
EffectsBase eb = action.getPowerAction().getEffectsBase();
|
||||
if(eb == null)
|
||||
return false;
|
||||
Effect eff = pc.addEffectNoTimer(eb.getName(),eb,msg.getNumTrains(),false);
|
||||
if(eff == null){
|
||||
Logger.error(pc.getFirstName() + " failed to apply self buff: " + msg.getPowerUsedID());
|
||||
}
|
||||
//Effect eff = pc.addEffectNoTimer(eb.getName(),eb,msg.getNumTrains(),false);
|
||||
//if(eff == null){
|
||||
// Logger.error(pc.getFirstName() + " failed to apply self buff: " + msg.getPowerUsedID());
|
||||
//}
|
||||
|
||||
UsePowerJob asj =new UsePowerJob(pc,msg,eb.getToken(),pb,pc.getLiveCounter(),pc.getLiveCounter());
|
||||
|
||||
JobContainer jc = JobScheduler.getInstance().scheduleJob(asj, 1800000);
|
||||
Effect eff = new Effect(jc, eb, msg.getNumTrains());
|
||||
pc.effects.put("CASTABLE", eff);
|
||||
pc.applyAllBonuses();
|
||||
|
||||
ApplyEffectMsg pum = new ApplyEffectMsg();
|
||||
pum.setEffectID(eff.getEffectToken());
|
||||
pum.setSourceType(pc.getObjectType().ordinal());
|
||||
pum.setSourceID(pc.getObjectUUID());
|
||||
pum.setTargetType(pc.getObjectType().ordinal());
|
||||
pum.setTargetID(pc.getObjectUUID());
|
||||
pum.setNumTrains(eff.getTrains());
|
||||
pum.setUnknown05(1);
|
||||
pum.setUnknown02(2);
|
||||
pum.setUnknown06((byte) 1);
|
||||
pum.setEffectSourceType(GameObjectType.PlayerCharacter.ordinal());
|
||||
pum.setEffectSourceID(pc.getObjectUUID());
|
||||
pum.setDuration(1800);
|
||||
|
||||
|
||||
DispatchMessage.dispatchMsgToInterestArea(pc, pum, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
}
|
||||
catch(Exception e){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user