Merge pull request #3400 from Bootz/master
REPO: Code-Style fixes... (Part duece)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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() ||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,7 +260,7 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MapInstanced::CanEnter(Player* /*player*/)
|
||||
bool Mainstanced::CanEnter(Player* /*player*/)
|
||||
{
|
||||
//ASSERT(false);
|
||||
return true;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -66,9 +66,9 @@ public:
|
||||
|
||||
uint32 entry = atol(cId);
|
||||
|
||||
Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry);
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(entry);
|
||||
|
||||
if (!pQuest)
|
||||
if (!quest)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -87,9 +87,9 @@ public:
|
||||
}
|
||||
|
||||
// ok, normal (creature/GO starting) quest
|
||||
if (player->CanAddQuest(pQuest, true))
|
||||
if (player->CanAddQuest(quest, true))
|
||||
{
|
||||
player->AddQuest(pQuest, NULL);
|
||||
player->AddQuest(quest, NULL);
|
||||
|
||||
if (player->CanCompleteQuest(entry))
|
||||
player->CompleteQuest(entry);
|
||||
@@ -116,9 +116,9 @@ public:
|
||||
|
||||
uint32 entry = atol(cId);
|
||||
|
||||
Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry);
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(entry);
|
||||
|
||||
if (!pQuest)
|
||||
if (!quest)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -163,10 +163,10 @@ public:
|
||||
|
||||
uint32 entry = atol(cId);
|
||||
|
||||
Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry);
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(entry);
|
||||
|
||||
// If player doesn't have the quest
|
||||
if (!pQuest || player->GetQuestStatus(entry) == QUEST_STATUS_NONE)
|
||||
if (!quest || player->GetQuestStatus(entry) == QUEST_STATUS_NONE)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -176,8 +176,8 @@ public:
|
||||
// Add quest items for quests that require items
|
||||
for (uint8 x = 0; x < QUEST_ITEM_OBJECTIVES_COUNT; ++x)
|
||||
{
|
||||
uint32 id = pQuest->ReqItemId[x];
|
||||
uint32 count = pQuest->ReqItemCount[x];
|
||||
uint32 id = quest->ReqItemId[x];
|
||||
uint32 count = quest->ReqItemCount[x];
|
||||
if (!id || !count)
|
||||
continue;
|
||||
|
||||
@@ -195,10 +195,10 @@ public:
|
||||
// All creature/GO slain/casted (not required, but otherwise it will display "Creature slain 0/10")
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
int32 creature = pQuest->ReqCreatureOrGOId[i];
|
||||
uint32 creaturecount = pQuest->ReqCreatureOrGOCount[i];
|
||||
int32 creature = quest->ReqCreatureOrGOId[i];
|
||||
uint32 creaturecount = quest->ReqCreatureOrGOCount[i];
|
||||
|
||||
if (uint32 spell_id = pQuest->ReqSpell[i])
|
||||
if (uint32 spell_id = quest->ReqSpell[i])
|
||||
{
|
||||
for (uint16 z = 0; z < creaturecount; ++z)
|
||||
player->CastedCreatureOrGO(creature, 0, spell_id);
|
||||
@@ -217,9 +217,9 @@ public:
|
||||
}
|
||||
|
||||
// If the quest requires reputation to complete
|
||||
if (uint32 repFaction = pQuest->GetRepObjectiveFaction())
|
||||
if (uint32 repFaction = quest->GetRepObjectiveFaction())
|
||||
{
|
||||
uint32 repValue = pQuest->GetRepObjectiveValue();
|
||||
uint32 repValue = quest->GetRepObjectiveValue();
|
||||
uint32 curRep = player->GetReputationMgr().GetReputation(repFaction);
|
||||
if (curRep < repValue)
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(repFaction))
|
||||
@@ -227,9 +227,9 @@ public:
|
||||
}
|
||||
|
||||
// If the quest requires a SECOND reputation to complete
|
||||
if (uint32 repFaction = pQuest->GetRepObjectiveFaction2())
|
||||
if (uint32 repFaction = quest->GetRepObjectiveFaction2())
|
||||
{
|
||||
uint32 repValue2 = pQuest->GetRepObjectiveValue2();
|
||||
uint32 repValue2 = quest->GetRepObjectiveValue2();
|
||||
uint32 curRep = player->GetReputationMgr().GetReputation(repFaction);
|
||||
if (curRep < repValue2)
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(repFaction))
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
}
|
||||
|
||||
// If the quest requires money
|
||||
int32 ReqOrRewMoney = pQuest->GetRewOrReqMoney();
|
||||
int32 ReqOrRewMoney = quest->GetRewOrReqMoney();
|
||||
if (ReqOrRewMoney < 0)
|
||||
player->ModifyMoney(-ReqOrRewMoney);
|
||||
|
||||
|
||||
@@ -49,19 +49,19 @@ class go_shadowforge_brazier : public GameObjectScript
|
||||
public:
|
||||
go_shadowforge_brazier() : GameObjectScript("go_shadowforge_brazier") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* pGo)
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go)
|
||||
{
|
||||
if (InstanceScript* pInstance = pGo->GetInstanceScript())
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
{
|
||||
if (pInstance->GetData(TYPE_LYCEUM) == IN_PROGRESS)
|
||||
pInstance->SetData(TYPE_LYCEUM, DONE);
|
||||
if (instance->GetData(TYPE_LYCEUM) == IN_PROGRESS)
|
||||
instance->SetData(TYPE_LYCEUM, DONE);
|
||||
else
|
||||
pInstance->SetData(TYPE_LYCEUM, IN_PROGRESS);
|
||||
instance->SetData(TYPE_LYCEUM, IN_PROGRESS);
|
||||
// If used brazier open linked doors (North or South)
|
||||
if (pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_N))
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GOLEM_DOOR_N), true);
|
||||
else if (pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_S))
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GOLEM_DOOR_S), true);
|
||||
if (go->GetGUID() == instance->GetData64(DATA_SF_BRAZIER_N))
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GOLEM_DOOR_N), true);
|
||||
else if (go->GetGUID() == instance->GetData64(DATA_SF_BRAZIER_S))
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GOLEM_DOOR_S), true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -108,12 +108,12 @@ public:
|
||||
|
||||
bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/)
|
||||
{
|
||||
if (InstanceScript* pInstance = player->GetInstanceScript())
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
{
|
||||
if (pInstance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || pInstance->GetData(TYPE_RING_OF_LAW) == DONE)
|
||||
if (instance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || instance->GetData(TYPE_RING_OF_LAW) == DONE)
|
||||
return false;
|
||||
|
||||
pInstance->SetData(TYPE_RING_OF_LAW, IN_PROGRESS);
|
||||
instance->SetData(TYPE_RING_OF_LAW, IN_PROGRESS);
|
||||
player->SummonCreature(NPC_GRIMSTONE, 625.559f, -205.618f, -52.735f, 2.609f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
|
||||
return false;
|
||||
@@ -152,11 +152,11 @@ public:
|
||||
{
|
||||
npc_grimstoneAI(Creature* c) : npc_escortAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
MobSpawnId = rand()%6;
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint8 EventPhase;
|
||||
uint32 Event_Timer;
|
||||
@@ -235,10 +235,10 @@ public:
|
||||
Event_Timer = 5000;
|
||||
break;
|
||||
case 5:
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me);
|
||||
pInstance->SetData(TYPE_RING_OF_LAW, DONE);
|
||||
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me);
|
||||
instance->SetData(TYPE_RING_OF_LAW, DONE);
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete.");
|
||||
}
|
||||
break;
|
||||
@@ -247,12 +247,12 @@ public:
|
||||
|
||||
void HandleGameObject(uint32 id, bool open)
|
||||
{
|
||||
pInstance->HandleGameObject(pInstance->GetData64(id), open);
|
||||
instance->HandleGameObject(instance->GetData64(id), open);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (MobDeath_Timer)
|
||||
@@ -641,14 +641,14 @@ public:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(false, true, player->GetGUID());
|
||||
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
pInstance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS)
|
||||
if (player->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUGHAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
player->SEND_GOSSIP_MENU(2846, creature->GetGUID());
|
||||
@@ -665,12 +665,12 @@ public:
|
||||
switch (i)
|
||||
{
|
||||
case 0:me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break;
|
||||
case 1:pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break;
|
||||
case 1:instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break;
|
||||
case 2:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
|
||||
instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -685,14 +685,14 @@ public:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
|
||||
instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
|
||||
if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED)
|
||||
if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
|
||||
if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED)
|
||||
{
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -765,10 +765,10 @@ public:
|
||||
{
|
||||
if (quest->GetQuestId() == 4322)
|
||||
{PlayerStart = player;
|
||||
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
{
|
||||
CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
|
||||
pInstance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
creature->setFaction(11);
|
||||
}
|
||||
|
||||
@@ -780,7 +780,7 @@ public:
|
||||
{
|
||||
npc_marshal_windsorAI(Creature* c) : npc_escortAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
@@ -800,13 +800,13 @@ public:
|
||||
break;
|
||||
case 12:
|
||||
me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID);
|
||||
pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
break;
|
||||
case 13:
|
||||
me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
|
||||
break;
|
||||
case 14:
|
||||
pInstance->SetData(DATA_GATE_SR, 0);
|
||||
instance->SetData(DATA_GATE_SR, 0);
|
||||
me->setFaction(11);
|
||||
break;
|
||||
case 16:
|
||||
@@ -816,14 +816,14 @@ public:
|
||||
me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
|
||||
break;
|
||||
case 18:
|
||||
pInstance->SetData(DATA_GATE_SC, 0);
|
||||
instance->SetData(DATA_GATE_SC, 0);
|
||||
break;
|
||||
case 19:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED);
|
||||
instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -842,25 +842,25 @@ public:
|
||||
|
||||
void JustDied(Unit* slayer)
|
||||
{
|
||||
pInstance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_FAILED);
|
||||
instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_FAILED);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
|
||||
if (pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED)
|
||||
if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
|
||||
if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED)
|
||||
SetEscortPaused(false);
|
||||
if (!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
if (!instance->GetData(DATA_GATE_D) && instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
{
|
||||
me->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID);
|
||||
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START);
|
||||
instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START);
|
||||
}
|
||||
if (pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED)
|
||||
if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED)
|
||||
{
|
||||
me->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID);
|
||||
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
|
||||
instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
|
||||
}
|
||||
if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED)
|
||||
if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED)
|
||||
{
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -1009,7 +1009,7 @@ public:
|
||||
case 32:
|
||||
me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID);
|
||||
PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me);
|
||||
pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED);
|
||||
instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1046,53 +1046,53 @@ public:
|
||||
|
||||
void JustDied(Unit* slayer)
|
||||
{
|
||||
pInstance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_FAILED);
|
||||
instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_FAILED);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
|
||||
if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
|
||||
if (wp == 7)
|
||||
{
|
||||
if (!pInstance->GetData(DATA_GATE_J) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
if (!instance->GetData(DATA_GATE_J) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
{
|
||||
pInstance->SetData(DATA_CREATURE_JAZ, 1);
|
||||
pInstance->SetData(DATA_JAZ, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
instance->SetData(DATA_CREATURE_JAZ, 1);
|
||||
instance->SetData(DATA_JAZ, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
}
|
||||
if (pInstance->GetData(DATA_CREATURE_JAZ) && pInstance->GetData(DATA_CREATURE_OGRABISI) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS)
|
||||
if (instance->GetData(DATA_CREATURE_JAZ) && instance->GetData(DATA_CREATURE_OGRABISI) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS)
|
||||
{
|
||||
SetEscortPaused(false);
|
||||
pInstance->SetData(DATA_JAZ, ENCOUNTER_STATE_ENDED);
|
||||
instance->SetData(DATA_JAZ, ENCOUNTER_STATE_ENDED);
|
||||
}
|
||||
}
|
||||
else if (wp == 11)
|
||||
{
|
||||
if (!pInstance->GetData(DATA_GATE_S) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
if (!instance->GetData(DATA_GATE_S) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
{
|
||||
pInstance->SetData(DATA_CREATURE_SHILL, 1);
|
||||
pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
instance->SetData(DATA_CREATURE_SHILL, 1);
|
||||
instance->SetData(DATA_SHILL, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
}
|
||||
if (pInstance->GetData(DATA_CREATURE_SHILL) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS)
|
||||
if (instance->GetData(DATA_CREATURE_SHILL) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS)
|
||||
{
|
||||
pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED);
|
||||
instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED);
|
||||
SetEscortPaused(false);
|
||||
}
|
||||
}
|
||||
else if (wp == 20)
|
||||
{
|
||||
if (!pInstance->GetData(DATA_GATE_C) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
if (!instance->GetData(DATA_GATE_C) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
{
|
||||
pInstance->SetData(DATA_CREATURE_CREST, 1);
|
||||
instance->SetData(DATA_CREATURE_CREST, 1);
|
||||
me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID);
|
||||
pInstance->SetData(DATA_CREST, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
instance->SetData(DATA_CREST, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
}
|
||||
if (pInstance->GetData(DATA_CREATURE_CREST) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS)
|
||||
if (instance->GetData(DATA_CREATURE_CREST) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS)
|
||||
{
|
||||
SetEscortPaused(false);
|
||||
pInstance->SetData(DATA_CREST, ENCOUNTER_STATE_ENDED);
|
||||
instance->SetData(DATA_CREST, ENCOUNTER_STATE_ENDED);
|
||||
}
|
||||
}
|
||||
if (pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false);
|
||||
if (instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false);
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
@@ -1131,14 +1131,14 @@ public:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(false, true, player->GetGUID());
|
||||
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
pInstance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_IN_PROGRESS);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS)
|
||||
if (player->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Get out of here, Tobias, you're free!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
player->SEND_GOSSIP_MENU(2847, creature->GetGUID());
|
||||
@@ -1160,7 +1160,7 @@ public:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pInstance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED);
|
||||
instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1170,20 +1170,20 @@ public:
|
||||
{
|
||||
case 0:me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break;
|
||||
case 2:
|
||||
pInstance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break;
|
||||
instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break;
|
||||
case 4:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pInstance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED);
|
||||
instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
|
||||
if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED)
|
||||
if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
|
||||
if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED)
|
||||
{
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -1265,10 +1265,10 @@ public:
|
||||
{
|
||||
npc_rocknotAI(Creature* c) : npc_escortAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 BreakKeg_Timer;
|
||||
uint32 BreakDoor_Timer;
|
||||
@@ -1284,13 +1284,13 @@ public:
|
||||
|
||||
void DoGo(uint32 id, uint32 state)
|
||||
{
|
||||
if (GameObject* pGo = pInstance->instance->GetGameObject(pInstance->GetData64(id)))
|
||||
pGo->SetGoState((GOState)state);
|
||||
if (GameObject* go = instance->instance->GetGameObject(instance->GetData64(id)))
|
||||
go->SetGoState((GOState)state);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (i)
|
||||
@@ -1316,7 +1316,7 @@ public:
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (BreakKeg_Timer)
|
||||
@@ -1337,12 +1337,12 @@ public:
|
||||
DoGo(DATA_GO_BAR_KEG_TRAP, 0); //doesn't work very well, leaving code here for future
|
||||
//spell by trap has effect61, this indicate the bar go hostile
|
||||
|
||||
if (Unit* tmp = Unit::GetUnit(*me, pInstance->GetData64(DATA_PHALANX)))
|
||||
if (Unit* tmp = Unit::GetUnit(*me, instance->GetData64(DATA_PHALANX)))
|
||||
tmp->setFaction(14);
|
||||
|
||||
//for later, this event(s) has alot more to it.
|
||||
//optionally, DONE can trigger bar to go hostile.
|
||||
pInstance->SetData(TYPE_BAR, DONE);
|
||||
instance->SetData(TYPE_BAR, DONE);
|
||||
|
||||
BreakDoor_Timer = 0;
|
||||
} else BreakDoor_Timer -= diff;
|
||||
|
||||
@@ -91,8 +91,8 @@ public:
|
||||
// When he die open door to last chamber
|
||||
void JustDied(Unit* who)
|
||||
{
|
||||
if (InstanceScript* pInstance = who->GetInstanceScript())
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_THRONE_DOOR), true);
|
||||
if (InstanceScript* instance = who->GetInstanceScript())
|
||||
instance->HandleGameObject(instance->GetData64(DATA_THRONE_DOOR), true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@ public:
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+22:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
//are 5 minutes expected? go template may have data to despawn when used at quest
|
||||
pInstance->DoRespawnGameObject(pInstance->GetData64(DATA_GO_CHALICE), MINUTE*5);
|
||||
instance->DoRespawnGameObject(instance->GetData64(DATA_GO_CHALICE), MINUTE*5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -127,9 +127,9 @@ public:
|
||||
creature->setFaction(FACTION_HOSTILE);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
creature->AI()->AttackStart(player);
|
||||
InstanceScript* pInstance = creature->GetInstanceScript();
|
||||
if (pInstance)
|
||||
pInstance->SetData64(DATA_EVENSTARTER, player->GetGUID());
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
instance->SetData64(DATA_EVENSTARTER, player->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
@@ -152,10 +152,10 @@ public:
|
||||
{
|
||||
boss_doomrelAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
uint32 ShadowVolley_Timer;
|
||||
uint32 Immolate_Timer;
|
||||
uint32 CurseOfWeakness_Timer;
|
||||
@@ -175,9 +175,9 @@ public:
|
||||
// was set before event start, so set again
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_GHOSTKILL) >= 7)
|
||||
if (instance->GetData(DATA_GHOSTKILL) >= 7)
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
else
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
@@ -197,14 +197,14 @@ public:
|
||||
if (me->isAlive())
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
me->SetLootRecipient(NULL);
|
||||
if (pInstance)
|
||||
pInstance->SetData64(DATA_EVENSTARTER, 0);
|
||||
if (instance)
|
||||
instance->SetData64(DATA_EVENSTARTER, 0);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_GHOSTKILL, 1);
|
||||
if (instance)
|
||||
instance->SetData(DATA_GHOSTKILL, 1);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -73,14 +73,14 @@ class instance_blackrock_depths : public InstanceMapScript
|
||||
public:
|
||||
instance_blackrock_depths() : InstanceMapScript("instance_blackrock_depths", 230) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_blackrock_depths_InstanceMapScript(pMap);
|
||||
return new instance_blackrock_depths_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_blackrock_depths_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_blackrock_depths_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_blackrock_depths_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
&& unit->HasAura(SPELL_BROODAF_BRONZE)
|
||||
&& unit->HasAura(SPELL_BROODAF_GREEN))
|
||||
{
|
||||
//pTarget->RemoveAllAuras();
|
||||
//target->RemoveAllAuras();
|
||||
//DoCast(target, SPELL_CHROMATIC_MUT_1);
|
||||
|
||||
//Chromatic mutation is causing issues
|
||||
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
//We simply use this function to find players until we can use pMap->GetPlayers()
|
||||
//We simply use this function to find players until we can use map->GetPlayers()
|
||||
|
||||
if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who))
|
||||
{
|
||||
|
||||
@@ -51,10 +51,10 @@ public:
|
||||
{
|
||||
boss_mr_smiteAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
pInstance = creature->GetInstanceScript();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 uiTrashTimer;
|
||||
uint32 uiSlamTimer;
|
||||
@@ -126,11 +126,11 @@ public:
|
||||
++uiHealth;
|
||||
DoCastAOE(SPELL_SMITE_STOMP, false);
|
||||
SetCombatMovement(false);
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_SMITE_CHEST)))
|
||||
if (instance)
|
||||
if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_SMITE_CHEST)))
|
||||
{
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(1, pGo->GetPositionX() - 3.0f, pGo->GetPositionY(), pGo->GetPositionZ());
|
||||
me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,18 +38,18 @@ public:
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
|
||||
{
|
||||
InstanceScript* pInstance = player->GetInstanceScript();
|
||||
InstanceScript* instance = player->GetInstanceScript();
|
||||
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
{
|
||||
player->GetSession()->SendNotification("Instance script not initialized");
|
||||
return true;
|
||||
}
|
||||
if (pInstance->GetData(EVENT_STATE)!= CANNON_NOT_USED)
|
||||
if (instance->GetData(EVENT_STATE)!= CANNON_NOT_USED)
|
||||
return false;
|
||||
if (targets.GetGOTarget() && targets.GetGOTarget()->GetEntry() == GO_DEFIAS_CANNON)
|
||||
{
|
||||
pInstance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED);
|
||||
instance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED);
|
||||
}
|
||||
|
||||
player->DestroyItemCount(item->GetEntry(), 1, true);
|
||||
|
||||
@@ -53,7 +53,7 @@ class instance_deadmines : public InstanceMapScript
|
||||
|
||||
struct instance_deadmines_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_deadmines_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_deadmines_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint64 FactoryDoorGUID;
|
||||
uint64 IronCladDoorGUID;
|
||||
@@ -251,9 +251,9 @@ class instance_deadmines : public InstanceMapScript
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_deadmines_InstanceMapScript(pMap);
|
||||
return new instance_deadmines_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -113,9 +113,9 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
InstanceScript* pInstance = creature->GetInstanceScript();
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
|
||||
if (pInstance && pInstance->GetData(TYPE_EVENT) == NOT_STARTED)
|
||||
if (instance && instance->GetData(TYPE_EVENT) == NOT_STARTED)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXT_EMI, creature->GetGUID());
|
||||
@@ -127,12 +127,12 @@ public:
|
||||
{
|
||||
npc_blastmaster_emi_shortfuseAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
pInstance = creature->GetInstanceScript();
|
||||
instance = creature->GetInstanceScript();
|
||||
creature->RestoreFaction();
|
||||
Reset();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint8 uiPhase;
|
||||
uint32 uiTimer;
|
||||
@@ -170,63 +170,63 @@ public:
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
|
||||
{
|
||||
if (GameObject* pGo = GameObject::GetGameObject(*me, *itr))
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, *itr))
|
||||
{
|
||||
if (pGo)
|
||||
if (go)
|
||||
{
|
||||
if (Creature* trigger = pGo->SummonTrigger(pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), 0, 1))
|
||||
if (Creature* trigger = go->SummonTrigger(go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, 1))
|
||||
{
|
||||
//visual effects are not working!
|
||||
trigger->CastSpell(trigger, 11542, true);
|
||||
trigger->CastSpell(trigger, 35470, true);
|
||||
}
|
||||
pGo->RemoveFromWorld();
|
||||
//pGo->CastSpell(me, 12158); makes all die?!
|
||||
go->RemoveFromWorld();
|
||||
//go->CastSpell(me, 12158); makes all die?!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bBool)
|
||||
{
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
pInstance->HandleGameObject(0, false, pGo);
|
||||
if (instance)
|
||||
if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
instance->HandleGameObject(0, false, go);
|
||||
}else
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
pInstance->HandleGameObject(0, false, pGo);
|
||||
if (instance)
|
||||
if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
instance->HandleGameObject(0, false, go);
|
||||
}
|
||||
|
||||
void SetInFace(bool bBool)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (bBool)
|
||||
{
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
me->SetFacingToObject(pGo);
|
||||
if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
me->SetFacingToObject(go);
|
||||
}else
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
me->SetFacingToObject(pGo);
|
||||
if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
me->SetFacingToObject(go);
|
||||
}
|
||||
|
||||
void RestoreAll()
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
pInstance->HandleGameObject(0, false, pGo);
|
||||
if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
instance->HandleGameObject(0, false, go);
|
||||
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
pInstance->HandleGameObject(0, false, pGo);
|
||||
if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
instance->HandleGameObject(0, false, go);
|
||||
|
||||
if (!GoSummonList.empty())
|
||||
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
|
||||
{
|
||||
if (GameObject* pGo = GameObject::GetGameObject(*me, *itr))
|
||||
pGo->RemoveFromWorld();
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, *itr))
|
||||
go->RemoveFromWorld();
|
||||
}
|
||||
|
||||
if (!SummonList.empty())
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void AggroAllPlayers(Creature* pTemp)
|
||||
void AggroAllPlayers(Creature* temp)
|
||||
{
|
||||
Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
|
||||
|
||||
@@ -258,9 +258,9 @@ public:
|
||||
|
||||
if (player->isAlive())
|
||||
{
|
||||
pTemp->SetInCombatWith(player);
|
||||
player->SetInCombatWith(pTemp);
|
||||
pTemp->AddThreat(player, 0.0f);
|
||||
temp->SetInCombatWith(player);
|
||||
player->SetInCombatWith(temp);
|
||||
temp->AddThreat(player, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -320,16 +320,16 @@ public:
|
||||
NextStep(1500, true);
|
||||
break;
|
||||
case 2:
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (uiValue)
|
||||
{
|
||||
case 1:
|
||||
pInstance->SetData(TYPE_EVENT, IN_PROGRESS);
|
||||
instance->SetData(TYPE_EVENT, IN_PROGRESS);
|
||||
break;
|
||||
case 2:
|
||||
pInstance->SetData(TYPE_EVENT, DONE);
|
||||
instance->SetData(TYPE_EVENT, DONE);
|
||||
NextStep(5000, false, 22);
|
||||
break;
|
||||
}
|
||||
@@ -354,10 +354,10 @@ public:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
case 2:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -533.140f, -105.322f, -156.016f, 0, 0, 0, 0, 0, 1000))
|
||||
if (GameObject* go = me->SummonGameObject(183410, -533.140f, -105.322f, -156.016f, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
|
||||
GoSummonList.push_back(go->GetGUID());
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
|
||||
}
|
||||
Summon(3);
|
||||
break;
|
||||
@@ -369,10 +369,10 @@ public:
|
||||
DoScriptText(SAY_BLASTMASTER_19, me);
|
||||
break;
|
||||
case 4:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -542.199f, -96.854f, -155.790f, 0, 0, 0, 0, 0, 1000))
|
||||
if (GameObject* go = me->SummonGameObject(183410, -542.199f, -96.854f, -155.790f, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
GoSummonList.push_back(go->GetGUID());
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
@@ -389,18 +389,18 @@ public:
|
||||
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
|
||||
break;
|
||||
case 7:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -507.820f, -103.333f, -151.353f, 0, 0, 0, 0, 0, 1000))
|
||||
if (GameObject* go = me->SummonGameObject(183410, -507.820f, -103.333f, -151.353f, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
|
||||
GoSummonList.push_back(go->GetGUID());
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
|
||||
Summon(6);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (GameObject* pGo = me->SummonGameObject(183410, -511.829f, -86.249f, -151.431f, 0, 0, 0, 0, 0, 1000))
|
||||
if (GameObject* go = me->SummonGameObject(183410, -511.829f, -86.249f, -151.431f, 0, 0, 0, 0, 0, 1000))
|
||||
{
|
||||
GoSummonList.push_back(pGo->GetGUID());
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
|
||||
GoSummonList.push_back(go->GetGUID());
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
@@ -444,9 +444,9 @@ public:
|
||||
SetInFace(true);
|
||||
DoScriptText(SAY_BLASTMASTER_5, me);
|
||||
Summon(1);
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
pInstance->HandleGameObject(0, true, pGo);
|
||||
if (instance)
|
||||
if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
instance->HandleGameObject(0, true, go);
|
||||
NextStep(3000, true);
|
||||
break;
|
||||
case 7:
|
||||
@@ -490,9 +490,9 @@ public:
|
||||
case 16:
|
||||
DoScriptText(SAY_BLASTMASTER_23, me);
|
||||
SetInFace(false);
|
||||
if (pInstance)
|
||||
if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
pInstance->HandleGameObject(0, true, pGo);
|
||||
if (instance)
|
||||
if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
instance->HandleGameObject(0, true, go);
|
||||
NextStep(2000, true);
|
||||
break;
|
||||
case 17:
|
||||
|
||||
@@ -25,14 +25,14 @@ class instance_gnomeregan : public InstanceMapScript
|
||||
public:
|
||||
instance_gnomeregan() : InstanceMapScript("instance_gnomeregan", 90) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_gnomeregan_InstanceMapScript(pMap);
|
||||
return new instance_gnomeregan_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_gnomeregan_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_gnomeregan_InstanceMapScript(Map* pMap) : InstanceScript(pMap)
|
||||
instance_gnomeregan_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -78,10 +78,10 @@ public:
|
||||
{
|
||||
AddId[i] = 0;
|
||||
}
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 AddGUID[4];
|
||||
|
||||
@@ -110,14 +110,14 @@ public:
|
||||
SpawnAdds();
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_MOROES, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MOROES, NOT_STARTED);
|
||||
}
|
||||
|
||||
void StartEvent()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_MOROES, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MOROES, IN_PROGRESS);
|
||||
|
||||
DoZoneInCombat();
|
||||
}
|
||||
@@ -140,14 +140,14 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_MOROES, DONE);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MOROES, DONE);
|
||||
|
||||
DeSpawnAdds();
|
||||
|
||||
//remove aura from spell Garrote when Moroes dies
|
||||
if (pInstance)
|
||||
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE);
|
||||
if (instance)
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE);
|
||||
}
|
||||
|
||||
void SpawnAdds()
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (pInstance && !pInstance->GetData(TYPE_MOROES))
|
||||
if (instance && !instance->GetData(TYPE_MOROES))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
|
||||
struct boss_moroes_guestAI : public ScriptedAI
|
||||
{
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 GuestGUID[4];
|
||||
|
||||
@@ -327,21 +327,21 @@ struct boss_moroes_guestAI : public ScriptedAI
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
GuestGUID[i] = 0;
|
||||
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_MOROES, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MOROES, NOT_STARTED);
|
||||
}
|
||||
|
||||
void AcquireGUID()
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
uint64 MoroesGUID = pInstance->GetData64(DATA_MOROES);
|
||||
uint64 MoroesGUID = instance->GetData64(DATA_MOROES);
|
||||
Creature* Moroes = (Unit::GetCreature((*me), MoroesGUID));
|
||||
if (Moroes)
|
||||
{
|
||||
@@ -369,7 +369,7 @@ struct boss_moroes_guestAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 /*diff*/)
|
||||
{
|
||||
if (pInstance && !pInstance->GetData(TYPE_MOROES))
|
||||
if (instance && !instance->GetData(TYPE_MOROES))
|
||||
EnterEvadeMode();
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
{
|
||||
boss_netherspiteAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
{
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
bool PortalPhase;
|
||||
bool Berserk;
|
||||
@@ -247,7 +247,7 @@ public:
|
||||
|
||||
void HandleDoors(bool open) // Massive Door switcher
|
||||
{
|
||||
if (GameObject* Door = GameObject::GetGameObject(*me, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
|
||||
if (GameObject* Door = GameObject::GetGameObject(*me, instance ? instance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
|
||||
Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,11 +72,11 @@ public:
|
||||
{
|
||||
boss_nightbaneAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
Intro = true;
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 Phase;
|
||||
|
||||
@@ -125,12 +125,12 @@ public:
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
me->setActive(true);
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
if (pInstance->GetData(TYPE_NIGHTBANE) == DONE || pInstance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_NIGHTBANE) == DONE || instance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
|
||||
me->DisappearAndDie();
|
||||
else
|
||||
pInstance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
|
||||
instance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
|
||||
}
|
||||
|
||||
HandleTerraceDoors(true);
|
||||
@@ -147,17 +147,17 @@ public:
|
||||
|
||||
void HandleTerraceDoors(bool open)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
|
||||
|
||||
HandleTerraceDoors(false);
|
||||
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0);
|
||||
@@ -171,8 +171,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_NIGHTBANE, DONE);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_NIGHTBANE, DONE);
|
||||
|
||||
HandleTerraceDoors(true);
|
||||
}
|
||||
|
||||
@@ -185,10 +185,10 @@ public:
|
||||
{
|
||||
boss_malchezaarAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
uint32 EnfeebleTimer;
|
||||
uint32 EnfeebleResetTimer;
|
||||
uint32 ShadowNovaTimer;
|
||||
@@ -234,8 +234,8 @@ public:
|
||||
SunderArmorTimer = urand(5000, 10000);
|
||||
phase = 1;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
if (instance)
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -255,16 +255,16 @@ public:
|
||||
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
|
||||
positions.push_back(&InfernalPoints[i]);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
if (instance)
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
|
||||
if (instance)
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
|
||||
}
|
||||
|
||||
void InfernalCleanup()
|
||||
|
||||
@@ -95,10 +95,10 @@ public:
|
||||
{
|
||||
boss_aranAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 SecondarySpellTimer;
|
||||
uint32 NormalCastTimer;
|
||||
@@ -149,11 +149,11 @@ public:
|
||||
Drinking = false;
|
||||
DrinkInturrupted = false;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
// Not in progress
|
||||
pInstance->SetData(TYPE_ARAN, NOT_STARTED);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
instance->SetData(TYPE_ARAN, NOT_STARTED);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,10 +166,10 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(TYPE_ARAN, DONE);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
instance->SetData(TYPE_ARAN, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,10 +177,10 @@ public:
|
||||
{
|
||||
DoScriptText(RAND(SAY_AGGRO1, SAY_AGGRO2, SAY_AGGRO3), me);
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(TYPE_ARAN, IN_PROGRESS);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
instance->SetData(TYPE_ARAN, IN_PROGRESS);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,9 +228,9 @@ public:
|
||||
{
|
||||
if (CloseDoorTimer <= diff)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
|
||||
CloseDoorTimer = 0;
|
||||
}
|
||||
} else CloseDoorTimer -= diff;
|
||||
|
||||
@@ -70,10 +70,10 @@ public:
|
||||
{
|
||||
mob_kilrekAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 TerestianGUID;
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
{
|
||||
ERROR_INST_DATA(me);
|
||||
return;
|
||||
@@ -96,9 +96,9 @@ public:
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN);
|
||||
uint64 TerestianGUID = instance->GetData64(DATA_TERESTIAN);
|
||||
if (TerestianGUID)
|
||||
{
|
||||
Unit* Terestian = Unit::GetUnit((*me), TerestianGUID);
|
||||
@@ -262,10 +262,10 @@ public:
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
PortalGUID[i] = 0;
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 PortalGUID[2];
|
||||
uint8 PortalsCount;
|
||||
@@ -303,8 +303,8 @@ public:
|
||||
SummonedPortals = false;
|
||||
Berserk = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_TERESTIAN, NOT_STARTED);
|
||||
|
||||
me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
|
||||
|
||||
@@ -359,8 +359,8 @@ public:
|
||||
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_TERESTIAN, DONE);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_TERESTIAN, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -88,11 +88,11 @@ EndScriptData */
|
||||
#define CREATURE_CYCLONE 18412
|
||||
#define CREATURE_CRONE 18168
|
||||
|
||||
void SummonCroneIfReady(InstanceScript* pInstance, Creature* creature)
|
||||
void SummonCroneIfReady(InstanceScript* instance, Creature* creature)
|
||||
{
|
||||
pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, SPECIAL); // Increment DeathCount
|
||||
instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, SPECIAL); // Increment DeathCount
|
||||
|
||||
if (pInstance->GetData(DATA_OPERA_OZ_DEATHCOUNT) == 4)
|
||||
if (instance->GetData(DATA_OPERA_OZ_DEATHCOUNT) == 4)
|
||||
{
|
||||
if (Creature* pCrone = creature->SummonCreature(CREATURE_CRONE, -10891.96f, -1755.95f, creature->GetPositionZ(), 4.64f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
|
||||
{
|
||||
@@ -116,10 +116,10 @@ public:
|
||||
{
|
||||
boss_dorotheeAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 AggroTimer;
|
||||
|
||||
@@ -158,8 +158,8 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DOROTHEE_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
SummonCroneIfReady(pInstance, me);
|
||||
if (instance)
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
@@ -298,10 +298,10 @@ public:
|
||||
{
|
||||
boss_strawmanAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 AggroTimer;
|
||||
uint32 BrainBashTimer;
|
||||
@@ -357,8 +357,8 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_STRAWMAN_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
SummonCroneIfReady(pInstance, me);
|
||||
if (instance)
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -413,10 +413,10 @@ public:
|
||||
{
|
||||
boss_tinheadAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 AggroTimer;
|
||||
uint32 CleaveTimer;
|
||||
@@ -463,8 +463,8 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_TINHEAD_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
SummonCroneIfReady(pInstance, me);
|
||||
if (instance)
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -523,10 +523,10 @@ public:
|
||||
{
|
||||
boss_roarAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 AggroTimer;
|
||||
uint32 MangleTimer;
|
||||
@@ -571,8 +571,8 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_ROAR_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
SummonCroneIfReady(pInstance, me);
|
||||
if (instance)
|
||||
SummonCroneIfReady(instance, me);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -632,10 +632,10 @@ public:
|
||||
{
|
||||
boss_croneAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 CycloneTimer;
|
||||
uint32 ChainLightningTimer;
|
||||
@@ -662,13 +662,13 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_CRONE_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(TYPE_OPERA, DONE);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
|
||||
if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
}
|
||||
@@ -807,10 +807,10 @@ public:
|
||||
{
|
||||
boss_bigbadwolfAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 ChaseTimer;
|
||||
uint32 FearTimer;
|
||||
@@ -847,13 +847,13 @@ public:
|
||||
{
|
||||
DoPlaySoundToSet(me, SOUND_WOLF_DEATH);
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(TYPE_OPERA, DONE);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
|
||||
if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
}
|
||||
@@ -1006,13 +1006,13 @@ public:
|
||||
{
|
||||
boss_julianneAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
EntryYellTimer = 1000;
|
||||
AggroYellTimer = 10000;
|
||||
IsFakingDeath = false;
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 EntryYellTimer;
|
||||
uint32 AggroYellTimer;
|
||||
@@ -1095,12 +1095,12 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_JULIANNE_DEATH02, me);
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(TYPE_OPERA, DONE);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
}
|
||||
@@ -1129,12 +1129,12 @@ public:
|
||||
{
|
||||
boss_romuloAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
EntryYellTimer = 8000;
|
||||
AggroYellTimer = 15000;
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 JulianneGUID;
|
||||
uint32 Phase;
|
||||
@@ -1250,13 +1250,13 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_ROMULO_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(TYPE_OPERA, DONE);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
instance->SetData(TYPE_OPERA, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORLEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GO_STAGEDOORRIGHT), true);
|
||||
|
||||
if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
|
||||
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,14 +48,14 @@ class instance_karazhan : public InstanceMapScript
|
||||
public:
|
||||
instance_karazhan() : InstanceMapScript("instance_karazhan", 532) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_karazhan_InstanceMapScript(pMap);
|
||||
return new instance_karazhan_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_karazhan_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_karazhan_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_karazhan_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string strSaveData;
|
||||
|
||||
@@ -113,10 +113,10 @@ public:
|
||||
{
|
||||
RaidWiped = false;
|
||||
m_uiEventId = 0;
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 m_uiSpotlightGUID;
|
||||
|
||||
@@ -138,20 +138,20 @@ public:
|
||||
|
||||
PerformanceReady = false;
|
||||
|
||||
if (pInstance)
|
||||
m_uiEventId = pInstance->GetData(DATA_OPERA_PERFORMANCE);
|
||||
if (instance)
|
||||
m_uiEventId = instance->GetData(DATA_OPERA_PERFORMANCE);
|
||||
}
|
||||
|
||||
void StartEvent()
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
pInstance->SetData(TYPE_OPERA, IN_PROGRESS);
|
||||
instance->SetData(TYPE_OPERA, IN_PROGRESS);
|
||||
|
||||
//resets count for this event, in case earlier failed
|
||||
if (m_uiEventId == EVENT_OZ)
|
||||
pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS);
|
||||
instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS);
|
||||
|
||||
Start(false, false);
|
||||
}
|
||||
@@ -160,14 +160,14 @@ public:
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
DoCast(me, SPELL_TUXEDO, false);
|
||||
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT));
|
||||
instance->DoUseDoorOrButton(instance->GetData64(DATA_GO_STAGEDOORLEFT));
|
||||
break;
|
||||
case 4:
|
||||
TalkCount = 0;
|
||||
@@ -183,12 +183,12 @@ public:
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT));
|
||||
instance->DoUseDoorOrButton(instance->GetData64(DATA_GO_STAGEDOORLEFT));
|
||||
PerformanceReady = true;
|
||||
break;
|
||||
case 9:
|
||||
PrepareEncounter();
|
||||
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_CURTAINS));
|
||||
instance->DoUseDoorOrButton(instance->GetData64(DATA_GO_CURTAINS));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -291,11 +291,11 @@ public:
|
||||
{
|
||||
if (WipeTimer <= diff)
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
if (!pMap->IsDungeon())
|
||||
Map* map = me->GetMap();
|
||||
if (!map->IsDungeon())
|
||||
return;
|
||||
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
if (PlayerList.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -361,10 +361,10 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
// Check for death of Moroes and if opera event is not done already
|
||||
if (pInstance->GetData(TYPE_MOROES) == DONE && pInstance->GetData(TYPE_OPERA) != DONE)
|
||||
if (instance->GetData(TYPE_MOROES) == DONE && instance->GetData(TYPE_OPERA) != DONE)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
@@ -426,10 +426,10 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
// Check if Shade of Aran event is done
|
||||
if (pInstance->GetData(TYPE_ARAN) == DONE)
|
||||
if (instance->GetData(TYPE_ARAN) == DONE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
}
|
||||
|
||||
@@ -476,10 +476,10 @@ public:
|
||||
{
|
||||
npc_image_of_medivhAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 ArcanagosGUID;
|
||||
|
||||
@@ -494,9 +494,9 @@ public:
|
||||
{
|
||||
ArcanagosGUID = 0;
|
||||
|
||||
if (pInstance && pInstance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
|
||||
if (instance && instance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
|
||||
{
|
||||
pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, me->GetGUID());
|
||||
instance->SetData64(DATA_IMAGE_OF_MEDIVH, me->GetGUID());
|
||||
(*me).GetMotionMaster()->MovePoint(1, MedivPos[0], MedivPos[1], MedivPos[2]);
|
||||
Step = 0;
|
||||
}else
|
||||
@@ -537,7 +537,7 @@ public:
|
||||
uint32 NextStep(uint32 Step)
|
||||
{
|
||||
Unit* arca = Unit::GetUnit((*me), ArcanagosGUID);
|
||||
Map* pMap = me->GetMap();
|
||||
Map* map = me->GetMap();
|
||||
switch (Step)
|
||||
{
|
||||
case 0: return 9999999;
|
||||
@@ -593,9 +593,9 @@ public:
|
||||
me->SetVisible(false);
|
||||
me->ClearInCombat();
|
||||
|
||||
if (pMap->IsDungeon())
|
||||
if (map->IsDungeon())
|
||||
{
|
||||
InstanceMap::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
InstanceMap::PlayerList const &PlayerList = map->GetPlayers();
|
||||
for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (i->getSource()->isAlive())
|
||||
|
||||
@@ -91,10 +91,10 @@ public:
|
||||
{
|
||||
boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 FireballTimer;
|
||||
uint32 PhoenixTimer;
|
||||
@@ -138,10 +138,10 @@ public:
|
||||
|
||||
Phase = 0;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true);
|
||||
instance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), true);
|
||||
// Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
|
||||
// Small door opened after event are expected to be closed by default
|
||||
}
|
||||
@@ -151,10 +151,10 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), true);
|
||||
// Open the encounter door
|
||||
}
|
||||
|
||||
@@ -166,10 +166,10 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), false);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), false);
|
||||
//Close the encounter door, open it in JustDied/Reset
|
||||
}
|
||||
|
||||
@@ -361,10 +361,10 @@ public:
|
||||
DoScriptText(SAY_GRAVITY_LAPSE, me);
|
||||
FirstGravityLapse = false;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_STATUE_LEFT), true);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_STATUE_RIGHT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_KAEL_STATUE_LEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_KAEL_STATUE_RIGHT), true);
|
||||
}
|
||||
}else
|
||||
{
|
||||
@@ -485,10 +485,10 @@ public:
|
||||
{
|
||||
mob_felkael_phoenixAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
uint32 BurnTimer;
|
||||
uint32 Death_Timer;
|
||||
bool Rebirth;
|
||||
@@ -520,7 +520,7 @@ public:
|
||||
|
||||
}
|
||||
//Don't really die in all phases of Kael'Thas
|
||||
if (pInstance && pInstance->GetData(DATA_KAELTHAS_EVENT) == 0)
|
||||
if (instance && instance->GetData(DATA_KAELTHAS_EVENT) == 0)
|
||||
{
|
||||
//prevent death
|
||||
damage = 0;
|
||||
|
||||
@@ -101,12 +101,12 @@ public:
|
||||
{
|
||||
boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID));
|
||||
LackeyEntryList.clear();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
std::vector<uint32> LackeyEntryList;
|
||||
uint64 m_auiLackeyGUID[MAX_ACTIVE_LACKEY];
|
||||
@@ -137,8 +137,8 @@ public:
|
||||
//this mean she at some point evaded
|
||||
void JustReachedHome()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DELRISSA_EVENT, FAIL);
|
||||
if (instance)
|
||||
instance->SetData(DATA_DELRISSA_EVENT, FAIL);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
@@ -157,8 +157,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void InitializeLackeys()
|
||||
@@ -224,11 +224,11 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY)
|
||||
pInstance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
if (instance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY)
|
||||
instance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
else
|
||||
{
|
||||
if (me->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
|
||||
@@ -342,12 +342,12 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
{
|
||||
boss_priestess_lackey_commonAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
memset(&m_auiLackeyGUIDs, 0, sizeof(m_auiLackeyGUIDs));
|
||||
AcquireGUIDs();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 m_auiLackeyGUIDs[MAX_ACTIVE_LACKEY];
|
||||
uint32 ResetThreatTimer;
|
||||
@@ -365,7 +365,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
ResetThreatTimer = urand(5000, 20000);
|
||||
|
||||
// in case she is not alive and Reset was for some reason called, respawn her (most likely party wipe after killing her)
|
||||
if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DELRISSA) : 0))
|
||||
if (Creature* pDelrissa = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_DELRISSA) : 0))
|
||||
{
|
||||
if (!pDelrissa->isAlive())
|
||||
pDelrissa->Respawn();
|
||||
@@ -377,7 +377,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
{
|
||||
@@ -391,7 +391,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)))
|
||||
if (Creature* pDelrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA)))
|
||||
{
|
||||
if (pDelrissa->isAlive() && !pDelrissa->getVictim())
|
||||
{
|
||||
@@ -404,11 +404,11 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA));
|
||||
uint32 uiLackeyDeathCount = pInstance->GetData(DATA_DELRISSA_DEATH_COUNT);
|
||||
Creature* pDelrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA));
|
||||
uint32 uiLackeyDeathCount = instance->GetData(DATA_DELRISSA_DEATH_COUNT);
|
||||
|
||||
if (!pDelrissa)
|
||||
return;
|
||||
@@ -416,7 +416,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
//should delrissa really yell if dead?
|
||||
DoScriptText(LackeyDeath[uiLackeyDeathCount].id, pDelrissa);
|
||||
|
||||
pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, SPECIAL);
|
||||
instance->SetData(DATA_DELRISSA_DEATH_COUNT, SPECIAL);
|
||||
|
||||
//increase local var, since we now may have four dead
|
||||
++uiLackeyDeathCount;
|
||||
@@ -429,26 +429,26 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
if (!pDelrissa->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
|
||||
pDelrissa->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
|
||||
pInstance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
instance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* Delrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)))
|
||||
if (Creature* Delrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA)))
|
||||
Delrissa->AI()->KilledUnit(victim);
|
||||
}
|
||||
|
||||
void AcquireGUIDs()
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* Delrissa = (Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA))))
|
||||
if (Creature* Delrissa = (Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA))))
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
m_auiLackeyGUIDs[i] = CAST_AI(boss_priestess_delrissa::boss_priestess_delrissaAI, Delrissa->AI())->m_auiLackeyGUID[i];
|
||||
@@ -1055,14 +1055,14 @@ public:
|
||||
if (Freezing_Trap_Timer <= diff)
|
||||
{
|
||||
//attempt find go summoned from spell (casted by me)
|
||||
GameObject* pGo = me->GetGameObject(SPELL_FREEZING_TRAP);
|
||||
GameObject* go = me->GetGameObject(SPELL_FREEZING_TRAP);
|
||||
|
||||
//if we have a pGo, we need to wait (only one trap at a time)
|
||||
if (pGo)
|
||||
//if we have a go, we need to wait (only one trap at a time)
|
||||
if (go)
|
||||
Freezing_Trap_Timer = 2500;
|
||||
else
|
||||
{
|
||||
//if pGo does not exist, then we can cast
|
||||
//if go does not exist, then we can cast
|
||||
DoCast(me->getVictim(), SPELL_FREEZING_TRAP);
|
||||
Freezing_Trap_Timer = 15000;
|
||||
}
|
||||
|
||||
@@ -65,23 +65,23 @@ public:
|
||||
{
|
||||
boss_selin_fireheartAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
|
||||
Crystals.clear();
|
||||
//GUIDs per instance is static, so we only need to load them once.
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE);
|
||||
uint32 size = instance->GetData(DATA_FEL_CRYSTAL_SIZE);
|
||||
for (uint8 i = 0; i < size; ++i)
|
||||
{
|
||||
uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL);
|
||||
uint64 guid = instance->GetData64(DATA_FEL_CRYSTAL);
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Selin: Adding Fel Crystal " UI64FMTD " to list", guid);
|
||||
Crystals.push_back(guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
std::list<uint64> Crystals;
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
@@ -115,11 +115,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true);
|
||||
// Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
|
||||
// Small door opened after event are expected to be closed by default
|
||||
// Set Inst data for encounter
|
||||
pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
|
||||
} else sLog->outError(ERROR_INST_DATA);
|
||||
|
||||
DrainLifeTimer = 3000 + rand()%4000;
|
||||
@@ -196,8 +196,8 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false);
|
||||
if (instance)
|
||||
instance->HandleGameObject(instance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false);
|
||||
//Close the encounter door, open it in JustDied/Reset
|
||||
}
|
||||
|
||||
@@ -232,12 +232,12 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); // Open the encounter door
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_DOOR), true); // Open the door leading further in
|
||||
instance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
|
||||
instance->HandleGameObject(instance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); // Open the encounter door
|
||||
instance->HandleGameObject(instance->GetData64(DATA_SELIN_DOOR), true); // Open the door leading further in
|
||||
ShatterRemainingCrystals();
|
||||
}
|
||||
|
||||
@@ -343,9 +343,9 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (InstanceScript* pInstance = me->GetInstanceScript())
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
Creature* Selin = (Unit::GetCreature(*me, pInstance->GetData64(DATA_SELIN)));
|
||||
Creature* Selin = (Unit::GetCreature(*me, instance->GetData64(DATA_SELIN)));
|
||||
if (Selin && Selin->isAlive())
|
||||
{
|
||||
if (CAST_AI(boss_selin_fireheart::boss_selin_fireheartAI, Selin->AI())->CrystalGUID == me->GetGUID())
|
||||
|
||||
@@ -73,10 +73,10 @@ public:
|
||||
{
|
||||
boss_vexallusAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 ChainLightningTimer;
|
||||
uint32 ArcaneShockTimer;
|
||||
@@ -92,8 +92,8 @@ public:
|
||||
IntervalHealthAmount = 1;
|
||||
Enraged = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -103,16 +103,16 @@ public:
|
||||
|
||||
void JustDied(Unit* /*victim*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
|
||||
@@ -40,14 +40,14 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
public:
|
||||
instance_magisters_terrace() : InstanceMapScript("instance_magisters_terrace", 585) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_magisters_terrace_InstanceMapScript(pMap);
|
||||
return new instance_magisters_terrace_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_magisters_terrace_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_magisters_terrace_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_magisters_terrace_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint32 DelrissaDeathCount;
|
||||
|
||||
@@ -128,12 +128,12 @@ public:
|
||||
// some targeting issues with the spell, so use this workaround as temporary solution
|
||||
void DoWorkaroundForQuestCredit()
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
Map* map = me->GetMap();
|
||||
|
||||
if (!pMap || pMap->IsHeroic())
|
||||
if (!map || map->IsHeroic())
|
||||
return;
|
||||
|
||||
Map::PlayerList const &lList = pMap->GetPlayers();
|
||||
Map::PlayerList const &lList = map->GetPlayers();
|
||||
|
||||
if (lList.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -313,9 +313,9 @@ class go_acherus_soul_prison : public GameObjectScript
|
||||
public:
|
||||
go_acherus_soul_prison() : GameObjectScript("go_acherus_soul_prison") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* pGo)
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
if (Creature* anchor = pGo->FindNearestCreature(29521, 15))
|
||||
if (Creature* anchor = go->FindNearestCreature(29521, 15))
|
||||
if (uint64 prisonerGUID = anchor->AI()->GetGUID())
|
||||
if (Creature* prisoner = Creature::GetCreature(*player, prisonerGUID))
|
||||
CAST_AI(npc_unworthy_initiate::npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, player);
|
||||
|
||||
@@ -177,9 +177,9 @@ class npc_koltira_deathweaver : public CreatureScript
|
||||
public:
|
||||
npc_koltira_deathweaver() : CreatureScript("npc_koltira_deathweaver") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* pQuest)
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
|
||||
{
|
||||
if (pQuest->GetQuestId() == QUEST_BREAKOUT)
|
||||
if (quest->GetQuestId() == QUEST_BREAKOUT)
|
||||
{
|
||||
creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
@@ -305,9 +305,9 @@ public:
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
Creature* pTemp = Unit::GetCreature(*me, m_uiValrothGUID);
|
||||
Creature* temp = Unit::GetCreature(*me, m_uiValrothGUID);
|
||||
|
||||
if (!pTemp || !pTemp->isAlive())
|
||||
if (!temp || !temp->isAlive())
|
||||
{
|
||||
DoScriptText(SAY_BREAKOUT8, me);
|
||||
m_uiWave_Timer = 5000;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -361,10 +361,10 @@ public:
|
||||
{
|
||||
boss_headless_horsemanAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 headGUID;
|
||||
uint64 PlayerGUID;
|
||||
@@ -413,8 +413,8 @@ public:
|
||||
headGUID = 0;
|
||||
}
|
||||
|
||||
//if (pInstance)
|
||||
// pInstance->SetData(DATA_HORSEMAN_EVENT, NOT_STARTED);
|
||||
//if (instance)
|
||||
// instance->SetData(DATA_HORSEMAN_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void FlyMode()
|
||||
@@ -450,8 +450,8 @@ public:
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
if (pInstance)
|
||||
pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
|
||||
if (instance)
|
||||
instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
|
||||
break;
|
||||
case 19:
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
|
||||
@@ -473,8 +473,8 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
void AttackStart(Unit* who) {ScriptedAI::AttackStart(who);}
|
||||
@@ -503,10 +503,10 @@ public:
|
||||
|
||||
Player* SelectRandomPlayer(float range = 0.0f, bool checkLoS = true)
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
if (!pMap->IsDungeon()) return NULL;
|
||||
Map* map = me->GetMap();
|
||||
if (!map->IsDungeon()) return NULL;
|
||||
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
Map::PlayerList::const_iterator i;
|
||||
if (PlayerList.isEmpty()) return NULL;
|
||||
|
||||
@@ -542,8 +542,8 @@ public:
|
||||
flame->CastSpell(flame, SPELL_BODY_FLAME, false);
|
||||
if (Creature* wisp = DoSpawnCreature(WISP_INVIS, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 60000))
|
||||
CAST_AI(mob_wisp_invis::mob_wisp_invisAI, wisp->AI())->SetType(4);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HORSEMAN_EVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_HORSEMAN_EVENT, DONE);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, const SpellInfo* spell)
|
||||
@@ -824,12 +824,12 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* soil)
|
||||
{
|
||||
InstanceScript* pInstance = player->GetInstanceScript();
|
||||
if (pInstance)
|
||||
InstanceScript* instance = player->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_HORSEMAN_EVENT) != NOT_STARTED)
|
||||
if (instance->GetData(DATA_HORSEMAN_EVENT) != NOT_STARTED)
|
||||
return true;
|
||||
pInstance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS);
|
||||
instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS);
|
||||
}
|
||||
/* if (soil->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER && player->getLevel() > 64)
|
||||
{
|
||||
|
||||
@@ -51,10 +51,10 @@ public:
|
||||
{
|
||||
boss_interrogator_vishasAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
bool Yell30;
|
||||
bool Yell60;
|
||||
@@ -77,11 +77,11 @@ public:
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
//Any other actions to do with vorrel? setStandState?
|
||||
if (Unit* vorrel = Unit::GetUnit(*me, pInstance->GetData64(DATA_VORREL)))
|
||||
if (Unit* vorrel = Unit::GetUnit(*me, instance->GetData64(DATA_VORREL)))
|
||||
DoScriptText(SAY_TRIGGER_VORREL, vorrel);
|
||||
}
|
||||
|
||||
|
||||
+23
-23
@@ -67,10 +67,10 @@ public:
|
||||
{
|
||||
boss_scarlet_commander_mograineAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
m_pInstance = creature->GetInstanceScript();
|
||||
m_instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* m_pInstance;
|
||||
InstanceScript* m_instance;
|
||||
|
||||
uint32 m_uiCrusaderStrike_Timer;
|
||||
uint32 m_uiHammerOfJustice_Timer;
|
||||
@@ -89,9 +89,9 @@ public:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
if (m_pInstance)
|
||||
if (m_instance)
|
||||
if (me->isAlive())
|
||||
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
|
||||
m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
|
||||
|
||||
m_bHasDied = false;
|
||||
m_bHeal = false;
|
||||
@@ -100,10 +100,10 @@ public:
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
if (m_pInstance)
|
||||
if (m_instance)
|
||||
{
|
||||
if (m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT != NOT_STARTED))
|
||||
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL);
|
||||
if (m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT != NOT_STARTED))
|
||||
m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,13 +125,13 @@ public:
|
||||
if (uiDamage < me->GetHealth() || m_bHasDied || m_bFakeDeath)
|
||||
return;
|
||||
|
||||
if (!m_pInstance)
|
||||
if (!m_instance)
|
||||
return;
|
||||
|
||||
//On first death, fake death and open door, as well as initiate whitemane if exist
|
||||
if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE)))
|
||||
if (Unit* Whitemane = Unit::GetUnit((*me), m_instance->GetData64(DATA_WHITEMANE)))
|
||||
{
|
||||
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);
|
||||
m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);
|
||||
|
||||
Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f);
|
||||
|
||||
@@ -165,8 +165,8 @@ public:
|
||||
DoScriptText(SAY_MO_RESSURECTED, me);
|
||||
m_bFakeDeath = false;
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
|
||||
if (m_instance)
|
||||
m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,10 +175,10 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (m_bHasDied && !m_bHeal && m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
|
||||
if (m_bHasDied && !m_bHeal && m_instance && m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
|
||||
{
|
||||
//On ressurection, stop fake death and heal whitemane and resume fight
|
||||
if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE)))
|
||||
if (Unit* Whitemane = Unit::GetUnit((*me), m_instance->GetData64(DATA_WHITEMANE)))
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
@@ -232,10 +232,10 @@ public:
|
||||
{
|
||||
boss_high_inquisitor_whitemaneAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
m_pInstance = creature->GetInstanceScript();
|
||||
m_instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* m_pInstance;
|
||||
InstanceScript* m_instance;
|
||||
|
||||
uint32 m_uiHeal_Timer;
|
||||
uint32 m_uiPowerWordShield_Timer;
|
||||
@@ -255,14 +255,14 @@ public:
|
||||
m_bCanResurrectCheck = false;
|
||||
m_bCanResurrect = false;
|
||||
|
||||
if (m_pInstance)
|
||||
if (m_instance)
|
||||
if (me->isAlive())
|
||||
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
|
||||
m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED)
|
||||
if (m_instance && m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED)
|
||||
return;
|
||||
|
||||
ScriptedAI::AttackStart(who);
|
||||
@@ -286,9 +286,9 @@ public:
|
||||
if (m_bCanResurrect)
|
||||
{
|
||||
//When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out
|
||||
if (m_pInstance && m_uiWait_Timer <= uiDiff)
|
||||
if (m_instance && m_uiWait_Timer <= uiDiff)
|
||||
{
|
||||
if (Unit* Mograine = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_MOGRAINE)))
|
||||
if (Unit* Mograine = Unit::GetUnit((*me), m_instance->GetData64(DATA_MOGRAINE)))
|
||||
{
|
||||
DoCast(Mograine, SPELL_SCARLETRESURRECTION);
|
||||
DoScriptText(SAY_WH_RESSURECT, me);
|
||||
@@ -322,9 +322,9 @@ public:
|
||||
if (!HealthAbovePct(75))
|
||||
target = me;
|
||||
|
||||
if (m_pInstance)
|
||||
if (m_instance)
|
||||
{
|
||||
if (Creature* pMograine = Unit::GetCreature((*me), m_pInstance->GetData64(DATA_MOGRAINE)))
|
||||
if (Creature* pMograine = Unit::GetCreature((*me), m_instance->GetData64(DATA_MOGRAINE)))
|
||||
{
|
||||
// checking m_bCanResurrectCheck prevents her healing Mograine while he is "faking death"
|
||||
if (m_bCanResurrectCheck && pMograine->isAlive() && !pMograine->HealthAbovePct(75))
|
||||
|
||||
@@ -38,14 +38,14 @@ class instance_scarlet_monastery : public InstanceMapScript
|
||||
public:
|
||||
instance_scarlet_monastery() : InstanceMapScript("instance_scarlet_monastery", 189) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_scarlet_monastery_InstanceMapScript(pMap);
|
||||
return new instance_scarlet_monastery_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_scarlet_monastery_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_scarlet_monastery_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_scarlet_monastery_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint64 PumpkinShrineGUID;
|
||||
uint64 HorsemanGUID;
|
||||
|
||||
@@ -64,10 +64,10 @@ public:
|
||||
{
|
||||
boss_darkmaster_gandlingAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 ArcaneMissiles_Timer;
|
||||
uint32 ShadowShield_Timer;
|
||||
@@ -88,8 +88,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_GANDLING, DONE);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_GANDLING, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -60,12 +60,12 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
InstanceScript* pInstance = me->GetInstanceScript();
|
||||
if (pInstance)
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0);
|
||||
instance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0);
|
||||
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,12 +60,12 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
InstanceScript* pInstance = me->GetInstanceScript();
|
||||
if (pInstance)
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0);
|
||||
instance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0);
|
||||
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,12 +67,12 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
InstanceScript* pInstance = me->GetInstanceScript();
|
||||
if (pInstance)
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0);
|
||||
instance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0);
|
||||
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,12 +56,12 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
InstanceScript* pInstance = me->GetInstanceScript();
|
||||
if (pInstance)
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0);
|
||||
instance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0);
|
||||
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,12 +60,12 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
InstanceScript* pInstance = me->GetInstanceScript();
|
||||
if (pInstance)
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0);
|
||||
instance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0);
|
||||
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,12 +62,12 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
InstanceScript* pInstance = me->GetInstanceScript();
|
||||
if (pInstance)
|
||||
InstanceScript* instance = me->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_THERAVENIAN_DEATH, 0);
|
||||
instance->SetData(DATA_THERAVENIAN_DEATH, 0);
|
||||
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,14 +42,14 @@ class instance_scholomance : public InstanceMapScript
|
||||
public:
|
||||
instance_scholomance() : InstanceMapScript("instance_scholomance", 289) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_scholomance_InstanceMapScript(pMap);
|
||||
return new instance_scholomance_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_scholomance_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_scholomance_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_scholomance_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
//Lord Alexei Barov, Doctor Theolen Krastinov, The Ravenian, Lorekeeper Polkelt, Instructor Malicia and the Lady Illucia Barov.
|
||||
bool IsBossDied[6];
|
||||
|
||||
@@ -59,14 +59,14 @@ class instance_shadowfang_keep : public InstanceMapScript
|
||||
public:
|
||||
instance_shadowfang_keep() : InstanceMapScript("instance_shadowfang_keep", 33) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_shadowfang_keep_InstanceMapScript(pMap);
|
||||
return new instance_shadowfang_keep_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_shadowfang_keep_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_shadowfang_keep_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_shadowfang_keep_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
@@ -78,9 +78,9 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
InstanceScript* pInstance = creature->GetInstanceScript();
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
|
||||
if (pInstance && pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE)
|
||||
if (instance && instance->GetData(TYPE_FREE_NPC) != DONE && instance->GetData(TYPE_RETHILGORE) == DONE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
@@ -92,11 +92,11 @@ public:
|
||||
{
|
||||
npc_shadowfang_prisonerAI(Creature* c) : npc_escortAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
uiNpcEntry = c->GetEntry();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
uint32 uiNpcEntry;
|
||||
|
||||
void WaypointReached(uint32 uiPoint)
|
||||
@@ -125,8 +125,8 @@ public:
|
||||
else
|
||||
DoScriptText(SAY_POST1_DOOR_AD, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_FREE_NPC, DONE);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_FREE_NPC, DONE);
|
||||
break;
|
||||
case 13:
|
||||
if (uiNpcEntry != NPC_ASH)
|
||||
@@ -155,10 +155,10 @@ public:
|
||||
{
|
||||
npc_arugal_voidwalkerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
pInstance = creature->GetInstanceScript();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 uiDarkOffering;
|
||||
|
||||
@@ -189,8 +189,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_FENRUS, pInstance->GetData(TYPE_FENRUS) + 1);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_FENRUS, instance->GetData(TYPE_FENRUS) + 1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -91,10 +91,10 @@ public:
|
||||
{
|
||||
boss_baron_rivendareAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 ShadowBolt_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
@@ -109,14 +109,14 @@ public:
|
||||
MortalStrike_Timer = 12000;
|
||||
// RaiseDead_Timer = 30000;
|
||||
SummonSkeletons_Timer = 34000;
|
||||
if (pInstance && pInstance->GetData(TYPE_RAMSTEIN) == DONE)
|
||||
pInstance->SetData(TYPE_BARON, NOT_STARTED);
|
||||
if (instance && instance->GetData(TYPE_RAMSTEIN) == DONE)
|
||||
instance->SetData(TYPE_BARON, NOT_STARTED);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (pInstance)//can't use entercombat(), boss' dmg aura sets near players in combat, before entering the room's door
|
||||
pInstance->SetData(TYPE_BARON, IN_PROGRESS);
|
||||
if (instance)//can't use entercombat(), boss' dmg aura sets near players in combat, before entering the room's door
|
||||
instance->SetData(TYPE_BARON, IN_PROGRESS);
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
@@ -128,8 +128,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_BARON, DONE);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_BARON, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -45,10 +45,10 @@ public:
|
||||
{
|
||||
boss_baroness_anastariAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 BansheeWail_Timer;
|
||||
uint32 BansheeCurse_Timer;
|
||||
@@ -69,8 +69,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_BARONESS, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_BARONESS, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -45,10 +45,10 @@ public:
|
||||
{
|
||||
boss_maleki_the_pallidAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 Frostbolt_Timer;
|
||||
uint32 IceTomb_Timer;
|
||||
@@ -67,8 +67,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_PALLID, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_PALLID, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -45,10 +45,10 @@ public:
|
||||
{
|
||||
boss_nerubenkanAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 EncasingWebs_Timer;
|
||||
uint32 PierceArmor_Timer;
|
||||
@@ -69,8 +69,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_NERUB, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_NERUB, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void RaiseUndeadScarab(Unit* victim)
|
||||
|
||||
@@ -56,10 +56,10 @@ public:
|
||||
{
|
||||
boss_silver_hand_bossesAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 HolyLight_Timer;
|
||||
uint32 DivineShield_Timer;
|
||||
@@ -69,24 +69,24 @@ public:
|
||||
HolyLight_Timer = 20000;
|
||||
DivineShield_Timer = 20000;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case SH_AELMAR:
|
||||
pInstance->SetData(TYPE_SH_AELMAR, 0);
|
||||
instance->SetData(TYPE_SH_AELMAR, 0);
|
||||
break;
|
||||
case SH_CATHELA:
|
||||
pInstance->SetData(TYPE_SH_CATHELA, 0);
|
||||
instance->SetData(TYPE_SH_CATHELA, 0);
|
||||
break;
|
||||
case SH_GREGOR:
|
||||
pInstance->SetData(TYPE_SH_GREGOR, 0);
|
||||
instance->SetData(TYPE_SH_GREGOR, 0);
|
||||
break;
|
||||
case SH_NEMAS:
|
||||
pInstance->SetData(TYPE_SH_NEMAS, 0);
|
||||
instance->SetData(TYPE_SH_NEMAS, 0);
|
||||
break;
|
||||
case SH_VICAR:
|
||||
pInstance->SetData(TYPE_SH_VICAR, 0);
|
||||
instance->SetData(TYPE_SH_VICAR, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -98,27 +98,27 @@ public:
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case SH_AELMAR:
|
||||
pInstance->SetData(TYPE_SH_AELMAR, 2);
|
||||
instance->SetData(TYPE_SH_AELMAR, 2);
|
||||
break;
|
||||
case SH_CATHELA:
|
||||
pInstance->SetData(TYPE_SH_CATHELA, 2);
|
||||
instance->SetData(TYPE_SH_CATHELA, 2);
|
||||
break;
|
||||
case SH_GREGOR:
|
||||
pInstance->SetData(TYPE_SH_GREGOR, 2);
|
||||
instance->SetData(TYPE_SH_GREGOR, 2);
|
||||
break;
|
||||
case SH_NEMAS:
|
||||
pInstance->SetData(TYPE_SH_NEMAS, 2);
|
||||
instance->SetData(TYPE_SH_NEMAS, 2);
|
||||
break;
|
||||
case SH_VICAR:
|
||||
pInstance->SetData(TYPE_SH_VICAR, 2);
|
||||
instance->SetData(TYPE_SH_VICAR, 2);
|
||||
break;
|
||||
}
|
||||
if (pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER)
|
||||
if (instance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER)
|
||||
CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ public:
|
||||
{
|
||||
boss_ramstein_the_gorgerAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 Trample_Timer;
|
||||
uint32 Knockout_Timer;
|
||||
@@ -71,8 +71,8 @@ public:
|
||||
mob->AI()->AttackStart(me->SelectNearestTarget(100.0f));
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_RAMSTEIN, DONE);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_RAMSTEIN, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/* ScriptData
|
||||
SDName: Stratholme
|
||||
SD%Complete: 100
|
||||
SDComment: Misc mobs for instance. pGo-script to apply aura and start event for quest 8945
|
||||
SDComment: Misc mobs for instance. go-script to apply aura and start event for quest 8945
|
||||
SDCategory: Stratholme
|
||||
EndScriptData */
|
||||
|
||||
@@ -43,14 +43,14 @@ class go_gauntlet_gate : public GameObjectScript
|
||||
public:
|
||||
go_gauntlet_gate() : GameObjectScript("go_gauntlet_gate") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* pGo)
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
InstanceScript* pInstance = pGo->GetInstanceScript();
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
if (pInstance->GetData(TYPE_BARON_RUN) != NOT_STARTED)
|
||||
if (instance->GetData(TYPE_BARON_RUN) != NOT_STARTED)
|
||||
return false;
|
||||
|
||||
if (Group* group = player->GetGroup())
|
||||
@@ -63,15 +63,15 @@ public:
|
||||
|
||||
if (pGroupie->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE &&
|
||||
!pGroupie->HasAura(SPELL_BARON_ULTIMATUM) &&
|
||||
pGroupie->GetMap() == pGo->GetMap())
|
||||
pGroupie->GetMap() == go->GetMap())
|
||||
pGroupie->CastSpell(pGroupie, SPELL_BARON_ULTIMATUM, true);
|
||||
}
|
||||
} else if (player->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE &&
|
||||
!player->HasAura(SPELL_BARON_ULTIMATUM) &&
|
||||
player->GetMap() == pGo->GetMap())
|
||||
player->GetMap() == go->GetMap())
|
||||
player->CastSpell(player, SPELL_BARON_ULTIMATUM, true);
|
||||
|
||||
pInstance->SetData(TYPE_BARON_RUN, IN_PROGRESS);
|
||||
instance->SetData(TYPE_BARON_RUN, IN_PROGRESS);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -177,9 +177,9 @@ public:
|
||||
{
|
||||
if (Die_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTemp = Unit::GetUnit(*me, Tagger))
|
||||
if (Unit* temp = Unit::GetUnit(*me, Tagger))
|
||||
{
|
||||
CAST_PLR(pTemp)->KilledMonsterCredit(ENTRY_RESTLESS, me->GetGUID());
|
||||
CAST_PLR(temp)->KilledMonsterCredit(ENTRY_RESTLESS, me->GetGUID());
|
||||
me->Kill(me);
|
||||
}
|
||||
} else Die_Timer -= diff;
|
||||
|
||||
@@ -44,14 +44,14 @@ class instance_sunken_temple : public InstanceMapScript
|
||||
public:
|
||||
instance_sunken_temple() : InstanceMapScript("instance_sunken_temple", 109) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_sunken_temple_InstanceMapScript(pMap);
|
||||
return new instance_sunken_temple_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_sunken_temple_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_sunken_temple_InstanceMapScript(Map* pMap) : InstanceScript(pMap)
|
||||
instance_sunken_temple_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -56,10 +56,10 @@ class go_atalai_statue : public GameObjectScript
|
||||
public:
|
||||
go_atalai_statue() : GameObjectScript("go_atalai_statue") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* pGo)
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
if (InstanceScript* pInstance = player->GetInstanceScript())
|
||||
pInstance->SetData(EVENT_STATE, pGo->GetEntry());
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
instance->SetData(EVENT_STATE, go->GetEntry());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,11 +80,11 @@ public:
|
||||
{
|
||||
boss_brutallusAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
Intro = true;
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 SlashTimer;
|
||||
uint32 BurnTimer;
|
||||
@@ -115,16 +115,16 @@ public:
|
||||
|
||||
DoCast(me, SPELL_DUAL_WIELD, true);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(YELL_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_BRUTALLUS_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_BRUTALLUS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -136,9 +136,9 @@ public:
|
||||
{
|
||||
DoScriptText(YELL_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_BRUTALLUS_EVENT, DONE);
|
||||
instance->SetData(DATA_BRUTALLUS_EVENT, DONE);
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
me->SummonCreature(FELMYST, x, y, z+30, me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0);
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
{
|
||||
if (!Intro || IsIntro)
|
||||
return;
|
||||
Creature* Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0);
|
||||
Creature* Madrigosa = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_MADRIGOSA) : 0);
|
||||
if (Madrigosa)
|
||||
{
|
||||
Madrigosa->Respawn();
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
|
||||
void DoIntro()
|
||||
{
|
||||
Creature* Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0);
|
||||
Creature* Madrigosa = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_MADRIGOSA) : 0);
|
||||
if (!Madrigosa)
|
||||
return;
|
||||
|
||||
@@ -271,8 +271,8 @@ public:
|
||||
{
|
||||
if (!me->IsValidAttackTarget(who))
|
||||
return;
|
||||
if (pInstance && Intro)
|
||||
pInstance->SetData(DATA_BRUTALLUS_EVENT, SPECIAL);
|
||||
if (instance && Intro)
|
||||
instance->SetData(DATA_BRUTALLUS_EVENT, SPECIAL);
|
||||
|
||||
if (Intro && !IsIntro)
|
||||
StartIntro();
|
||||
@@ -292,7 +292,7 @@ public:
|
||||
{
|
||||
if (IntroFrostBoltTimer <= diff)
|
||||
{
|
||||
if (Creature* Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0))
|
||||
if (Creature* Madrigosa = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_MADRIGOSA) : 0))
|
||||
{
|
||||
Madrigosa->CastSpell(me, SPELL_INTRO_FROSTBOLT, true);
|
||||
IntroFrostBoltTimer = 2000;
|
||||
|
||||
@@ -99,10 +99,10 @@ public:
|
||||
{
|
||||
boss_sacrolashAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
bool SisterDeath;
|
||||
bool Enraged;
|
||||
@@ -118,9 +118,9 @@ public:
|
||||
{
|
||||
Enraged = false;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit((*me), pInstance->GetData64(DATA_ALYTHESS));
|
||||
Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS));
|
||||
if (Temp)
|
||||
{
|
||||
if (Temp->isDead())
|
||||
@@ -142,23 +142,23 @@ public:
|
||||
SisterDeath = false;
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit((*me), pInstance->GetData64(DATA_ALYTHESS));
|
||||
Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS));
|
||||
if (Temp && Temp->isAlive() && !(Temp->getVictim()))
|
||||
CAST_CRE(Temp)->AI()->AttackStart(who);
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_EREDAR_TWINS_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_EREDAR_TWINS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -174,8 +174,8 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_SAC_DEAD, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_EREDAR_TWINS_EVENT, DONE);
|
||||
}
|
||||
else
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
@@ -228,10 +228,10 @@ public:
|
||||
{
|
||||
if (!SisterDeath)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
Unit* Temp = NULL;
|
||||
Temp = Unit::GetUnit((*me), pInstance->GetData64(DATA_ALYTHESS));
|
||||
Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS));
|
||||
if (Temp && Temp->isDead())
|
||||
{
|
||||
DoScriptText(YELL_SISTER_ALYTHESS_DEAD, me);
|
||||
@@ -357,11 +357,11 @@ public:
|
||||
{
|
||||
boss_alythessAI(Creature* c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
IntroStepCounter = 10;
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
bool SisterDeath;
|
||||
bool Enraged;
|
||||
@@ -380,9 +380,9 @@ public:
|
||||
{
|
||||
Enraged = false;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit((*me), pInstance->GetData64(DATA_SACROLASH));
|
||||
Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH));
|
||||
if (Temp)
|
||||
{
|
||||
if (Temp->isDead())
|
||||
@@ -405,23 +405,23 @@ public:
|
||||
SisterDeath = false;
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit((*me), pInstance->GetData64(DATA_SACROLASH));
|
||||
Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH));
|
||||
if (Temp && Temp->isAlive() && !(Temp->getVictim()))
|
||||
CAST_CRE(Temp)->AI()->AttackStart(who);
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_EREDAR_TWINS_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_EREDAR_TWINS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
@@ -468,8 +468,8 @@ public:
|
||||
{
|
||||
DoScriptText(YELL_ALY_DEAD, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_EREDAR_TWINS_EVENT, DONE);
|
||||
}
|
||||
else
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
@@ -524,7 +524,7 @@ public:
|
||||
|
||||
uint32 IntroStep(uint32 step)
|
||||
{
|
||||
Creature* Sacrolash = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_SACROLASH) : 0);
|
||||
Creature* Sacrolash = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_SACROLASH) : 0);
|
||||
switch (step)
|
||||
{
|
||||
case 0: return 0;
|
||||
@@ -564,10 +564,10 @@ public:
|
||||
|
||||
if (!SisterDeath)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
Unit* Temp = NULL;
|
||||
Temp = Unit::GetUnit((*me), pInstance->GetData64(DATA_SACROLASH));
|
||||
Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH));
|
||||
if (Temp && Temp->isDead())
|
||||
{
|
||||
DoScriptText(YELL_SISTER_SACROLASH_DEAD, me);
|
||||
@@ -579,9 +579,9 @@ public:
|
||||
}
|
||||
if (!me->getVictim())
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
Creature* sisiter = Unit::GetCreature((*me), pInstance->GetData64(DATA_SACROLASH));
|
||||
Creature* sisiter = Unit::GetCreature((*me), instance->GetData64(DATA_SACROLASH));
|
||||
if (sisiter && !sisiter->isDead() && sisiter->getVictim())
|
||||
{
|
||||
me->AddThreat(sisiter->getVictim(), 0.0f);
|
||||
|
||||
@@ -117,10 +117,10 @@ public:
|
||||
{
|
||||
boss_felmystAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
PhaseFelmyst phase;
|
||||
EventMap events;
|
||||
|
||||
@@ -144,8 +144,8 @@ public:
|
||||
DespawnSummons(MOB_VAPOR_TRAIL);
|
||||
me->setActive(false);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_FELMYST_EVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_FELMYST_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
@@ -158,8 +158,8 @@ public:
|
||||
DoCast(me, AURA_NOXIOUS_FUMES, true);
|
||||
EnterPhase(PHASE_GROUND);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_FELMYST_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_FELMYST_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
@@ -188,8 +188,8 @@ public:
|
||||
{
|
||||
DoScriptText(YELL_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_FELMYST_EVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_FELMYST_EVENT, DONE);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, const SpellInfo* spell)
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
|
||||
if (!target)
|
||||
target = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
|
||||
target = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_PLAYER_GUID) : 0);
|
||||
|
||||
if (!target)
|
||||
{
|
||||
@@ -311,7 +311,7 @@ public:
|
||||
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
|
||||
if (!target)
|
||||
target = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
|
||||
target = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_PLAYER_GUID) : 0);
|
||||
|
||||
if (!target)
|
||||
{
|
||||
@@ -319,7 +319,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
//pTarget->CastSpell(target, SPELL_VAPOR_SUMMON, true); need core support
|
||||
//target->CastSpell(target, SPELL_VAPOR_SUMMON, true); need core support
|
||||
Creature* pVapor = me->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
|
||||
if (pVapor)
|
||||
{
|
||||
@@ -341,7 +341,7 @@ public:
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
|
||||
if (!target)
|
||||
target = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
|
||||
target = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_PLAYER_GUID) : 0);
|
||||
|
||||
if (!target)
|
||||
{
|
||||
|
||||
@@ -117,14 +117,14 @@ public:
|
||||
{
|
||||
boss_kalecgosAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
SathGUID = 0;
|
||||
DoorGUID = 0;
|
||||
bJustReset = false;
|
||||
me->setActive(true);
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 ArcaneBuffetTimer;
|
||||
uint32 FrostBreathTimer;
|
||||
@@ -146,10 +146,10 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
SathGUID = pInstance->GetData64(DATA_SATHROVARR);
|
||||
pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED);
|
||||
SathGUID = instance->GetData64(DATA_SATHROVARR);
|
||||
instance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
if (Creature* Sath = Unit::GetCreature(*me, SathGUID))
|
||||
@@ -351,8 +351,8 @@ public:
|
||||
DoScriptText(SAY_EVIL_AGGRO, me);
|
||||
DoZoneInCombat();
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KALECGOS_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_KALECGOS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -445,7 +445,7 @@ public:
|
||||
|
||||
struct boss_kalecAI : public ScriptedAI
|
||||
{
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 RevitalizeTimer;
|
||||
uint32 HeroicStrikeTimer;
|
||||
@@ -458,13 +458,13 @@ public:
|
||||
|
||||
boss_kalecAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
SathGUID = pInstance->GetData64(DATA_SATHROVARR);
|
||||
if (instance)
|
||||
SathGUID = instance->GetData64(DATA_SATHROVARR);
|
||||
|
||||
RevitalizeTimer = 5000;
|
||||
HeroicStrikeTimer = 3000;
|
||||
@@ -540,14 +540,14 @@ class kalecgos_teleporter : public GameObjectScript
|
||||
public:
|
||||
kalecgos_teleporter() : GameObjectScript("kalecgos_teleporter") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* pGo)
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
uint8 SpectralPlayers = 0;
|
||||
Map* pMap = pGo->GetMap();
|
||||
if (!pMap->IsDungeon())
|
||||
Map* map = go->GetMap();
|
||||
if (!map->IsDungeon())
|
||||
return true;
|
||||
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (i->getSource() && i->getSource()->GetPositionZ() < DEMON_REALM_Z + 5)
|
||||
@@ -577,12 +577,12 @@ public:
|
||||
{
|
||||
boss_sathrovarrAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
KalecGUID = 0;
|
||||
KalecgosGUID = 0;
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 CorruptionStrikeTimer;
|
||||
uint32 AgonyCurseTimer;
|
||||
@@ -600,10 +600,10 @@ public:
|
||||
{
|
||||
me->SetFullHealth();//dunno why it does not resets health at evade..
|
||||
me->setActive(true);
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
KalecgosGUID = pInstance->GetData64(DATA_KALECGOS_DRAGON);
|
||||
pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED);
|
||||
KalecgosGUID = instance->GetData64(DATA_KALECGOS_DRAGON);
|
||||
instance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED);
|
||||
}
|
||||
if (KalecGUID)
|
||||
{
|
||||
@@ -669,15 +669,15 @@ public:
|
||||
CAST_AI(boss_kalecgos::boss_kalecgosAI, Kalecgos->AI())->isFriendly = true;
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KALECGOS_EVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_KALECGOS_EVENT, DONE);
|
||||
}
|
||||
|
||||
void TeleportAllPlayersBack()
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
if (!pMap->IsDungeon()) return;
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
Map* map = me->GetMap();
|
||||
if (!map->IsDungeon()) return;
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (i->getSource()->GetPositionZ() <= DRAGON_REALM_Z-5)
|
||||
|
||||
@@ -253,10 +253,10 @@ public:
|
||||
{
|
||||
boss_kalecgos_kjAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
uint8 OrbsEmpowered;
|
||||
uint8 EmpowerCount;
|
||||
|
||||
@@ -275,19 +275,19 @@ public:
|
||||
|
||||
GameObject* GetOrb(int32 index)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return NULL;
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_1));
|
||||
return instance->instance->GetGameObject(instance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_1));
|
||||
case 1:
|
||||
return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_2));
|
||||
return instance->instance->GetGameObject(instance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_2));
|
||||
case 2:
|
||||
return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_3));
|
||||
return instance->instance->GetGameObject(instance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_3));
|
||||
case 3:
|
||||
return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_4));
|
||||
return instance->instance->GetGameObject(instance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_4));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -374,19 +374,19 @@ class go_orb_of_the_blue_flight : public GameObjectScript
|
||||
public:
|
||||
go_orb_of_the_blue_flight() : GameObjectScript("go_orb_of_the_blue_flight") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* pGo)
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
if (pGo->GetUInt32Value(GAMEOBJECT_FACTION) == 35)
|
||||
if (go->GetUInt32Value(GAMEOBJECT_FACTION) == 35)
|
||||
{
|
||||
InstanceScript* pInstance = pGo->GetInstanceScript();
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
player->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
|
||||
player->CastSpell(player, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, false);
|
||||
pGo->SetUInt32Value(GAMEOBJECT_FACTION, 0);
|
||||
go->SetUInt32Value(GAMEOBJECT_FACTION, 0);
|
||||
|
||||
if (Creature* pKalec = Unit::GetCreature(*player, pInstance->GetData64(DATA_KALECGOS_KJ)))
|
||||
if (Creature* pKalec = Unit::GetCreature(*player, instance->GetData64(DATA_KALECGOS_KJ)))
|
||||
CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalec->AI())->SetRingOfBlueFlames();
|
||||
|
||||
pGo->Refresh();
|
||||
go->Refresh();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -408,10 +408,10 @@ public:
|
||||
{
|
||||
mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), summons(me)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
SummonList summons;
|
||||
|
||||
bool bSummonedDeceivers;
|
||||
@@ -434,7 +434,7 @@ public:
|
||||
{
|
||||
phase = PHASE_DECEIVERS;
|
||||
|
||||
if (Creature* pKalecKJ = Unit::GetCreature((*me), pInstance->GetData64(DATA_KALECGOS_KJ)))
|
||||
if (Creature* pKalecKJ = Unit::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ)))
|
||||
CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs();
|
||||
deceiverDeathCount = 0;
|
||||
bSummonedDeceivers = false;
|
||||
@@ -467,7 +467,7 @@ public:
|
||||
{
|
||||
if (uiRandomSayTimer < diff)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED)
|
||||
if (instance && instance->GetData(DATA_MURU_EVENT) != DONE && instance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED)
|
||||
DoScriptText(RAND(SAY_KJ_OFFCOMBAT1, SAY_KJ_OFFCOMBAT2, SAY_KJ_OFFCOMBAT3, SAY_KJ_OFFCOMBAT4, SAY_KJ_OFFCOMBAT5), me);
|
||||
uiRandomSayTimer = 30000;
|
||||
} else uiRandomSayTimer -= diff;
|
||||
@@ -508,10 +508,10 @@ public:
|
||||
{
|
||||
boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), summons(me)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
SummonList summons;
|
||||
|
||||
uint8 Phase;
|
||||
@@ -567,9 +567,9 @@ public:
|
||||
OrbActivated = false;
|
||||
SpeechBegins = true;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
if (Creature* pKalec = Unit::GetCreature(*me, pInstance->GetData64(DATA_KALECGOS_KJ)))
|
||||
if (Creature* pKalec = Unit::GetCreature(*me, instance->GetData64(DATA_KALECGOS_KJ)))
|
||||
pKalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
|
||||
}
|
||||
me->SetFloatValue(UNIT_FIELD_COMBATREACH, 12);
|
||||
@@ -616,8 +616,8 @@ public:
|
||||
DoScriptText(SAY_KJ_DEATH, me);
|
||||
summons.DespawnAll();
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KILJAEDEN_EVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_KILJAEDEN_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -631,9 +631,9 @@ public:
|
||||
summons.DespawnAll();
|
||||
|
||||
// Reset the controller
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
|
||||
if (Creature* pControl = Unit::GetCreature(*me, instance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
|
||||
CAST_AI(mob_kiljaeden_controller::mob_kiljaeden_controllerAI, pControl->AI())->Reset();
|
||||
}
|
||||
}
|
||||
@@ -722,11 +722,11 @@ public:
|
||||
if (Speeches[speechCount].timer < SpeechTimer)
|
||||
{
|
||||
SpeechTimer = 0;
|
||||
if (pInstance)
|
||||
if (Creature* pSpeechCreature = Unit::GetCreature(*me, pInstance->GetData64(Speeches[speechCount].creature)))
|
||||
if (instance)
|
||||
if (Creature* pSpeechCreature = Unit::GetCreature(*me, instance->GetData64(Speeches[speechCount].creature)))
|
||||
DoScriptText(Speeches[speechCount].textid, pSpeechCreature);
|
||||
if (speechCount == 12)
|
||||
if (Creature* pAnveena = Unit::GetCreature(*me, pInstance->GetData64(DATA_ANVEENA)))
|
||||
if (Creature* pAnveena = Unit::GetCreature(*me, instance->GetData64(DATA_ANVEENA)))
|
||||
pAnveena->CastSpell(me, SPELL_SACRIFICE_OF_ANVEENA, false);
|
||||
// ChangeTimers(true, 10000); // Kil should do an emote while screaming without attacking for 10 seconds
|
||||
if (speechCount == speechPhaseEnd)
|
||||
@@ -825,8 +825,8 @@ public:
|
||||
}
|
||||
break;
|
||||
case TIMER_ORBS_EMPOWER: //Phase 3
|
||||
if (pInstance)
|
||||
if (Creature* pKalec = Unit::GetCreature(*me, pInstance->GetData64(DATA_KALECGOS_KJ)))
|
||||
if (instance)
|
||||
if (Creature* pKalec = Unit::GetCreature(*me, instance->GetData64(DATA_KALECGOS_KJ)))
|
||||
{
|
||||
switch (Phase)
|
||||
{
|
||||
@@ -922,10 +922,10 @@ public:
|
||||
{
|
||||
mob_hand_of_the_deceiverAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 ShadowBoltVolleyTimer;
|
||||
uint32 FelfirePortalTimer;
|
||||
@@ -935,8 +935,8 @@ public:
|
||||
// TODO: Timers!
|
||||
ShadowBoltVolleyTimer = urand(8000, 14000); // So they don't all cast it in the same moment.
|
||||
FelfirePortalTimer = 20000;
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KILJAEDEN_EVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_KILJAEDEN_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
@@ -947,10 +947,10 @@ public:
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS);
|
||||
if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
|
||||
instance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS);
|
||||
if (Creature* pControl = Unit::GetCreature(*me, instance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
|
||||
pControl->AddThreat(who, 1.0f);
|
||||
}
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
@@ -958,10 +958,10 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
|
||||
if (Creature* pControl = Unit::GetCreature(*me, instance->GetData64(DATA_KILJAEDEN_CONTROLLER)))
|
||||
++(CAST_AI(mob_kiljaeden_controller::mob_kiljaeden_controllerAI, pControl->AI())->deceiverDeathCount);
|
||||
}
|
||||
|
||||
@@ -1181,10 +1181,10 @@ public:
|
||||
{
|
||||
mob_shield_orbAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
bool bPointReached;
|
||||
bool bClockwise;
|
||||
@@ -1237,7 +1237,7 @@ public:
|
||||
|
||||
if (uiTimer <= diff)
|
||||
{
|
||||
if (Unit* random = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0))
|
||||
if (Unit* random = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_PLAYER_GUID) : 0))
|
||||
DoCast(random, SPELL_SHADOW_BOLT, false);
|
||||
uiTimer = urand(500, 1000);
|
||||
} else uiTimer -= diff;
|
||||
|
||||
@@ -115,10 +115,10 @@ public:
|
||||
{
|
||||
boss_entropiusAI(Creature* c) : ScriptedAI(c), Summons(me)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
SummonList Summons;
|
||||
|
||||
uint32 BlackHoleSummonTimer;
|
||||
@@ -130,8 +130,8 @@ public:
|
||||
|
||||
Summons.DespawnAll();
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MURU_EVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_MURU_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
@@ -139,8 +139,8 @@ public:
|
||||
DoCastAOE(SPELL_NEGATIVE_ENERGY_E, true);
|
||||
DoCast(me, SPELL_ENTROPIUS_SPAWN, false);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MURU_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_MURU_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
@@ -165,8 +165,8 @@ public:
|
||||
{
|
||||
Summons.DespawnAll();
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MURU_EVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_MURU_EVENT, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
@@ -215,10 +215,10 @@ public:
|
||||
{
|
||||
boss_muruAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
SummonList Summons;
|
||||
|
||||
uint8 Phase;
|
||||
@@ -242,16 +242,16 @@ public:
|
||||
|
||||
Summons.DespawnAll();
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MURU_EVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_MURU_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoCastAOE(SPELL_NEGATIVE_ENERGY, false);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MURU_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_MURU_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*done_by*/, uint32 &damage)
|
||||
@@ -292,9 +292,9 @@ public:
|
||||
{
|
||||
if (Timer[TIMER_PHASE] <= diff)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
switch (pInstance->GetData(DATA_MURU_EVENT))
|
||||
switch (instance->GetData(DATA_MURU_EVENT))
|
||||
{
|
||||
case NOT_STARTED:
|
||||
Reset();
|
||||
@@ -380,10 +380,10 @@ public:
|
||||
{
|
||||
npc_muru_portalAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
SummonList Summons;
|
||||
|
||||
@@ -406,8 +406,8 @@ public:
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
if (pInstance)
|
||||
if (Player* Target = Unit::GetPlayer(*me, pInstance->GetData64(DATA_PLAYER_GUID)))
|
||||
if (instance)
|
||||
if (Player* Target = Unit::GetPlayer(*me, instance->GetData64(DATA_PLAYER_GUID)))
|
||||
summoned->AI()->AttackStart(Target);
|
||||
|
||||
Summons.Summon(summoned);
|
||||
@@ -435,7 +435,7 @@ public:
|
||||
{
|
||||
if (!SummonSentinel)
|
||||
{
|
||||
if (InAction && pInstance && pInstance->GetData(DATA_MURU_EVENT) == NOT_STARTED)
|
||||
if (InAction && instance && instance->GetData(DATA_MURU_EVENT) == NOT_STARTED)
|
||||
Reset();
|
||||
return;
|
||||
}
|
||||
@@ -583,10 +583,10 @@ public:
|
||||
{
|
||||
npc_blackholeAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 DespawnTimer;
|
||||
uint32 SpellTimer;
|
||||
@@ -607,7 +607,7 @@ public:
|
||||
{
|
||||
if (SpellTimer <= diff)
|
||||
{
|
||||
Unit* Victim = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
|
||||
Unit* Victim = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_PLAYER_GUID) : 0);
|
||||
switch (NeedForAHack)
|
||||
{
|
||||
case 0:
|
||||
|
||||
@@ -42,14 +42,14 @@ class instance_sunwell_plateau : public InstanceMapScript
|
||||
public:
|
||||
instance_sunwell_plateau() : InstanceMapScript("instance_sunwell_plateau", 580) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_sunwell_plateau_InstanceMapScript(pMap);
|
||||
return new instance_sunwell_plateau_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_sunwell_plateau_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_sunwell_plateau_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_sunwell_plateau_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class boss_archaedas : public CreatureScript
|
||||
{
|
||||
boss_archaedasAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
uint32 uiTremorTimer;
|
||||
@@ -75,7 +75,7 @@ class boss_archaedas : public CreatureScript
|
||||
|
||||
bool bGuardiansAwake;
|
||||
bool bVaultWalkersAwake;
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -87,8 +87,8 @@ class boss_archaedas : public CreatureScript
|
||||
bGuardiansAwake = false;
|
||||
bVaultWalkersAwake = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(0, 5); // respawn any dead minions
|
||||
if (instance)
|
||||
instance->SetData(0, 5); // respawn any dead minions
|
||||
me->setFaction(35);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
@@ -132,7 +132,7 @@ class boss_archaedas : public CreatureScript
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
// we're still doing awaken animation
|
||||
if (bWakingUp && iAwakenTimer >= 0)
|
||||
@@ -142,7 +142,7 @@ class boss_archaedas : public CreatureScript
|
||||
} else if (bWakingUp && iAwakenTimer <= 0)
|
||||
{
|
||||
bWakingUp = false;
|
||||
AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0)));
|
||||
AttackStart(Unit::GetUnit(*me, instance->GetData64(0)));
|
||||
return; // dont want to continue until we finish the AttackStart method
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ class boss_archaedas : public CreatureScript
|
||||
// wake a wall minion
|
||||
if (uiWallMinionTimer <= uiDiff)
|
||||
{
|
||||
pInstance->SetData (DATA_MINIONS, IN_PROGRESS);
|
||||
instance->SetData (DATA_MINIONS, IN_PROGRESS);
|
||||
|
||||
uiWallMinionTimer = 10000;
|
||||
} else uiWallMinionTimer -= uiDiff;
|
||||
@@ -161,12 +161,12 @@ class boss_archaedas : public CreatureScript
|
||||
//If we are <66 summon the guardians
|
||||
if (!bGuardiansAwake && !HealthAbovePct(66))
|
||||
{
|
||||
ActivateMinion(pInstance->GetData64(5), true); // EarthenGuardian1
|
||||
ActivateMinion(pInstance->GetData64(6), true); // EarthenGuardian2
|
||||
ActivateMinion(pInstance->GetData64(7), true); // EarthenGuardian3
|
||||
ActivateMinion(pInstance->GetData64(8), true); // EarthenGuardian4
|
||||
ActivateMinion(pInstance->GetData64(9), true); // EarthenGuardian5
|
||||
ActivateMinion(pInstance->GetData64(10), false); // EarthenGuardian6
|
||||
ActivateMinion(instance->GetData64(5), true); // EarthenGuardian1
|
||||
ActivateMinion(instance->GetData64(6), true); // EarthenGuardian2
|
||||
ActivateMinion(instance->GetData64(7), true); // EarthenGuardian3
|
||||
ActivateMinion(instance->GetData64(8), true); // EarthenGuardian4
|
||||
ActivateMinion(instance->GetData64(9), true); // EarthenGuardian5
|
||||
ActivateMinion(instance->GetData64(10), false); // EarthenGuardian6
|
||||
me->MonsterYell(SAY_SUMMON, LANG_UNIVERSAL, 0);
|
||||
DoPlaySoundToSet(me, SOUND_SUMMON);
|
||||
bGuardiansAwake = true;
|
||||
@@ -175,10 +175,10 @@ class boss_archaedas : public CreatureScript
|
||||
//If we are <33 summon the vault walkers
|
||||
if (!bVaultWalkersAwake && !HealthAbovePct(33))
|
||||
{
|
||||
ActivateMinion(pInstance->GetData64(1), true); // VaultWalker1
|
||||
ActivateMinion(pInstance->GetData64(2), true); // VaultWalker2
|
||||
ActivateMinion(pInstance->GetData64(3), true); // VaultWalker3
|
||||
ActivateMinion(pInstance->GetData64(4), false); // VaultWalker4
|
||||
ActivateMinion(instance->GetData64(1), true); // VaultWalker1
|
||||
ActivateMinion(instance->GetData64(2), true); // VaultWalker2
|
||||
ActivateMinion(instance->GetData64(3), true); // VaultWalker3
|
||||
ActivateMinion(instance->GetData64(4), false); // VaultWalker4
|
||||
me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, 0);
|
||||
DoPlaySoundToSet(me, SOUND_SUMMON2);
|
||||
bVaultWalkersAwake = true;
|
||||
@@ -198,10 +198,10 @@ class boss_archaedas : public CreatureScript
|
||||
|
||||
void JustDied (Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_ANCIENT_DOOR, DONE); // open the vault door
|
||||
pInstance->SetData(DATA_MINIONS, SPECIAL); // deactivate his minions
|
||||
instance->SetData(DATA_ANCIENT_DOOR, DONE); // open the vault door
|
||||
instance->SetData(DATA_MINIONS, SPECIAL); // deactivate his minions
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -234,7 +234,7 @@ class mob_archaedas_minions : public CreatureScript
|
||||
{
|
||||
mob_archaedas_minionsAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
uint32 uiArcing_Timer;
|
||||
@@ -242,7 +242,7 @@ class mob_archaedas_minions : public CreatureScript
|
||||
bool bWakingUp;
|
||||
|
||||
bool bAmIAwake;
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -293,7 +293,7 @@ class mob_archaedas_minions : public CreatureScript
|
||||
{
|
||||
bWakingUp = false;
|
||||
bAmIAwake = true;
|
||||
// AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); // whoWokeArchaedasGUID
|
||||
// AttackStart(Unit::GetUnit(*me, instance->GetData64(0))); // whoWokeArchaedasGUID
|
||||
return; // dont want to continue until we finish the AttackStart method
|
||||
}
|
||||
|
||||
@@ -333,10 +333,10 @@ class mob_stonekeepers : public CreatureScript
|
||||
{
|
||||
mob_stonekeepersAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -365,8 +365,8 @@ class mob_stonekeepers : public CreatureScript
|
||||
void JustDied(Unit* /*attacker*/)
|
||||
{
|
||||
DoCast (me, SPELL_SELF_DESTRUCT, true);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate next stonekeeper
|
||||
if (instance)
|
||||
instance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate next stonekeeper
|
||||
}
|
||||
};
|
||||
|
||||
@@ -396,13 +396,13 @@ class go_altar_of_archaedas : public GameObjectScript
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* /*pGO*/)
|
||||
{
|
||||
InstanceScript* pInstance = player->GetInstanceScript();
|
||||
if (!pInstance)
|
||||
InstanceScript* instance = player->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
player->CastSpell (player, SPELL_BOSS_OBJECT_VISUAL, false);
|
||||
|
||||
pInstance->SetData64(0, player->GetGUID()); // activate archaedas
|
||||
instance->SetData64(0, player->GetGUID()); // activate archaedas
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -425,15 +425,15 @@ class go_altar_of_the_keepers : public GameObjectScript
|
||||
{
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* /*pGo*/)
|
||||
bool OnGossipHello(Player* player, GameObject* /*go*/)
|
||||
{
|
||||
InstanceScript* pInstance = player->GetInstanceScript();
|
||||
if (!pInstance)
|
||||
InstanceScript* instance = player->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
player->CastSpell (player, SPELL_BOSS_OBJECT_VISUAL, false);
|
||||
|
||||
pInstance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate the Stone Keepers
|
||||
instance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate the Stone Keepers
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
|
||||
struct instance_uldaman_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_uldaman_InstanceMapScript(Map* pMap) : InstanceScript(pMap)
|
||||
instance_uldaman_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -480,9 +480,9 @@ class instance_uldaman : public InstanceMapScript
|
||||
} // end GetData64
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_uldaman_InstanceMapScript(pMap);
|
||||
return new instance_uldaman_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -110,10 +110,10 @@ class go_keystone_chamber : public GameObjectScript
|
||||
public:
|
||||
go_keystone_chamber() : GameObjectScript("go_keystone_chamber") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* pGo)
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go)
|
||||
{
|
||||
if (InstanceScript* pInstance = pGo->GetInstanceScript())
|
||||
pInstance->SetData(DATA_IRONAYA_SEAL, IN_PROGRESS); //door animation and save state.
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
instance->SetData(DATA_IRONAYA_SEAL, IN_PROGRESS); //door animation and save state.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,9 +74,9 @@ class boss_akilzon : public CreatureScript
|
||||
{
|
||||
boss_akilzonAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 BirdGUIDs[8];
|
||||
uint64 TargetGUID;
|
||||
@@ -97,8 +97,8 @@ class boss_akilzon : public CreatureScript
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
|
||||
|
||||
StaticDisruption_Timer = urand(10000, 20000); //10 to 20 seconds (bosskillers)
|
||||
GustOfWind_Timer = urand(20000, 30000); //20 to 30 seconds(bosskillers)
|
||||
@@ -127,16 +127,16 @@ class boss_akilzon : public CreatureScript
|
||||
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
|
||||
DoPlaySoundToSet(me, SOUND_ONAGGRO);
|
||||
//DoZoneInCombat();
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0);
|
||||
DoPlaySoundToSet(me, SOUND_ONDEATH);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_AKILZONEVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_AKILZONEVENT, DONE);
|
||||
DespawnSummons();
|
||||
}
|
||||
|
||||
@@ -170,14 +170,14 @@ class boss_akilzon : public CreatureScript
|
||||
|
||||
void SetWeather(uint32 weather, float grade)
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
if (!pMap->IsDungeon())
|
||||
Map* map = me->GetMap();
|
||||
if (!map->IsDungeon())
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_WEATHER, (4+4+4));
|
||||
data << uint32(weather) << float(grade) << uint8(0);
|
||||
|
||||
pMap->SendToPlayers(&data);
|
||||
map->SendToPlayers(&data);
|
||||
}
|
||||
|
||||
void HandleStormSequence(Unit* Cloud) // 1: begin, 2-9: tick, 10: end
|
||||
|
||||
@@ -85,10 +85,10 @@ class boss_halazzi : public CreatureScript
|
||||
{
|
||||
boss_halazziAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 FrenzyTimer;
|
||||
uint32 SaberlashTimer;
|
||||
@@ -105,8 +105,8 @@ class boss_halazzi : public CreatureScript
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
|
||||
|
||||
TransformCount = 0;
|
||||
BerserkTimer = 600000;
|
||||
@@ -120,8 +120,8 @@ class boss_halazzi : public CreatureScript
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
|
||||
|
||||
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0);
|
||||
DoPlaySoundToSet(me, SOUND_AGGRO);
|
||||
@@ -326,8 +326,8 @@ class boss_halazzi : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HALAZZIEVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_HALAZZIEVENT, DONE);
|
||||
|
||||
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0);
|
||||
DoPlaySoundToSet(me, SOUND_DEATH);
|
||||
|
||||
@@ -177,11 +177,11 @@ static PlayerAbilityStruct PlayerAbility[][3] =
|
||||
|
||||
struct boss_hexlord_addAI : public ScriptedAI
|
||||
{
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
boss_hexlord_addAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Reset() {}
|
||||
@@ -190,7 +190,7 @@ struct boss_hexlord_addAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 /*diff*/)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_HEXLORDEVENT) != IN_PROGRESS)
|
||||
if (instance && instance->GetData(DATA_HEXLORDEVENT) != IN_PROGRESS)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -213,13 +213,13 @@ class boss_hexlord_malacrass : public CreatureScript
|
||||
{
|
||||
boss_hex_lord_malacrassAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
SelectAddEntry();
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
AddGUID[i] = 0;
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 AddGUID[4];
|
||||
uint32 AddEntry[4];
|
||||
@@ -237,8 +237,8 @@ class boss_hexlord_malacrass : public CreatureScript
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HEXLORDEVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_HEXLORDEVENT, NOT_STARTED);
|
||||
|
||||
SpiritBolts_Timer = 20000;
|
||||
DrainPower_Timer = 60000;
|
||||
@@ -255,8 +255,8 @@ class boss_hexlord_malacrass : public CreatureScript
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS);
|
||||
|
||||
DoZoneInCombat();
|
||||
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0);
|
||||
@@ -292,8 +292,8 @@ class boss_hexlord_malacrass : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*victim*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HEXLORDEVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_HEXLORDEVENT, DONE);
|
||||
|
||||
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0);
|
||||
DoPlaySoundToSet(me, SOUND_YELL_DEATH);
|
||||
@@ -359,9 +359,9 @@ class boss_hexlord_malacrass : public CreatureScript
|
||||
if (CheckAddState_Timer <= diff)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, AddGUID[i]))
|
||||
if (pTemp->isAlive() && !pTemp->getVictim())
|
||||
pTemp->AI()->AttackStart(me->getVictim());
|
||||
if (Creature* temp = Unit::GetCreature(*me, AddGUID[i]))
|
||||
if (temp->isAlive() && !temp->getVictim())
|
||||
temp->AI()->AttackStart(me->getVictim());
|
||||
|
||||
CheckAddState_Timer = 5000;
|
||||
} else CheckAddState_Timer -= diff;
|
||||
|
||||
@@ -115,10 +115,10 @@ class boss_janalai : public CreatureScript
|
||||
{
|
||||
boss_janalaiAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 FireBreathTimer;
|
||||
uint32 BombTimer;
|
||||
@@ -137,8 +137,8 @@ class boss_janalai : public CreatureScript
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_JANALAIEVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_JANALAIEVENT, NOT_STARTED);
|
||||
|
||||
FireBreathTimer = 8000;
|
||||
BombTimer = 30000;
|
||||
@@ -163,8 +163,8 @@ class boss_janalai : public CreatureScript
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_JANALAIEVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_JANALAIEVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -174,8 +174,8 @@ class boss_janalai : public CreatureScript
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_JANALAIEVENT, IN_PROGRESS);
|
||||
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
// DoZoneInCombat();
|
||||
@@ -375,9 +375,9 @@ class boss_janalai : public CreatureScript
|
||||
BombSequenceTimer = 100;
|
||||
|
||||
//Teleport every Player into the middle
|
||||
Map* pMap = me->GetMap();
|
||||
if (!pMap->IsDungeon()) return;
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
Map* map = me->GetMap();
|
||||
if (!map->IsDungeon()) return;
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* i_pl = i->getSource())
|
||||
if (i_pl->isAlive())
|
||||
@@ -488,10 +488,10 @@ class mob_janalai_hatcher : public CreatureScript
|
||||
{
|
||||
mob_janalai_hatcherAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance =c->GetInstanceScript();
|
||||
instance =c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 waypoint;
|
||||
uint32 HatchNum;
|
||||
@@ -561,7 +561,7 @@ class mob_janalai_hatcher : public CreatureScript
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
|
||||
if (!instance || !(instance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
|
||||
{
|
||||
me->DisappearAndDie();
|
||||
return;
|
||||
@@ -621,10 +621,10 @@ class mob_janalai_hatchling : public CreatureScript
|
||||
{
|
||||
mob_janalai_hatchlingAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance =c->GetInstanceScript();
|
||||
instance =c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
uint32 BuffetTimer;
|
||||
|
||||
void Reset()
|
||||
@@ -642,7 +642,7 @@ class mob_janalai_hatchling : public CreatureScript
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
|
||||
if (!instance || !(instance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
|
||||
{
|
||||
me->DisappearAndDie();
|
||||
return;
|
||||
|
||||
@@ -105,10 +105,10 @@ class boss_nalorakk : public CreatureScript
|
||||
{
|
||||
MoveEvent = true;
|
||||
MovePhase = 0;
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 BrutalSwipe_Timer;
|
||||
uint32 Mangle_Timer;
|
||||
@@ -142,8 +142,8 @@ class boss_nalorakk : public CreatureScript
|
||||
(*me).GetMotionMaster()->MovePoint(0, NalorakkWay[7][0], NalorakkWay[7][1], NalorakkWay[7][2]);
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_NALORAKKEVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_NALORAKKEVENT, NOT_STARTED);
|
||||
|
||||
Surge_Timer = 15000 + rand()%5000;
|
||||
BrutalSwipe_Timer = 7000 + rand()%5000;
|
||||
@@ -269,8 +269,8 @@ class boss_nalorakk : public CreatureScript
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
|
||||
|
||||
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0);
|
||||
DoPlaySoundToSet(me, SOUND_YELL_AGGRO);
|
||||
@@ -279,8 +279,8 @@ class boss_nalorakk : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_NALORAKKEVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_NALORAKKEVENT, DONE);
|
||||
|
||||
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0);
|
||||
DoPlaySoundToSet(me, SOUND_YELL_DEATH);
|
||||
|
||||
@@ -153,9 +153,9 @@ class boss_zuljin : public CreatureScript
|
||||
{
|
||||
boss_zuljinAI(Creature* c) : ScriptedAI(c), Summons(me)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 SpiritGUID[4];
|
||||
uint64 ClawTargetGUID;
|
||||
@@ -186,8 +186,8 @@ class boss_zuljin : public CreatureScript
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
|
||||
|
||||
Phase = 0;
|
||||
|
||||
@@ -223,8 +223,8 @@ class boss_zuljin : public CreatureScript
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
|
||||
|
||||
DoZoneInCombat();
|
||||
|
||||
@@ -254,8 +254,8 @@ class boss_zuljin : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ZULJINEVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_ZULJINEVENT, DONE);
|
||||
|
||||
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0);
|
||||
DoPlaySoundToSet(me, SOUND_DEATH);
|
||||
@@ -608,7 +608,7 @@ class mob_zuljin_vortex : public CreatureScript
|
||||
|
||||
void Reset() {}
|
||||
|
||||
void EnterCombat(Unit* /*pTarget*/) {}
|
||||
void EnterCombat(Unit* /*target*/) {}
|
||||
|
||||
void SpellHit(Unit* caster, const SpellInfo* spell)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ class instance_zulaman : public InstanceMapScript
|
||||
|
||||
struct instance_zulaman_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_zulaman_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_zulaman_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint64 HarkorsSatchelGUID;
|
||||
uint64 TanzarsTrunkGUID;
|
||||
@@ -314,9 +314,9 @@ class instance_zulaman : public InstanceMapScript
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_zulaman_InstanceMapScript(pMap);
|
||||
return new instance_zulaman_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -51,10 +51,10 @@ class npc_forest_frog : public CreatureScript
|
||||
{
|
||||
npc_forest_frogAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset() {}
|
||||
|
||||
@@ -62,7 +62,7 @@ class npc_forest_frog : public CreatureScript
|
||||
|
||||
void DoSpawnRandom()
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
uint32 cEntry = 0;
|
||||
switch (rand()%10)
|
||||
@@ -79,15 +79,15 @@ class npc_forest_frog : public CreatureScript
|
||||
case 9: cEntry = 24455; break; //Hollee
|
||||
}
|
||||
|
||||
if (!pInstance->GetData(TYPE_RAND_VENDOR_1))
|
||||
if (!instance->GetData(TYPE_RAND_VENDOR_1))
|
||||
if (rand()%10 == 1) cEntry = 24408; //Gunter
|
||||
if (!pInstance->GetData(TYPE_RAND_VENDOR_2))
|
||||
if (!instance->GetData(TYPE_RAND_VENDOR_2))
|
||||
if (rand()%10 == 1) cEntry = 24409; //Kyren
|
||||
|
||||
if (cEntry) me->UpdateEntry(cEntry);
|
||||
|
||||
if (cEntry == 24408) pInstance->SetData(TYPE_RAND_VENDOR_1, DONE);
|
||||
if (cEntry == 24409) pInstance->SetData(TYPE_RAND_VENDOR_2, DONE);
|
||||
if (cEntry == 24408) instance->SetData(TYPE_RAND_VENDOR_1, DONE);
|
||||
if (cEntry == 24409) instance->SetData(TYPE_RAND_VENDOR_2, DONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,11 +167,11 @@ class npc_zulaman_hostage : public CreatureScript
|
||||
return true;
|
||||
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
|
||||
InstanceScript* pInstance = creature->GetInstanceScript();
|
||||
if (pInstance)
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
{
|
||||
//uint8 progress = pInstance->GetData(DATA_CHESTLOOTED);
|
||||
pInstance->SetData(DATA_CHESTLOOTED, 0);
|
||||
//uint8 progress = instance->GetData(DATA_CHESTLOOTED);
|
||||
instance->SetData(DATA_CHESTLOOTED, 0);
|
||||
float x, y, z;
|
||||
creature->GetPosition(x, y, z);
|
||||
uint32 entry = creature->GetEntry();
|
||||
|
||||
@@ -61,10 +61,10 @@ class boss_arlokk : public CreatureScript
|
||||
{
|
||||
boss_arlokkAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
m_pInstance = creature->GetInstanceScript();
|
||||
m_instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* m_pInstance;
|
||||
InstanceScript* m_instance;
|
||||
|
||||
uint32 m_uiShadowWordPain_Timer;
|
||||
uint32 m_uiGouge_Timer;
|
||||
@@ -110,8 +110,8 @@ class boss_arlokk : public CreatureScript
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_ARLOKK, NOT_STARTED);
|
||||
if (m_instance)
|
||||
m_instance->SetData(DATA_ARLOKK, NOT_STARTED);
|
||||
|
||||
//we should be summoned, so despawn
|
||||
me->DespawnOrUnsummon();
|
||||
@@ -124,8 +124,8 @@ class boss_arlokk : public CreatureScript
|
||||
me->SetDisplayId(MODEL_ID_NORMAL);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_ARLOKK, DONE);
|
||||
if (m_instance)
|
||||
m_instance->SetData(DATA_ARLOKK, DONE);
|
||||
}
|
||||
|
||||
void DoSummonPhanters()
|
||||
@@ -269,14 +269,14 @@ class go_gong_of_bethekk : public GameObjectScript
|
||||
{
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* pGo)
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go)
|
||||
{
|
||||
if (InstanceScript* m_pInstance = pGo->GetInstanceScript())
|
||||
if (InstanceScript* m_instance = go->GetInstanceScript())
|
||||
{
|
||||
if (m_pInstance->GetData(DATA_ARLOKK) == DONE || m_pInstance->GetData(DATA_ARLOKK) == IN_PROGRESS)
|
||||
if (m_instance->GetData(DATA_ARLOKK) == DONE || m_instance->GetData(DATA_ARLOKK) == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
m_pInstance->SetData(DATA_ARLOKK, IN_PROGRESS);
|
||||
m_instance->SetData(DATA_ARLOKK, IN_PROGRESS);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,10 +57,10 @@ class boss_hakkar : public CreatureScript
|
||||
{
|
||||
boss_hakkarAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
m_pInstance = c->GetInstanceScript();
|
||||
m_instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* m_pInstance;
|
||||
InstanceScript* m_instance;
|
||||
|
||||
uint32 BloodSiphon_Timer;
|
||||
uint32 CorruptedBlood_Timer;
|
||||
@@ -156,9 +156,9 @@ class boss_hakkar : public CreatureScript
|
||||
//Checking if Jeklik is dead. If not we cast her Aspect
|
||||
if (CheckJeklik_Timer <= diff)
|
||||
{
|
||||
if (m_pInstance)
|
||||
if (m_instance)
|
||||
{
|
||||
if (m_pInstance->GetData(DATA_JEKLIK) != DONE)
|
||||
if (m_instance->GetData(DATA_JEKLIK) != DONE)
|
||||
{
|
||||
if (AspectOfJeklik_Timer <= diff)
|
||||
{
|
||||
@@ -173,9 +173,9 @@ class boss_hakkar : public CreatureScript
|
||||
//Checking if Venoxis is dead. If not we cast his Aspect
|
||||
if (CheckVenoxis_Timer <= diff)
|
||||
{
|
||||
if (m_pInstance)
|
||||
if (m_instance)
|
||||
{
|
||||
if (m_pInstance->GetData(DATA_VENOXIS) != DONE)
|
||||
if (m_instance->GetData(DATA_VENOXIS) != DONE)
|
||||
{
|
||||
if (AspectOfVenoxis_Timer <= diff)
|
||||
{
|
||||
@@ -190,9 +190,9 @@ class boss_hakkar : public CreatureScript
|
||||
//Checking if Marli is dead. If not we cast her Aspect
|
||||
if (CheckMarli_Timer <= diff)
|
||||
{
|
||||
if (m_pInstance)
|
||||
if (m_instance)
|
||||
{
|
||||
if (m_pInstance->GetData(DATA_MARLI) != DONE)
|
||||
if (m_instance->GetData(DATA_MARLI) != DONE)
|
||||
{
|
||||
if (AspectOfMarli_Timer <= diff)
|
||||
{
|
||||
@@ -208,9 +208,9 @@ class boss_hakkar : public CreatureScript
|
||||
//Checking if Thekal is dead. If not we cast his Aspect
|
||||
if (CheckThekal_Timer <= diff)
|
||||
{
|
||||
if (m_pInstance)
|
||||
if (m_instance)
|
||||
{
|
||||
if (m_pInstance->GetData(DATA_THEKAL) != DONE)
|
||||
if (m_instance->GetData(DATA_THEKAL) != DONE)
|
||||
{
|
||||
if (AspectOfThekal_Timer <= diff)
|
||||
{
|
||||
@@ -225,9 +225,9 @@ class boss_hakkar : public CreatureScript
|
||||
//Checking if Arlokk is dead. If yes we cast her Aspect
|
||||
if (CheckArlokk_Timer <= diff)
|
||||
{
|
||||
if (m_pInstance)
|
||||
if (m_instance)
|
||||
{
|
||||
if (m_pInstance->GetData(DATA_ARLOKK) != DONE)
|
||||
if (m_instance->GetData(DATA_ARLOKK) != DONE)
|
||||
{
|
||||
if (AspectOfArlokk_Timer <= diff)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user