Core/Entities: Use ObjectGuid class in game project

This commit is contained in:
Shauren
2014-09-14 16:14:12 +02:00
parent ce67a097bf
commit a0e50ea35f
256 changed files with 3334 additions and 3833 deletions
+2 -2
View File
@@ -275,7 +275,7 @@ public:
arena->SetCaptain(targetGuid);
CharacterNameData const* oldCaptainNameData = sWorld->GetCharacterNameData(GUID_LOPART(arena->GetCaptain()));
CharacterNameData const* oldCaptainNameData = sWorld->GetCharacterNameData(arena->GetCaptain());
if (!oldCaptainNameData)
{
handler->SetSentErrorMessage(true);
@@ -313,7 +313,7 @@ public:
handler->PSendSysMessage(LANG_ARENA_INFO_HEADER, arena->GetName().c_str(), arena->GetId(), arena->GetRating(), arena->GetType(), arena->GetType());
for (ArenaTeam::MemberList::iterator itr = arena->m_membersBegin(); itr != arena->m_membersEnd(); ++itr)
handler->PSendSysMessage(LANG_ARENA_INFO_MEMBERS, itr->Name.c_str(), GUID_LOPART(itr->Guid), itr->PersonalRating, (arena->GetCaptain() == itr->Guid ? "- Captain" : ""));
handler->PSendSysMessage(LANG_ARENA_INFO_MEMBERS, itr->Name.c_str(), itr->Guid.GetCounter(), itr->PersonalRating, (arena->GetCaptain() == itr->Guid ? "- Captain" : ""));
return true;
}
+23 -23
View File
@@ -226,10 +226,10 @@ public:
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA);
stmt->setUInt32(0, delInfo.lowGuid);
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
sWorld->AddCharacterNameData(delInfo.lowGuid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8(), (*result)[3].GetUInt8());
sWorld->AddCharacterNameData(ObjectGuid(HIGHGUID_PLAYER, delInfo.lowGuid), delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8(), (*result)[3].GetUInt8());
}
static void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel, ChatHandler* handler)
static void HandleCharacterLevel(Player* player, ObjectGuid playerGuid, uint32 oldLevel, uint32 newLevel, ChatHandler* handler)
{
if (player)
{
@@ -252,7 +252,7 @@ public:
// Update level and reset XP, everything else will be updated at login
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
stmt->setUInt8(0, uint8(newLevel));
stmt->setUInt32(1, GUID_LOPART(playerGuid));
stmt->setUInt32(1, playerGuid.GetCounter());
CharacterDatabase.Execute(stmt);
}
}
@@ -303,7 +303,7 @@ public:
static bool HandleCharacterRenameCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
@@ -382,7 +382,7 @@ public:
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_NAME_BY_GUID);
stmt->setString(0, newName);
stmt->setUInt32(1, GUID_LOPART(targetGuid));
stmt->setUInt32(1, targetGuid.GetCounter());
CharacterDatabase.Execute(stmt);
}
@@ -396,7 +396,7 @@ public:
sLog->outCommand(session->GetAccountId(), "GM %s (Account: %u) forced rename %s to player %s (Account: %u)", player->GetName().c_str(), session->GetAccountId(), newName.c_str(), playerOldName.c_str(), sObjectMgr->GetPlayerAccountIdByGUID(targetGuid));
}
else
sLog->outCommand(0, "CONSOLE forced rename '%s' to '%s' (GUID: %u)", playerOldName.c_str(), newName.c_str(), GUID_LOPART(targetGuid));
sLog->outCommand(0, "CONSOLE forced rename '%s' to '%s' (%s)", playerOldName.c_str(), newName.c_str(), targetGuid.ToString().c_str());
}
else
{
@@ -416,11 +416,11 @@ public:
return false;
std::string oldNameLink = handler->playerLink(targetName);
handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), targetGuid.GetCounter());
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
stmt->setUInt32(1, targetGuid.GetCounter());
CharacterDatabase.Execute(stmt);
}
}
@@ -444,7 +444,7 @@ public:
}
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName))
return false;
@@ -472,7 +472,7 @@ public:
static bool HandleCharacterCustomizeCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
@@ -488,8 +488,8 @@ public:
else
{
std::string oldNameLink = handler->playerLink(targetName);
stmt->setUInt32(1, GUID_LOPART(targetGuid));
handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
stmt->setUInt32(1, targetGuid.GetCounter());
handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), targetGuid.GetCounter());
}
CharacterDatabase.Execute(stmt);
@@ -499,7 +499,7 @@ public:
static bool HandleCharacterChangeFactionCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
@@ -516,8 +516,8 @@ public:
else
{
std::string oldNameLink = handler->playerLink(targetName);
handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), targetGuid.GetCounter());
stmt->setUInt32(1, targetGuid.GetCounter());
}
CharacterDatabase.Execute(stmt);
@@ -527,7 +527,7 @@ public:
static bool HandleCharacterChangeRaceCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
@@ -545,8 +545,8 @@ public:
{
std::string oldNameLink = handler->playerLink(targetName);
/// @todo add text into database
handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), targetGuid.GetCounter());
stmt->setUInt32(1, targetGuid.GetCounter());
}
CharacterDatabase.Execute(stmt);
@@ -773,7 +773,7 @@ public:
if (!normalizePlayerName(characterName))
return false;
uint64 characterGuid;
ObjectGuid characterGuid;
uint32 accountId;
Player* player = sObjectAccessor->FindPlayerByName(characterName);
@@ -799,7 +799,7 @@ public:
AccountMgr::GetName(accountId, accountName);
Player::DeleteFromDB(characterGuid, accountId, true, true);
handler->PSendSysMessage(LANG_CHARACTER_DELETED, characterName.c_str(), GUID_LOPART(characterGuid), accountName.c_str(), accountId);
handler->PSendSysMessage(LANG_CHARACTER_DELETED, characterName.c_str(), characterGuid.GetCounter(), accountName.c_str(), accountId);
return true;
}
@@ -818,7 +818,7 @@ public:
}
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName))
return false;
@@ -966,10 +966,10 @@ public:
if (!fileStr || !playerStr)
return false;
uint64 guid;
ObjectGuid guid;
// character name can't start from number
if (isNumeric(playerStr))
guid = MAKE_NEW_GUID(atoi(playerStr), 0, HIGHGUID_PLAYER);
guid = ObjectGuid(HIGHGUID_PLAYER, uint32(atoi(playerStr)));
else
{
std::string name = handler->extractPlayerNameFromLink(playerStr);
+16 -16
View File
@@ -558,10 +558,10 @@ public:
for (uint8 j = 0; j < bag->GetBagSize(); ++j)
if (Item* item2 = bag->GetItemByPos(j))
if (item2->GetState() == state)
handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item2->GetSlot(), item2->GetGUIDLow(), GUID_LOPART(item2->GetOwnerGUID()));
handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item2->GetSlot(), item2->GetGUIDLow(), item2->GetOwnerGUID().GetCounter());
}
else if (item->GetState() == state)
handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item->GetSlot(), item->GetGUIDLow(), GUID_LOPART(item->GetOwnerGUID()));
handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item->GetSlot(), item->GetGUIDLow(), item->GetOwnerGUID().GetCounter());
}
}
}
@@ -623,7 +623,7 @@ public:
if (item->GetOwnerGUID() != player->GetGUID())
{
handler->PSendSysMessage("The item with slot %d and itemguid %d does have non-matching owner guid (%d) and player guid (%d) !", item->GetSlot(), item->GetGUIDLow(), GUID_LOPART(item->GetOwnerGUID()), player->GetGUIDLow());
handler->PSendSysMessage("The item with slot %d and itemguid %d does have non-matching owner guid (%d) and player guid (%d) !", item->GetSlot(), item->GetGUIDLow(), item->GetOwnerGUID().GetCounter(), player->GetGUIDLow());
error = true;
continue;
}
@@ -683,7 +683,7 @@ public:
if (item2->GetOwnerGUID() != player->GetGUID())
{
handler->PSendSysMessage("The item in bag %d at slot %d and with itemguid %d, the owner's guid (%d) and the player's guid (%d) don't match!", bag->GetSlot(), item2->GetSlot(), item2->GetGUIDLow(), GUID_LOPART(item2->GetOwnerGUID()), player->GetGUIDLow());
handler->PSendSysMessage("The item in bag %d at slot %d and with itemguid %d, the owner's guid (%d) and the player's guid (%d) don't match!", bag->GetSlot(), item2->GetSlot(), item2->GetGUIDLow(), item2->GetOwnerGUID().GetCounter(), player->GetGUIDLow());
error = true;
continue;
}
@@ -745,7 +745,7 @@ public:
if (item->GetOwnerGUID() != player->GetGUID())
{
handler->PSendSysMessage("queue(%zu): For the item with guid %d, the owner's guid (%d) and the player's guid (%d) don't match!", i, item->GetGUIDLow(), GUID_LOPART(item->GetOwnerGUID()), player->GetGUIDLow());
handler->PSendSysMessage("queue(%zu): For the item with guid %d, the owner's guid (%d) and the player's guid (%d) don't match!", i, item->GetGUIDLow(), item->GetOwnerGUID().GetCounter(), player->GetGUIDLow());
error = true;
continue;
}
@@ -972,7 +972,7 @@ public:
uint32 guid = (uint32)atoi(e);
uint32 index = (uint32)atoi(f);
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM));
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, 0, guid));
if (!i)
return false;
@@ -1003,7 +1003,7 @@ public:
uint32 index = (uint32)atoi(f);
uint32 value = (uint32)atoi(g);
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM));
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, 0, guid));
if (!i)
return false;
@@ -1027,7 +1027,7 @@ public:
uint32 guid = (uint32)atoi(e);
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM));
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
if (!i)
return false;
@@ -1106,12 +1106,12 @@ public:
return false;
}
uint64 guid = target->GetGUID();
ObjectGuid guid = target->GetGUID();
uint32 field = (uint32)atoi(x);
if (field >= target->GetValuesCount())
{
handler->PSendSysMessage(LANG_TOO_BIG_INDEX, field, GUID_LOPART(guid), target->GetValuesCount());
handler->PSendSysMessage(LANG_TOO_BIG_INDEX, field, guid.GetCounter(), target->GetValuesCount());
return false;
}
@@ -1123,13 +1123,13 @@ public:
{
uint32 value = (uint32)atoi(y);
target->SetUInt32Value(field, value);
handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), field, value);
handler->PSendSysMessage(LANG_SET_UINT_FIELD, guid.GetCounter(), field, value);
}
else
{
float value = (float)atof(y);
target->SetFloatValue(field, value);
handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), field, value);
handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, guid.GetCounter(), field, value);
}
return true;
@@ -1154,12 +1154,12 @@ public:
return false;
}
uint64 guid = target->GetGUID();
ObjectGuid guid = target->GetGUID();
uint32 opcode = (uint32)atoi(x);
if (opcode >= target->GetValuesCount())
{
handler->PSendSysMessage(LANG_TOO_BIG_INDEX, opcode, GUID_LOPART(guid), target->GetValuesCount());
handler->PSendSysMessage(LANG_TOO_BIG_INDEX, opcode, guid.GetCounter(), target->GetValuesCount());
return false;
}
@@ -1170,12 +1170,12 @@ public:
if (isInt32)
{
uint32 value = target->GetUInt32Value(opcode);
handler->PSendSysMessage(LANG_GET_UINT_FIELD, GUID_LOPART(guid), opcode, value);
handler->PSendSysMessage(LANG_GET_UINT_FIELD, guid.GetCounter(), opcode, value);
}
else
{
float value = target->GetFloatValue(opcode);
handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, GUID_LOPART(guid), opcode, value);
handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, guid.GetCounter(), opcode, value);
}
return true;
+1 -1
View File
@@ -140,7 +140,7 @@ public:
Transport* transport = NULL;
if (Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, id, HIGHGUID_UNIT), (Creature*)NULL))
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HIGHGUID_UNIT, id, guid), (Creature*)NULL))
{
x = creature->GetPositionX();
y = creature->GetPositionY();
+4 -4
View File
@@ -324,7 +324,7 @@ public:
return false;
}
GameObject* target = handler->GetSession()->GetPlayer()->GetMap()->GetGameObject(MAKE_NEW_GUID(guidLow, id, HIGHGUID_GAMEOBJECT));
GameObject* target = handler->GetSession()->GetPlayer()->GetMap()->GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, id, guidLow));
handler->PSendSysMessage(LANG_GAMEOBJECT_DETAIL, guidLow, objectInfo->name.c_str(), guidLow, id, x, y, z, mapId, o, phase);
@@ -367,13 +367,13 @@ public:
return false;
}
uint64 ownerGuid = object->GetOwnerGUID();
ObjectGuid ownerGuid = object->GetOwnerGUID();
if (ownerGuid)
{
Unit* owner = ObjectAccessor::GetUnit(*handler->GetSession()->GetPlayer(), ownerGuid);
if (!owner || !IS_PLAYER_GUID(ownerGuid))
if (!owner || !ownerGuid.IsPlayer())
{
handler->PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, GUID_LOPART(ownerGuid), object->GetGUIDLow());
handler->PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, ownerGuid.GetCounter(), object->GetGUIDLow());
handler->SetSentErrorMessage(true);
return false;
}
+5 -5
View File
@@ -263,18 +263,18 @@ public:
// Get ALL the variables!
Player* playerTarget;
uint32 phase = 0;
uint64 guidTarget;
ObjectGuid guidTarget;
std::string nameTarget;
std::string zoneName;
const char* onlineState = "";
// Parse the guid to uint32...
uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER);
ObjectGuid parseGUID(HIGHGUID_PLAYER, uint32(atol((char*)args)));
// ... and try to extract a player out of it.
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, nameTarget))
{
playerTarget = sObjectMgr->GetPlayerByLowGUID(parseGUID);
playerTarget = ObjectAccessor::FindPlayer(parseGUID);
guidTarget = parseGUID;
}
// If not, we return false and end right away.
@@ -292,7 +292,7 @@ public:
if (!groupTarget)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
stmt->setUInt32(0, guidTarget);
stmt->setUInt32(0, guidTarget.GetCounter());
PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt);
if (resultGroup)
groupTarget = sGroupMgr->GetGroupByDbStoreId((*resultGroup)[0].GetUInt32());
@@ -368,7 +368,7 @@ public:
// Now we can print those informations for every single member of each group!
handler->PSendSysMessage(LANG_GROUP_PLAYER_NAME_GUID, slot.name.c_str(), onlineState,
zoneName.c_str(), phase, GUID_LOPART(slot.guid), flags.c_str(),
zoneName.c_str(), phase, slot.guid.GetCounter(), flags.c_str(),
lfg::GetRolesString(slot.roles).c_str());
}
+8 -8
View File
@@ -447,8 +447,8 @@ public:
handler->PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (handler->GetSession() ? ss_name.str().c_str() : name),
aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(),
aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""),
(talent ? talentStr : ""), IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature",
GUID_LOPART(aura->GetCasterGUID()));
(talent ? talentStr : ""), aura->GetCasterGUID().IsPlayer() ? "player" : "creature",
aura->GetCasterGUID().GetCounter());
}
for (uint16 i = 0; i < TOTAL_AURAS; ++i)
@@ -469,25 +469,25 @@ public:
static bool HandleListMailCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
PreparedStatement* stmt = NULL;
if (!*args)
return false;
uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER);
ObjectGuid parseGUID(HIGHGUID_PLAYER, uint32(atol((char*)args)));
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName))
{
target = sObjectMgr->GetPlayerByLowGUID(parseGUID);
target = ObjectAccessor::FindPlayer(parseGUID);
targetGuid = parseGUID;
}
else if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_LIST_COUNT);
stmt->setUInt32(0, targetGuid);
stmt->setUInt32(0, targetGuid.GetCounter());
PreparedQueryResult queryResult = CharacterDatabase.Query(stmt);
if (queryResult)
{
@@ -495,11 +495,11 @@ public:
uint32 countMail = fields[0].GetUInt64();
std::string nameLink = handler->playerLink(targetName);
handler->PSendSysMessage(LANG_LIST_MAIL_HEADER, countMail, nameLink.c_str(), targetGuid);
handler->PSendSysMessage(LANG_LIST_MAIL_HEADER, countMail, nameLink.c_str(), targetGuid.GetCounter());
handler->PSendSysMessage(LANG_ACCOUNT_LIST_BAR);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_LIST_INFO);
stmt->setUInt32(0, targetGuid);
stmt->setUInt32(0, targetGuid.GetCounter());
PreparedQueryResult queryResult = CharacterDatabase.Query(stmt);
if (queryResult)
+23 -23
View File
@@ -136,7 +136,7 @@ public:
WorldObject* object = NULL;
if (*args)
{
uint64 guid = handler->extractGuidFromLink((char*)args);
ObjectGuid guid = handler->extractGuidFromLink((char*)args);
if (guid)
object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
@@ -266,7 +266,7 @@ public:
static bool HandleAppearCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
@@ -282,7 +282,7 @@ public:
if (target)
{
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
return false;
std::string chrNameLink = handler->playerLink(targetName);
@@ -408,7 +408,7 @@ public:
static bool HandleSummonCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
@@ -425,7 +425,7 @@ public:
{
std::string nameLink = handler->playerLink(targetName);
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
return false;
if (target->IsBeingTeleported())
@@ -537,7 +537,7 @@ public:
}
if (Player* player = target->ToPlayer())
if (handler->HasLowerSecurity(player, 0, false))
if (handler->HasLowerSecurity(player, ObjectGuid::Empty, false))
return false;
if (target->IsAlive())
@@ -554,7 +554,7 @@ public:
static bool HandleReviveCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid))
return false;
@@ -597,16 +597,16 @@ public:
static bool HandleGUIDCommand(ChatHandler* handler, char const* /*args*/)
{
uint64 guid = handler->GetSession()->GetPlayer()->GetTarget();
ObjectGuid guid = handler->GetSession()->GetPlayer()->GetTarget();
if (guid == 0)
if (guid.IsEmpty())
{
handler->SendSysMessage(LANG_NO_SELECTION);
handler->SetSentErrorMessage(true);
return false;
}
handler->PSendSysMessage(LANG_OBJECT_GUID, GUID_LOPART(guid), GUID_HIPART(guid));
handler->PSendSysMessage(LANG_OBJECT_GUID, guid.GetCounter(), guid.GetHigh());
return true;
}
@@ -703,7 +703,7 @@ public:
if (*args)
{
uint64 guid = handler->extractGuidFromLink((char*)args);
ObjectGuid guid = handler->extractGuidFromLink((char*)args);
if (guid)
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
@@ -737,7 +737,7 @@ public:
return false;
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
return false;
if (target->IsBeingTeleported())
@@ -805,7 +805,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
return false;
std::string kickReasonStr = handler->GetTrinityString(LANG_NO_REASON);
@@ -1380,17 +1380,17 @@ public:
{
// Define ALL the player variables!
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
PreparedStatement* stmt = NULL;
// To make sure we get a target, we convert our guid to an omniversal...
uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER);
ObjectGuid parseGUID(HIGHGUID_PLAYER, uint32(atol((char*)args)));
// ... and make sure we get a target, somehow.
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName))
{
target = sObjectMgr->GetPlayerByLowGUID(parseGUID);
target = ObjectAccessor::FindPlayer(parseGUID);
targetGuid = parseGUID;
}
// if not, then return false. Which shouldn't happen, now should it ?
@@ -1432,7 +1432,7 @@ public:
// Account data print variables
std::string userName = handler->GetTrinityString(LANG_ERROR);
uint32 accId = 0;
uint32 lowguid = GUID_LOPART(targetGuid);
uint32 lowguid = targetGuid.GetCounter();
std::string eMail = handler->GetTrinityString(LANG_ERROR);
std::string regMail = handler->GetTrinityString(LANG_ERROR);
uint32 security = 0;
@@ -1486,7 +1486,7 @@ public:
if (target)
{
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
return false;
accId = target->GetSession()->GetAccountId();
@@ -1796,7 +1796,7 @@ public:
muteReasonStr = muteReason;
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName))
return false;
@@ -1859,7 +1859,7 @@ public:
static bool HandleUnmuteCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
@@ -2115,7 +2115,7 @@ public:
}
if (Player* player = target->ToPlayer())
if (handler->HasLowerSecurity(player, 0, false))
if (handler->HasLowerSecurity(player, ObjectGuid::Empty, false))
return false;
if (!target->IsAlive())
@@ -2205,7 +2205,7 @@ public:
}
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
return false;
target->CombatStop();
@@ -2226,7 +2226,7 @@ public:
return false;
// check online security
if (handler->HasLowerSecurity(target, 0))
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
return false;
// Repair items
+1 -1
View File
@@ -521,7 +521,7 @@ public:
return false;
if (CreatureData const* cr_data = sObjectMgr->GetCreatureData(lowguid))
unit = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT));
unit = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, cr_data->id, lowguid));
}
else
unit = handler->getSelectedCreature();
+1 -1
View File
@@ -85,7 +85,7 @@ public:
creatureTarget->RemoveCorpse();
creatureTarget->SetHealth(0); // just for nice GM-mode view
pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID());
pet->SetGuidValue(UNIT_FIELD_CREATEDBY, player->GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction());
if (!pet->InitStatsForLevel(creatureTarget->getLevel()))
+6 -6
View File
@@ -59,14 +59,14 @@ public:
static bool HandleResetAchievementsCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid))
return false;
if (target)
target->ResetAchievements();
else
AchievementMgr::DeleteFromDB(GUID_LOPART(targetGuid));
AchievementMgr::DeleteFromDB(targetGuid);
return true;
}
@@ -158,7 +158,7 @@ public:
static bool HandleResetSpellsCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
@@ -175,7 +175,7 @@ public:
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
stmt->setUInt32(1, targetGuid.GetCounter());
CharacterDatabase.Execute(stmt);
handler->PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str());
@@ -205,7 +205,7 @@ public:
static bool HandleResetTalentsCommand(ChatHandler* handler, char const* args)
{
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
{
@@ -249,7 +249,7 @@ public:
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
stmt->setUInt32(1, targetGuid.GetCounter());
CharacterDatabase.Execute(stmt);
std::string nameLink = handler->playerLink(targetName);
+6 -6
View File
@@ -51,7 +51,7 @@ public:
{
// format: name "subject text" "mail text"
Player* target;
uint64 targetGuid;
ObjectGuid targetGuid;
std::string targetName;
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
@@ -82,7 +82,7 @@ public:
/// @todo Fix poor design
SQLTransaction trans = CharacterDatabase.BeginTransaction();
MailDraft(subject, text)
.SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender);
.SendMailTo(trans, MailReceiver(target, targetGuid.GetCounter()), sender);
CharacterDatabase.CommitTransaction(trans);
@@ -96,7 +96,7 @@ public:
{
// format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12]
Player* receiver;
uint64 receiverGuid;
ObjectGuid receiverGuid;
std::string receiverName;
if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName))
return false;
@@ -192,7 +192,7 @@ public:
}
}
draft.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender);
draft.SendMailTo(trans, MailReceiver(receiver, receiverGuid.GetCounter()), sender);
CharacterDatabase.CommitTransaction(trans);
std::string nameLink = handler->playerLink(receiverName);
@@ -205,7 +205,7 @@ public:
/// format: name "subject text" "mail text" money
Player* receiver;
uint64 receiverGuid;
ObjectGuid receiverGuid;
std::string receiverName;
if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName))
return false;
@@ -242,7 +242,7 @@ public:
MailDraft(subject, text)
.AddMoney(money)
.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender);
.SendMailTo(trans, MailReceiver(receiver, receiverGuid.GetCounter()), sender);
CharacterDatabase.CommitTransaction(trans);
+1 -1
View File
@@ -123,7 +123,7 @@ public:
return false;
Player* target;
uint64 target_guid;
ObjectGuid target_guid;
std::string target_name;
if (!handler->extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
return false;
+2 -2
View File
@@ -153,7 +153,7 @@ public:
return true;
}
sTicketMgr->CloseTicket(ticket->GetId(), player ? player->GetGUID() : -1);
sTicketMgr->CloseTicket(ticket->GetId(), player ? player->GetGUID() : ObjectGuid(uint64(-1)));
sTicketMgr->UpdateLastChange();
std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName().c_str() : "Console", NULL, NULL, NULL, NULL);
@@ -434,7 +434,7 @@ public:
return false;
// Detect target's GUID
uint64 guid = 0;
ObjectGuid guid = 0;
if (Player* player = sObjectAccessor->FindPlayerByName(name))
guid = player->GetGUID();
else
+4 -4
View File
@@ -628,7 +628,7 @@ public:
handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid);
if (wpGuid != 0)
if (Creature* wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)))
if (Creature* wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, VISUAL_WAYPOINT, wpGuid)))
{
wpCreature->CombatStop();
wpCreature->DeleteFromDB();
@@ -661,7 +661,7 @@ public:
// Respawn the owner of the waypoints
if (wpGuid != 0)
{
if (Creature* wpCreature = map->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)))
if (Creature* wpCreature = map->GetCreature(ObjectGuid(HIGHGUID_UNIT, VISUAL_WAYPOINT, wpGuid)))
{
wpCreature->CombatStop();
wpCreature->DeleteFromDB();
@@ -842,7 +842,7 @@ public:
{
Field* fields = result2->Fetch();
uint32 wpguid = fields[0].GetUInt32();
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpguid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, VISUAL_WAYPOINT, wpguid));
if (!creature)
{
@@ -1038,7 +1038,7 @@ public:
{
Field* fields = result->Fetch();
uint32 guid = fields[0].GetUInt32();
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(guid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, VISUAL_WAYPOINT, guid));
if (!creature)
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, guid);
@@ -65,7 +65,7 @@ public:
void Initialize()
{
WaterElementalGUID = 0;
WaterElementalGUID.Clear();
HasCastIceblock = false;
}
@@ -177,7 +177,7 @@ public:
private:
EventMap events;
SummonList summons;
uint64 WaterElementalGUID;
ObjectGuid WaterElementalGUID;
bool HasCastIceblock;
};
@@ -138,9 +138,9 @@ public:
MobDeath_Timer = 0;
for (uint8 i = 0; i < MAX_NPC_AMOUNT; ++i)
RingMobGUID[i] = 0;
RingMobGUID[i].Clear();
RingBossGUID = 0;
RingBossGUID.Clear();
CanWalk = false;
}
@@ -154,8 +154,8 @@ public:
uint8 MobCount;
uint32 MobDeath_Timer;
uint64 RingMobGUID[4];
uint64 RingBossGUID;
ObjectGuid RingMobGUID[4];
ObjectGuid RingBossGUID;
bool CanWalk;
@@ -81,37 +81,37 @@ public:
uint32 encounter[MAX_ENCOUNTER];
std::string str_data;
uint64 EmperorGUID;
uint64 PhalanxGUID;
uint64 MagmusGUID;
uint64 MoiraGUID;
ObjectGuid EmperorGUID;
ObjectGuid PhalanxGUID;
ObjectGuid MagmusGUID;
ObjectGuid MoiraGUID;
uint64 GoArena1GUID;
uint64 GoArena2GUID;
uint64 GoArena3GUID;
uint64 GoArena4GUID;
uint64 GoShadowLockGUID;
uint64 GoShadowMechGUID;
uint64 GoShadowGiantGUID;
uint64 GoShadowDummyGUID;
uint64 GoBarKegGUID;
uint64 GoBarKegTrapGUID;
uint64 GoBarDoorGUID;
uint64 GoTombEnterGUID;
uint64 GoTombExitGUID;
uint64 GoLyceumGUID;
uint64 GoSFSGUID;
uint64 GoSFNGUID;
uint64 GoGolemNGUID;
uint64 GoGolemSGUID;
uint64 GoThroneGUID;
uint64 GoChestGUID;
uint64 GoSpectralChaliceGUID;
ObjectGuid GoArena1GUID;
ObjectGuid GoArena2GUID;
ObjectGuid GoArena3GUID;
ObjectGuid GoArena4GUID;
ObjectGuid GoShadowLockGUID;
ObjectGuid GoShadowMechGUID;
ObjectGuid GoShadowGiantGUID;
ObjectGuid GoShadowDummyGUID;
ObjectGuid GoBarKegGUID;
ObjectGuid GoBarKegTrapGUID;
ObjectGuid GoBarDoorGUID;
ObjectGuid GoTombEnterGUID;
ObjectGuid GoTombExitGUID;
ObjectGuid GoLyceumGUID;
ObjectGuid GoSFSGUID;
ObjectGuid GoSFNGUID;
ObjectGuid GoGolemNGUID;
ObjectGuid GoGolemSGUID;
ObjectGuid GoThroneGUID;
ObjectGuid GoChestGUID;
ObjectGuid GoSpectralChaliceGUID;
uint32 BarAleCount;
uint32 GhostKillCount;
uint64 TombBossGUIDs[7];
uint64 TombEventStarterGUID;
ObjectGuid TombBossGUIDs[7];
ObjectGuid TombEventStarterGUID;
uint32 TombTimer;
uint32 TombEventCounter;
@@ -120,41 +120,10 @@ public:
SetHeaders(DataHeader);
memset(&encounter, 0, sizeof(encounter));
EmperorGUID = 0;
PhalanxGUID = 0;
MagmusGUID = 0;
MoiraGUID = 0;
GoArena1GUID = 0;
GoArena2GUID = 0;
GoArena3GUID = 0;
GoArena4GUID = 0;
GoShadowLockGUID = 0;
GoShadowMechGUID = 0;
GoShadowGiantGUID = 0;
GoShadowDummyGUID = 0;
GoBarKegGUID = 0;
GoBarKegTrapGUID = 0;
GoBarDoorGUID = 0;
GoTombEnterGUID = 0;
GoTombExitGUID = 0;
GoLyceumGUID = 0;
GoSFSGUID = 0;
GoSFNGUID = 0;
GoGolemNGUID = 0;
GoGolemSGUID = 0;
GoThroneGUID = 0;
GoChestGUID = 0;
GoSpectralChaliceGUID = 0;
BarAleCount = 0;
GhostKillCount = 0;
TombEventStarterGUID = 0;
TombTimer = TIMER_TOMBOFTHESEVEN;
TombEventCounter = 0;
for (uint8 i = 0; i < 7; ++i)
TombBossGUIDs[i] = 0;
}
void OnCreatureCreate(Creature* creature) override
@@ -409,7 +378,7 @@ public:
}
}
GhostKillCount = 0;
TombEventStarterGUID = 0;
TombEventStarterGUID.Clear();
TombEventCounter = 0;
TombTimer = TIMER_TOMBOFTHESEVEN;
SetData(TYPE_TOMB_OF_SEVEN, NOT_STARTED);
@@ -427,7 +396,7 @@ public:
DoRespawnGameObject(GoChestGUID, DAY);
HandleGameObject(GoTombExitGUID, true);//event done, open exit door
HandleGameObject(GoTombEnterGUID, true);//event done, open entrance door
TombEventStarterGUID = 0;
TombEventStarterGUID.Clear();
SetData(TYPE_TOMB_OF_SEVEN, DONE);
}
void Update(uint32 diff) override
@@ -167,16 +167,16 @@ public:
boss_rend_blackhandAI(Creature* creature) : BossAI(creature, DATA_WARCHIEF_REND_BLACKHAND)
{
gythEvent = false;
victorGUID = 0;
portcullisGUID = 0;
victorGUID.Clear();
portcullisGUID.Clear();
}
void Reset() override
{
_Reset();
gythEvent = false;
victorGUID = 0;
portcullisGUID = 0;
victorGUID.Clear();
portcullisGUID.Clear();
}
void EnterCombat(Unit* /*who*/) override
@@ -437,8 +437,8 @@ public:
private:
bool gythEvent;
uint64 victorGUID;
uint64 portcullisGUID;
ObjectGuid victorGUID;
ObjectGuid portcullisGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -52,29 +52,6 @@ public:
{
SetHeaders(DataHeader);
SetBossNumber(EncounterCount);
HighlordOmokk = 0;
ShadowHunterVoshgajin = 0;
WarMasterVoone = 0;
MotherSmolderweb = 0;
UrokDoomhowl = 0;
QuartermasterZigris = 0;
GizrultheSlavener = 0;
Halycon = 0;
OverlordWyrmthalak = 0;
PyroguardEmberseer = 0;
WarchiefRendBlackhand = 0;
Gyth = 0;
LordVictorNefarius = 0;
TheBeast = 0;
GeneralDrakkisath = 0;
go_emberseerin = 0;
go_doors = 0;
go_emberseerout = 0;
go_blackrockaltar = 0;
go_portcullis_active = 0;
go_portcullis_tobossrooms = 0;
memset(go_roomrunes, 0, sizeof(go_roomrunes));
memset(go_emberseerrunes, 0, sizeof(go_emberseerrunes));
}
void OnCreatureCreate(Creature* creature) override
@@ -504,30 +481,30 @@ public:
protected:
EventMap Events;
uint64 HighlordOmokk;
uint64 ShadowHunterVoshgajin;
uint64 WarMasterVoone;
uint64 MotherSmolderweb;
uint64 UrokDoomhowl;
uint64 QuartermasterZigris;
uint64 GizrultheSlavener;
uint64 Halycon;
uint64 OverlordWyrmthalak;
uint64 PyroguardEmberseer;
uint64 WarchiefRendBlackhand;
uint64 Gyth;
uint64 LordVictorNefarius;
uint64 TheBeast;
uint64 GeneralDrakkisath;
uint64 go_emberseerin;
uint64 go_doors;
uint64 go_emberseerout;
uint64 go_blackrockaltar;
uint64 go_roomrunes[7];
uint64 go_emberseerrunes[7];
uint64 runecreaturelist[7][5];
uint64 go_portcullis_active;
uint64 go_portcullis_tobossrooms;
ObjectGuid HighlordOmokk;
ObjectGuid ShadowHunterVoshgajin;
ObjectGuid WarMasterVoone;
ObjectGuid MotherSmolderweb;
ObjectGuid UrokDoomhowl;
ObjectGuid QuartermasterZigris;
ObjectGuid GizrultheSlavener;
ObjectGuid Halycon;
ObjectGuid OverlordWyrmthalak;
ObjectGuid PyroguardEmberseer;
ObjectGuid WarchiefRendBlackhand;
ObjectGuid Gyth;
ObjectGuid LordVictorNefarius;
ObjectGuid TheBeast;
ObjectGuid GeneralDrakkisath;
ObjectGuid go_emberseerin;
ObjectGuid go_doors;
ObjectGuid go_emberseerout;
ObjectGuid go_blackrockaltar;
ObjectGuid go_roomrunes[7];
ObjectGuid go_emberseerrunes[7];
ObjectGuid runecreaturelist[7][5];
ObjectGuid go_portcullis_active;
ObjectGuid go_portcullis_tobossrooms;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
@@ -78,7 +78,7 @@ public:
void Initialize()
{
PlayerGUID = 0;
PlayerGUID.Clear();
HasYelled = false;
}
@@ -231,7 +231,7 @@ public:
}
private:
uint64 PlayerGUID;
ObjectGuid PlayerGUID;
bool HasYelled;
};
@@ -60,25 +60,6 @@ public:
// Razorgore
EggCount = 0;
EggEvent = 0;
RazorgoreTheUntamedGUID = 0;
RazorgoreDoorGUID = 0;
// Vaelastrasz the Corrupt
VaelastraszTheCorruptGUID = 0;
VaelastraszDoorGUID = 0;
// Broodlord Lashlayer
BroodlordLashlayerGUID = 0;
BroodlordDoorGUID = 0;
// 3 Dragons
FiremawGUID = 0;
EbonrocGUID = 0;
FlamegorGUID = 0;
ChrommagusDoorGUID = 0;
// Chormaggus
ChromaggusGUID = 0;
NefarianDoorGUID = 0;
// Nefarian
LordVictorNefariusGUID = 0;
NefarianGUID = 0;
SetBossNumber(EncounterCount);
}
@@ -87,26 +68,6 @@ public:
// Razorgore
EggCount = 0;
EggEvent = 0;
RazorgoreTheUntamedGUID = 0;
RazorgoreDoorGUID = 0;
EggList.clear();
// Vaelastrasz the Corrupt
VaelastraszTheCorruptGUID = 0;
VaelastraszDoorGUID = 0;
// Broodlord Lashlayer
BroodlordLashlayerGUID = 0;
BroodlordDoorGUID = 0;
// 3 Dragons
FiremawGUID = 0;
EbonrocGUID = 0;
FlamegorGUID = 0;
ChrommagusDoorGUID = 0;
// Chormaggus
ChromaggusGUID = 0;
NefarianDoorGUID = 0;
// Nefarian
LordVictorNefariusGUID = 0;
NefarianGUID = 0;
}
void OnCreatureCreate(Creature* creature) override
@@ -340,31 +301,31 @@ public:
// Razorgore
uint8 EggCount;
uint32 EggEvent;
uint64 RazorgoreTheUntamedGUID;
uint64 RazorgoreDoorGUID;
std::list<uint64> EggList;
ObjectGuid RazorgoreTheUntamedGUID;
ObjectGuid RazorgoreDoorGUID;
GuidList EggList;
// Vaelastrasz the Corrupt
uint64 VaelastraszTheCorruptGUID;
uint64 VaelastraszDoorGUID;
ObjectGuid VaelastraszTheCorruptGUID;
ObjectGuid VaelastraszDoorGUID;
// Broodlord Lashlayer
uint64 BroodlordLashlayerGUID;
uint64 BroodlordDoorGUID;
ObjectGuid BroodlordLashlayerGUID;
ObjectGuid BroodlordDoorGUID;
// 3 Dragons
uint64 FiremawGUID;
uint64 EbonrocGUID;
uint64 FlamegorGUID;
uint64 ChrommagusDoorGUID;
ObjectGuid FiremawGUID;
ObjectGuid EbonrocGUID;
ObjectGuid FlamegorGUID;
ObjectGuid ChrommagusDoorGUID;
// Chormaggus
uint64 ChromaggusGUID;
uint64 NefarianDoorGUID;
ObjectGuid ChromaggusGUID;
ObjectGuid NefarianDoorGUID;
// Nefarian
uint64 LordVictorNefariusGUID;
uint64 NefarianGUID;
ObjectGuid LordVictorNefariusGUID;
ObjectGuid NefarianGUID;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
@@ -45,9 +45,6 @@ class instance_molten_core : public InstanceMapScript
{
SetHeaders(DataHeader);
SetBossNumber(MAX_ENCOUNTER);
_golemaggTheIncineratorGUID = 0;
_majordomoExecutusGUID = 0;
_cacheOfTheFirelordGUID = 0;
_executusSchedule = false;
_ragnarosAddDeaths = 0;
}
@@ -176,9 +173,9 @@ class instance_molten_core : public InstanceMapScript
}
private:
uint64 _golemaggTheIncineratorGUID;
uint64 _majordomoExecutusGUID;
uint64 _cacheOfTheFirelordGUID;
ObjectGuid _golemaggTheIncineratorGUID;
ObjectGuid _majordomoExecutusGUID;
ObjectGuid _cacheOfTheFirelordGUID;
bool _executusSchedule;
uint8 _ragnarosAddDeaths;
};
@@ -59,32 +59,24 @@ class instance_deadmines : public InstanceMapScript
{
instance_deadmines_InstanceMapScript(Map* map) : InstanceScript(map) { }
uint64 FactoryDoorGUID;
uint64 IronCladDoorGUID;
uint64 DefiasCannonGUID;
uint64 DoorLeverGUID;
uint64 DefiasPirate1GUID;
uint64 DefiasPirate2GUID;
uint64 DefiasCompanionGUID;
ObjectGuid FactoryDoorGUID;
ObjectGuid IronCladDoorGUID;
ObjectGuid DefiasCannonGUID;
ObjectGuid DoorLeverGUID;
ObjectGuid DefiasPirate1GUID;
ObjectGuid DefiasPirate2GUID;
ObjectGuid DefiasCompanionGUID;
uint32 State;
uint32 CannonBlast_Timer;
uint32 PiratesDelay_Timer;
uint64 uiSmiteChestGUID;
ObjectGuid uiSmiteChestGUID;
void Initialize() override
{
SetHeaders(DataHeader);
FactoryDoorGUID = 0;
IronCladDoorGUID = 0;
DefiasCannonGUID = 0;
DoorLeverGUID = 0;
DefiasPirate1GUID = 0;
DefiasPirate2GUID = 0;
DefiasCompanionGUID = 0;
State = CANNON_NOT_USED;
uiSmiteChestGUID = 0;
}
virtual void Update(uint32 diff) override
@@ -41,19 +41,14 @@ public:
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint64 uiCaveInLeftGUID;
uint64 uiCaveInRightGUID;
ObjectGuid uiCaveInLeftGUID;
ObjectGuid uiCaveInRightGUID;
uint64 uiBastmasterEmiShortfuseGUID;
ObjectGuid uiBastmasterEmiShortfuseGUID;
void Initialize() override
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
uiCaveInLeftGUID = 0;
uiCaveInRightGUID = 0;
uiBastmasterEmiShortfuseGUID = 0;
}
void Load(const char* in) override
@@ -398,7 +398,7 @@ public:
if (me->HasUnitState(UNIT_STATE_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
return;
if (me->GetVictim() && me->GetUInt64Value(UNIT_FIELD_TARGET) != me->EnsureVictim()->GetGUID())
if (me->GetVictim() && me->GetTarget() != me->EnsureVictim()->GetGUID())
me->SetTarget(me->EnsureVictim()->GetGUID());
if (phase == 1)
@@ -134,7 +134,7 @@ public:
uint32 FlameWreathTimer;
uint32 FlameWreathCheckTime;
uint64 FlameWreathTarget[3];
ObjectGuid FlameWreathTarget[3];
float FWTargPosX[3];
float FWTargPosY[3];
@@ -393,9 +393,9 @@ public:
FlameWreathTimer = 20000;
FlameWreathCheckTime = 500;
FlameWreathTarget[0] = 0;
FlameWreathTarget[1] = 0;
FlameWreathTarget[2] = 0;
FlameWreathTarget[0].Clear();
FlameWreathTarget[1].Clear();
FlameWreathTarget[2].Clear();
FlameWreathEffect();
break;
@@ -465,7 +465,7 @@ public:
{
unit->CastSpell(unit, 20476, true, 0, 0, me->GetGUID());
unit->CastSpell(unit, 11027, true);
FlameWreathTarget[i] = 0;
FlameWreathTarget[i].Clear();
}
}
FlameWreathCheckTime = 500;
@@ -64,21 +64,21 @@ public:
uint32 m_uiOperaEvent;
uint32 m_uiOzDeathCount;
uint64 m_uiCurtainGUID;
uint64 m_uiStageDoorLeftGUID;
uint64 m_uiStageDoorRightGUID;
uint64 m_uiKilrekGUID;
uint64 m_uiTerestianGUID;
uint64 m_uiMoroesGUID;
uint64 m_uiLibraryDoor; // Door at Shade of Aran
uint64 m_uiMassiveDoor; // Door at Netherspite
uint64 m_uiSideEntranceDoor; // Side Entrance
uint64 m_uiGamesmansDoor; // Door before Chess
uint64 m_uiGamesmansExitDoor; // Door after Chess
uint64 m_uiNetherspaceDoor; // Door at Malchezaar
uint64 MastersTerraceDoor[2];
uint64 ImageGUID;
uint64 DustCoveredChest;
ObjectGuid m_uiCurtainGUID;
ObjectGuid m_uiStageDoorLeftGUID;
ObjectGuid m_uiStageDoorRightGUID;
ObjectGuid m_uiKilrekGUID;
ObjectGuid m_uiTerestianGUID;
ObjectGuid m_uiMoroesGUID;
ObjectGuid m_uiLibraryDoor; // Door at Shade of Aran
ObjectGuid m_uiMassiveDoor; // Door at Netherspite
ObjectGuid m_uiSideEntranceDoor; // Side Entrance
ObjectGuid m_uiGamesmansDoor; // Door before Chess
ObjectGuid m_uiGamesmansExitDoor; // Door after Chess
ObjectGuid m_uiNetherspaceDoor; // Door at Malchezaar
ObjectGuid MastersTerraceDoor[2];
ObjectGuid ImageGUID;
ObjectGuid DustCoveredChest;
void Initialize() override
{
@@ -88,25 +88,6 @@ public:
// 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered.
m_uiOperaEvent = urand(1, 3);
m_uiOzDeathCount = 0;
m_uiCurtainGUID = 0;
m_uiStageDoorLeftGUID = 0;
m_uiStageDoorRightGUID = 0;
m_uiKilrekGUID = 0;
m_uiTerestianGUID = 0;
m_uiMoroesGUID = 0;
m_uiLibraryDoor = 0;
m_uiMassiveDoor = 0;
m_uiSideEntranceDoor = 0;
m_uiGamesmansDoor = 0;
m_uiGamesmansExitDoor = 0;
m_uiNetherspaceDoor = 0;
MastersTerraceDoor[0]= 0;
MastersTerraceDoor[1]= 0;
ImageGUID = 0;
DustCoveredChest = 0;
}
bool IsEncounterInProgress() const override
@@ -119,7 +119,6 @@ public:
{
Initialize();
instance = creature->GetInstanceScript();
memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID));
LackeyEntryList.clear();
}
@@ -138,7 +137,7 @@ public:
InstanceScript* instance;
std::vector<uint32> LackeyEntryList;
uint64 m_auiLackeyGUID[MAX_ACTIVE_LACKEY];
ObjectGuid m_auiLackeyGUID[MAX_ACTIVE_LACKEY];
uint8 PlayersKilled;
@@ -1054,7 +1053,6 @@ public:
boss_garaxxasAI(Creature* creature) : boss_priestess_lackey_commonAI(creature)
{
Initialize();
m_uiPetGUID = 0;
}
void Initialize()
@@ -1067,7 +1065,7 @@ public:
Freezing_Trap_Timer = 15000;
}
uint64 m_uiPetGUID;
ObjectGuid m_uiPetGUID;
uint32 Aimed_Shot_Timer;
uint32 Shoot_Timer;
@@ -71,7 +71,6 @@ class boss_selin_fireheart : public CreatureScript
{
boss_selin_fireheartAI(Creature* creature) : BossAI(creature, DATA_SELIN)
{
CrystalGUID = 0;
_scheduledEvents = false;
}
@@ -89,7 +88,7 @@ class boss_selin_fireheart : public CreatureScript
}
_Reset();
CrystalGUID = 0;
CrystalGUID.Clear();
_scheduledEvents = false;
}
@@ -255,7 +254,7 @@ class boss_selin_fireheart : public CreatureScript
private:
std::list<Creature*> Crystals;
uint64 CrystalGUID;
ObjectGuid CrystalGUID;
bool _scheduledEvents;
};
@@ -50,12 +50,6 @@ class instance_magisters_terrace : public InstanceMapScript
LoadDoorData(doorData);
DelrissaDeathCount = 0;
SelinGUID = 0;
DelrissaGUID = 0;
EscapeOrbGUID = 0;
memset(KaelStatue, 0, 2 * sizeof(uint64));
}
uint32 GetData(uint32 type) const override
@@ -183,10 +177,10 @@ class instance_magisters_terrace : public InstanceMapScript
}
protected:
uint64 SelinGUID;
uint64 DelrissaGUID;
uint64 KaelStatue[2];
uint64 EscapeOrbGUID;
ObjectGuid SelinGUID;
ObjectGuid DelrissaGUID;
ObjectGuid KaelStatue[2];
ObjectGuid EscapeOrbGUID;
uint32 DelrissaDeathCount;
};
@@ -60,12 +60,12 @@ public:
{
speechTimer = 0;
speechCounter = 0;
playerGUID = 0;
playerGUID.Clear();
}
uint32 speechTimer;
uint32 speechCounter;
uint64 playerGUID;
ObjectGuid playerGUID;
void Reset() override
{
@@ -223,7 +223,7 @@ public:
{
wave = 0;
waveTimer = 3000;
valrothGUID = 0;
valrothGUID.Clear();
}
void Reset() override
@@ -357,7 +357,7 @@ public:
private:
uint8 wave;
uint32 waveTimer;
uint64 valrothGUID;
ObjectGuid valrothGUID;
};
@@ -642,12 +642,12 @@ public:
{
ExecuteSpeech_Timer = 0;
ExecuteSpeech_Counter = 0;
PlayerGUID = 0;
PlayerGUID.Clear();
}
uint32 ExecuteSpeech_Timer;
uint32 ExecuteSpeech_Counter;
uint64 PlayerGUID;
ObjectGuid PlayerGUID;
void Reset() override
{
@@ -311,25 +311,6 @@ public:
{
npc_highlord_darion_mograineAI(Creature* creature) : npc_escortAI(creature)
{
uiTirionGUID = 0;
uiAlexandrosGUID = 0;
uiDarionGUID = 0;
uiKorfaxGUID = 0;
uiMaxwellGUID = 0;
uiEligorGUID = 0;
uiRayneGUID = 0;
uiKoltiraGUID = 0;
uiOrbazGUID = 0;
uiThassarianGUID = 0;
uiLichKingGUID = 0;
memset(uiDefenderGUID, 0, sizeof(uiDefenderGUID));
memset(uiEarthshatterGUID, 0, sizeof(uiEarthshatterGUID));
memset(uiAbominationGUID, 0, sizeof(uiAbominationGUID));
memset(uiBehemothGUID, 0, sizeof(uiBehemothGUID));
memset(uiGhoulGUID, 0, sizeof(uiGhoulGUID));
memset(uiWarriorGUID, 0, sizeof(uiWarriorGUID));
Reset();
}
@@ -352,25 +333,25 @@ public:
uint32 uiTargetcheck;
// Dawn
uint64 uiTirionGUID;
uint64 uiAlexandrosGUID;
uint64 uiDarionGUID;
uint64 uiKorfaxGUID;
uint64 uiMaxwellGUID;
uint64 uiEligorGUID;
uint64 uiRayneGUID;
uint64 uiDefenderGUID[ENCOUNTER_DEFENDER_NUMBER];
uint64 uiEarthshatterGUID[ENCOUNTER_EARTHSHATTER_NUMBER];
ObjectGuid uiTirionGUID;
ObjectGuid uiAlexandrosGUID;
ObjectGuid uiDarionGUID;
ObjectGuid uiKorfaxGUID;
ObjectGuid uiMaxwellGUID;
ObjectGuid uiEligorGUID;
ObjectGuid uiRayneGUID;
ObjectGuid uiDefenderGUID[ENCOUNTER_DEFENDER_NUMBER];
ObjectGuid uiEarthshatterGUID[ENCOUNTER_EARTHSHATTER_NUMBER];
// Death
uint64 uiKoltiraGUID;
uint64 uiOrbazGUID;
uint64 uiThassarianGUID;
uint64 uiLichKingGUID;
uint64 uiAbominationGUID[ENCOUNTER_ABOMINATION_NUMBER];
uint64 uiBehemothGUID[ENCOUNTER_BEHEMOTH_NUMBER];
uint64 uiGhoulGUID[ENCOUNTER_GHOUL_NUMBER];
uint64 uiWarriorGUID[ENCOUNTER_WARRIOR_NUMBER];
ObjectGuid uiKoltiraGUID;
ObjectGuid uiOrbazGUID;
ObjectGuid uiThassarianGUID;
ObjectGuid uiLichKingGUID;
ObjectGuid uiAbominationGUID[ENCOUNTER_ABOMINATION_NUMBER];
ObjectGuid uiBehemothGUID[ENCOUNTER_BEHEMOTH_NUMBER];
ObjectGuid uiGhoulGUID[ENCOUNTER_GHOUL_NUMBER];
ObjectGuid uiWarriorGUID[ENCOUNTER_WARRIOR_NUMBER];
void Reset() override
{
@@ -413,23 +394,23 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiRayneGUID))
temp->setDeathState(JUST_DIED);
uiTirionGUID = 0;
uiKorfaxGUID = 0;
uiMaxwellGUID = 0;
uiEligorGUID = 0;
uiRayneGUID = 0;
uiTirionGUID.Clear();
uiKorfaxGUID.Clear();
uiMaxwellGUID.Clear();
uiEligorGUID.Clear();
uiRayneGUID.Clear();
for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i)
{
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiDefenderGUID[i]))
temp->setDeathState(JUST_DIED);
uiDefenderGUID[i] = 0;
uiDefenderGUID[i].Clear();
}
for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i)
{
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiEarthshatterGUID[i]))
temp->setDeathState(JUST_DIED);
uiEarthshatterGUID[i] = 0;
uiEarthshatterGUID[i].Clear();
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKoltiraGUID))
@@ -441,33 +422,33 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiLichKingGUID))
temp->Respawn();
uiKoltiraGUID = 0;
uiOrbazGUID = 0;
uiThassarianGUID = 0;
uiLichKingGUID = 0;
uiKoltiraGUID.Clear();
uiOrbazGUID.Clear();
uiThassarianGUID.Clear();
uiLichKingGUID.Clear();
for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
{
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiAbominationGUID[i]))
temp->setDeathState(JUST_DIED);
uiAbominationGUID[i] = 0;
uiAbominationGUID[i].Clear();
}
for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
{
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiBehemothGUID[i]))
temp->setDeathState(JUST_DIED);
uiBehemothGUID[i] = 0;
uiBehemothGUID[i].Clear();
}
for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
{
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiGhoulGUID[i]))
temp->setDeathState(JUST_DIED);
uiGhoulGUID[i] = 0;
uiGhoulGUID[i].Clear();
}
for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
{
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiWarriorGUID[i]))
temp->setDeathState(JUST_DIED);
uiWarriorGUID[i] = 0;
uiWarriorGUID[i].Clear();
}
}
}
@@ -38,13 +38,6 @@ class instance_scarlet_monastery : public InstanceMapScript
SetBossNumber(EncounterCount);
LoadDoorData(doorData);
PumpkinShrineGUID = 0;
HorsemanGUID = 0;
HeadGUID = 0;
MograineGUID = 0;
WhitemaneGUID = 0;
VorrelGUID = 0;
HorsemanAdds.clear();
}
@@ -124,7 +117,7 @@ class instance_scarlet_monastery : public InstanceMapScript
case DATA_HORSEMAN_EVENT:
if (state == DONE)
{
for (uint64 guid : HorsemanAdds)
for (ObjectGuid guid : HorsemanAdds)
{
Creature* add = instance->GetCreature(guid);
if (add && add->IsAlive())
@@ -157,14 +150,14 @@ class instance_scarlet_monastery : public InstanceMapScript
}
protected:
uint64 PumpkinShrineGUID;
uint64 HorsemanGUID;
uint64 HeadGUID;
uint64 MograineGUID;
uint64 WhitemaneGUID;
uint64 VorrelGUID;
ObjectGuid PumpkinShrineGUID;
ObjectGuid HorsemanGUID;
ObjectGuid HeadGUID;
ObjectGuid MograineGUID;
ObjectGuid WhitemaneGUID;
ObjectGuid VorrelGUID;
std::set<uint64> HorsemanAdds;
GuidSet HorsemanAdds;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
@@ -38,15 +38,6 @@ class instance_scholomance : public InstanceMapScript
{
SetHeaders(DataHeader);
SetBossNumber(EncounterCount);
GateKirtonosGUID = 0;
GateGandlingGUID = 0;
GateMiliciaGUID = 0;
GateTheolenGUID = 0;
GatePolkeltGUID = 0;
GateRavenianGUID = 0;
GateBarovGUID = 0;
GateIlluciaGUID = 0;
BrazierOfTheHeraldGUID = 0;
}
void OnGameObjectCreate(GameObject* go) override
@@ -175,15 +166,15 @@ class instance_scholomance : public InstanceMapScript
}
protected:
uint64 GateKirtonosGUID;
uint64 GateGandlingGUID;
uint64 GateMiliciaGUID;
uint64 GateTheolenGUID;
uint64 GatePolkeltGUID;
uint64 GateRavenianGUID;
uint64 GateBarovGUID;
uint64 GateIlluciaGUID;
uint64 BrazierOfTheHeraldGUID;
ObjectGuid GateKirtonosGUID;
ObjectGuid GateGandlingGUID;
ObjectGuid GateMiliciaGUID;
ObjectGuid GateTheolenGUID;
ObjectGuid GatePolkeltGUID;
ObjectGuid GateRavenianGUID;
ObjectGuid GateBarovGUID;
ObjectGuid GateIlluciaGUID;
ObjectGuid BrazierOfTheHeraldGUID;
};
};
@@ -83,13 +83,13 @@ public:
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
uint64 uiAshGUID;
uint64 uiAdaGUID;
uint64 uiArchmageArugalGUID;
ObjectGuid uiAshGUID;
ObjectGuid uiAdaGUID;
ObjectGuid uiArchmageArugalGUID;
uint64 DoorCourtyardGUID;
uint64 DoorSorcererGUID;
uint64 DoorArugalGUID;
ObjectGuid DoorCourtyardGUID;
ObjectGuid DoorSorcererGUID;
ObjectGuid DoorArugalGUID;
uint8 uiPhase;
uint16 uiTimer;
@@ -99,14 +99,6 @@ public:
SetHeaders(DataHeader);
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
uiAshGUID = 0;
uiAdaGUID = 0;
uiArchmageArugalGUID = 0;
DoorCourtyardGUID = 0;
DoorSorcererGUID = 0;
DoorArugalGUID = 0;
uiPhase = 0;
uiTimer = 0;
}
@@ -56,21 +56,21 @@ class instance_stratholme : public InstanceMapScript
bool IsSilverHandDead[5];
uint64 serviceEntranceGUID;
uint64 gauntletGate1GUID;
uint64 ziggurat1GUID;
uint64 ziggurat2GUID;
uint64 ziggurat3GUID;
uint64 ziggurat4GUID;
uint64 ziggurat5GUID;
uint64 portGauntletGUID;
uint64 portSlaugtherGUID;
uint64 portElderGUID;
ObjectGuid serviceEntranceGUID;
ObjectGuid gauntletGate1GUID;
ObjectGuid ziggurat1GUID;
ObjectGuid ziggurat2GUID;
ObjectGuid ziggurat3GUID;
ObjectGuid ziggurat4GUID;
ObjectGuid ziggurat5GUID;
ObjectGuid portGauntletGUID;
ObjectGuid portSlaugtherGUID;
ObjectGuid portElderGUID;
uint64 baronGUID;
uint64 ysidaTriggerGUID;
std::set<uint64> crystalsGUID;
std::set<uint64> abomnationGUID;
ObjectGuid baronGUID;
ObjectGuid ysidaTriggerGUID;
GuidSet crystalsGUID;
GuidSet abomnationGUID;
EventMap events;
void Initialize() override
@@ -81,19 +81,6 @@ class instance_stratholme : public InstanceMapScript
for (uint8 i = 0; i < 5; ++i)
IsSilverHandDead[i] = false;
serviceEntranceGUID = 0;
gauntletGate1GUID = 0;
ziggurat1GUID = 0;
ziggurat2GUID = 0;
ziggurat3GUID = 0;
ziggurat4GUID = 0;
ziggurat5GUID = 0;
portGauntletGUID = 0;
portSlaugtherGUID = 0;
portElderGUID = 0;
baronGUID = 0;
ysidaTriggerGUID = 0;
crystalsGUID.clear();
abomnationGUID.clear();
}
@@ -117,12 +117,12 @@ public:
void Initialize()
{
Tagger = 0;
Tagger.Clear();
Die_Timer = 5000;
Tagged = false;
}
uint64 Tagger;
ObjectGuid Tagger;
uint32 Die_Timer;
bool Tagged;
@@ -63,13 +63,13 @@ public:
SetHeaders(DataHeader);
}
uint64 GOAtalaiStatue1;
uint64 GOAtalaiStatue2;
uint64 GOAtalaiStatue3;
uint64 GOAtalaiStatue4;
uint64 GOAtalaiStatue5;
uint64 GOAtalaiStatue6;
uint64 GOAtalaiIdol;
ObjectGuid GOAtalaiStatue1;
ObjectGuid GOAtalaiStatue2;
ObjectGuid GOAtalaiStatue3;
ObjectGuid GOAtalaiStatue4;
ObjectGuid GOAtalaiStatue5;
ObjectGuid GOAtalaiStatue6;
ObjectGuid GOAtalaiIdol;
uint32 State;
@@ -82,13 +82,6 @@ public:
void Initialize() override
{
GOAtalaiStatue1 = 0;
GOAtalaiStatue2 = 0;
GOAtalaiStatue3 = 0;
GOAtalaiStatue4 = 0;
GOAtalaiStatue5 = 0;
GOAtalaiStatue6 = 0;
GOAtalaiIdol = 0;
State = 0;
@@ -593,8 +593,6 @@ public:
{
Initialize();
instance = creature->GetInstanceScript();
KalecGUID = 0;
KalecgosGUID = 0;
}
void Initialize()
@@ -616,8 +614,8 @@ public:
uint32 CheckTimer;
uint32 ResetThreat;
uint64 KalecGUID;
uint64 KalecgosGUID;
ObjectGuid KalecGUID;
ObjectGuid KalecgosGUID;
bool isEnraged;
bool isBanished;
@@ -632,7 +630,7 @@ public:
{
if (Creature* Kalec = ObjectAccessor::GetCreature(*me, KalecGUID))
Kalec->setDeathState(JUST_DIED);
KalecGUID = 0;
KalecGUID.Clear();
}
Initialize();
@@ -183,7 +183,7 @@ public:
{
DarkFiend = false;
HasEnraged = false;
EntropiusGUID = 0;
EntropiusGUID.Clear();
}
void Reset() override
@@ -278,7 +278,7 @@ public:
private:
bool DarkFiend;
bool HasEnraged;
uint64 EntropiusGUID;
ObjectGuid EntropiusGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -53,21 +53,7 @@ class instance_sunwell_plateau : public InstanceMapScript
SetBossNumber(EncounterCount);
LoadDoorData(doorData);
KalecgosDragonGUID = 0;
KalecgosHumanGUID = 0;
SathrovarrGUID = 0;
BrutallusGUID = 0;
MadrigosaGUID = 0;
FelmystGUID = 0;
AlythessGUID = 0;
SacrolashGUID = 0;
MuruGUID = 0;
KilJaedenGUID = 0;
KilJaedenControllerGUID = 0;
AnveenaGUID = 0;
KalecgosKjGUID = 0;
SpectralPlayers = 0;
SpectralRealmTimer = 5000;
}
@@ -214,23 +200,23 @@ class instance_sunwell_plateau : public InstanceMapScript
}
protected:
uint64 KalecgosDragonGUID;
uint64 KalecgosHumanGUID;
uint64 SathrovarrGUID;
uint64 BrutallusGUID;
uint64 MadrigosaGUID;
uint64 FelmystGUID;
uint64 AlythessGUID;
uint64 SacrolashGUID;
uint64 MuruGUID;
uint64 KilJaedenGUID;
uint64 KilJaedenControllerGUID;
uint64 AnveenaGUID;
uint64 KalecgosKjGUID;
uint32 SpectralPlayers;
ObjectGuid KalecgosDragonGUID;
ObjectGuid KalecgosHumanGUID;
ObjectGuid SathrovarrGUID;
ObjectGuid BrutallusGUID;
ObjectGuid MadrigosaGUID;
ObjectGuid FelmystGUID;
ObjectGuid AlythessGUID;
ObjectGuid SacrolashGUID;
ObjectGuid MuruGUID;
ObjectGuid KilJaedenGUID;
ObjectGuid KilJaedenControllerGUID;
ObjectGuid AnveenaGUID;
ObjectGuid KalecgosKjGUID;
ObjectGuid SpectralPlayers;
uint32 SpectralRealmTimer;
std::vector<uint64> SpectralRealmList;
GuidVector SpectralRealmList;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
@@ -52,18 +52,6 @@ class instance_uldaman : public InstanceMapScript
SetHeaders(DataHeader);
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
archaedasGUID = 0;
ironayaGUID = 0;
whoWokeuiArchaedasGUID = 0;
altarOfTheKeeperTempleDoor = 0;
archaedasTempleDoor = 0;
ancientVaultDoor = 0;
ironayaSealDoor = 0;
keystoneGUID = 0;
ironayaSealDoorTimer = 27000; //animation time
keystoneCheck = false;
}
@@ -77,25 +65,25 @@ class instance_uldaman : public InstanceMapScript
return false;
}
uint64 archaedasGUID;
uint64 ironayaGUID;
uint64 whoWokeuiArchaedasGUID;
ObjectGuid archaedasGUID;
ObjectGuid ironayaGUID;
ObjectGuid whoWokeuiArchaedasGUID;
uint64 altarOfTheKeeperTempleDoor;
uint64 archaedasTempleDoor;
uint64 ancientVaultDoor;
uint64 ironayaSealDoor;
ObjectGuid altarOfTheKeeperTempleDoor;
ObjectGuid archaedasTempleDoor;
ObjectGuid ancientVaultDoor;
ObjectGuid ironayaSealDoor;
uint64 keystoneGUID;
ObjectGuid keystoneGUID;
uint32 ironayaSealDoorTimer;
bool keystoneCheck;
std::vector<uint64> stoneKeepers;
std::vector<uint64> altarOfTheKeeperCounts;
std::vector<uint64> vaultWalkers;
std::vector<uint64> earthenGuardians;
std::vector<uint64> archaedasWallMinions; // minions lined up around the wall
GuidVector stoneKeepers;
GuidVector altarOfTheKeeperCounts;
GuidVector vaultWalkers;
GuidVector earthenGuardians;
GuidVector archaedasWallMinions; // minions lined up around the wall
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
@@ -177,7 +165,7 @@ class instance_uldaman : public InstanceMapScript
{
if (GetData(DATA_ALTAR_DOORS) != DONE)
{
for (std::vector<uint64>::const_iterator i = stoneKeepers.begin(); i != stoneKeepers.end(); ++i)
for (GuidVector::const_iterator i = stoneKeepers.begin(); i != stoneKeepers.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
if (!target || !target->IsAlive())
@@ -199,7 +187,7 @@ class instance_uldaman : public InstanceMapScript
if (!archaedas)
return;
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
for (GuidVector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
if (!target || !target->IsAlive() || target->getFaction() == 14)
@@ -217,7 +205,7 @@ class instance_uldaman : public InstanceMapScript
void DeActivateMinions()
{
// first despawn any aggroed wall minions
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
for (GuidVector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->getFaction() != 14)
@@ -227,7 +215,7 @@ class instance_uldaman : public InstanceMapScript
}
// Vault Walkers
for (std::vector<uint64>::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
for (GuidVector::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->getFaction() != 14)
@@ -274,7 +262,7 @@ class instance_uldaman : public InstanceMapScript
void RespawnMinions()
{
// first respawn any aggroed wall minions
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
for (GuidVector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
if (target && target->isDead())
@@ -286,7 +274,7 @@ class instance_uldaman : public InstanceMapScript
}
// Vault Walkers
for (std::vector<uint64>::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
for (GuidVector::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
if (target && target->isDead())
@@ -298,7 +286,7 @@ class instance_uldaman : public InstanceMapScript
}
// Earthen Guardians
for (std::vector<uint64>::const_iterator i = earthenGuardians.begin(); i != earthenGuardians.end(); ++i)
for (GuidVector::const_iterator i = earthenGuardians.begin(); i != earthenGuardians.end(); ++i)
{
Creature* target = instance->GetCreature(*i);
if (target && target->isDead())
@@ -93,10 +93,12 @@ class boss_akilzon : public CreatureScript
void Initialize()
{
TargetGUID = 0;
CloudGUID = 0;
CycloneGUID = 0;
memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
TargetGUID.Clear();
CloudGUID.Clear();
CycloneGUID.Clear();
for (ObjectGuid& guid : BirdGUIDs)
guid.Clear();
StormCount = 0;
isRaining = false;
}
@@ -364,10 +366,10 @@ class boss_akilzon : public CreatureScript
}
private:
uint64 BirdGUIDs[8];
uint64 TargetGUID;
uint64 CycloneGUID;
uint64 CloudGUID;
ObjectGuid BirdGUIDs[8];
ObjectGuid TargetGUID;
ObjectGuid CycloneGUID;
ObjectGuid CloudGUID;
uint8 StormCount;
bool isRaining;
};
@@ -394,12 +396,12 @@ class npc_akilzon_eagle : public CreatureScript
{
EagleSwoop_Timer = urand(5000, 10000);
arrived = true;
TargetGUID = 0;
TargetGUID.Clear();
}
uint32 EagleSwoop_Timer;
bool arrived;
uint64 TargetGUID;
ObjectGuid TargetGUID;
void Reset() override
{
@@ -85,7 +85,7 @@ class boss_halazzi : public CreatureScript
void Initialize()
{
LynxGUID = 0;
LynxGUID.Clear();
TransformCount = 0;
BerserkTimer = 600000;
CheckTimer = 1000;
@@ -103,7 +103,7 @@ class boss_halazzi : public CreatureScript
uint32 BerserkTimer;
uint32 TransformCount;
uint64 LynxGUID;
ObjectGuid LynxGUID;
void Reset() override
{
@@ -258,8 +258,8 @@ class boss_hexlord_malacrass : public CreatureScript
instance = creature->GetInstanceScript();
SelectAddEntry();
for (uint8 i = 0; i < 4; ++i)
AddGUID[i] = 0;
PlayerGUID = 0;
AddGUID[i].Clear();
PlayerGUID.Clear();
PlayerClass = CLASS_NONE;
}
@@ -275,10 +275,10 @@ class boss_hexlord_malacrass : public CreatureScript
InstanceScript* instance;
uint64 AddGUID[4];
ObjectGuid AddGUID[4];
uint32 AddEntry[4];
uint64 PlayerGUID;
ObjectGuid PlayerGUID;
uint32 SpiritBolts_Timer;
uint32 DrainPower_Timer;
@@ -141,7 +141,7 @@ class boss_janalai : public CreatureScript
isFlameBreathing = false;
for (uint8 i = 0; i < 40; ++i)
FireBombGUIDs[i] = 0;
FireBombGUIDs[i].Clear();
}
InstanceScript* instance;
@@ -159,7 +159,7 @@ class boss_janalai : public CreatureScript
bool isFlameBreathing;
uint64 FireBombGUIDs[40];
ObjectGuid FireBombGUIDs[40];
void Reset() override
{
@@ -138,7 +138,6 @@ class boss_zuljin : public CreatureScript
{
Initialize();
instance = creature->GetInstanceScript();
memset(SpiritGUID, 0, sizeof(SpiritGUID));
health_20 = 0;
}
@@ -164,15 +163,15 @@ class boss_zuljin : public CreatureScript
Flame_Breath_Timer = 6000;
Pillar_Of_Fire_Timer = 7000;
ClawTargetGUID = 0;
TankGUID = 0;
ClawTargetGUID.Clear();
TankGUID.Clear();
}
InstanceScript* instance;
uint64 SpiritGUID[4];
uint64 ClawTargetGUID;
uint64 TankGUID;
ObjectGuid SpiritGUID[4];
ObjectGuid ClawTargetGUID;
ObjectGuid TankGUID;
uint32 Phase;
uint32 health_20;
@@ -68,19 +68,19 @@ class instance_zulaman : public InstanceMapScript
{
instance_zulaman_InstanceMapScript(Map* map) : InstanceScript(map) { }
uint64 HarkorsSatchelGUID;
uint64 TanzarsTrunkGUID;
uint64 AshlisBagGUID;
uint64 KrazsPackageGUID;
uint64 StrangeGongGUID;
uint64 HarrisonJonesGUID;
ObjectGuid HarkorsSatchelGUID;
ObjectGuid TanzarsTrunkGUID;
ObjectGuid AshlisBagGUID;
ObjectGuid KrazsPackageGUID;
ObjectGuid StrangeGongGUID;
ObjectGuid HarrisonJonesGUID;
uint64 HexLordGateGUID;
uint64 ZulJinGateGUID;
uint64 MassiveGateGUID;
uint64 AkilzonDoorGUID;
uint64 ZulJinDoorGUID;
uint64 HalazziDoorGUID;
ObjectGuid HexLordGateGUID;
ObjectGuid ZulJinGateGUID;
ObjectGuid MassiveGateGUID;
ObjectGuid AkilzonDoorGUID;
ObjectGuid ZulJinDoorGUID;
ObjectGuid HalazziDoorGUID;
uint32 QuestTimer;
uint16 BossKilled;
@@ -95,20 +95,6 @@ class instance_zulaman : public InstanceMapScript
SetHeaders(DataHeader);
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
HarkorsSatchelGUID = 0;
TanzarsTrunkGUID = 0;
AshlisBagGUID = 0;
KrazsPackageGUID = 0;
StrangeGongGUID = 0;
HexLordGateGUID = 0;
ZulJinGateGUID = 0;
MassiveGateGUID = 0;
AkilzonDoorGUID = 0;
HalazziDoorGUID = 0;
ZulJinDoorGUID = 0;
HarrisonJonesGUID = 0;
QuestTimer = 0;
QuestMinute = 0;
BossKilled = 0;
@@ -95,8 +95,6 @@ class boss_arlokk : public CreatureScript
boss_arlokkAI(Creature* creature) : BossAI(creature, DATA_ARLOKK)
{
Initialize();
memset(_triggersSideAGUID, 0, sizeof(_triggersSideAGUID));
memset(_triggersSideBGUID, 0, sizeof(_triggersSideBGUID));
}
void Initialize()
@@ -305,8 +303,8 @@ class boss_arlokk : public CreatureScript
private:
uint8 _summonCountA;
uint8 _summonCountB;
uint64 _triggersSideAGUID[5];
uint64 _triggersSideBGUID[5];
ObjectGuid _triggersSideAGUID[5];
ObjectGuid _triggersSideBGUID[5];
};
CreatureAI* GetAI(Creature* creature) const override
@@ -115,7 +115,6 @@ class boss_mandokir : public CreatureScript
boss_mandokirAI(Creature* creature) : BossAI(creature, DATA_MANDOKIR)
{
Initialize();
memset(chainedSpirtGUIDs, 0, sizeof(chainedSpirtGUIDs));
}
void Initialize()
@@ -286,7 +285,7 @@ class boss_mandokir : public CreatureScript
private:
uint8 killCount;
uint64 chainedSpirtGUIDs[CHAINED_SPIRT_COUNT];
ObjectGuid chainedSpirtGUIDs[CHAINED_SPIRT_COUNT];
};
CreatureAI* GetAI(Creature* creature) const override
@@ -46,17 +46,6 @@ class instance_zulgurub : public InstanceMapScript
LoadDoorData(doorData);
}
void Initialize() override
{
_zealotLorkhanGUID = 0;
_zealotZathGUID = 0;
_highPriestTekalGUID = 0;
_jindoTheHexxerGUID = 0;
_vilebranchSpeakerGUID = 0;
_arlokkGUID = 0;
_goGongOfBethekkGUID = 0;
}
bool IsEncounterInProgress() const override
{
// not active in Zul'Gurub
@@ -149,13 +138,13 @@ class instance_zulgurub : public InstanceMapScript
//If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too.
//Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too.
uint64 _zealotLorkhanGUID;
uint64 _zealotZathGUID;
uint64 _highPriestTekalGUID;
uint64 _jindoTheHexxerGUID;
uint64 _vilebranchSpeakerGUID;
uint64 _arlokkGUID;
uint64 _goGongOfBethekkGUID;
ObjectGuid _zealotLorkhanGUID;
ObjectGuid _zealotZathGUID;
ObjectGuid _highPriestTekalGUID;
ObjectGuid _jindoTheHexxerGUID;
ObjectGuid _vilebranchSpeakerGUID;
ObjectGuid _arlokkGUID;
ObjectGuid _goGongOfBethekkGUID;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
@@ -46,7 +46,7 @@ public:
{
npc_galen_goodwardAI(Creature* creature) : npc_escortAI(creature)
{
galensCageGUID = 0;
galensCageGUID.Clear();
Reset();
}
@@ -135,7 +135,7 @@ public:
}
private:
uint64 galensCageGUID;
ObjectGuid galensCageGUID;
uint32 periodicSay;
};
@@ -77,12 +77,12 @@ public:
{
m_uiPhase = 0;
m_uiPhaseTimer = 5000;
m_uiPlayerGUID = 0;
m_uiPlayerGUID.Clear();
}
uint32 m_uiPhase;
uint32 m_uiPhaseTimer;
uint64 m_uiPlayerGUID;
ObjectGuid m_uiPlayerGUID;
void Reset() override
{
@@ -108,7 +108,7 @@ public:
{
LamentEventTimer = 5000;
LamentEvent = false;
targetGUID = 0;
targetGUID.Clear();
FadeTimer = 30000;
SummonSkeletonTimer = 20000;
@@ -119,7 +119,7 @@ public:
uint32 LamentEventTimer;
bool LamentEvent;
uint64 targetGUID;
ObjectGuid targetGUID;
uint32 FadeTimer;
uint32 SummonSkeletonTimer;
@@ -117,11 +117,11 @@ class spell_ex_5581 : public SpellScriptLoader
void HandleDummyLaunchTarget(SpellEffIndex /*effIndex*/)
{
uint64 targetGUID = 0;
ObjectGuid targetGUID;
if (Unit* unitTarget = GetHitUnit())
targetGUID = unitTarget->GetGUID();
// we're handling SPELL_EFFECT_DUMMY in effIndex 0 here
TC_LOG_INFO("misc", "Spell %u with SPELL_EFFECT_DUMMY is just launched at it's target: " UI64FMTD "!", GetSpellInfo()->Id, targetGUID);
TC_LOG_INFO("misc", "Spell %u with SPELL_EFFECT_DUMMY is just launched at it's target: " UI64FMTD "!", GetSpellInfo()->Id, targetGUID.GetRawValue());
}
void HandleDummyHit(SpellEffIndex /*effIndex*/)
@@ -1654,7 +1654,7 @@ class spell_halion_twilight_cutter : public SpellScriptLoader
return;
Unit* caster = GetCaster();
if (Unit* channelTarget = ObjectAccessor::GetUnit(*caster, caster->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT)))
if (Unit* channelTarget = ObjectAccessor::GetUnit(*caster, caster->GetChannelObjectGuid()))
{
unitList.remove_if(TwilightCutterSelector(caster, channelTarget));
return;
@@ -203,8 +203,8 @@ class npc_corrupted_soul_fragment : public CreatureScript
if (TempSummon* summ = me->ToTempSummon())
{
uint64 BronjahmGUID = instance->GetData64(DATA_BRONJAHM);
if (GUID_LOPART(BronjahmGUID) != id)
ObjectGuid BronjahmGUID(instance->GetData64(DATA_BRONJAHM));
if (BronjahmGUID.GetCounter() != id)
return;
if (Creature* bronjahm = ObjectAccessor::GetCreature(*me, BronjahmGUID))
@@ -213,7 +213,7 @@ struct boss_horAI : BossAI
class GameObjectDeleteDelayEvent : public BasicEvent
{
public:
GameObjectDeleteDelayEvent(Unit* owner, uint64 gameObjectGUID) : _owner(owner), _gameObjectGUID(gameObjectGUID) { }
GameObjectDeleteDelayEvent(Unit* owner, ObjectGuid gameObjectGUID) : _owner(owner), _gameObjectGUID(gameObjectGUID) { }
void DeleteGameObject()
{
@@ -234,7 +234,7 @@ class GameObjectDeleteDelayEvent : public BasicEvent
private:
Unit* _owner;
uint64 _gameObjectGUID;
ObjectGuid _gameObjectGUID;
};
template<class AI>
@@ -85,27 +85,6 @@ class instance_halls_of_reflection : public InstanceMapScript
SetHeaders(DataHeader);
SetBossNumber(EncounterCount);
JainaOrSylvanasIntroGUID = 0;
KorelnOrLoralenGUID = 0;
TheLichkingIntroGUID = 0;
FalricGUID = 0;
MarwynGUID = 0;
FrostmourneAltarBunnyGUID = 0;
FrostswornGeneralGUID = 0;
JainaOrSylvanasEscapeGUID = 0;
TheLichKingEscapeGUID = 0;
FrostmourneGUID = 0;
EntranceDoorGUID = 0;
ImpenetrableDoorGUID = 0;
ShadowThroneDoorGUID = 0;
CaveInGUID = 0;
GunshipGUID = 0;
CaptainsChestGUID = 0;
CaptainGUID = 0;
IcewallGUID = 0;
IcewallTargetGUID = 0;
_teamInInstance = 0;
_waveCount = 0;
_introState = NOT_STARTED;
@@ -200,7 +179,7 @@ class instance_halls_of_reflection : public InstanceMapScript
break;
}
case NPC_ICE_WALL_TARGET:
IcewallTargetGUID = 0;
IcewallTargetGUID.Clear();
break;
case NPC_WORLD_TRIGGER:
case NPC_GUNSHIP_CANNON_HORDE:
@@ -256,11 +235,11 @@ class instance_halls_of_reflection : public InstanceMapScript
break;
case GO_IMPENETRABLE_DOOR:
ImpenetrableDoorGUID = go->GetGUID();
HandleGameObject(0, GetBossState(DATA_MARWYN) == DONE, go);
HandleGameObject(ObjectGuid::Empty, GetBossState(DATA_MARWYN) == DONE, go);
break;
case GO_SHADOW_THRONE_DOOR:
ShadowThroneDoorGUID = go->GetGUID();
HandleGameObject(0, GetData(DATA_FROSTSWORN_GENERAL) == DONE, go);
HandleGameObject(ObjectGuid::Empty, GetData(DATA_FROSTSWORN_GENERAL) == DONE, go);
break;
case GO_CAVE_IN:
CaveInGUID = go->GetGUID();
@@ -282,7 +261,7 @@ class instance_halls_of_reflection : public InstanceMapScript
CaptainsChestGUID = go->GetGUID();
break;
case GO_ICE_WALL:
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
IcewallGUID = go->GetGUID();
break;
default:
@@ -483,7 +462,7 @@ class instance_halls_of_reflection : public InstanceMapScript
case NPC_WAVE_MAGE:
{
uint32 waveId = creature->AI()->GetData(0);
for (uint64 guid : waveGuidList[waveId])
for (ObjectGuid guid : waveGuidList[waveId])
{
if (Creature* npc = instance->GetCreature(guid))
if (npc->IsAlive())
@@ -539,7 +518,7 @@ class instance_halls_of_reflection : public InstanceMapScript
{
tempList = possibilityList;
uint64 bossGuid = i <= 3 ? FalricGUID : MarwynGUID;
ObjectGuid bossGuid = i <= 3 ? FalricGUID : MarwynGUID;
if (!i)
Trinity::Containers::RandomResizeList(tempList, 3);
@@ -571,7 +550,7 @@ class instance_halls_of_reflection : public InstanceMapScript
if (_waveCount % 5)
{
uint32 internalWaveId = _waveCount - ((_waveCount < 5) ? 1 : 2);
for (uint64 guid : waveGuidList[internalWaveId])
for (ObjectGuid guid : waveGuidList[internalWaveId])
{
if (Creature* temp = instance->GetCreature(guid))
{
@@ -610,7 +589,7 @@ class instance_halls_of_reflection : public InstanceMapScript
// despawn wave npcs
for (uint8 i = 0; i < 8; ++i)
{
for (uint64 guid : waveGuidList[i])
for (ObjectGuid guid : waveGuidList[i])
if (Creature* creature = instance->GetCreature(guid))
creature->DespawnOrUnsummon(1);
waveGuidList[i].clear();
@@ -630,9 +609,9 @@ class instance_halls_of_reflection : public InstanceMapScript
if (Creature* captain = instance->GetCreature(CaptainGUID))
captain->AI()->Talk(SAY_CAPTAIN_FIRE);
for (uint64 guid : GunshipCannonGUIDs)
for (ObjectGuid guid : GunshipCannonGUIDs)
{
uint32 entry = GUID_ENPART(guid);
uint32 entry = guid.GetEntry();
if ((entry == NPC_WORLD_TRIGGER && _teamInInstance == ALLIANCE) || (entry == NPC_GUNSHIP_CANNON_HORDE && _teamInInstance == HORDE))
if (Creature* cannon = instance->GetCreature(guid))
cannon->CastSpell(cannon, SPELL_GUNSHIP_CANNON_FIRE, true);
@@ -642,7 +621,7 @@ class instance_halls_of_reflection : public InstanceMapScript
if (Transport* gunship = instance->GetTransport(GunshipGUID))
gunship->EnableMovement(false);
for (uint64 guid : GunshipStairGUIDs)
for (ObjectGuid guid : GunshipStairGUIDs)
if (GameObject* stairs = instance->GetGameObject(guid))
stairs->SetRespawnTime(DAY);
@@ -732,21 +711,21 @@ class instance_halls_of_reflection : public InstanceMapScript
}
private:
uint64 JainaOrSylvanasIntroGUID; // unused
uint64 KorelnOrLoralenGUID;
uint64 TheLichkingIntroGUID; // unused
uint64 FalricGUID;
uint64 MarwynGUID;
uint64 FrostmourneAltarBunnyGUID;
uint64 FrostswornGeneralGUID;
uint64 JainaOrSylvanasEscapeGUID;
uint64 TheLichKingEscapeGUID;
ObjectGuid JainaOrSylvanasIntroGUID; // unused
ObjectGuid KorelnOrLoralenGUID;
ObjectGuid TheLichkingIntroGUID; // unused
ObjectGuid FalricGUID;
ObjectGuid MarwynGUID;
ObjectGuid FrostmourneAltarBunnyGUID;
ObjectGuid FrostswornGeneralGUID;
ObjectGuid JainaOrSylvanasEscapeGUID;
ObjectGuid TheLichKingEscapeGUID;
uint64 FrostmourneGUID;
uint64 EntranceDoorGUID;
uint64 ImpenetrableDoorGUID;
uint64 ShadowThroneDoorGUID;
uint64 CaveInGUID;
ObjectGuid FrostmourneGUID;
ObjectGuid EntranceDoorGUID;
ObjectGuid ImpenetrableDoorGUID;
ObjectGuid ShadowThroneDoorGUID;
ObjectGuid CaveInGUID;
uint32 _teamInInstance;
uint32 _waveCount;
@@ -754,16 +733,16 @@ class instance_halls_of_reflection : public InstanceMapScript
uint32 _frostswornGeneralState;
EventMap events;
std::set<uint64> waveGuidList[8];
GuidSet waveGuidList[8];
uint64 GunshipGUID;
uint64 CaptainsChestGUID;
uint64 CaptainGUID;
uint64 IcewallGUID;
uint64 IcewallTargetGUID;
ObjectGuid GunshipGUID;
ObjectGuid CaptainsChestGUID;
ObjectGuid CaptainGUID;
ObjectGuid IcewallGUID;
ObjectGuid IcewallTargetGUID;
std::set<uint64> GunshipCannonGUIDs;
std::set<uint64> GunshipStairGUIDs;
GuidSet GunshipCannonGUIDs;
GuidSet GunshipStairGUIDs;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
@@ -1148,7 +1148,6 @@ class npc_ball_of_flame : public CreatureScript
npc_ball_of_flameAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
{
_despawnTimer = 0;
_chaseGUID = 0;
}
void Reset() override
@@ -1163,7 +1162,7 @@ class npc_ball_of_flame : public CreatureScript
void MovementInform(uint32 type, uint32 id) override
{
if (type == CHASE_MOTION_TYPE && id == GUID_LOPART(_chaseGUID) && _chaseGUID)
if (type == CHASE_MOTION_TYPE && id == _chaseGUID.GetCounter() && _chaseGUID)
{
me->RemoveAurasDueToSpell(SPELL_BALL_OF_FLAMES_PERIODIC);
DoCast(me, SPELL_FLAMES);
@@ -1174,7 +1173,7 @@ class npc_ball_of_flame : public CreatureScript
void SetGUID(uint64 guid, int32 /*type*/) override
{
_chaseGUID = guid;
_chaseGUID.Set(guid);
}
void DoAction(int32 action) override
@@ -1213,7 +1212,7 @@ class npc_ball_of_flame : public CreatureScript
}
private:
uint64 _chaseGUID;
ObjectGuid _chaseGUID;
InstanceScript* _instance;
uint32 _despawnTimer;
};
@@ -330,7 +330,7 @@ enum MiscData
class VehicleCheckPredicate
{
public:
bool operator()(uint64 guid) { return IS_VEHICLE_GUID(guid); }
bool operator()(ObjectGuid guid) { return guid.IsVehicle(); }
};
class boss_malygos : public CreatureScript
@@ -1633,7 +1633,7 @@ class FlameLeviathanPursuedTargetSelector
//! Vehicle must be in use by player
bool playerFound = false;
for (SeatMap::const_iterator itr = vehicle->Seats.begin(); itr != vehicle->Seats.end() && !playerFound; ++itr)
if (IS_PLAYER_GUID(itr->second.Passenger.Guid))
if (itr->second.Passenger.Guid.IsPlayer())
playerFound = true;
return !playerFound;
@@ -1028,7 +1028,7 @@ class boss_vx_001 : public CreatureScript
// Handle rotation during SPELL_SPINNING_UP, SPELL_P3WX2_LASER_BARRAGE, SPELL_RAPID_BURST, and SPELL_HAND_PULSE_LEFT/RIGHT
if (me->HasUnitState(UNIT_STATE_CASTING))
{
if (Creature* channelTarget = ObjectAccessor::GetCreature(*me, me->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT)))
if (Creature* channelTarget = ObjectAccessor::GetCreature(*me, me->GetChannelObjectGuid()))
me->SetFacingToObject(channelTarget);
return;
}
@@ -1953,7 +1953,7 @@ class spell_mimiron_p3wx2_laser_barrage : public SpellScriptLoader
void OnHit(SpellEffIndex /*effIndex*/)
{
GetCaster()->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, GetHitUnit()->GetGUID());
GetCaster()->SetChannelObjectGuid(GetHitUnit()->GetGUID());
}
void Register() override
@@ -2357,7 +2357,7 @@ class spell_mimiron_spinning_up : public SpellScriptLoader
void OnHit(SpellEffIndex /*effIndex*/)
{
if (GetHitUnit() != GetCaster())
GetCaster()->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, GetHitUnit()->GetGUID());
GetCaster()->SetChannelObjectGuid(GetHitUnit()->GetGUID());
}
void Register() override
@@ -266,11 +266,14 @@ public:
break;
}
/*
BEWARE - SHIT.
if (creature->GetGUID() == uiFirstBoss || creature->GetGUID() == uiSecondBoss)
{
creature->AllLootRemovedFromCorpse();
creature->RemoveLootMode(1);
}
*/
}
void OnGameObjectCreate(GameObject* go) override
@@ -85,7 +85,7 @@ void OPvPCapturePointEP_EWT::ChangeState()
// complete quest objective
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
SendObjectiveComplete(EP_EWT_CM, 0);
SendObjectiveComplete(EP_EWT_CM, ObjectGuid::Empty);
}
void OPvPCapturePointEP_EWT::FillInitialWorldStates(WorldPacket &data)
@@ -195,7 +195,7 @@ void OPvPCapturePointEP_NPT::ChangeState()
// complete quest objective
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
SendObjectiveComplete(EP_NPT_CM, 0);
SendObjectiveComplete(EP_NPT_CM, ObjectGuid::Empty);
}
void OPvPCapturePointEP_NPT::FillInitialWorldStates(WorldPacket &data)
@@ -289,7 +289,7 @@ void OPvPCapturePointEP_CGT::ChangeState()
// complete quest objective
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
SendObjectiveComplete(EP_CGT_CM, 0);
SendObjectiveComplete(EP_CGT_CM, ObjectGuid::Empty);
}
void OPvPCapturePointEP_CGT::FillInitialWorldStates(WorldPacket &data)
@@ -390,7 +390,7 @@ void OPvPCapturePointEP_PWT::ChangeState()
// complete quest objective
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
SendObjectiveComplete(EP_PWT_CM, 0);
SendObjectiveComplete(EP_PWT_CM, ObjectGuid::Empty);
}
void OPvPCapturePointEP_PWT::FillInitialWorldStates(WorldPacket &data)
@@ -537,7 +537,7 @@ void OutdoorPvPEP::HandlePlayerLeaveZone(Player* player, uint32 zone)
void OutdoorPvPEP::BuffTeams()
{
for (PlayerSet::iterator itr = m_players[0].begin(); itr != m_players[0].end(); ++itr)
for (GuidSet::iterator itr = m_players[0].begin(); itr != m_players[0].end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(*itr))
{
@@ -547,7 +547,7 @@ void OutdoorPvPEP::BuffTeams()
player->CastSpell(player, EP_AllianceBuffs[m_AllianceTowersControlled-1], true);
}
}
for (PlayerSet::iterator itr = m_players[1].begin(); itr != m_players[1].end(); ++itr)
for (GuidSet::iterator itr = m_players[1].begin(); itr != m_players[1].end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(*itr))
{
@@ -255,7 +255,7 @@ void OPvPCapturePointHP::ChangeState()
// complete quest objective
if (m_State == OBJECTIVESTATE_ALLIANCE || m_State == OBJECTIVESTATE_HORDE)
SendObjectiveComplete(HP_CREDITMARKER[m_TowerType], 0);
SendObjectiveComplete(HP_CREDITMARKER[m_TowerType], ObjectGuid::Empty);
}
void OPvPCapturePointHP::FillInitialWorldStates(WorldPacket &data)
@@ -43,7 +43,7 @@ void OutdoorPvPNA::HandleKillImpl(Player* player, Unit* killed)
uint32 OPvPCapturePointNA::GetAliveGuardsCount()
{
uint32 cnt = 0;
for (std::map<uint32, uint64>::iterator itr = m_Creatures.begin(); itr != m_Creatures.end(); ++itr)
for (std::map<uint32, ObjectGuid>::iterator itr = m_Creatures.begin(); itr != m_Creatures.end(); ++itr)
{
switch (itr->first)
{
@@ -372,7 +372,7 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* player, uint32 spellId, GameO
return false;
}
int32 OPvPCapturePointNA::HandleOpenGo(Player* player, uint64 guid)
int32 OPvPCapturePointNA::HandleOpenGo(Player* player, ObjectGuid guid)
{
int32 retval = OPvPCapturePoint::HandleOpenGo(player, guid);
if (retval >= 0)
+1 -1
View File
@@ -269,7 +269,7 @@ class OPvPCapturePointNA : public OPvPCapturePoint
bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go);
int32 HandleOpenGo(Player* player, uint64 guid);
int32 HandleOpenGo(Player* player, ObjectGuid guid) override;
uint32 GetAliveGuardsCount();
uint32 GetControllingFaction() const;
@@ -281,7 +281,7 @@ void OPvPCapturePointTF::ChangeState()
m_PvP->SendDefenseMessage(OutdoorPvPTFBuffZones[0], TEXT_SPIRIT_TOWER_TAKEN_ALLIANCE);
for (PlayerSet::iterator itr = m_activePlayers[0].begin(); itr != m_activePlayers[0].end(); ++itr)
for (GuidSet::iterator itr = m_activePlayers[0].begin(); itr != m_activePlayers[0].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
player->AreaExploredOrEventHappens(TF_ALLY_QUEST);
break;
@@ -296,7 +296,7 @@ void OPvPCapturePointTF::ChangeState()
m_PvP->SendDefenseMessage(OutdoorPvPTFBuffZones[0], TEXT_SPIRIT_TOWER_TAKEN_HORDE);
for (PlayerSet::iterator itr = m_activePlayers[1].begin(); itr != m_activePlayers[1].end(); ++itr)
for (GuidSet::iterator itr = m_activePlayers[1].begin(); itr != m_activePlayers[1].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
player->AreaExploredOrEventHappens(TF_HORDE_QUEST);
break;
@@ -181,7 +181,7 @@ bool OPvPCapturePointZM_GraveYard::Update(uint32 /*diff*/)
return retval;
}
int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid)
int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, ObjectGuid guid)
{
int32 retval = OPvPCapturePoint::HandleOpenGo(player, guid);
if (retval >= 0)
@@ -218,7 +218,7 @@ OPvPCapturePointZM_GraveYard::OPvPCapturePointZM_GraveYard(OutdoorPvP* pvp)
{
m_BothControllingFaction = 0;
m_GraveYardState = ZM_GRAVEYARD_N;
m_FlagCarrierGUID = 0;
m_FlagCarrierGUID.Clear();
// add field scouts here
AddCreature(ZM_ALLIANCE_FIELD_SCOUT, ZM_AllianceFieldScout.entry, ZM_AllianceFieldScout.map, ZM_AllianceFieldScout.x, ZM_AllianceFieldScout.y, ZM_AllianceFieldScout.z, ZM_AllianceFieldScout.o);
AddCreature(ZM_HORDE_FIELD_SCOUT, ZM_HordeFieldScout.entry, ZM_HordeFieldScout.map, ZM_HordeFieldScout.x, ZM_HordeFieldScout.y, ZM_HordeFieldScout.z, ZM_HordeFieldScout.o);
@@ -286,7 +286,7 @@ void OPvPCapturePointZM_GraveYard::SetBeaconState(uint32 controlling_faction)
p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
}
m_FlagCarrierGUID = 0;
m_FlagCarrierGUID.Clear();
}
}
break;
@@ -309,9 +309,9 @@ bool OPvPCapturePointZM_GraveYard::CanTalkTo(Player* player, Creature* c, Gossip
return false;
}
bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* player, uint64 guid, uint32 /*gossipid*/)
bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* player, ObjectGuid guid, uint32 /*gossipid*/)
{
std::map<uint64, uint32>::iterator itr = m_CreatureTypes.find(guid);
std::map<ObjectGuid, uint32>::iterator itr = m_CreatureTypes.find(guid);
if (itr != m_CreatureTypes.end())
{
Creature* cr = HashMapHolder<Creature>::Find(guid);
@@ -342,10 +342,10 @@ bool OPvPCapturePointZM_GraveYard::HandleDropFlag(Player* /*player*/, uint32 spe
switch (spellId)
{
case ZM_BATTLE_STANDARD_A:
m_FlagCarrierGUID = 0;
m_FlagCarrierGUID.Clear();
return true;
case ZM_BATTLE_STANDARD_H:
m_FlagCarrierGUID = 0;
m_FlagCarrierGUID.Clear();
return true;
}
return false;
+3 -3
View File
@@ -192,11 +192,11 @@ class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint
void UpdateTowerState();
int32 HandleOpenGo(Player* player, uint64 guid);
int32 HandleOpenGo(Player* player, ObjectGuid guid) override;
void SetBeaconState(uint32 controlling_team); // not good atm
bool HandleGossipOption(Player* player, uint64 guid, uint32 gossipid);
bool HandleGossipOption(Player* player, ObjectGuid guid, uint32 gossipid);
bool HandleDropFlag(Player* player, uint32 spellId);
@@ -210,7 +210,7 @@ class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint
protected:
uint32 m_BothControllingFaction;
uint64 m_FlagCarrierGUID;
ObjectGuid m_FlagCarrierGUID;
};
class OutdoorPvPZM : public OutdoorPvP
+1 -1
View File
@@ -504,7 +504,7 @@ class spell_pri_mind_sear : public SpellScriptLoader
void FilterTargets(std::list<WorldObject*>& unitList)
{
unitList.remove_if(Trinity::ObjectGUIDCheck(GetCaster()->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT)));
unitList.remove_if(Trinity::ObjectGUIDCheck(GetCaster()->GetChannelObjectGuid()));
}
void Register() override
@@ -252,24 +252,24 @@ public:
CharacterDeleteActionIpLogger() : PlayerScript("CharacterDeleteActionIpLogger") { }
// CHARACTER_DELETE = 10
void OnDelete(uint64 guid, uint32 accountId) override
void OnDelete(ObjectGuid guid, uint32 accountId) override
{
DeleteIPLogAction(guid, accountId, CHARACTER_DELETE);
}
// CHARACTER_FAILED_DELETE = 11
void OnFailedDelete(uint64 guid, uint32 accountId) override
void OnFailedDelete(ObjectGuid guid, uint32 accountId) override
{
DeleteIPLogAction(guid, accountId, CHARACTER_FAILED_DELETE);
}
void DeleteIPLogAction(uint64 guid, uint32 playerGuid, IPLoggingTypes aType)
void DeleteIPLogAction(ObjectGuid guid, uint32 playerGuid, IPLoggingTypes aType)
{
// Action IP Logger is only intialized if config is set up
// Else, this script isn't loaded in the first place: We require no config check.
// We declare all the required variables
uint32 characterGuid = GUID_LOPART(guid); // We have no access to any member function of Player* or WorldSession*. So use old-fashioned way.
uint32 characterGuid = guid.GetCounter(); // We have no access to any member function of Player* or WorldSession*. So use old-fashioned way.
// Query playerGuid/accountId, as we only have characterGuid
std::string systemNote = "ERROR"; // "ERROR" is a placeholder here. We change it later.
@@ -431,8 +431,8 @@ class AreaTrigger_at_frostgrips_hollow : public AreaTriggerScript
public:
AreaTrigger_at_frostgrips_hollow() : AreaTriggerScript("at_frostgrips_hollow")
{
stormforgedMonitorGUID = 0;
stormforgedEradictorGUID = 0;
stormforgedMonitorGUID.Clear();
stormforgedEradictorGUID.Clear();
}
bool OnTrigger(Player* player, AreaTriggerEntry const* /* trigger */) override
@@ -469,8 +469,8 @@ public:
}
private:
uint64 stormforgedMonitorGUID;
uint64 stormforgedEradictorGUID;
ObjectGuid stormforgedMonitorGUID;
ObjectGuid stormforgedEradictorGUID;
};
void AddSC_areatrigger_scripts()
@@ -418,7 +418,7 @@ class npc_spirit_shade : public CreatureScript
struct npc_spirit_shadeAI : public PassiveAI
{
npc_spirit_shadeAI(Creature* creature) : PassiveAI(creature), _summonerGuid(0)
npc_spirit_shadeAI(Creature* creature) : PassiveAI(creature), _summonerGuid()
{
}
@@ -430,7 +430,7 @@ class npc_spirit_shade : public CreatureScript
void MovementInform(uint32 moveType, uint32 data) override
{
if (moveType == FOLLOW_MOTION_TYPE && data == _summonerGuid)
if (moveType == FOLLOW_MOTION_TYPE && data == _summonerGuid.GetCounter())
{
me->CastSpell((Unit*)NULL, SPELL_DARK_OFFERING, false);
me->DespawnOrUnsummon(1000);
@@ -438,7 +438,7 @@ class npc_spirit_shade : public CreatureScript
}
private:
uint64 _summonerGuid;
ObjectGuid _summonerGuid;
};
CreatureAI* GetAI(Creature* creature) const override
+6 -6
View File
@@ -280,7 +280,7 @@ public:
{
banishTimer = 5000;
exileTimer = 8500;
playerGUID = 0;
playerGUID.Clear();
canTeleport = false;
}
@@ -303,7 +303,7 @@ public:
temp->CastSpell(temp, SPELL_EXILE, true);
temp->CastSpell(temp, SPELL_BANISH_TELEPORT, true);
}
playerGUID = 0;
playerGUID.Clear();
exileTimer = 8500;
canTeleport = false;
} else exileTimer -= diff;
@@ -327,7 +327,7 @@ public:
private:
uint32 exileTimer;
uint32 banishTimer;
uint64 playerGUID;
ObjectGuid playerGUID;
bool canTeleport;
};
@@ -353,7 +353,7 @@ public:
{
banishTimer = 5000;
exileTimer = 8500;
playerGUID = 0;
playerGUID.Clear();
canTeleport = false;
}
@@ -376,7 +376,7 @@ public:
temp->CastSpell(temp, SPELL_EXILE, true);
temp->CastSpell(temp, SPELL_BANISH_TELEPORT, true);
}
playerGUID = 0;
playerGUID.Clear();
exileTimer = 8500;
canTeleport = false;
} else exileTimer -= diff;
@@ -399,7 +399,7 @@ public:
private:
uint32 exileTimer;
uint32 banishTimer;
uint64 playerGUID;
ObjectGuid playerGUID;
bool canTeleport;
};
+15 -16
View File
@@ -124,7 +124,7 @@ public:
npc_air_force_botsAI(Creature* creature) : ScriptedAI(creature)
{
SpawnAssoc = NULL;
SpawnedGUID = 0;
SpawnedGUID.Clear();
// find the correct spawnhandling
static uint32 entryCount = sizeof(spawnAssociations) / sizeof(SpawnAssociation);
@@ -154,7 +154,7 @@ public:
}
SpawnAssociation* SpawnAssoc;
uint64 SpawnedGUID;
ObjectGuid SpawnedGUID;
void Reset() override { }
@@ -597,7 +597,7 @@ public:
void Initialize()
{
PlayerGUID = 0;
PlayerGUID.Clear();
SummonPatientTimer = 10000;
SummonPatientCount = 0;
@@ -610,7 +610,7 @@ public:
Event = false;
}
uint64 PlayerGUID;
ObjectGuid PlayerGUID;
uint32 SummonPatientTimer;
uint32 SummonPatientCount;
@@ -619,7 +619,7 @@ public:
bool Event;
std::list<uint64> Patients;
GuidList Patients;
std::vector<Location*> Coordinates;
void Reset() override
@@ -690,10 +690,9 @@ public:
{
if (!Patients.empty())
{
std::list<uint64>::const_iterator itr;
for (itr = Patients.begin(); itr != Patients.end(); ++itr)
for (GuidList::const_iterator itr = Patients.begin(); itr != Patients.end(); ++itr)
{
if (Creature* patient = ObjectAccessor::GetCreature((*me), *itr))
if (Creature* patient = ObjectAccessor::GetCreature(*me, *itr))
patient->setDeathState(JUST_DIED);
}
}
@@ -749,11 +748,11 @@ public:
void Initialize()
{
DoctorGUID = 0;
DoctorGUID.Clear();
Coord = NULL;
}
uint64 DoctorGUID;
ObjectGuid DoctorGUID;
Location* Coord;
void Reset() override
@@ -950,7 +949,7 @@ public:
Reset();
}
uint64 CasterGUID;
ObjectGuid CasterGUID;
bool IsHealed;
bool CanRun;
@@ -959,7 +958,7 @@ public:
void Reset() override
{
CasterGUID = 0;
CasterGUID.Clear();
IsHealed = false;
CanRun = false;
@@ -2262,7 +2261,7 @@ public:
void Initialize()
{
inLove = false;
rabbitGUID = 0;
rabbitGUID.Clear();
jumpTimer = urand(5000, 10000);
bunnyTimer = urand(10000, 20000);
searchTimer = urand(5000, 10000);
@@ -2272,7 +2271,7 @@ public:
uint32 jumpTimer;
uint32 bunnyTimer;
uint32 searchTimer;
uint64 rabbitGUID;
ObjectGuid rabbitGUID;
void Reset() override
{
@@ -2347,7 +2346,7 @@ public:
{
npc_imp_in_a_ballAI(Creature* creature) : ScriptedAI(creature)
{
summonerGUID = 0;
summonerGUID.Clear();
}
void IsSummonedBy(Unit* summoner) override
@@ -2375,7 +2374,7 @@ public:
private:
EventMap events;
uint64 summonerGUID;
ObjectGuid summonerGUID;
};
CreatureAI* GetAI(Creature* creature) const override