Track poweraction work
This commit is contained in:
@@ -86,15 +86,15 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler {
|
||||
if (ablist == null)
|
||||
return true;
|
||||
|
||||
TrackPowerAction tpa = null;
|
||||
TrackPowerAction trackPowerAction = null;
|
||||
|
||||
for (ActionsBase ab : ablist) {
|
||||
AbstractPowerAction apa = ab.getPowerAction();
|
||||
if (apa != null && apa instanceof TrackPowerAction)
|
||||
tpa = (TrackPowerAction) apa;
|
||||
trackPowerAction = (TrackPowerAction) apa;
|
||||
}
|
||||
|
||||
if (tpa == null)
|
||||
if (trackPowerAction == null)
|
||||
return true;
|
||||
|
||||
// Check powers for normal users
|
||||
@@ -111,16 +111,16 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler {
|
||||
int mask = 0;
|
||||
|
||||
if (pb.targetPlayer())
|
||||
if (tpa.trackVampire()) // track vampires
|
||||
if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.Vampire)) // track vampires
|
||||
mask = MBServerStatics.MASK_PLAYER | MBServerStatics.MASK_UNDEAD;
|
||||
else
|
||||
// track all players
|
||||
mask = MBServerStatics.MASK_PLAYER;
|
||||
else if (pb.targetCorpse()) // track corpses
|
||||
mask = MBServerStatics.MASK_CORPSE;
|
||||
else if (tpa.trackNPC()) // Track NPCs
|
||||
else if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.NPC)) // Track NPCs
|
||||
mask = MBServerStatics.MASK_NPC;
|
||||
else if (tpa.trackUndead()) // Track Undead
|
||||
else if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.Undead)) // Track Undead
|
||||
mask = MBServerStatics.MASK_MOB | MBServerStatics.MASK_UNDEAD;
|
||||
else
|
||||
// Track All
|
||||
|
||||
@@ -25,63 +25,20 @@ import java.util.HashMap;
|
||||
public class TrackPowerAction extends AbstractPowerAction {
|
||||
|
||||
private String effectID;
|
||||
private boolean trackPlayer;
|
||||
private boolean trackCorpse;
|
||||
private boolean trackAll;
|
||||
private boolean trackDragon;
|
||||
private boolean trackGiant;
|
||||
private boolean trackNPC;
|
||||
private boolean trackUndead;
|
||||
private boolean trackVampire;
|
||||
private int maxTrack;
|
||||
private EffectsBase effect;
|
||||
public PowerAction powerAction;
|
||||
|
||||
public TrackPowerAction(PowerAction powerAction, HashMap<String, EffectsBase> effects) {
|
||||
super(powerAction);
|
||||
this.effectID = powerAction.effects.get(0).effect_id;
|
||||
this.effect = effects.get(this.effectID);
|
||||
this.powerAction = powerAction;
|
||||
}
|
||||
|
||||
public String getEffectID() {
|
||||
return this.effectID;
|
||||
}
|
||||
|
||||
public boolean trackPlayer() {
|
||||
return this.trackPlayer;
|
||||
}
|
||||
|
||||
public boolean trackCorpse() {
|
||||
return this.trackCorpse;
|
||||
}
|
||||
|
||||
public boolean trackAll() {
|
||||
return this.trackAll;
|
||||
}
|
||||
|
||||
public boolean trackDragon() {
|
||||
return this.trackDragon;
|
||||
}
|
||||
|
||||
public boolean trackGiant() {
|
||||
return this.trackGiant;
|
||||
}
|
||||
|
||||
public boolean trackNPC() {
|
||||
return this.trackNPC;
|
||||
}
|
||||
|
||||
public boolean trackUndead() {
|
||||
return this.trackUndead;
|
||||
}
|
||||
|
||||
public boolean trackVampire() {
|
||||
return this.trackVampire;
|
||||
}
|
||||
|
||||
public int getMaxTrack() {
|
||||
return this.maxTrack;
|
||||
}
|
||||
|
||||
public EffectsBase getEffect() {
|
||||
return this.effect;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user