PVE flag
This commit is contained in:
@@ -46,6 +46,7 @@ public enum InterestManager implements Runnable {
|
||||
LoadCharacterMsg lcm;
|
||||
NPC npc;
|
||||
Corpse corpse;
|
||||
PlayerCharacter pc;
|
||||
HashSet<AbstractWorldObject> toUpdate;
|
||||
|
||||
switch (awo.getObjectType()) {
|
||||
@@ -64,6 +65,11 @@ public enum InterestManager implements Runnable {
|
||||
lcm = new LoadCharacterMsg(npc, false);
|
||||
msg = lcm;
|
||||
break;
|
||||
case PlayerCharacter:
|
||||
pc = (PlayerCharacter) awo;
|
||||
lcm = new LoadCharacterMsg(pc, false);
|
||||
msg = lcm;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@@ -132,8 +138,9 @@ public enum InterestManager implements Runnable {
|
||||
if (cc == null)
|
||||
continue;
|
||||
|
||||
if (!fromBox && pcc.getObjectUUID() == absChar.getObjectUUID())
|
||||
if (pcc.getObjectUUID() == absChar.getObjectUUID()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
else {
|
||||
if (pc != null)
|
||||
|
||||
@@ -241,6 +241,16 @@ public enum CombatManager {
|
||||
if (ac == null)
|
||||
return;
|
||||
|
||||
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
PlayerCharacter pc = (PlayerCharacter)ac;
|
||||
if(pc.isBoxed){
|
||||
if(pc.combatTarget != null && pc.combatTarget.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
ChatManager.chatSystemInfo(pc, " You Are PvE Flagged: Cannot Attack Players.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Attempt to eat null targets until we can clean
|
||||
// up this unholy mess and refactor it into a thread.
|
||||
|
||||
|
||||
@@ -170,6 +170,25 @@ public enum PowersManager {
|
||||
if(pc == null)
|
||||
return;
|
||||
|
||||
if(pc.isBoxed){
|
||||
AbstractWorldObject tar = getTarget(msg);
|
||||
if(tar != null && tar.getObjectType().equals(GameObjectType.PlayerCharacter) && !tar.equals(pc)) {
|
||||
RecyclePowerMsg rpm = new RecyclePowerMsg(msg.getPowerUsedID());
|
||||
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), rpm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
|
||||
|
||||
// Send Fail to cast message
|
||||
sendPowerMsg(pc, 2, msg);
|
||||
if (pc.isCasting()) {
|
||||
pc.update(false);
|
||||
}
|
||||
|
||||
pc.setIsCasting(false);
|
||||
ChatManager.chatSystemInfo(pc, " You Are PvE Flagged: Cannot Attack Players.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!pc.isFlying() && powersBaseByToken.get(msg.getPowerUsedID()) != null && powersBaseByToken.get(msg.getPowerUsedID()).isSpell) //cant be sitting if flying
|
||||
CombatManager.toggleSit(false,origin);
|
||||
|
||||
@@ -1090,6 +1109,13 @@ public enum PowersManager {
|
||||
|
||||
//Player didn't miss power, send finish cast. Miss cast already sent.
|
||||
|
||||
if (playerCharacter.isBoxed) {
|
||||
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
||||
if (target.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// finally Apply actions
|
||||
for (ActionsBase ab : pb.getActions()) {
|
||||
@@ -1902,6 +1928,18 @@ public enum PowersManager {
|
||||
public static void finishApplyPowerA(AbstractCharacter ac,
|
||||
AbstractWorldObject target, Vector3fImmutable targetLoc,
|
||||
PowersBase pb, int trains, boolean fromChant) {
|
||||
|
||||
|
||||
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
PlayerCharacter pc = (PlayerCharacter) ac;
|
||||
if (pc.isBoxed) {
|
||||
if(AbstractCharacter.IsAbstractCharacter(target)){
|
||||
if (target.getObjectType().equals(GameObjectType.PlayerCharacter)){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// finally Apply actions
|
||||
ArrayList<ActionsBase> actions = pb.getActions();
|
||||
for (ActionsBase ab : actions) {
|
||||
|
||||
Reference in New Issue
Block a user