aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authormegamage <none@none.none>2011-10-07 17:56:47 -0700
committermegamage <none@none.none>2011-10-07 17:56:47 -0700
commit679802ecf40ed3f970aff74f26d8bec5b288d81a (patch)
tree28ccad306faf876cf8b6f1bfdae6b0a9f2c8733e /src/server/game
parent1e44044a8f21c36847bdc544dcf89f83b02b941a (diff)
parent5b4c7783c2a28e420cb4aaf4f2967083db8f6787 (diff)
Merge pull request #3400 from Bootz/master
REPO: Code-Style fixes... (Part duece)
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp4
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.cpp4
-rwxr-xr-xsrc/server/game/Chat/Commands/Level1.cpp10
-rwxr-xr-xsrc/server/game/Chat/Commands/Level3.cpp6
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.cpp8
-rwxr-xr-xsrc/server/game/Entities/Creature/GossipDef.cpp8
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp14
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.h2
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp361
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h36
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp46
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h2
-rwxr-xr-xsrc/server/game/Globals/ObjectAccessor.cpp2
-rwxr-xr-xsrc/server/game/Grids/Notifiers/GridNotifiers.h8
-rwxr-xr-xsrc/server/game/Groups/Group.cpp2
-rwxr-xr-xsrc/server/game/Instances/InstanceSaveMgr.cpp10
-rwxr-xr-xsrc/server/game/Instances/InstanceScript.cpp26
-rwxr-xr-xsrc/server/game/Maps/Map.cpp9
-rwxr-xr-xsrc/server/game/Maps/Map.h8
-rwxr-xr-xsrc/server/game/Maps/MapInstanced.cpp28
-rwxr-xr-xsrc/server/game/Maps/MapInstanced.h6
-rwxr-xr-xsrc/server/game/Maps/MapManager.cpp16
-rwxr-xr-xsrc/server/game/Pools/PoolMgr.cpp18
-rwxr-xr-xsrc/server/game/Scripting/MapScripts.cpp34
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.cpp20
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.h2
-rwxr-xr-xsrc/server/game/Scripting/ScriptSystem.cpp76
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp48
28 files changed, 399 insertions, 415 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 02cbacb8db0..1e0b212dd45 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -46,8 +46,8 @@ void FollowerAI::AttackStart(Unit* who)
}
}
-//This part provides assistance to a player that are attacked by pWho, even if out of normal aggro range
-//It will cause me to attack pWho that are attacking _any_ player (which has been confirmed may happen also on offi)
+//This part provides assistance to a player that are attacked by who, even if out of normal aggro range
+//It will cause me to attack who that are attacking _any_ player (which has been confirmed may happen also on offi)
//The flag (type_flag) is unconfirmed, but used here for further research and is a good candidate.
bool FollowerAI::AssistPlayerInCombat(Unit* who)
{
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index f85ea1f7b4b..e00abb03320 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -296,7 +296,6 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
if (!team && plr)
team = plr->GetBGTeam();
*data << uint8(team == ALLIANCE ? 1 : 0); // green or yellow
-
}
*data << uint32(itr2->second->DamageDone); // damage done
*data << uint32(itr2->second->HealingDone); // healing done
@@ -1090,7 +1089,6 @@ void BattlegroundMgr::LoadBattleMastersEntry()
}
mBattleMastersMap[entry] = BattlegroundTypeId(bgTypeId);
-
}
while (result->NextRow());
@@ -1129,4 +1127,4 @@ BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType(HolidayIds holiday)
bool BattlegroundMgr::IsBGWeekend(BattlegroundTypeId bgTypeId)
{
return IsHolidayActive(BGTypeToWeekendHolidayId(bgTypeId));
-}
+} \ No newline at end of file
diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp
index 07b5cadd118..c737e2b0b54 100755
--- a/src/server/game/Chat/Commands/Level1.cpp
+++ b/src/server/game/Chat/Commands/Level1.cpp
@@ -153,9 +153,9 @@ bool ChatHandler::HandleSummonCommand(const char* args)
return false;
}
- Map* pMap = m_session->GetPlayer()->GetMap();
+ Map* map = m_session->GetPlayer()->GetMap();
- if (pMap->IsBattlegroundOrArena())
+ if (map->IsBattlegroundOrArena())
{
// only allow if gm mode is on
if (!_player->isGameMaster())
@@ -175,12 +175,12 @@ bool ChatHandler::HandleSummonCommand(const char* args)
if (!target->GetMap()->IsBattlegroundOrArena())
target->SetBattlegroundEntryPoint();
}
- else if (pMap->IsDungeon())
+ else if (map->IsDungeon())
{
Map* cMap = target->GetMap();
- if (cMap->Instanceable() && cMap->GetInstanceId() != pMap->GetInstanceId())
- target->UnbindInstance(pMap->GetInstanceId(), target->GetDungeonDifficulty(), true);
+ if (cMap->Instanceable() && cMap->GetInstanceId() != map->GetInstanceId())
+ target->UnbindInstance(map->GetInstanceId(), target->GetDungeonDifficulty(), true);
// we are in instance, and can summon only player in our group with us as lead
if (!m_session->GetPlayer()->GetGroup() || !target->GetGroup() ||
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
index cc6911e34a5..e76cbfcc76b 100755
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ b/src/server/game/Chat/Commands/Level3.cpp
@@ -4124,7 +4124,7 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char *args)
if (!player)
player = m_session->GetPlayer();
- char* pMap = strtok((char*)args, " ");
+ char* map = strtok((char*)args, " ");
char* pDiff = strtok(NULL, " ");
int8 diff = -1;
if (pDiff)
@@ -4132,9 +4132,9 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char *args)
uint16 counter = 0;
uint16 MapId = 0;
- if (strcmp(pMap, "all"))
+ if (strcmp(map, "all"))
{
- MapId = uint16(atoi(pMap));
+ MapId = uint16(atoi(map));
if (!MapId)
return false;
}
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index d92f591803e..a8e219f4f6b 100755
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -2117,15 +2117,15 @@ void Creature::SetInCombatWithZone()
return;
}
- Map* pMap = GetMap();
+ Map* map = GetMap();
- if (!pMap->IsDungeon())
+ if (!map->IsDungeon())
{
- sLog->outError("Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), pMap->GetId());
+ sLog->outError("Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), map->GetId());
return;
}
- Map::PlayerList const &PlList = pMap->GetPlayers();
+ Map::PlayerList const &PlList = map->GetPlayers();
if (PlList.isEmpty())
return;
diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp
index b5a857d1abc..3ff21645a27 100755
--- a/src/server/game/Entities/Creature/GossipDef.cpp
+++ b/src/server/game/Entities/Creature/GossipDef.cpp
@@ -261,9 +261,9 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title
uint32 questID = qmi.QuestId;
- if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(questID))
+ if (Quest const* quest = sObjectMgr->GetQuestTemplate(questID))
{
- std::string title = pQuest->GetTitle();
+ std::string title = quest->GetTitle();
int loc_idx = _session->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
@@ -272,8 +272,8 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title
data << uint32(questID);
data << uint32(qmi.QuestIcon);
- data << int32(pQuest->GetQuestLevel());
- data << uint32(pQuest->GetFlags()); // 3.3.3 quest flags
+ data << int32(quest->GetQuestLevel());
+ data << uint32(quest->GetFlags()); // 3.3.3 quest flags
data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation
data << title;
}
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index c6484c63e45..086dc4255cc 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -875,9 +875,9 @@ void GameObject::Respawn()
}
}
-bool GameObject::ActivateToQuest(Player* pTarget) const
+bool GameObject::ActivateToQuest(Player* target) const
{
- if (pTarget->HasQuestForGO(GetEntry()))
+ if (target->HasQuestForGO(GetEntry()))
return true;
if (!sObjectMgr->IsGameObjectForQuests(GetEntry()))
@@ -888,13 +888,13 @@ bool GameObject::ActivateToQuest(Player* pTarget) const
// scan GO chest with loot including quest items
case GAMEOBJECT_TYPE_CHEST:
{
- if (LootTemplates_Gameobject.HaveQuestLootForPlayer(GetGOInfo()->GetLootId(), pTarget))
+ if (LootTemplates_Gameobject.HaveQuestLootForPlayer(GetGOInfo()->GetLootId(), target))
{
//TODO: fix this hack
//look for battlegroundAV for some objects which are only activated after mine gots captured by own team
if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S)
- if (Battleground* bg = pTarget->GetBattleground())
- if (bg->GetTypeID(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam())))
+ if (Battleground* bg = target->GetBattleground())
+ if (bg->GetTypeID(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), target->GetTeam())))
return false;
return true;
}
@@ -902,13 +902,13 @@ bool GameObject::ActivateToQuest(Player* pTarget) const
}
case GAMEOBJECT_TYPE_GENERIC:
{
- if (GetGOInfo()->_generic.questID == -1 || pTarget->GetQuestStatus(GetGOInfo()->_generic.questID) == QUEST_STATUS_INCOMPLETE)
+ if (GetGOInfo()->_generic.questID == -1 || target->GetQuestStatus(GetGOInfo()->_generic.questID) == QUEST_STATUS_INCOMPLETE)
return true;
break;
}
case GAMEOBJECT_TYPE_GOOBER:
{
- if (GetGOInfo()->goober.questId == -1 || pTarget->GetQuestStatus(GetGOInfo()->goober.questId) == QUEST_STATUS_INCOMPLETE)
+ if (GetGOInfo()->goober.questId == -1 || target->GetQuestStatus(GetGOInfo()->goober.questId) == QUEST_STATUS_INCOMPLETE)
return true;
break;
}
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index 49230569498..3402eaa64bc 100755
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -745,7 +745,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
bool hasQuest(uint32 quest_id) const;
bool hasInvolvedQuest(uint32 quest_id) const;
- bool ActivateToQuest(Player* pTarget) const;
+ bool ActivateToQuest(Player* target) const;
void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false);
// 0 = use `gameobject`.`spawntimesecs`
void ResetDoorOrButton();
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index e3a9cc14406..faf164b77f7 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -3828,7 +3828,6 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
break;
}
}
-
}
}
@@ -4047,7 +4046,6 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
SetSkill(prevSkill->skill, prevSkill->step, skill_value, skill_max_value);
}
}
-
}
else
{
@@ -4329,7 +4327,6 @@ void Player::_SaveSpellCooldowns(SQLTransaction& trans)
}
else
++itr;
-
}
// if something changed execute
if (!first_round)
@@ -5567,7 +5564,6 @@ void Player::CleanupChannels()
ch->Leave(GetGUID(), false); // not send to client, not remove from player's channel list
if (ChannelMgr* cMgr = channelMgr(GetTeam()))
cMgr->LeftChannel(ch->GetName()); // deleted channel if empty
-
}
sLog->outDebug(LOG_FILTER_CHATSYS, "Player: channels cleaned up!");
}
@@ -6973,16 +6969,16 @@ void Player::RewardReputation(Unit* pVictim, float rate)
{
// support for: Championing - http://www.wowwiki.com/Championing
- Map const* pMap = GetMap();
- if (pMap && pMap->IsDungeon())
+ Map const* map = GetMap();
+ if (map && map->IsDungeon())
{
- InstanceTemplate const* pInstance = sObjectMgr->GetInstanceTemplate(pMap->GetId());
- if (pInstance)
+ InstanceTemplate const* instance = sObjectMgr->GetInstanceTemplate(map->GetId());
+ if (instance)
{
- AccessRequirement const* pAccessRequirement = sObjectMgr->GetAccessRequirement(pMap->GetId(), ((InstanceMap*)pMap)->GetDifficulty());
+ AccessRequirement const* pAccessRequirement = sObjectMgr->GetAccessRequirement(map->GetId(), ((InstanceMap*)map)->GetDifficulty());
if (pAccessRequirement)
{
- if (!pMap->IsRaid() && pAccessRequirement->levelMin == 80)
+ if (!map->IsRaid() && pAccessRequirement->levelMin == 80)
ChampioningFaction = GetChampioningFaction();
}
}
@@ -7032,29 +7028,29 @@ void Player::RewardReputation(Unit* pVictim, float rate)
}
//Calculate how many reputation points player gain with the quest
-void Player::RewardReputation(Quest const* pQuest)
+void Player::RewardReputation(Quest const* quest)
{
bool recruitAFriend = GetsRecruitAFriendBonus(false);
// quest reputation reward/loss
for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
{
- if (!pQuest->RewRepFaction[i])
+ if (!quest->RewRepFaction[i])
continue;
- if (pQuest->RewRepValue[i])
+ if (quest->RewRepValue[i])
{
- int32 rep = CalculateReputationGain(GetQuestLevel(pQuest), pQuest->RewRepValue[i]/100, pQuest->RewRepFaction[i], true, true);
+ int32 rep = CalculateReputationGain(GetQuestLevel(quest), quest->RewRepValue[i]/100, quest->RewRepFaction[i], true, true);
if (recruitAFriend)
rep = int32(rep * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS)));
- if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->RewRepFaction[i]))
+ if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(quest->RewRepFaction[i]))
GetReputationMgr().ModifyReputation(factionEntry, rep);
}
else
{
- uint32 row = ((pQuest->RewRepValueId[i] < 0) ? 1 : 0) + 1;
- uint32 field = abs(pQuest->RewRepValueId[i]);
+ uint32 row = ((quest->RewRepValueId[i] < 0) ? 1 : 0) + 1;
+ uint32 field = abs(quest->RewRepValueId[i]);
if (const QuestFactionRewEntry* pRow = sQuestFactionRewardStore.LookupEntry(row))
{
@@ -7063,12 +7059,12 @@ void Player::RewardReputation(Quest const* pQuest)
if (!repPoints)
continue;
- repPoints = CalculateReputationGain(GetQuestLevel(pQuest), repPoints, pQuest->RewRepFaction[i], true);
+ repPoints = CalculateReputationGain(GetQuestLevel(quest), repPoints, quest->RewRepFaction[i], true);
if (recruitAFriend)
repPoints = int32(repPoints * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS)));
- if (const FactionEntry* factionEntry = sFactionStore.LookupEntry(pQuest->RewRepFaction[i]))
+ if (const FactionEntry* factionEntry = sFactionStore.LookupEntry(quest->RewRepFaction[i]))
GetReputationMgr().ModifyReputation(factionEntry, repPoints);
}
}
@@ -14382,14 +14378,14 @@ void Player::PrepareQuestMenu(uint64 guid)
for (QuestRelations::const_iterator i = pObjectQR.first; i != pObjectQR.second; ++i)
{
uint32 quest_id = i->second;
- Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id);
- if (!pQuest)
+ Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id);
+ if (!quest)
continue;
- if (!CanTakeQuest(pQuest, false))
+ if (!CanTakeQuest(quest, false))
continue;
- if (pQuest->IsAutoComplete())
+ if (quest->IsAutoComplete())
qm.AddMenuItem(quest_id, 4);
else if (GetQuestStatus(quest_id) == QUEST_STATUS_NONE)
qm.AddMenuItem(quest_id, 2);
@@ -14420,7 +14416,7 @@ void Player::SendPreparedQuest(uint64 guid)
else if (icon == 4)
PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, CanRewardQuest(quest, false), true);
// Send completable on repeatable and autoCompletable quest if player don't have quest
- // TODO: verify if check for !pQuest->IsDaily() is really correct (possibly not)
+ // TODO: verify if check for !quest->IsDaily() is really correct (possibly not)
else
{
Object* object = ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT | TYPEMASK_ITEM);
@@ -14497,7 +14493,7 @@ bool Player::IsActiveQuest(uint32 quest_id) const
return m_QuestStatus.find(quest_id) != m_QuestStatus.end();
}
-Quest const* Player::GetNextQuest(uint64 guid, Quest const* pQuest)
+Quest const* Player::GetNextQuest(uint64 guid, Quest const* quest)
{
QuestRelationBounds pObjectQR;
@@ -14517,7 +14513,7 @@ Quest const* Player::GetNextQuest(uint64 guid, Quest const* pQuest)
return NULL;
}
- uint32 nextQuestID = pQuest->GetNextQuestInChain();
+ uint32 nextQuestID = quest->GetNextQuestInChain();
for (QuestRelations::const_iterator itr = pObjectQR.first; itr != pObjectQR.second; ++itr)
{
if (itr->second == nextQuestID)
@@ -14527,41 +14523,41 @@ Quest const* Player::GetNextQuest(uint64 guid, Quest const* pQuest)
return NULL;
}
-bool Player::CanSeeStartQuest(Quest const* pQuest)
+bool Player::CanSeeStartQuest(Quest const* quest)
{
- if (SatisfyQuestRace(pQuest, false) && SatisfyQuestSkillOrClass(pQuest, false) &&
- SatisfyQuestExclusiveGroup(pQuest, false) && SatisfyQuestReputation(pQuest, false) &&
- SatisfyQuestPreviousQuest(pQuest, false) && SatisfyQuestNextChain(pQuest, false) &&
- SatisfyQuestPrevChain(pQuest, false) && SatisfyQuestDay(pQuest, false) && SatisfyQuestWeek(pQuest, false) &&
- !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this))
+ if (SatisfyQuestRace(quest, false) && SatisfyQuestSkillOrClass(quest, false) &&
+ SatisfyQuestExclusiveGroup(quest, false) && SatisfyQuestReputation(quest, false) &&
+ SatisfyQuestPreviousQuest(quest, false) && SatisfyQuestNextChain(quest, false) &&
+ SatisfyQuestPrevChain(quest, false) && SatisfyQuestDay(quest, false) && SatisfyQuestWeek(quest, false) &&
+ !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this))
{
- return getLevel() + sWorld->getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel();
+ return getLevel() + sWorld->getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= quest->GetMinLevel();
}
return false;
}
-bool Player::CanTakeQuest(Quest const* pQuest, bool msg)
+bool Player::CanTakeQuest(Quest const* quest, bool msg)
{
- return SatisfyQuestStatus(pQuest, msg) && SatisfyQuestExclusiveGroup(pQuest, msg)
- && SatisfyQuestRace(pQuest, msg) && SatisfyQuestLevel(pQuest, msg)
- && SatisfyQuestSkillOrClass(pQuest, msg) && SatisfyQuestReputation(pQuest, msg)
- && SatisfyQuestPreviousQuest(pQuest, msg) && SatisfyQuestTimed(pQuest, msg)
- && SatisfyQuestNextChain(pQuest, msg) && SatisfyQuestPrevChain(pQuest, msg)
- && SatisfyQuestDay(pQuest, msg) && SatisfyQuestWeek(pQuest, msg)
- && !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this)
- && SatisfyQuestConditions(pQuest, msg);
+ return SatisfyQuestStatus(quest, msg) && SatisfyQuestExclusiveGroup(quest, msg)
+ && SatisfyQuestRace(quest, msg) && SatisfyQuestLevel(quest, msg)
+ && SatisfyQuestSkillOrClass(quest, msg) && SatisfyQuestReputation(quest, msg)
+ && SatisfyQuestPreviousQuest(quest, msg) && SatisfyQuestTimed(quest, msg)
+ && SatisfyQuestNextChain(quest, msg) && SatisfyQuestPrevChain(quest, msg)
+ && SatisfyQuestDay(quest, msg) && SatisfyQuestWeek(quest, msg)
+ && !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this)
+ && SatisfyQuestConditions(quest, msg);
}
-bool Player::CanAddQuest(Quest const* pQuest, bool msg)
+bool Player::CanAddQuest(Quest const* quest, bool msg)
{
if (!SatisfyQuestLog(msg))
return false;
- uint32 srcitem = pQuest->GetSrcItemId();
+ uint32 srcitem = quest->GetSrcItemId();
if (srcitem > 0)
{
- uint32 count = pQuest->GetSrcItemCount();
+ uint32 count = quest->GetSrcItemCount();
ItemPosCountVec dest;
InventoryResult msg2 = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, srcitem, count);
@@ -14601,7 +14597,6 @@ bool Player::CanCompleteQuest(uint32 quest_id)
if (q_status.m_status == QUEST_STATUS_INCOMPLETE)
{
-
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
{
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
@@ -14649,92 +14644,92 @@ bool Player::CanCompleteQuest(uint32 quest_id)
return false;
}
-bool Player::CanCompleteRepeatableQuest(Quest const* pQuest)
+bool Player::CanCompleteRepeatableQuest(Quest const* quest)
{
// Solve problem that player don't have the quest and try complete it.
// if repeatable she must be able to complete event if player don't have it.
// Seem that all repeatable quest are DELIVER Flag so, no need to add more.
- if (!CanTakeQuest(pQuest, false))
+ if (!CanTakeQuest(quest, false))
return false;
- if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
+ if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
- if (pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i], pQuest->ReqItemCount[i]))
+ if (quest->ReqItemId[i] && quest->ReqItemCount[i] && !HasItemCount(quest->ReqItemId[i], quest->ReqItemCount[i]))
return false;
- if (!CanRewardQuest(pQuest, false))
+ if (!CanRewardQuest(quest, false))
return false;
return true;
}
-bool Player::CanRewardQuest(Quest const* pQuest, bool msg)
+bool Player::CanRewardQuest(Quest const* quest, bool msg)
{
// not auto complete quest and not completed quest (only cheating case, then ignore without message)
- if (!pQuest->IsDFQuest() && !pQuest->IsAutoComplete() && !(pQuest->GetFlags() & QUEST_FLAGS_AUTOCOMPLETE) && GetQuestStatus(pQuest->GetQuestId()) != QUEST_STATUS_COMPLETE)
+ if (!quest->IsDFQuest() && !quest->IsAutoComplete() && !(quest->GetFlags() & QUEST_FLAGS_AUTOCOMPLETE) && GetQuestStatus(quest->GetQuestId()) != QUEST_STATUS_COMPLETE)
return false;
// daily quest can't be rewarded (25 daily quest already completed)
- if (!SatisfyQuestDay(pQuest, true) || !SatisfyQuestWeek(pQuest, true))
+ if (!SatisfyQuestDay(quest, true) || !SatisfyQuestWeek(quest, true))
return false;
// rewarded and not repeatable quest (only cheating case, then ignore without message)
- if (GetQuestRewardStatus(pQuest->GetQuestId()))
+ if (GetQuestRewardStatus(quest->GetQuestId()))
return false;
// prevent receive reward with quest items in bank
- if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
+ if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
{
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
{
- if (pQuest->ReqItemCount[i]!= 0 &&
- GetItemCount(pQuest->ReqItemId[i]) < pQuest->ReqItemCount[i])
+ if (quest->ReqItemCount[i]!= 0 &&
+ GetItemCount(quest->ReqItemId[i]) < quest->ReqItemCount[i])
{
if (msg)
- SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL, pQuest->ReqItemId[i]);
+ SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL, quest->ReqItemId[i]);
return false;
}
}
}
// prevent receive reward with low money and GetRewOrReqMoney() < 0
- if (pQuest->GetRewOrReqMoney() < 0 && !HasEnoughMoney(-pQuest->GetRewOrReqMoney()))
+ if (quest->GetRewOrReqMoney() < 0 && !HasEnoughMoney(-quest->GetRewOrReqMoney()))
return false;
return true;
}
-bool Player::CanRewardQuest(Quest const* pQuest, uint32 reward, bool msg)
+bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
{
// prevent receive reward with quest items in bank or for not completed quest
- if (!CanRewardQuest(pQuest, msg))
+ if (!CanRewardQuest(quest, msg))
return false;
- if (pQuest->GetRewChoiceItemsCount() > 0)
+ if (quest->GetRewChoiceItemsCount() > 0)
{
- if (pQuest->RewChoiceItemId[reward])
+ if (quest->RewChoiceItemId[reward])
{
ItemPosCountVec dest;
- InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, pQuest->RewChoiceItemId[reward], pQuest->RewChoiceItemCount[reward]);
+ InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewChoiceItemId[reward], quest->RewChoiceItemCount[reward]);
if (res != EQUIP_ERR_OK)
{
- SendEquipError(res, NULL, NULL, pQuest->RewChoiceItemId[reward]);
+ SendEquipError(res, NULL, NULL, quest->RewChoiceItemId[reward]);
return false;
}
}
}
- if (pQuest->GetRewItemsCount() > 0)
+ if (quest->GetRewItemsCount() > 0)
{
- for (uint32 i = 0; i < pQuest->GetRewItemsCount(); ++i)
+ for (uint32 i = 0; i < quest->GetRewItemsCount(); ++i)
{
- if (pQuest->RewItemId[i])
+ if (quest->RewItemId[i])
{
ItemPosCountVec dest;
- InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, pQuest->RewItemId[i], pQuest->RewItemCount[i]);
+ InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewItemId[i], quest->RewItemCount[i]);
if (res != EQUIP_ERR_OK)
{
- SendEquipError(res, NULL, NULL, pQuest->RewItemId[i]);
+ SendEquipError(res, NULL, NULL, quest->RewItemId[i]);
return false;
}
}
@@ -14744,12 +14739,12 @@ bool Player::CanRewardQuest(Quest const* pQuest, uint32 reward, bool msg)
return true;
}
-void Player::AddQuest(Quest const* pQuest, Object* questGiver)
+void Player::AddQuest(Quest const* quest, Object* questGiver)
{
uint16 log_slot = FindQuestSlot(0);
ASSERT(log_slot < MAX_QUEST_LOG_SIZE);
- uint32 quest_id = pQuest->GetQuestId();
+ uint32 quest_id = quest->GetQuestId();
// if not exist then created with set uState == NEW and rewarded=false
QuestStatusData& questStatusData = m_QuestStatus[quest_id];
@@ -14758,36 +14753,36 @@ void Player::AddQuest(Quest const* pQuest, Object* questGiver)
questStatusData.m_status = QUEST_STATUS_INCOMPLETE;
questStatusData.m_explored = false;
- if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
+ if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
{
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
questStatusData.m_itemcount[i] = 0;
}
- if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO))
+ if (quest->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO))
{
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
questStatusData.m_creatureOrGOcount[i] = 0;
}
- if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL))
+ if (quest->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL))
questStatusData.m_playercount = 0;
- GiveQuestSourceItem(pQuest);
- AdjustQuestReqItemCount(pQuest, questStatusData);
+ GiveQuestSourceItem(quest);
+ AdjustQuestReqItemCount(quest, questStatusData);
- if (pQuest->GetRepObjectiveFaction())
- if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->GetRepObjectiveFaction()))
+ if (quest->GetRepObjectiveFaction())
+ if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(quest->GetRepObjectiveFaction()))
GetReputationMgr().SetVisible(factionEntry);
- if (pQuest->GetRepObjectiveFaction2())
- if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->GetRepObjectiveFaction2()))
+ if (quest->GetRepObjectiveFaction2())
+ if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(quest->GetRepObjectiveFaction2()))
GetReputationMgr().SetVisible(factionEntry);
uint32 qtime = 0;
- if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
+ if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
{
- uint32 limittime = pQuest->GetLimitTime();
+ uint32 limittime = quest->GetLimitTime();
// shared timed quest
if (questGiver && questGiver->GetTypeId() == TYPEID_PLAYER)
@@ -14807,8 +14802,8 @@ void Player::AddQuest(Quest const* pQuest, Object* questGiver)
GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, quest_id);
//starting initial quest script
- if (questGiver && pQuest->GetQuestStartScript() != 0)
- GetMap()->ScriptsStart(sQuestStartScripts, pQuest->GetQuestStartScript(), questGiver, this);
+ if (questGiver && quest->GetQuestStartScript() != 0)
+ GetMap()->ScriptsStart(sQuestStartScripts, quest->GetQuestStartScript(), questGiver, this);
// Some spells applied at quest activation
SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(quest_id, true);
@@ -14858,59 +14853,59 @@ void Player::IncompleteQuest(uint32 quest_id)
}
}
-void Player::RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver, bool announce)
+void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, bool announce)
{
//this THING should be here to protect code from quest, which cast on player far teleport as a reward
//should work fine, cause far teleport will be executed in Player::Update()
SetCanDelayTeleport(true);
- uint32 quest_id = pQuest->GetQuestId();
+ uint32 quest_id = quest->GetQuestId();
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
- if (pQuest->ReqItemId[i])
- DestroyItemCount(pQuest->ReqItemId[i], pQuest->ReqItemCount[i], true);
+ if (quest->ReqItemId[i])
+ DestroyItemCount(quest->ReqItemId[i], quest->ReqItemCount[i], true);
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
{
- if (pQuest->ReqSourceId[i])
+ if (quest->ReqSourceId[i])
{
- uint32 count = pQuest->ReqSourceCount[i];
- DestroyItemCount(pQuest->ReqSourceId[i], count ? count : 9999, true);
+ uint32 count = quest->ReqSourceCount[i];
+ DestroyItemCount(quest->ReqSourceId[i], count ? count : 9999, true);
}
}
RemoveTimedQuest(quest_id);
- if (pQuest->GetRewChoiceItemsCount() > 0)
+ if (quest->GetRewChoiceItemsCount() > 0)
{
- if (uint32 itemId = pQuest->RewChoiceItemId[reward])
+ if (uint32 itemId = quest->RewChoiceItemId[reward])
{
ItemPosCountVec dest;
- if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, pQuest->RewChoiceItemCount[reward]) == EQUIP_ERR_OK)
+ if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewChoiceItemCount[reward]) == EQUIP_ERR_OK)
{
Item* item = StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
- SendNewItem(item, pQuest->RewChoiceItemCount[reward], true, false);
+ SendNewItem(item, quest->RewChoiceItemCount[reward], true, false);
}
}
}
- if (pQuest->GetRewItemsCount() > 0)
+ if (quest->GetRewItemsCount() > 0)
{
- for (uint32 i = 0; i < pQuest->GetRewItemsCount(); ++i)
+ for (uint32 i = 0; i < quest->GetRewItemsCount(); ++i)
{
- if (uint32 itemId = pQuest->RewItemId[i])
+ if (uint32 itemId = quest->RewItemId[i])
{
ItemPosCountVec dest;
- if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, pQuest->RewItemCount[i]) == EQUIP_ERR_OK)
+ if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, quest->RewItemCount[i]) == EQUIP_ERR_OK)
{
Item* item = StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
- SendNewItem(item, pQuest->RewItemCount[i], true, false);
+ SendNewItem(item, quest->RewItemCount[i], true, false);
}
}
}
}
- RewardReputation(pQuest);
+ RewardReputation(quest);
uint16 log_slot = FindQuestSlot(quest_id);
if (log_slot < MAX_QUEST_LOG_SIZE)
@@ -14920,7 +14915,7 @@ void Player::RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver,
bool rewarded = (rewItr != m_RewardedQuests.end());
// Not give XP in case already completed once repeatable quest
- uint32 XP = rewarded ? 0 : uint32(pQuest->XPValue(this)*sWorld->getRate(RATE_XP_QUEST));
+ uint32 XP = rewarded ? 0 : uint32(quest->XPValue(this)*sWorld->getRate(RATE_XP_QUEST));
// handle SPELL_AURA_MOD_XP_QUEST_PCT auras
Unit::AuraEffectList const& ModXPPctAuras = GetAuraEffectsByType(SPELL_AURA_MOD_XP_QUEST_PCT);
@@ -14931,11 +14926,11 @@ void Player::RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver,
if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
GiveXP(XP, NULL);
else
- moneyRew = int32(pQuest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY));
+ moneyRew = int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY));
// Give player extra money if GetRewOrReqMoney > 0 and get ReqMoney if negative
- if (pQuest->GetRewOrReqMoney())
- moneyRew += pQuest->GetRewOrReqMoney();
+ if (quest->GetRewOrReqMoney())
+ moneyRew += quest->GetRewOrReqMoney();
if (moneyRew)
{
@@ -14946,44 +14941,44 @@ void Player::RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver,
}
// honor reward
- if (uint32 honor = pQuest->CalculateHonorGain(getLevel()))
+ if (uint32 honor = quest->CalculateHonorGain(getLevel()))
RewardHonor(NULL, 0, honor);
// title reward
- if (pQuest->GetCharTitleId())
+ if (quest->GetCharTitleId())
{
- if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(pQuest->GetCharTitleId()))
+ if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(quest->GetCharTitleId()))
SetTitle(titleEntry);
}
- if (pQuest->GetBonusTalents())
+ if (quest->GetBonusTalents())
{
- m_questRewardTalentCount+=pQuest->GetBonusTalents();
+ m_questRewardTalentCount+=quest->GetBonusTalents();
InitTalentForLevel();
}
- if (pQuest->GetRewArenaPoints())
- ModifyArenaPoints(pQuest->GetRewArenaPoints());
+ if (quest->GetRewArenaPoints())
+ ModifyArenaPoints(quest->GetRewArenaPoints());
// Send reward mail
- if (uint32 mail_template_id = pQuest->GetRewMailTemplateId())
+ if (uint32 mail_template_id = quest->GetRewMailTemplateId())
{
//- TODO: Poor design of mail system
SQLTransaction trans = CharacterDatabase.BeginTransaction();
- MailDraft(mail_template_id).SendMailTo(trans, this, questGiver, MAIL_CHECK_MASK_HAS_BODY, pQuest->GetRewMailDelaySecs());
+ MailDraft(mail_template_id).SendMailTo(trans, this, questGiver, MAIL_CHECK_MASK_HAS_BODY, quest->GetRewMailDelaySecs());
CharacterDatabase.CommitTransaction(trans);
}
- if (pQuest->IsDaily() || pQuest->IsDFQuest())
+ if (quest->IsDaily() || quest->IsDFQuest())
{
SetDailyQuestStatus(quest_id);
- if (pQuest->IsDaily())
+ if (quest->IsDaily())
{
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST, quest_id);
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY, quest_id);
}
}
- else if (pQuest->IsWeekly())
+ else if (quest->IsWeekly())
SetWeeklyQuestStatus(quest_id);
RemoveActiveQuest(quest_id);
@@ -14997,18 +14992,18 @@ void Player::RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver,
_SaveQuestStatus(trans);
if (announce)
- SendQuestReward(pQuest, XP, questGiver);
+ SendQuestReward(quest, XP, questGiver);
// cast spells after mark quest complete (some spells have quest completed state requirements in spell_area data)
- if (pQuest->GetRewSpellCast() > 0)
- CastSpell(this, pQuest->GetRewSpellCast(), true);
- else if (pQuest->GetRewSpell() > 0)
- CastSpell(this, pQuest->GetRewSpell(), true);
+ if (quest->GetRewSpellCast() > 0)
+ CastSpell(this, quest->GetRewSpellCast(), true);
+ else if (quest->GetRewSpell() > 0)
+ CastSpell(this, quest->GetRewSpell(), true);
- if (pQuest->GetZoneOrSort() > 0)
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, pQuest->GetZoneOrSort());
+ if (quest->GetZoneOrSort() > 0)
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, quest->GetZoneOrSort());
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST, pQuest->GetQuestId());
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST, quest->GetQuestId());
uint32 zone = 0;
uint32 area = 0;
@@ -15043,7 +15038,7 @@ void Player::RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver,
void Player::FailQuest(uint32 questId)
{
- if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(questId))
+ if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
{
SetQuestStatus(questId, QUEST_STATUS_FAILED);
@@ -15055,7 +15050,7 @@ void Player::FailQuest(uint32 questId)
SetQuestSlotState(log_slot, QUEST_STATE_FAIL);
}
- if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
+ if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED))
{
QuestStatusData& q_status = m_QuestStatus[questId];
@@ -15069,13 +15064,13 @@ void Player::FailQuest(uint32 questId)
// Destroy quest items on quest failure.
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- if (pQuest->ReqItemId[i] > 0 && pQuest->ReqItemCount[i] > 0)
+ if (quest->ReqItemId[i] > 0 && quest->ReqItemCount[i] > 0)
// Destroy items recieved on starting the quest.
- DestroyItemCount(pQuest->ReqItemId[i], pQuest->ReqItemCount[i], true, true);
+ DestroyItemCount(quest->ReqItemId[i], quest->ReqItemCount[i], true, true);
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
- if (pQuest->ReqSourceId[i] > 0 && pQuest->ReqSourceCount[i] > 0)
+ if (quest->ReqSourceId[i] > 0 && quest->ReqSourceCount[i] > 0)
// Destroy items recieved during the quest.
- DestroyItemCount(pQuest->ReqSourceId[i], pQuest->ReqSourceCount[i], true, true);
+ DestroyItemCount(quest->ReqSourceId[i], quest->ReqSourceCount[i], true, true);
}
}
@@ -15458,12 +15453,12 @@ bool Player::SatisfyQuestWeek(Quest const* qInfo, bool /*msg*/)
return m_weeklyquests.find(qInfo->GetQuestId()) == m_weeklyquests.end();
}
-bool Player::GiveQuestSourceItem(Quest const* pQuest)
+bool Player::GiveQuestSourceItem(Quest const* quest)
{
- uint32 srcitem = pQuest->GetSrcItemId();
+ uint32 srcitem = quest->GetSrcItemId();
if (srcitem > 0)
{
- uint32 count = pQuest->GetSrcItemCount();
+ uint32 count = quest->GetSrcItemCount();
if (count <= 0)
count = 1;
@@ -15612,19 +15607,19 @@ uint16 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry)
return 0;
}
-void Player::AdjustQuestReqItemCount(Quest const* pQuest, QuestStatusData& questStatusData)
+void Player::AdjustQuestReqItemCount(Quest const* quest, QuestStatusData& questStatusData)
{
- if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
+ if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER))
{
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
{
- uint32 reqitemcount = pQuest->ReqItemCount[i];
+ uint32 reqitemcount = quest->ReqItemCount[i];
if (reqitemcount != 0)
{
- uint32 curitemcount = GetItemCount(pQuest->ReqItemId[i], true);
+ uint32 curitemcount = GetItemCount(quest->ReqItemId[i], true);
questStatusData.m_itemcount[i] = std::min(curitemcount, reqitemcount);
- m_QuestStatusSave[pQuest->GetQuestId()] = true;
+ m_QuestStatusSave[quest->GetQuestId()] = true;
}
}
}
@@ -16167,9 +16162,9 @@ void Player::SendQuestComplete(uint32 quest_id)
}
}
-void Player::SendQuestReward(Quest const* pQuest, uint32 XP, Object* questGiver)
+void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver)
{
- uint32 questid = pQuest->GetQuestId();
+ uint32 questid = quest->GetQuestId();
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid);
sGameEventMgr->HandleQuestComplete(questid);
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
@@ -16178,21 +16173,21 @@ void Player::SendQuestReward(Quest const* pQuest, uint32 XP, Object* questGiver)
if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
data << uint32(XP);
- data << uint32(pQuest->GetRewOrReqMoney());
+ data << uint32(quest->GetRewOrReqMoney());
}
else
{
data << uint32(0);
- data << uint32(pQuest->GetRewOrReqMoney() + int32(pQuest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY)));
+ data << uint32(quest->GetRewOrReqMoney() + int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY)));
}
- data << 10 * Trinity::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorMultiplier());
- data << uint32(pQuest->GetBonusTalents()); // bonus talents
- data << uint32(pQuest->GetRewArenaPoints());
+ data << 10 * Trinity::Honor::hk_honor_at_level(getLevel(), quest->GetRewHonorMultiplier());
+ data << uint32(quest->GetBonusTalents()); // bonus talents
+ data << uint32(quest->GetRewArenaPoints());
GetSession()->SendPacket(&data);
- if (pQuest->GetQuestCompleteScript() != 0)
- GetMap()->ScriptsStart(sQuestEndScripts, pQuest->GetQuestCompleteScript(), questGiver, this);
+ if (quest->GetQuestCompleteScript() != 0)
+ GetMap()->ScriptsStart(sQuestEndScripts, quest->GetQuestCompleteScript(), questGiver, this);
}
void Player::SendQuestFailed(uint32 questId, InventoryResult reason)
@@ -16226,19 +16221,19 @@ void Player::SendCanTakeQuestResponse(uint32 msg)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID");
}
-void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver)
+void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver)
{
if (pReceiver)
{
- std::string strTitle = pQuest->GetTitle();
+ std::string strTitle = quest->GetTitle();
int loc_idx = pReceiver->GetSession()->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
- if (const QuestLocale* pLocale = sObjectMgr->GetQuestLocale(pQuest->GetQuestId()))
+ if (const QuestLocale* pLocale = sObjectMgr->GetQuestLocale(quest->GetQuestId()))
ObjectMgr::GetLocaleString(pLocale->Title, loc_idx, strTitle);
WorldPacket data(SMSG_QUEST_CONFIRM_ACCEPT, (4 + strTitle.size() + 8));
- data << uint32(pQuest->GetQuestId());
+ data << uint32(quest->GetQuestId());
data << strTitle;
data << uint64(GetGUID());
pReceiver->GetSession()->SendPacket(&data);
@@ -16259,50 +16254,50 @@ void Player::SendPushToPartyResponse(Player* player, uint32 msg)
}
}
-void Player::SendQuestUpdateAddItem(Quest const* /*pQuest*/, uint32 /*item_idx*/, uint16 /*count*/)
+void Player::SendQuestUpdateAddItem(Quest const* /*quest*/, uint32 /*item_idx*/, uint16 /*count*/)
{
WorldPacket data(SMSG_QUESTUPDATE_ADD_ITEM, 0);
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM");
- //data << pQuest->ReqItemId[item_idx];
+ //data << quest->ReqItemId[item_idx];
//data << count;
GetSession()->SendPacket(&data);
}
-void Player::SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count)
+void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count)
{
ASSERT(old_count + add_count < 65536 && "mob/GO count store in 16 bits 2^16 = 65536 (0..65536)");
- int32 entry = pQuest->ReqCreatureOrGOId[ creatureOrGO_idx ];
+ int32 entry = quest->ReqCreatureOrGOId[ creatureOrGO_idx ];
if (entry < 0)
// client expected gameobject template id in form (id|0x80000000)
entry = (-entry) | 0x80000000;
WorldPacket data(SMSG_QUESTUPDATE_ADD_KILL, (4*4+8));
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_KILL");
- data << uint32(pQuest->GetQuestId());
+ data << uint32(quest->GetQuestId());
data << uint32(entry);
data << uint32(old_count + add_count);
- data << uint32(pQuest->ReqCreatureOrGOCount[ creatureOrGO_idx ]);
+ data << uint32(quest->ReqCreatureOrGOCount[ creatureOrGO_idx ]);
data << uint64(guid);
GetSession()->SendPacket(&data);
- uint16 log_slot = FindQuestSlot(pQuest->GetQuestId());
+ uint16 log_slot = FindQuestSlot(quest->GetQuestId());
if (log_slot < MAX_QUEST_LOG_SIZE)
SetQuestSlotCounter(log_slot, creatureOrGO_idx, GetQuestSlotCounter(log_slot, creatureOrGO_idx)+add_count);
}
-void Player::SendQuestUpdateAddPlayer(Quest const* pQuest, uint16 old_count, uint16 add_count)
+void Player::SendQuestUpdateAddPlayer(Quest const* quest, uint16 old_count, uint16 add_count)
{
ASSERT(old_count + add_count < 65536 && "player count store in 16 bits");
WorldPacket data(SMSG_QUESTUPDATE_ADD_PVP_KILL, (3*4));
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_PVP_KILL");
- data << uint32(pQuest->GetQuestId());
+ data << uint32(quest->GetQuestId());
data << uint32(old_count + add_count);
- data << uint32(pQuest->GetPlayersSlain());
+ data << uint32(quest->GetPlayersSlain());
GetSession()->SendPacket(&data);
- uint16 log_slot = FindQuestSlot(pQuest->GetQuestId());
+ uint16 log_slot = FindQuestSlot(quest->GetQuestId());
if (log_slot < MAX_QUEST_LOG_SIZE)
SetQuestSlotCounter(log_slot, QUEST_PVP_KILL_SLOT, GetQuestSlotCounter(log_slot, QUEST_PVP_KILL_SLOT) + add_count);
}
@@ -16799,7 +16794,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
RelocateToHomebind();
}
- // fix crash (because of if (Map* map = _FindMap(instanceId)) in MapInstanced::CreateInstance)
+ // fix crash (because of if (Map* map = _FindMap(instanceId)) in Mainstanced::CreateInstance)
if (instanceId)
if (InstanceSave* save = GetInstanceSave(mapId, mapEntry->IsRaid()))
if (save->GetInstanceId() != instanceId)
@@ -17664,8 +17659,8 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
uint32 quest_id = fields[0].GetUInt32();
// used to be new, no delete?
- Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id);
- if (pQuest)
+ Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id);
+ if (quest)
{
// find or create
QuestStatusData& questStatusData = m_QuestStatus[quest_id];
@@ -17683,7 +17678,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
time_t quest_time = time_t(fields[3].GetUInt32());
- if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id))
+ if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id))
{
AddTimedQuest(quest_id);
@@ -17748,21 +17743,21 @@ void Player::_LoadQuestStatusRewarded(PreparedQueryResult result)
uint32 quest_id = fields[0].GetUInt32();
// used to be new, no delete?
- Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id);
- if (pQuest)
+ Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id);
+ if (quest)
{
// learn rewarded spell if unknown
- learnQuestRewardedSpells(pQuest);
+ learnQuestRewardedSpells(quest);
// set rewarded title if any
- if (pQuest->GetCharTitleId())
+ if (quest->GetCharTitleId())
{
- if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(pQuest->GetCharTitleId()))
+ if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(quest->GetCharTitleId()))
SetTitle(titleEntry);
}
- if (pQuest->GetBonusTalents())
- m_questRewardTalentCount += pQuest->GetBonusTalents();
+ if (quest->GetBonusTalents())
+ m_questRewardTalentCount += quest->GetBonusTalents();
}
m_RewardedQuests.insert(quest_id);
@@ -17808,8 +17803,8 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result)
// save _any_ from daily quest times (it must be after last reset anyway)
m_lastDailyQuestTime = (time_t)fields[1].GetUInt64();
- Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id);
- if (!pQuest)
+ Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id);
+ if (!quest)
continue;
SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx, quest_id);
@@ -17832,8 +17827,8 @@ void Player::_LoadWeeklyQuestStatus(PreparedQueryResult result)
do
{
uint32 quest_id = (*result)[0].GetUInt32();
- Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id);
- if (!pQuest)
+ Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id);
+ if (!quest)
continue;
m_weeklyquests.insert(quest_id);
@@ -18481,7 +18476,6 @@ void Player::SaveToDB()
// save pet (hunter pet level and experience and all type pets health/mana).
if (Pet* pet = GetPet())
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
-
}
// fast save function for item/money cheating preventing - save only inventory and money state
@@ -19545,7 +19539,6 @@ void Player::VehicleSpellInitialize()
if (!veh)
return;
-
uint8 cooldownCount = veh->m_CreatureSpellCooldowns.size() + veh->m_CreatureCategoryCooldowns.size();
WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * 10 + 1 + 1 + cooldownCount * (4 + 2 + 4 + 4));
@@ -19881,7 +19874,6 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
Player* owner = ObjectAccessor::FindPlayer(ownerguid);
if (owner)
owner->GetSession()->SendPetitionQueryOpcode(petitionguid);
-
} while (result->NextRow());
if (type == 10)
@@ -21518,7 +21510,6 @@ void Player::SendInitialPacketsBeforeAddToMap()
// SMSG_PET_GUIDS
// SMSG_UPDATE_WORLD_STATE
// SMSG_POWER_UPDATE
-
}
void Player::SendInitialPacketsAfterAddToMap()
@@ -21892,7 +21883,6 @@ void Player::SetDailyQuestStatus(uint32 quest_id)
break;
}
}
-
} else
{
m_DFQuests.insert(quest_id);
@@ -24311,7 +24301,6 @@ void Player::UpdateSpecCount(uint8 count)
for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end(); ++itr)
trans->PAppend("INSERT INTO character_action (guid, button, action, type, spec) VALUES ('%u', '%u', '%u', '%u', '%u')",
GetGUIDLow(), uint32(itr->first), uint32(itr->second.GetAction()), uint32(itr->second.GetType()), 1);
-
}
// Delete spec data for removed spec.
else if (count < curCount)
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index f4d1b30b97a..862b271c464 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1382,23 +1382,23 @@ class Player : public Unit, public GridObject<Player>
/*** QUEST SYSTEM ***/
/*********************************************************/
- int32 GetQuestLevel(Quest const* pQuest) const { return pQuest && (pQuest->GetQuestLevel() > 0) ? pQuest->GetQuestLevel() : getLevel(); }
+ int32 GetQuestLevel(Quest const* quest) const { return quest && (quest->GetQuestLevel() > 0) ? quest->GetQuestLevel() : getLevel(); }
void PrepareQuestMenu(uint64 guid);
void SendPreparedQuest(uint64 guid);
bool IsActiveQuest(uint32 quest_id) const;
- Quest const* GetNextQuest(uint64 guid, Quest const* pQuest);
- bool CanSeeStartQuest(Quest const* pQuest);
- bool CanTakeQuest(Quest const* pQuest, bool msg);
- bool CanAddQuest(Quest const* pQuest, bool msg);
+ Quest const* GetNextQuest(uint64 guid, Quest const* quest);
+ bool CanSeeStartQuest(Quest const* quest);
+ bool CanTakeQuest(Quest const* quest, bool msg);
+ bool CanAddQuest(Quest const* quest, bool msg);
bool CanCompleteQuest(uint32 quest_id);
- bool CanCompleteRepeatableQuest(Quest const* pQuest);
- bool CanRewardQuest(Quest const* pQuest, bool msg);
- bool CanRewardQuest(Quest const* pQuest, uint32 reward, bool msg);
- void AddQuest(Quest const* pQuest, Object* questGiver);
+ bool CanCompleteRepeatableQuest(Quest const* quest);
+ bool CanRewardQuest(Quest const* quest, bool msg);
+ bool CanRewardQuest(Quest const* quest, uint32 reward, bool msg);
+ void AddQuest(Quest const* quest, Object* questGiver);
void CompleteQuest(uint32 quest_id);
void IncompleteQuest(uint32 quest_id);
- void RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver, bool announce = true);
+ void RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, bool announce = true);
void FailQuest(uint32 quest_id);
bool SatisfyQuestSkillOrClass(Quest const* qInfo, bool msg);
bool SatisfyQuestLevel(Quest const* qInfo, bool msg);
@@ -1414,7 +1414,7 @@ class Player : public Unit, public GridObject<Player>
bool SatisfyQuestPrevChain(Quest const* qInfo, bool msg);
bool SatisfyQuestDay(Quest const* qInfo, bool msg);
bool SatisfyQuestWeek(Quest const* qInfo, bool msg);
- bool GiveQuestSourceItem(Quest const* pQuest);
+ bool GiveQuestSourceItem(Quest const* quest);
bool TakeQuestSourceItem(uint32 questId, bool msg);
bool GetQuestRewardStatus(uint32 quest_id) const;
QuestStatus GetQuestStatus(uint32 quest_id) const;
@@ -1480,15 +1480,15 @@ class Player : public Unit, public GridObject<Player>
bool CanShareQuest(uint32 quest_id) const;
void SendQuestComplete(uint32 quest_id);
- void SendQuestReward(Quest const* pQuest, uint32 XP, Object* questGiver);
+ void SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver);
void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK);
void SendQuestTimerFailed(uint32 quest_id);
void SendCanTakeQuestResponse(uint32 msg);
- void SendQuestConfirmAccept(Quest const* pQuest, Player* pReceiver);
+ void SendQuestConfirmAccept(Quest const* quest, Player* pReceiver);
void SendPushToPartyResponse(Player* player, uint32 msg);
- void SendQuestUpdateAddItem(Quest const* pQuest, uint32 item_idx, uint16 count);
- void SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count);
- void SendQuestUpdateAddPlayer(Quest const* pQuest, uint16 old_count, uint16 add_count);
+ void SendQuestUpdateAddItem(Quest const* quest, uint32 item_idx, uint16 count);
+ void SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count);
+ void SendQuestUpdateAddPlayer(Quest const* quest, uint16 old_count, uint16 add_count);
uint64 GetDivider() { return m_divider; }
void SetDivider(uint64 guid) { m_divider = guid; }
@@ -2032,7 +2032,7 @@ class Player : public Unit, public GridObject<Player>
ReputationMgr const& GetReputationMgr() const { return m_reputationMgr; }
ReputationRank GetReputationRank(uint32 faction_id) const;
void RewardReputation(Unit* pVictim, float rate);
- void RewardReputation(Quest const* pQuest);
+ void RewardReputation(Quest const* quest);
void UpdateSkillsForLevel();
void UpdateSkillsToMaxSkillsForLevel(); // for .levelup
@@ -2756,7 +2756,7 @@ class Player : public Unit, public GridObject<Player>
void AddKnownCurrency(uint32 itemId);
int32 CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, int32 faction, bool for_quest, bool noQuestBonus = false);
- void AdjustQuestReqItemCount(Quest const* pQuest, QuestStatusData& questStatusData);
+ void AdjustQuestReqItemCount(Quest const* quest, QuestStatusData& questStatusData);
bool IsCanDelayTeleport() const { return m_bCanDelayTeleport; }
void SetCanDelayTeleport(bool setting) { m_bCanDelayTeleport = setting; }
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index a30b91dcfa0..5ba470e13b1 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -14164,13 +14164,13 @@ uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missC
return procEx;
}
-void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura)
+void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura)
{
// Player is loaded now - do not allow passive spell casts to proc
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetSession()->PlayerLoading())
return;
// For melee/ranged based attack need update skills and set some Aura states if victim present
- if (procFlag & MELEE_BASED_TRIGGER_MASK && pTarget)
+ if (procFlag & MELEE_BASED_TRIGGER_MASK && target)
{
// Update skills here for players
if (GetTypeId() == TYPEID_PLAYER)
@@ -14178,12 +14178,12 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
// On melee based hit/miss/resist need update skill (for victim and attacker)
if (procExtra & (PROC_EX_NORMAL_HIT|PROC_EX_MISS|PROC_EX_RESIST))
{
- if (pTarget->GetTypeId() != TYPEID_PLAYER && pTarget->GetCreatureType() != CREATURE_TYPE_CRITTER)
- ToPlayer()->UpdateCombatSkills(pTarget, attType, isVictim);
+ if (target->GetTypeId() != TYPEID_PLAYER && target->GetCreatureType() != CREATURE_TYPE_CRITTER)
+ ToPlayer()->UpdateCombatSkills(target, attType, isVictim);
}
// Update defence if player is victim and parry/dodge/block
else if (isVictim && procExtra & (PROC_EX_DODGE|PROC_EX_PARRY|PROC_EX_BLOCK))
- ToPlayer()->UpdateCombatSkills(pTarget, attType, true);
+ ToPlayer()->UpdateCombatSkills(target, attType, true);
}
// If exist crit/parry/dodge/block need update aura state (for victim and attacker)
if (procExtra & (PROC_EX_CRITICAL_HIT|PROC_EX_PARRY|PROC_EX_DODGE|PROC_EX_BLOCK))
@@ -14228,7 +14228,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
// Overpower on victim dodge
if (procExtra & PROC_EX_DODGE && GetTypeId() == TYPEID_PLAYER && getClass() == CLASS_WARRIOR)
{
- ToPlayer()->AddComboPoints(pTarget, 1);
+ ToPlayer()->AddComboPoints(target, 1);
StartReactiveTimer(REACTIVE_OVERPOWER);
}
}
@@ -14248,7 +14248,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
if (isVictim)
procExtra &= ~PROC_EX_INTERNAL_REQ_FAMILY;
SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
- if (!IsTriggeredAtSpellProcEvent(pTarget, triggerData.aura, procSpell, procFlag, procExtra, attType, isVictim, active, triggerData.spellProcEvent))
+ if (!IsTriggeredAtSpellProcEvent(target, triggerData.aura, procSpell, procFlag, procExtra, attType, isVictim, active, triggerData.spellProcEvent))
continue;
// Triggered spells not triggering additional spells
@@ -14308,7 +14308,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
// This bool is needed till separate aura effect procs are still here
bool handled = false;
- if (HandleAuraProc(pTarget, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled))
+ if (HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled))
{
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id);
takeCharges = true;
@@ -14329,15 +14329,15 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
{
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
// Don`t drop charge or add cooldown for not started trigger
- if (HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
takeCharges = true;
break;
}
case SPELL_AURA_PROC_TRIGGER_DAMAGE:
{
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount(), spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- SpellNonMeleeDamage damageInfo(this, pTarget, spellInfo->Id, spellInfo->SchoolMask);
- uint32 damage = SpellDamageBonus(pTarget, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE);
+ SpellNonMeleeDamage damageInfo(this, target, spellInfo->Id, spellInfo->SchoolMask);
+ uint32 damage = SpellDamageBonus(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE);
CalculateSpellDamageTaken(&damageInfo, damage, spellInfo);
DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
SendSpellNonMeleeDamageLog(&damageInfo);
@@ -14349,31 +14349,31 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
case SPELL_AURA_DUMMY:
{
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- if (HandleDummyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ if (HandleDummyAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
takeCharges = true;
break;
}
case SPELL_AURA_OBS_MOD_POWER:
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- if (HandleObsModEnergyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ if (HandleObsModEnergyAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
takeCharges = true;
break;
case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN:
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- if (HandleModDamagePctTakenAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ if (HandleModDamagePctTakenAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
takeCharges = true;
break;
case SPELL_AURA_MOD_MELEE_HASTE:
{
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- if (HandleHasteAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ if (HandleHasteAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
takeCharges = true;
break;
}
case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
{
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- if (HandleOverrideClassScriptAuraProc(pTarget, damage, triggeredByAura, procSpell, cooldown))
+ if (HandleOverrideClassScriptAuraProc(target, damage, triggeredByAura, procSpell, cooldown))
takeCharges = true;
break;
}
@@ -14399,7 +14399,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
{
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- if (HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
takeCharges = true;
break;
}
@@ -14433,12 +14433,12 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
break;
case SPELL_AURA_MOD_DAMAGE_FROM_CASTER:
// Compare casters
- if (triggeredByAura->GetCasterGUID() == pTarget->GetGUID())
+ if (triggeredByAura->GetCasterGUID() == target->GetGUID())
takeCharges = true;
break;
case SPELL_AURA_MOD_SPELL_CRIT_CHANCE:
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s spell crit chance aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- if (procSpell && HandleSpellCritChanceAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ if (procSpell && HandleSpellCritChanceAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
takeCharges = true;
break;
// CC Auras which use their amount amount to drop
@@ -15882,8 +15882,8 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
return false;
// Set charmed
- Map* pMap = GetMap();
- if (!IsVehicle() || (IsVehicle() && pMap && !pMap->IsBattleground()))
+ Map* map = GetMap();
+ if (!IsVehicle() || (IsVehicle() && map && !map->IsBattleground()))
setFaction(charmer->getFaction());
charmer->SetCharm(this, true);
@@ -15988,8 +15988,8 @@ void Unit::RemoveCharmedBy(Unit* charmer)
CombatStop(); // TODO: CombatStop(true) may cause crash (interrupt spells)
getHostileRefManager().deleteReferences();
DeleteThreatList();
- Map* pMap = GetMap();
- if (!IsVehicle() || (IsVehicle() && pMap && !pMap->IsBattleground()))
+ Map* map = GetMap();
+ if (!IsVehicle() || (IsVehicle() && map && !map->IsBattleground()))
RestoreFaction();
GetMotionMaster()->InitDefault();
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 269df57301c..087a8a76324 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1443,7 +1443,7 @@ class Unit : public WorldObject
int32 DealHeal(Unit* pVictim, uint32 addhealth);
void ProcDamageAndSpell(Unit* pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL);
- void ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = NULL);
+ void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = NULL);
void GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTriggeringProc, std::list<AuraApplication*>* procAuras, ProcEventInfo eventInfo);
void TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo);
diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp
index 77296b73f81..c351efb334f 100755
--- a/src/server/game/Globals/ObjectAccessor.cpp
+++ b/src/server/game/Globals/ObjectAccessor.cpp
@@ -396,4 +396,4 @@ template Pet* ObjectAccessor::GetObjectInWorld<Pet>(uint32 mapid, float x, float
template Creature* ObjectAccessor::GetObjectInWorld<Creature>(uint32 mapid, float x, float y, uint64 guid, Creature* /*fake*/);
template Corpse* ObjectAccessor::GetObjectInWorld<Corpse>(uint32 mapid, float x, float y, uint64 guid, Corpse* /*fake*/);
template GameObject* ObjectAccessor::GetObjectInWorld<GameObject>(uint32 mapid, float x, float y, uint64 guid, GameObject* /*fake*/);
-template DynamicObject* ObjectAccessor::GetObjectInWorld<DynamicObject>(uint32 mapid, float x, float y, uint64 guid, DynamicObject* /*fake*/);
+template DynamicObject* ObjectAccessor::GetObjectInWorld<DynamicObject>(uint32 mapid, float x, float y, uint64 guid, DynamicObject* /*fake*/); \ No newline at end of file
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 022bee3f1dd..a5bce96f653 100755
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -1197,9 +1197,9 @@ namespace Trinity
{
public:
AllGameObjectsWithEntryInRange(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {}
- bool operator() (GameObject* pGo)
+ bool operator() (GameObject* go)
{
- if (pGo->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pGo, m_fRange, false))
+ if (go->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(go, m_fRange, false))
return true;
return false;
@@ -1266,9 +1266,9 @@ namespace Trinity
{
public:
AllWorldObjectsInRange(const WorldObject* pObject, float fMaxRange) : m_pObject(pObject), m_fRange(fMaxRange) {}
- bool operator() (WorldObject* pGo)
+ bool operator() (WorldObject* go)
{
- return m_pObject->IsWithinDist(pGo, m_fRange, false);
+ return m_pObject->IsWithinDist(go, m_fRange, false);
}
private:
const WorldObject* m_pObject;
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 44d7f62305f..50e820147f0 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -31,7 +31,7 @@
#include "BattlegroundMgr.h"
#include "MapManager.h"
#include "InstanceSaveMgr.h"
-#include "MapInstanced.h"
+#include "Mapinstanced.h"
#include "Util.h"
#include "LFGMgr.h"
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp
index ca946b4a2c0..b25efa89171 100755
--- a/src/server/game/Instances/InstanceSaveMgr.cpp
+++ b/src/server/game/Instances/InstanceSaveMgr.cpp
@@ -511,7 +511,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr)
void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
{
sLog->outDebug(LOG_FILTER_MAPS, "InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId);
- Map* map = (MapInstanced*)sMapMgr->CreateBaseMap(mapid);
+ Map* map = (Mainstanced*)sMapMgr->CreateBaseMap(mapid);
if (!map->Instanceable())
return;
@@ -521,7 +521,7 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
DeleteInstanceFromDB(instanceId); // even if save not loaded
- Map* iMap = ((MapInstanced*)map)->FindMap(instanceId);
+ Map* iMap = ((Mainstanced*)map)->FindMap(instanceId);
if (iMap && iMap->IsDungeon())
((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);
@@ -584,8 +584,8 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
// note: this isn't fast but it's meant to be executed very rarely
Map const* map = sMapMgr->CreateBaseMap(mapid); // _not_ include difficulty
- MapInstanced::InstancedMaps &instMaps = ((MapInstanced*)map)->GetInstancedMaps();
- MapInstanced::InstancedMaps::iterator mitr;
+ Mainstanced::InstancedMaps &instMaps = ((Mainstanced*)map)->GetInstancedMaps();
+ Mainstanced::InstancedMaps::iterator mitr;
uint32 timeLeft;
for (mitr = instMaps.begin(); mitr != instMaps.end(); ++mitr)
@@ -626,4 +626,4 @@ uint32 InstanceSaveManager::GetNumBoundGroupsTotal()
ret += itr->second->GetGroupCount();
return ret;
-}
+} \ No newline at end of file
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index b2c504dfb9f..b9b9ed281fa 100755
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -253,35 +253,35 @@ void InstanceScript::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime,
if (!uiGuid)
return;
- GameObject* pGo = instance->GetGameObject(uiGuid);
+ GameObject* go = instance->GetGameObject(uiGuid);
- if (pGo)
+ if (go)
{
- if (pGo->GetGoType() == GAMEOBJECT_TYPE_DOOR || pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON)
+ if (go->GetGoType() == GAMEOBJECT_TYPE_DOOR || go->GetGoType() == GAMEOBJECT_TYPE_BUTTON)
{
- if (pGo->getLootState() == GO_READY)
- pGo->UseDoorOrButton(uiWithRestoreTime, bUseAlternativeState);
- else if (pGo->getLootState() == GO_ACTIVATED)
- pGo->ResetDoorOrButton();
+ if (go->getLootState() == GO_READY)
+ go->UseDoorOrButton(uiWithRestoreTime, bUseAlternativeState);
+ else if (go->getLootState() == GO_ACTIVATED)
+ go->ResetDoorOrButton();
}
else
- sLog->outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.", pGo->GetEntry(), pGo->GetGoType());
+ sLog->outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.", go->GetEntry(), go->GetGoType());
}
}
void InstanceScript::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
{
- if (GameObject* pGo = instance->GetGameObject(uiGuid))
+ if (GameObject* go = instance->GetGameObject(uiGuid))
{
//not expect any of these should ever be handled
- if (pGo->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || pGo->GetGoType() == GAMEOBJECT_TYPE_DOOR ||
- pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON || pGo->GetGoType() == GAMEOBJECT_TYPE_TRAP)
+ if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || go->GetGoType() == GAMEOBJECT_TYPE_DOOR ||
+ go->GetGoType() == GAMEOBJECT_TYPE_BUTTON || go->GetGoType() == GAMEOBJECT_TYPE_TRAP)
return;
- if (pGo->isSpawned())
+ if (go->isSpawned())
return;
- pGo->SetRespawnTime(uiTimeToDespawn);
+ go->SetRespawnTime(uiTimeToDespawn);
}
}
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index b283227bb58..fb535cff747 100755
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -31,7 +31,6 @@
#include "ObjectMgr.h"
#include "Group.h"
-
union u_map_magic
{
char asChar[4];
@@ -144,7 +143,7 @@ void Map::LoadMap(int gx, int gy, bool reload)
if (!m_parentMap->GridMaps[gx][gy])
m_parentMap->EnsureGridCreated(GridPair(63-gx, 63-gy));
- ((MapInstanced*)(m_parentMap))->AddGridMapReference(GridPair(gx, gy));
+ ((Mainstanced*)(m_parentMap))->AddGridMapReference(GridPair(gx, gy));
GridMaps[gx][gy] = m_parentMap->GridMaps[gx][gy];
return;
}
@@ -993,7 +992,7 @@ bool Map::UnloadGrid(const uint32 x, const uint32 y, bool unloadAll)
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gx, gy);
}
else
- ((MapInstanced*)m_parentMap)->RemoveGridMapReference(GridPair(gx, gy));
+ ((Mainstanced*)m_parentMap)->RemoveGridMapReference(GridPair(gx, gy));
GridMaps[gx][gy] = NULL;
}
@@ -1604,7 +1603,6 @@ float Map::GetHeight(float x, float y, float z, bool pUseVmaps, float maxSearchD
return vmapHeight;
else
return mapHeight; // better use .map surface height
-
}
else
return vmapHeight; // we have only vmapHeight (if have)
@@ -2656,7 +2654,6 @@ void BattlegroundMap::RemoveAllPlayers()
if (Player* plr = itr->getSource())
if (!plr->IsBeingTeleportedFar())
plr->TeleportTo(plr->GetBattlegroundEntryPoint());
-
}
Creature*
@@ -2681,4 +2678,4 @@ void Map::UpdateIteratorBack(Player* player)
{
if (m_mapRefIter == player->GetMapRef())
m_mapRefIter = m_mapRefIter->nocheck_prev();
-}
+} \ No newline at end of file
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index 640b70413f8..c47ae6ac614 100755
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -48,7 +48,7 @@ struct ScriptInfo;
struct ScriptAction;
struct Position;
class Battleground;
-class MapInstanced;
+class Mainstanced;
class InstanceMap;
namespace Trinity { struct ObjectUpdater; }
@@ -429,8 +429,8 @@ class Map : public GridRefManager<NGridType>
GameObject* GetGameObject(uint64 guid);
DynamicObject* GetDynamicObject(uint64 guid);
- MapInstanced* ToMapInstanced(){ if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); else return NULL; }
- const MapInstanced* ToMapInstanced() const { if (Instanceable()) return (const MapInstanced*)((MapInstanced*)this); else return NULL; }
+ Mainstanced* ToMainstanced(){ if (Instanceable()) return reinterpret_cast<Mainstanced*>(this); else return NULL; }
+ const Mainstanced* ToMainstanced() const { if (Instanceable()) return (const Mainstanced*)((Mainstanced*)this); else return NULL; }
InstanceMap* ToInstanceMap(){ if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return NULL; }
const InstanceMap* ToInstanceMap() const { if (IsDungeon()) return (const InstanceMap*)((InstanceMap*)this); else return NULL; }
@@ -508,7 +508,7 @@ class Map : public GridRefManager<NGridType>
time_t i_gridExpiry;
- //used for fast base_map (e.g. MapInstanced class object) search for
+ //used for fast base_map (e.g. Mainstanced class object) search for
//InstanceMaps and BattlegroundMaps...
Map* m_parentMap;
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index 88bfc9cdb69..aab2f469514 100755
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -25,7 +25,7 @@
#include "World.h"
#include "Group.h"
-MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL)
+Mainstanced::Mainstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL)
{
// initialize instanced maps list
m_InstancedMaps.clear();
@@ -33,7 +33,7 @@ MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEO
memset(&GridMapReference, 0, MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_GRIDS*sizeof(uint16));
}
-void MapInstanced::InitVisibilityDistance()
+void Mainstanced::InitVisibilityDistance()
{
if (m_InstancedMaps.empty())
return;
@@ -44,7 +44,7 @@ void MapInstanced::InitVisibilityDistance()
}
}
-void MapInstanced::Update(const uint32 t)
+void Mainstanced::Update(const uint32 t)
{
// take care of loaded GridMaps (when unused, unload it!)
Map::Update(t);
@@ -73,7 +73,7 @@ void MapInstanced::Update(const uint32 t)
}
}
-void MapInstanced::DelayedUpdate(const uint32 diff)
+void Mainstanced::DelayedUpdate(const uint32 diff)
{
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
i->second->DelayedUpdate(diff);
@@ -82,14 +82,14 @@ void MapInstanced::DelayedUpdate(const uint32 diff)
}
/*
-void MapInstanced::RelocationNotify()
+void Mainstanced::RelocationNotify()
{
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
i->second->RelocationNotify();
}
*/
-void MapInstanced::UnloadAll()
+void Mainstanced::UnloadAll()
{
// Unload instanced maps
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
@@ -110,7 +110,7 @@ void MapInstanced::UnloadAll()
- create the instance if it's not created already
- the player is not actually added to the instance (only in InstanceMap::Add)
*/
-Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player)
+Map* Mainstanced::CreateInstance(const uint32 mapId, Player* player)
{
if (GetId() != mapId || !player)
return NULL;
@@ -170,7 +170,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player)
return map;
}
-InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, Difficulty difficulty)
+InstanceMap* Mainstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, Difficulty difficulty)
{
// load/create a map
ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);
@@ -192,7 +192,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
// some instances only have one difficulty
GetDownscaledMapDifficultyData(GetId(), difficulty);
- sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal");
+ sLog->outDebug(LOG_FILTER_MAPS, "Mainstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal");
InstanceMap* map = new InstanceMap(GetId(), GetGridExpiry(), InstanceId, difficulty, this);
ASSERT(map->IsDungeon());
@@ -204,12 +204,12 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
return map;
}
-BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battleground* bg)
+BattlegroundMap* Mainstanced::CreateBattleground(uint32 InstanceId, Battleground* bg)
{
// load/create a map
ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);
- sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());
+ sLog->outDebug(LOG_FILTER_MAPS, "Mainstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel());
@@ -230,7 +230,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun
}
// increments the iterator after erase
-bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr)
+bool Mainstanced::DestroyInstance(InstancedMaps::iterator &itr)
{
itr->second->RemoveAllPlayers();
if (itr->second->HavePlayers())
@@ -260,8 +260,8 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr)
return true;
}
-bool MapInstanced::CanEnter(Player* /*player*/)
+bool Mainstanced::CanEnter(Player* /*player*/)
{
//ASSERT(false);
return true;
-}
+} \ No newline at end of file
diff --git a/src/server/game/Maps/MapInstanced.h b/src/server/game/Maps/MapInstanced.h
index 1913f0add51..2949a8ecb67 100755
--- a/src/server/game/Maps/MapInstanced.h
+++ b/src/server/game/Maps/MapInstanced.h
@@ -23,14 +23,14 @@
#include "InstanceSaveMgr.h"
#include "DBCEnums.h"
-class MapInstanced : public Map
+class Mainstanced : public Map
{
friend class MapManager;
public:
typedef UNORDERED_MAP< uint32, Map*> InstancedMaps;
- MapInstanced(uint32 id, time_t expiry);
- ~MapInstanced() {}
+ Mainstanced(uint32 id, time_t expiry);
+ ~Mainstanced() {}
// functions overwrite Map versions
void Update(const uint32);
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp
index 4684e96c79c..53159acc55d 100755
--- a/src/server/game/Maps/MapManager.cpp
+++ b/src/server/game/Maps/MapManager.cpp
@@ -106,7 +106,7 @@ Map* MapManager::_createBaseMap(uint32 id)
const MapEntry* entry = sMapStore.LookupEntry(id);
if (entry && entry->Instanceable())
{
- m = new MapInstanced(id, i_gridCleanUpDelay);
+ m = new Mainstanced(id, i_gridCleanUpDelay);
}
else
{
@@ -125,7 +125,7 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj, uint32 /*instanceI
//if (!obj->IsInWorld()) sLog->outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId());
Map* m = _createBaseMap(id);
- if (m && (obj->GetTypeId() == TYPEID_PLAYER) && m->Instanceable()) m = ((MapInstanced*)m)->CreateInstance(id, (Player*)obj);
+ if (m && (obj->GetTypeId() == TYPEID_PLAYER) && m->Instanceable()) m = ((Mainstanced*)m)->CreateInstance(id, (Player*)obj);
return m;
}
@@ -139,7 +139,7 @@ Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const
if (!map->Instanceable())
return instanceId == 0 ? map : NULL;
- return ((MapInstanced*)map)->FindMap(instanceId);
+ return ((Mainstanced*)map)->FindMap(instanceId);
}
bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
@@ -343,8 +343,8 @@ uint32 MapManager::GetNumInstances()
Map* map = itr->second;
if (!map->Instanceable())
continue;
- MapInstanced::InstancedMaps &maps = ((MapInstanced*)map)->GetInstancedMaps();
- for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
+ Mainstanced::InstancedMaps &maps = ((Mainstanced*)map)->GetInstancedMaps();
+ for (Mainstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
if (mitr->second->IsDungeon()) ret++;
}
return ret;
@@ -360,8 +360,8 @@ uint32 MapManager::GetNumPlayersInInstances()
Map* map = itr->second;
if (!map->Instanceable())
continue;
- MapInstanced::InstancedMaps &maps = ((MapInstanced*)map)->GetInstancedMaps();
- for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
+ Mainstanced::InstancedMaps &maps = ((Mainstanced*)map)->GetInstancedMaps();
+ for (Mainstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
if (mitr->second->IsDungeon())
ret += ((InstanceMap*)mitr->second)->GetPlayers().getSize();
}
@@ -432,4 +432,4 @@ void MapManager::FreeInstanceId(uint32 instanceId)
SetNextInstanceId(instanceId);
_instanceIds[instanceId] = false;
-}
+} \ No newline at end of file
diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp
index 801b95e4c42..03accce42ed 100755
--- a/src/server/game/Pools/PoolMgr.cpp
+++ b/src/server/game/Pools/PoolMgr.cpp
@@ -838,8 +838,8 @@ void PoolMgr::LoadFromDB()
uint32 entry = fields[0].GetUInt32();
uint32 pool_id = fields[1].GetUInt32();
- Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry);
- if (!pQuest)
+ Quest const* quest = sObjectMgr->GetQuestTemplate(entry);
+ if (!quest)
{
sLog->outErrorDb("`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id);
continue;
@@ -851,16 +851,16 @@ void PoolMgr::LoadFromDB()
continue;
}
- if (!pQuest->IsDailyOrWeekly())
+ if (!quest->IsDailyOrWeekly())
{
sLog->outErrorDb("`pool_quest` has an quest (%u) which is not daily or weekly in pool id (%u), use ExclusiveGroup instead, skipped.", entry, pool_id);
continue;
}
if (poolTypeMap[pool_id] == QUEST_NONE)
- poolTypeMap[pool_id] = pQuest->IsDaily() ? QUEST_DAILY : QUEST_WEEKLY;
+ poolTypeMap[pool_id] = quest->IsDaily() ? QUEST_DAILY : QUEST_WEEKLY;
- int32 currType = pQuest->IsDaily() ? QUEST_DAILY : QUEST_WEEKLY;
+ int32 currType = quest->IsDaily() ? QUEST_DAILY : QUEST_WEEKLY;
if (poolTypeMap[pool_id] != currType)
{
@@ -980,9 +980,9 @@ void PoolMgr::ChangeDailyQuests()
{
for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr)
{
- if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(itr->GetFirstEqualChancedObjectId()))
+ if (Quest const* quest = sObjectMgr->GetQuestTemplate(itr->GetFirstEqualChancedObjectId()))
{
- if (pQuest->IsWeekly())
+ if (quest->IsWeekly())
continue;
UpdatePool<Quest>(itr->GetPoolId(), 1); // anything non-zero means don't load from db
@@ -996,9 +996,9 @@ void PoolMgr::ChangeWeeklyQuests()
{
for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr)
{
- if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(itr->GetFirstEqualChancedObjectId()))
+ if (Quest const* quest = sObjectMgr->GetQuestTemplate(itr->GetFirstEqualChancedObjectId()))
{
- if (pQuest->IsDaily())
+ if (quest->IsDaily())
continue;
UpdatePool<Quest>(itr->GetPoolId(), 1);
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp
index d33d338fe82..de5d24ee6b6 100755
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -539,8 +539,8 @@ void Map::ScriptsProcess()
// when script called for item spell casting then target == (unit or GO) and source is player
WorldObject* worldObject;
- Player* pTarget = target->ToPlayer();
- if (pTarget)
+ Player* target = target->ToPlayer();
+ if (target)
{
if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER)
{
@@ -552,8 +552,8 @@ void Map::ScriptsProcess()
}
else
{
- pTarget = source->ToPlayer();
- if (pTarget)
+ target = source->ToPlayer();
+ if (target)
{
if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER)
{
@@ -575,10 +575,10 @@ void Map::ScriptsProcess()
// quest id and flags checked at script loading
if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) &&
- (step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(pTarget, float(step.script->QuestExplored.Distance))))
- pTarget->AreaExploredOrEventHappens(step.script->QuestExplored.QuestID);
+ (step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(target, float(step.script->QuestExplored.Distance))))
+ target->AreaExploredOrEventHappens(step.script->QuestExplored.QuestID);
else
- pTarget->FailQuest(step.script->QuestExplored.QuestID);
+ target->FailQuest(step.script->QuestExplored.QuestID);
break;
}
@@ -686,8 +686,8 @@ void Map::ScriptsProcess()
{
// Source (datalong2 != 0) or target (datalong2 == 0) must be Unit.
bool bReverse = step.script->RemoveAura.Flags & SF_REMOVEAURA_REVERSE;
- if (Unit* pTarget = _GetScriptUnit(bReverse ? source : target, bReverse, step.script))
- pTarget->RemoveAurasDueToSpell(step.script->RemoveAura.SpellID);
+ if (Unit* target = _GetScriptUnit(bReverse ? source : target, bReverse, step.script))
+ target->RemoveAurasDueToSpell(step.script->RemoveAura.SpellID);
break;
}
@@ -751,20 +751,20 @@ void Map::ScriptsProcess()
if (WorldObject* pSource = _GetScriptWorldObject(source, true, step.script))
{
// PlaySound.Flags bitmask: 0/1=anyone/target
- Player* pTarget = NULL;
+ Player* target = NULL;
if (step.script->PlaySound.Flags & SF_PLAYSOUND_TARGET_PLAYER)
{
// Target must be Player.
- pTarget = _GetScriptPlayer(target, false, step.script);
- if (!pTarget)
+ target = _GetScriptPlayer(target, false, step.script);
+ if (!target)
break;
}
// PlaySound.Flags bitmask: 0/2=without/with distance dependent
if (step.script->PlaySound.Flags & SF_PLAYSOUND_DISTANCE_SOUND)
- pSource->PlayDistanceSound(step.script->PlaySound.SoundID, pTarget);
+ pSource->PlayDistanceSound(step.script->PlaySound.SoundID, target);
else
- pSource->PlayDirectSound(step.script->PlaySound.SoundID, pTarget);
+ pSource->PlayDirectSound(step.script->PlaySound.SoundID, target);
}
break;
@@ -878,11 +878,11 @@ void Map::ScriptsProcess()
if (step.script->Orientation.Flags& SF_ORIENTATION_FACE_TARGET)
{
// Target must be Unit.
- Unit* pTarget = _GetScriptUnit(target, false, step.script);
- if (!pTarget)
+ Unit* target = _GetScriptUnit(target, false, step.script);
+ if (!target)
break;
- pSource->SetInFront(pTarget);
+ pSource->SetInFront(target);
}
else
pSource->SetOrientation(step.script->Orientation.Orientation);
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index d37938eba48..120227c172d 100755
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -155,7 +155,7 @@ class ScriptRegistry
if (!V) \
return R;
-void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
+void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
{
if (!pSource)
{
@@ -198,21 +198,21 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
switch (pData->uiType)
{
case CHAT_TYPE_SAY:
- pSource->MonsterSay(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0);
+ pSource->MonsterSay(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0);
break;
case CHAT_TYPE_YELL:
- pSource->MonsterYell(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0);
+ pSource->MonsterYell(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0);
break;
case CHAT_TYPE_TEXT_EMOTE:
- pSource->MonsterTextEmote(iTextEntry, pTarget ? pTarget->GetGUID() : 0);
+ pSource->MonsterTextEmote(iTextEntry, target ? target->GetGUID() : 0);
break;
case CHAT_TYPE_BOSS_EMOTE:
- pSource->MonsterTextEmote(iTextEntry, pTarget ? pTarget->GetGUID() : 0, true);
+ pSource->MonsterTextEmote(iTextEntry, target ? target->GetGUID() : 0, true);
break;
case CHAT_TYPE_WHISPER:
{
- if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
- pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID());
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ pSource->MonsterWhisper(iTextEntry, target->GetGUID());
else
sLog->outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
@@ -220,15 +220,15 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
}
case CHAT_TYPE_BOSS_WHISPER:
{
- if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
- pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID(), true);
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ pSource->MonsterWhisper(iTextEntry, target->GetGUID(), true);
else
sLog->outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
break;
}
case CHAT_TYPE_ZONE_YELL:
- pSource->MonsterYellToZone(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0);
+ pSource->MonsterYellToZone(iTextEntry, pData->uiLanguage, target ? target->GetGUID() : 0);
break;
}
}
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 5925992a3c2..b3ba7f0a89c 100755
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -69,7 +69,7 @@ struct OutdoorPvPData;
#define VISIBLE_RANGE 166.0f //MAX visible range (size of grid)
// Generic scripting text function.
-void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* pTarget = NULL);
+void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = NULL);
/*
TODO: Add more script type classes.
diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp
index ef5a3b8184f..8c6f5626101 100755
--- a/src/server/game/Scripting/ScriptSystem.cpp
+++ b/src/server/game/Scripting/ScriptSystem.cpp
@@ -64,13 +64,13 @@ void SystemMgr::LoadScriptTexts()
do
{
Field* pFields = result->Fetch();
- StringTextData pTemp;
+ StringTextData temp;
int32 iId = pFields[0].GetInt32();
- pTemp.uiSoundId = pFields[1].GetUInt32();
- pTemp.uiType = pFields[2].GetUInt32();
- pTemp.uiLanguage = pFields[3].GetUInt32();
- pTemp.uiEmote = pFields[4].GetUInt32();
+ temp.uiSoundId = pFields[1].GetUInt32();
+ temp.uiType = pFields[2].GetUInt32();
+ temp.uiLanguage = pFields[3].GetUInt32();
+ temp.uiEmote = pFields[4].GetUInt32();
if (iId >= 0)
{
@@ -84,19 +84,19 @@ void SystemMgr::LoadScriptTexts()
continue;
}
- if (pTemp.uiSoundId)
+ if (temp.uiSoundId)
{
- if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId))
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId);
+ if (!GetSoundEntriesStore()->LookupEntry(temp.uiSoundId))
+ sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
}
- if (!GetLanguageDescByID(pTemp.uiLanguage))
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage);
+ if (!GetLanguageDescByID(temp.uiLanguage))
+ sLog->outErrorDb("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
- if (pTemp.uiType > CHAT_TYPE_ZONE_YELL)
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType);
+ if (temp.uiType > CHAT_TYPE_ZONE_YELL)
+ sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
- m_mTextDataMap[iId] = pTemp;
+ m_mTextDataMap[iId] = temp;
++uiCount;
} while (result->NextRow());
@@ -125,13 +125,13 @@ void SystemMgr::LoadScriptTextsCustom()
do
{
Field* pFields = result->Fetch();
- StringTextData pTemp;
+ StringTextData temp;
int32 iId = pFields[0].GetInt32();
- pTemp.uiSoundId = pFields[1].GetUInt32();
- pTemp.uiType = pFields[2].GetUInt32();
- pTemp.uiLanguage = pFields[3].GetUInt32();
- pTemp.uiEmote = pFields[4].GetUInt32();
+ temp.uiSoundId = pFields[1].GetUInt32();
+ temp.uiType = pFields[2].GetUInt32();
+ temp.uiLanguage = pFields[3].GetUInt32();
+ temp.uiEmote = pFields[4].GetUInt32();
if (iId >= 0)
{
@@ -145,19 +145,19 @@ void SystemMgr::LoadScriptTextsCustom()
continue;
}
- if (pTemp.uiSoundId)
+ if (temp.uiSoundId)
{
- if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId))
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId);
+ if (!GetSoundEntriesStore()->LookupEntry(temp.uiSoundId))
+ sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
}
- if (!GetLanguageDescByID(pTemp.uiLanguage))
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage);
+ if (!GetLanguageDescByID(temp.uiLanguage))
+ sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
- if (pTemp.uiType > CHAT_TYPE_ZONE_YELL)
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType);
+ if (temp.uiType > CHAT_TYPE_ZONE_YELL)
+ sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
- m_mTextDataMap[iId] = pTemp;
+ m_mTextDataMap[iId] = temp;
++uiCount;
} while (result->NextRow());
@@ -195,28 +195,28 @@ void SystemMgr::LoadScriptWaypoints()
do
{
Field* pFields = result->Fetch();
- ScriptPointMove pTemp;
+ ScriptPointMove temp;
- pTemp.uiCreatureEntry = pFields[0].GetUInt32();
- uint32 uiEntry = pTemp.uiCreatureEntry;
- pTemp.uiPointId = pFields[1].GetUInt32();
- pTemp.fX = pFields[2].GetFloat();
- pTemp.fY = pFields[3].GetFloat();
- pTemp.fZ = pFields[4].GetFloat();
- pTemp.uiWaitTime = pFields[5].GetUInt32();
+ temp.uiCreatureEntry = pFields[0].GetUInt32();
+ uint32 uiEntry = temp.uiCreatureEntry;
+ temp.uiPointId = pFields[1].GetUInt32();
+ temp.fX = pFields[2].GetFloat();
+ temp.fY = pFields[3].GetFloat();
+ temp.fZ = pFields[4].GetFloat();
+ temp.uiWaitTime = pFields[5].GetUInt32();
- CreatureTemplate const* pCInfo = sObjectMgr->GetCreatureTemplate(pTemp.uiCreatureEntry);
+ CreatureTemplate const* pCInfo = sObjectMgr->GetCreatureTemplate(temp.uiCreatureEntry);
if (!pCInfo)
{
- sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.uiCreatureEntry);
+ sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", temp.uiCreatureEntry);
continue;
}
if (!pCInfo->ScriptID)
- sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.uiCreatureEntry);
+ sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", temp.uiCreatureEntry);
- m_mPointMoveMap[uiEntry].push_back(pTemp);
+ m_mPointMoveMap[uiEntry].push_back(temp);
++count;
} while (result->NextRow());
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index ee4b771f6fe..926a2280d18 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -257,16 +257,16 @@ void Spell::EffectResurrectNew(SpellEffIndex effIndex)
if (!unitTarget->IsInWorld())
return;
- Player* pTarget = unitTarget->ToPlayer();
+ Player* target = unitTarget->ToPlayer();
- if (pTarget->isRessurectRequested()) // already have one active request
+ if (target->isRessurectRequested()) // already have one active request
return;
uint32 health = damage;
uint32 mana = m_spellInfo->Effects[effIndex].MiscValue;
- ExecuteLogEffectResurrect(effIndex, pTarget);
- pTarget->setResurrectRequestData(m_caster->GetGUID(), m_caster->GetMapId(), m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), health, mana);
- SendResurrectRequest(pTarget);
+ ExecuteLogEffectResurrect(effIndex, target);
+ target->setResurrectRequestData(m_caster->GetGUID(), m_caster->GetMapId(), m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), health, mana);
+ SendResurrectRequest(target);
}
void Spell::EffectInstaKill(SpellEffIndex /*effIndex*/)
@@ -1922,18 +1922,18 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
}
break;
case 66550: // teleports outside (Isle of Conquest)
- if (Player* pTarget = unitTarget->ToPlayer())
+ if (Player* target = unitTarget->ToPlayer())
{
- if (pTarget->GetTeamId() == TEAM_ALLIANCE)
+ if (target->GetTeamId() == TEAM_ALLIANCE)
m_targets.SetDst(442.24f, -835.25f, 44.30f, 0.06f, 628);
else
m_targets.SetDst(1120.43f, -762.11f, 47.92f, 2.94f, 628);
}
break;
case 66551: // teleports inside (Isle of Conquest)
- if (Player* pTarget = unitTarget->ToPlayer())
+ if (Player* target = unitTarget->ToPlayer())
{
- if (pTarget->GetTeamId() == TEAM_ALLIANCE)
+ if (target->GetTeamId() == TEAM_ALLIANCE)
m_targets.SetDst(389.57f, -832.38f, 48.65f, 3.00f, 628);
else
m_targets.SetDst(1174.85f, -763.24f, 48.72f, 6.26f, 628);
@@ -5625,23 +5625,23 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)
if (!sWorld->getBoolConfig(CONFIG_CAST_UNSTUCK))
return;
- Player* pTarget = (Player*)m_caster;
+ Player* target = (Player*)m_caster;
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell Effect: Stuck");
- sLog->outDetail("Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", pTarget->GetName(), pTarget->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ());
+ sLog->outDetail("Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", target->GetName(), target->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
- if (pTarget->isInFlight())
+ if (target->isInFlight())
return;
- pTarget->TeleportTo(pTarget->GetStartPosition(), m_caster == m_caster ? TELE_TO_SPELL : 0);
+ target->TeleportTo(target->GetStartPosition(), m_caster == m_caster ? TELE_TO_SPELL : 0);
// homebind location is loaded always
- // pTarget->TeleportTo(pTarget->m_homebindMapId, pTarget->m_homebindX, pTarget->m_homebindY, pTarget->m_homebindZ, pTarget->GetOrientation(), (m_caster == m_caster ? TELE_TO_SPELL : 0));
+ // target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation(), (m_caster == m_caster ? TELE_TO_SPELL : 0));
// Stuck spell trigger Hearthstone cooldown
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(8690);
if (!spellInfo)
return;
- Spell spell(pTarget, spellInfo, TRIGGERED_FULL_MASK);
+ Spell spell(target, spellInfo, TRIGGERED_FULL_MASK);
spell.SendSpellCooldown();
}
@@ -5983,18 +5983,18 @@ void Spell::EffectResurrect(SpellEffIndex effIndex)
break;
}
- Player* pTarget = unitTarget->ToPlayer();
+ Player* target = unitTarget->ToPlayer();
- if (pTarget->isRessurectRequested()) // already have one active request
+ if (target->isRessurectRequested()) // already have one active request
return;
- uint32 health = pTarget->CountPctFromMaxHealth(damage);
- uint32 mana = CalculatePctN(pTarget->GetMaxPower(POWER_MANA), damage);
+ uint32 health = target->CountPctFromMaxHealth(damage);
+ uint32 mana = CalculatePctN(target->GetMaxPower(POWER_MANA), damage);
- ExecuteLogEffectResurrect(effIndex, pTarget);
+ ExecuteLogEffectResurrect(effIndex, target);
- pTarget->setResurrectRequestData(m_caster->GetGUID(), m_caster->GetMapId(), m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), health, mana);
- SendResurrectRequest(pTarget);
+ target->setResurrectRequestData(m_caster->GetGUID(), m_caster->GetMapId(), m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), health, mana);
+ SendResurrectRequest(target);
}
void Spell::EffectAddExtraAttacks(SpellEffIndex effIndex)
@@ -6291,9 +6291,9 @@ void Spell::EffectQuestClear(SpellEffIndex effIndex)
uint32 quest_id = m_spellInfo->Effects[effIndex].MiscValue;
- Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id);
+ Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id);
- if (!pQuest)
+ if (!quest)
return;
// Player has never done this quest