fixup 2
This commit is contained in:
@@ -101,10 +101,6 @@ public enum CombatManager {
|
|||||||
|
|
||||||
public static void AttackTarget(PlayerCharacter playerCharacter, AbstractWorldObject target) {
|
public static void AttackTarget(PlayerCharacter playerCharacter, AbstractWorldObject target) {
|
||||||
|
|
||||||
if(playerCharacter != null && playerCharacter.isBoxed)
|
|
||||||
if(target.getObjectType().equals(GameObjectType.PlayerCharacter))
|
|
||||||
return;
|
|
||||||
|
|
||||||
boolean swingOffhand = false;
|
boolean swingOffhand = false;
|
||||||
|
|
||||||
//check my weapon can I do an offhand attack
|
//check my weapon can I do an offhand attack
|
||||||
@@ -316,6 +312,7 @@ public enum CombatManager {
|
|||||||
if(pet.combatTarget == null && pet.assist)
|
if(pet.combatTarget == null && pet.assist)
|
||||||
pet.setCombatTarget(attacker.combatTarget);
|
pet.setCombatTarget(attacker.combatTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -484,6 +481,7 @@ public enum CombatManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
range += 2;
|
||||||
if (NotInRange(abstractCharacter, target, range)) {
|
if (NotInRange(abstractCharacter, target, range)) {
|
||||||
|
|
||||||
//target is in stealth and can't be seen by source
|
//target is in stealth and can't be seen by source
|
||||||
@@ -507,6 +505,16 @@ public enum CombatManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(abstractCharacter.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||||
|
PlayerCharacter pc = (PlayerCharacter)abstractCharacter;
|
||||||
|
if(pc.isBoxed){
|
||||||
|
if(target.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||||
|
ChatManager.chatSystemInfo(pc, "You Are PvE Flagged: Cannot Attack Players.");
|
||||||
|
attackFailure = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//TODO Verify attacker has los (if not ranged weapon).
|
//TODO Verify attacker has los (if not ranged weapon).
|
||||||
|
|
||||||
if (!attackFailure) {
|
if (!attackFailure) {
|
||||||
@@ -933,6 +941,11 @@ public enum CombatManager {
|
|||||||
|
|
||||||
float d = 0f;
|
float d = 0f;
|
||||||
|
|
||||||
|
int originalDamage = (int)damage;
|
||||||
|
if(ac != null && ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||||
|
damage *= ((PlayerCharacter)ac).ZergMultiplier;
|
||||||
|
} // Health modifications are modified by the ZergMechanic
|
||||||
|
|
||||||
errorTrack = 12;
|
errorTrack = 12;
|
||||||
|
|
||||||
//Subtract Damage from target's health
|
//Subtract Damage from target's health
|
||||||
@@ -949,9 +962,13 @@ public enum CombatManager {
|
|||||||
ac.setHateValue(damage * MBServerStatics.PLAYER_COMBAT_HATE_MODIFIER);
|
ac.setHateValue(damage * MBServerStatics.PLAYER_COMBAT_HATE_MODIFIER);
|
||||||
((Mob) tarAc).handleDirectAggro(ac);
|
((Mob) tarAc).handleDirectAggro(ac);
|
||||||
}
|
}
|
||||||
|
if (tarAc.getHealth() > 0) {
|
||||||
if (tarAc.getHealth() > 0)
|
|
||||||
d = tarAc.modifyHealth(-damage, ac, false);
|
d = tarAc.modifyHealth(-damage, ac, false);
|
||||||
|
if(tarAc != null && tarAc.getObjectType().equals(GameObjectType.PlayerCharacter) && ((PlayerCharacter)ac).ZergMultiplier != 1.0f){
|
||||||
|
PlayerCharacter debugged = (PlayerCharacter)tarAc;
|
||||||
|
ChatManager.chatSystemInfo(debugged, "ZERG DEBUG: " + ac.getName() + " Hits You For: " + (int)damage + " instead of " + originalDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tarAc.cancelOnTakeDamage();
|
tarAc.cancelOnTakeDamage();
|
||||||
|
|
||||||
|
|||||||
@@ -1093,7 +1093,7 @@ public enum PowersManager {
|
|||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
|
|
||||||
if (ab.blocked(target, pb, trains,playerCharacter)) {
|
if (ab.blocked(target, pb, trains, playerCharacter)) {
|
||||||
|
|
||||||
PowersManager.sendEffectMsg(playerCharacter, 5, ab, pb);
|
PowersManager.sendEffectMsg(playerCharacter, 5, ab, pb);
|
||||||
continue;
|
continue;
|
||||||
@@ -1280,7 +1280,7 @@ public enum PowersManager {
|
|||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
|
|
||||||
if (ab.blocked(target, pb, trains,caster))
|
if (ab.blocked(target, pb, trains, caster))
|
||||||
continue;
|
continue;
|
||||||
// TODO handle overwrite stack order here
|
// TODO handle overwrite stack order here
|
||||||
String stackType = ab.getStackType();
|
String stackType = ab.getStackType();
|
||||||
@@ -1481,7 +1481,7 @@ public enum PowersManager {
|
|||||||
// Handle Accepting or Denying a summons.
|
// Handle Accepting or Denying a summons.
|
||||||
// set timer based on summon type.
|
// set timer based on summon type.
|
||||||
boolean wentThrough = false;
|
boolean wentThrough = false;
|
||||||
if (msg.accepted())
|
if (msg.accepted()) {
|
||||||
// summons accepted, let's move the player if within time
|
// summons accepted, let's move the player if within time
|
||||||
if (source.isAlive()) {
|
if (source.isAlive()) {
|
||||||
|
|
||||||
@@ -1527,14 +1527,14 @@ public enum PowersManager {
|
|||||||
duration = 45000; // Belgosh Summons, 45 seconds
|
duration = 45000; // Belgosh Summons, 45 seconds
|
||||||
|
|
||||||
boolean enemiesNear = false;
|
boolean enemiesNear = false;
|
||||||
for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(pc.loc,MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER)){
|
for (AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(pc.loc, MBServerStatics.CHARACTER_LOAD_RANGE, MBServerStatics.MASK_PLAYER)) {
|
||||||
PlayerCharacter playerCharacter = (PlayerCharacter)awo;
|
PlayerCharacter playerCharacter = (PlayerCharacter) awo;
|
||||||
if(!playerCharacter.guild.getNation().equals(pc.guild.getNation())){
|
if (!playerCharacter.guild.getNation().equals(pc.guild.getNation())) {
|
||||||
enemiesNear = true;
|
enemiesNear = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(enemiesNear && !pc.isInSafeZone())
|
if (enemiesNear && !pc.isInSafeZone())
|
||||||
duration += 60000;
|
duration += 60000;
|
||||||
|
|
||||||
// Teleport to summoners location
|
// Teleport to summoners location
|
||||||
@@ -1545,7 +1545,10 @@ public enum PowersManager {
|
|||||||
timers.put("Summon", jc);
|
timers.put("Summon", jc);
|
||||||
wentThrough = true;
|
wentThrough = true;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
// recycle summons power
|
||||||
|
finishRecycleTime(428523680, source, true);
|
||||||
|
}
|
||||||
// Summons failed
|
// Summons failed
|
||||||
if (!wentThrough)
|
if (!wentThrough)
|
||||||
// summons refused. Let's be nice and reset recycle timer
|
// summons refused. Let's be nice and reset recycle timer
|
||||||
@@ -1834,6 +1837,10 @@ public enum PowersManager {
|
|||||||
private static void applyPowerA(AbstractCharacter ac, AbstractWorldObject target,
|
private static void applyPowerA(AbstractCharacter ac, AbstractWorldObject target,
|
||||||
Vector3fImmutable targetLoc, PowersBase pb, int trains,
|
Vector3fImmutable targetLoc, PowersBase pb, int trains,
|
||||||
boolean fromItem) {
|
boolean fromItem) {
|
||||||
|
|
||||||
|
if(fromItem && pb.token == 429021400)
|
||||||
|
trains = 40;
|
||||||
|
|
||||||
int time = pb.getCastTime(trains);
|
int time = pb.getCastTime(trains);
|
||||||
if (!fromItem)
|
if (!fromItem)
|
||||||
finishApplyPowerA(ac, target, targetLoc, pb, trains, false);
|
finishApplyPowerA(ac, target, targetLoc, pb, trains, false);
|
||||||
@@ -1899,7 +1906,7 @@ public enum PowersManager {
|
|||||||
if (trains < ab.getMinTrains() || trains > ab.getMaxTrains())
|
if (trains < ab.getMinTrains() || trains > ab.getMaxTrains())
|
||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
if (ab.blocked(target, pb, trains,ac))
|
if (ab.blocked(target, pb, trains, ac))
|
||||||
// sendPowerMsg(pc, 5, msg);
|
// sendPowerMsg(pc, 5, msg);
|
||||||
continue;
|
continue;
|
||||||
// TODO handle overwrite stack order here
|
// TODO handle overwrite stack order here
|
||||||
@@ -1975,31 +1982,9 @@ public enum PowersManager {
|
|||||||
public static void runPowerAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, ActionsBase ab, int trains, PowersBase pb) {
|
public static void runPowerAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, ActionsBase ab, int trains, PowersBase pb) {
|
||||||
AbstractPowerAction pa = ab.getPowerAction();
|
AbstractPowerAction pa = ab.getPowerAction();
|
||||||
if (pa == null) {
|
if (pa == null) {
|
||||||
Logger.error(
|
Logger.error("runPowerAction(): PowerAction not found of IDString: " + ab.getEffectID());
|
||||||
"runPowerAction(): PowerAction not found of IDString: "
|
|
||||||
+ ab.getEffectID());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(AbstractCharacter.IsAbstractCharacter(awo)) {
|
|
||||||
try {
|
|
||||||
boolean immune = false;
|
|
||||||
AbstractCharacter absChar = (AbstractCharacter) awo;
|
|
||||||
for (AbstractEffectModifier mod : ab.getPowerAction().getEffectsBase().getModifiers()) {
|
|
||||||
if (absChar.getBonuses() != null) {
|
|
||||||
if (absChar.getBonuses().getBool(ModType.ImmuneTo, mod.sourceType) || absChar.getBonuses().getBool(ModType.NoMod, mod.sourceType))
|
|
||||||
immune = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (immune)
|
|
||||||
return;
|
|
||||||
}catch(Exception e){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
pa.startAction(source, awo, targetLoc, trains, ab, pb);
|
pa.startAction(source, awo, targetLoc, trains, ab, pb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -239,6 +239,7 @@ public class ActionsBase {
|
|||||||
|
|
||||||
//Add blocked types here
|
//Add blocked types here
|
||||||
public boolean blocked(AbstractWorldObject awo, PowersBase pb, int trains, AbstractCharacter source) {
|
public boolean blocked(AbstractWorldObject awo, PowersBase pb, int trains, AbstractCharacter source) {
|
||||||
|
|
||||||
if(!pb.getName().contains("Summon")) {
|
if(!pb.getName().contains("Summon")) {
|
||||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||||
AbstractCharacter target = (AbstractCharacter) awo;
|
AbstractCharacter target = (AbstractCharacter) awo;
|
||||||
@@ -252,17 +253,22 @@ public class ActionsBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pb.isChant)
|
if(pb.isChant)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||||
|
|
||||||
if(ac.effects.containsKey(this.stackType)) {
|
if(ac.effects.containsKey(this.stackType)) {
|
||||||
Boolean sameRank = false;
|
Boolean sameRank = false;
|
||||||
Effect eff = ac.effects.get(this.stackType);
|
Effect eff = ac.effects.get(this.stackType);
|
||||||
|
|
||||||
String currentEffect = eff.getEffectsBase().getIDString();
|
String currentEffect = eff.getEffectsBase().getIDString();
|
||||||
String newEffect = this.effectID;
|
String newEffect = this.effectID;
|
||||||
if (currentEffect.equals(newEffect) && !this.stackType.equals("Stun"))
|
if (currentEffect.equals(newEffect) && !this.stackType.equals("Stun"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (eff != null) {
|
if (eff != null) {
|
||||||
for (ActionsBase action : eff.getPower().getActions()) {
|
for (ActionsBase action : eff.getPower().getActions()) {
|
||||||
if (this.stackType.equals(action.stackType) && this.stackOrder == action.stackOrder) {
|
if (this.stackType.equals(action.stackType) && this.stackOrder == action.stackOrder) {
|
||||||
@@ -270,9 +276,11 @@ public class ActionsBase {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sameRank) {
|
if (sameRank) {
|
||||||
if (this.greaterThan && trains <= eff.getTrains())
|
if (this.greaterThan && trains <= eff.getTrains())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (this.greaterThanEqual && trains < eff.getTrains())
|
if (this.greaterThanEqual && trains < eff.getTrains())
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -282,10 +290,12 @@ public class ActionsBase {
|
|||||||
PlayerBonuses bonus = ac.getBonuses();
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
if (bonus == null)
|
if (bonus == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SourceType sourceType = null;
|
SourceType sourceType = null;
|
||||||
try {
|
try {
|
||||||
sourceType = SourceType.GetSourceType(this.stackType);
|
sourceType = SourceType.GetSourceType(this.stackType);
|
||||||
}catch(Exception ignored){
|
}catch(Exception ignored){
|
||||||
|
|
||||||
}
|
}
|
||||||
if(sourceType != null && (bonus.getBool(ModType.ImmuneTo,sourceType) || bonus.getBool(ModType.NoMod,sourceType)))
|
if(sourceType != null && (bonus.getBool(ModType.ImmuneTo,sourceType) || bonus.getBool(ModType.NoMod,sourceType)))
|
||||||
return true;
|
return true;
|
||||||
@@ -296,12 +306,16 @@ public class ActionsBase {
|
|||||||
if(this.stackType.equals("Stun") && pc.getRace().getName().contains("Minotaur"))
|
if(this.stackType.equals("Stun") && pc.getRace().getName().contains("Minotaur"))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo,SourceType.Stun))
|
if(this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo,SourceType.Stun))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN))
|
if(pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
|
if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user