Instructions Jenkins Doxygen

[Fixed] toggling /invulnerable off while overt properly adds the OVERT 95/1195/4
authorIvojedi <ivojedi@swgemu.com>
Fri, 29 Nov 2013 11:20:57 +0000 (03:20 -0800)
committerIvojedi <ivojedi@swgemu.com>
Fri, 29 Nov 2013 11:20:57 +0000 (03:20 -0800)
mask
[Changed] toggling /invulnerable toggles the mask of active pets as well

Change-Id: Ice59781719f6130217e014638e9ddcfcb7e24fb8

MMOCoreORB/src/server/zone/objects/creature/commands/InvulnerableCommand.h

index 270eb4b..784d410 100755 (executable)
@@ -56,6 +56,15 @@ public:
 
        }
 
+       void setPetsPvpStatusBitMask(PlayerObject* ghost, int mask) {
+               for (int i = 0; i < ghost->getActivePetsSize(); i++) {
+                       Reference<AiAgent*> pet = ghost->getActivePet(i);
+
+                       if (pet != NULL)
+                               pet->setPvpStatusBitmask(mask);
+               }
+       }
+
        int doQueueCommand(CreatureObject* creature, const uint64& target, const UnicodeString& arguments) {
 
                if (!checkStateMask(creature))
@@ -72,6 +81,11 @@ public:
                if (player->isRidingMount() || player->isRidingCreature())
                        return GENERALERROR;
 
+               Reference<PlayerObject*> ghost = player->getPlayerObject();
+
+               if (ghost == NULL)
+                       return GENERALERROR;;
+
                StringTokenizer args(arguments.toString());
 
                if (args.hasMoreTokens()) {
@@ -96,6 +110,12 @@ public:
                        if (player->getPvpStatusBitmask() & CreatureFlag::PLAYER) {
                                player->setPvpStatusBitmask(CreatureFlag::NONE);
                                player->sendSystemMessage("You are now invulnerable.");
+                               setPetsPvpStatusBitMask(ghost, CreatureFlag::NONE);
+
+                       } else if (ghost->getFactionStatus() == FactionStatus::OVERT) {
+                               player->setPvpStatusBitmask(CreatureFlag::PLAYER | CreatureFlag::OVERT);
+                               player->sendSystemMessage("You are no longer invulnerable");
+                               setPetsPvpStatusBitMask(ghost, CreatureFlag::OVERT);
 
                        } else {
                                player->setPvpStatusBitmask(CreatureFlag::PLAYER);
@@ -103,9 +123,6 @@ public:
 
                        }
 
-                       UpdatePVPStatusMessage* mess = new UpdatePVPStatusMessage(player);
-                       player->broadcastMessage(mess, true);
-
                }
 
                return SUCCESS;