PVE flag
This commit is contained in:
@@ -46,6 +46,7 @@ public enum InterestManager implements Runnable {
|
|||||||
LoadCharacterMsg lcm;
|
LoadCharacterMsg lcm;
|
||||||
NPC npc;
|
NPC npc;
|
||||||
Corpse corpse;
|
Corpse corpse;
|
||||||
|
PlayerCharacter pc;
|
||||||
HashSet<AbstractWorldObject> toUpdate;
|
HashSet<AbstractWorldObject> toUpdate;
|
||||||
|
|
||||||
switch (awo.getObjectType()) {
|
switch (awo.getObjectType()) {
|
||||||
@@ -64,6 +65,11 @@ public enum InterestManager implements Runnable {
|
|||||||
lcm = new LoadCharacterMsg(npc, false);
|
lcm = new LoadCharacterMsg(npc, false);
|
||||||
msg = lcm;
|
msg = lcm;
|
||||||
break;
|
break;
|
||||||
|
case PlayerCharacter:
|
||||||
|
pc = (PlayerCharacter) awo;
|
||||||
|
lcm = new LoadCharacterMsg(pc, false);
|
||||||
|
msg = lcm;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -132,8 +138,9 @@ public enum InterestManager implements Runnable {
|
|||||||
if (cc == null)
|
if (cc == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!fromBox && pcc.getObjectUUID() == absChar.getObjectUUID())
|
if (pcc.getObjectUUID() == absChar.getObjectUUID()) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
if (pc != null)
|
if (pc != null)
|
||||||
|
|||||||
@@ -241,6 +241,16 @@ public enum CombatManager {
|
|||||||
if (ac == null)
|
if (ac == null)
|
||||||
return;
|
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
|
// Attempt to eat null targets until we can clean
|
||||||
// up this unholy mess and refactor it into a thread.
|
// up this unholy mess and refactor it into a thread.
|
||||||
|
|
||||||
|
|||||||
@@ -170,6 +170,25 @@ public enum PowersManager {
|
|||||||
if(pc == null)
|
if(pc == null)
|
||||||
return;
|
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
|
if(!pc.isFlying() && powersBaseByToken.get(msg.getPowerUsedID()) != null && powersBaseByToken.get(msg.getPowerUsedID()).isSpell) //cant be sitting if flying
|
||||||
CombatManager.toggleSit(false,origin);
|
CombatManager.toggleSit(false,origin);
|
||||||
|
|
||||||
@@ -1090,6 +1109,13 @@ public enum PowersManager {
|
|||||||
|
|
||||||
//Player didn't miss power, send finish cast. Miss cast already sent.
|
//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
|
// finally Apply actions
|
||||||
for (ActionsBase ab : pb.getActions()) {
|
for (ActionsBase ab : pb.getActions()) {
|
||||||
@@ -1902,6 +1928,18 @@ public enum PowersManager {
|
|||||||
public static void finishApplyPowerA(AbstractCharacter ac,
|
public static void finishApplyPowerA(AbstractCharacter ac,
|
||||||
AbstractWorldObject target, Vector3fImmutable targetLoc,
|
AbstractWorldObject target, Vector3fImmutable targetLoc,
|
||||||
PowersBase pb, int trains, boolean fromChant) {
|
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
|
// finally Apply actions
|
||||||
ArrayList<ActionsBase> actions = pb.getActions();
|
ArrayList<ActionsBase> actions = pb.getActions();
|
||||||
for (ActionsBase ab : actions) {
|
for (ActionsBase ab : actions) {
|
||||||
|
|||||||
Reference in New Issue
Block a user