Core: Clean up script variables to make variables consistant/standardized, and some additional warning-removals:
+ Fix compilewarning in Unit.cpp + Remove/comment out unused parameters for some commandscripts/scripts (warnings) + Replace "plr" with "player" all over the scriptbase for consistency
This commit is contained in:
@@ -3797,7 +3797,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
|
||||
if (aura->IsSingleTarget())
|
||||
aura->UnregisterSingleTarget();
|
||||
|
||||
if (newAura = Aura::TryRefreshStackOrCreate(aura->GetSpellProto(), effMask, stealer, NULL, &baseDamage[0], NULL, aura->GetCasterGUID()))
|
||||
if (Aura* newAura = Aura::TryRefreshStackOrCreate(aura->GetSpellProto(), effMask, stealer, NULL, &baseDamage[0], NULL, aura->GetCasterGUID()))
|
||||
{
|
||||
// created aura must not be single target aura,, so stealer won't loose it on recast
|
||||
if (newAura->IsSingleTarget())
|
||||
|
||||
@@ -392,14 +392,14 @@ public:
|
||||
|
||||
static bool HandleDebugAreaTriggersCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
Player* plr = handler->GetSession()->GetPlayer();
|
||||
if (!plr->isDebugAreaTriggers)
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
if (!player->isDebugAreaTriggers)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_DEBUG_AREATRIGGER_ON);
|
||||
plr->isDebugAreaTriggers = true;
|
||||
player->isDebugAreaTriggers = true;
|
||||
} else {
|
||||
handler->PSendSysMessage(LANG_DEBUG_AREATRIGGER_OFF);
|
||||
plr->isDebugAreaTriggers = false;
|
||||
player->isDebugAreaTriggers = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWPGPSCommand(ChatHandler* handler, const char *args)
|
||||
static bool HandleWPGPSCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
|
||||
@@ -698,15 +698,15 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Player* plr = target->ToPlayer())
|
||||
if (Player* player = target->ToPlayer())
|
||||
{
|
||||
// check online security
|
||||
if (handler->HasLowerSecurity(plr, 0))
|
||||
if (handler->HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, handler->GetNameLink(plr).c_str());
|
||||
if (handler->needReportToTarget(plr))
|
||||
(ChatHandler(plr)).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale);
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, handler->GetNameLink(player).c_str());
|
||||
if (handler->needReportToTarget(player))
|
||||
(ChatHandler(player)).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale);
|
||||
}
|
||||
|
||||
target->SetFloatValue(OBJECT_FIELD_SCALE_X, Scale);
|
||||
|
||||
@@ -60,13 +60,13 @@ public:
|
||||
{
|
||||
if (FlyBackTimer <= diff)
|
||||
{
|
||||
Player* plr = NULL;
|
||||
Player* player = NULL;
|
||||
if (me->isSummon())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
||||
plr = CAST_PLR(summoner);
|
||||
player = CAST_PLR(summoner);
|
||||
|
||||
if (!plr)
|
||||
if (!player)
|
||||
phase = 3;
|
||||
|
||||
switch(phase)
|
||||
@@ -77,19 +77,19 @@ public:
|
||||
FlyBackTimer = 500;
|
||||
break;
|
||||
case 1:
|
||||
plr->GetClosePoint(x, y, z, me->GetObjectSize());
|
||||
player->GetClosePoint(x, y, z, me->GetObjectSize());
|
||||
z += 2.5; x -= 2; y -= 1.5;
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, player->GetGUID());
|
||||
me->SetVisible(true);
|
||||
FlyBackTimer = 4500;
|
||||
break;
|
||||
case 2:
|
||||
if (!plr->isRessurectRequested())
|
||||
if (!player->isRessurectRequested())
|
||||
{
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
|
||||
DoCast(plr, SPELL_REVIVE, true);
|
||||
me->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
|
||||
DoCast(player, SPELL_REVIVE, true);
|
||||
me->MonsterWhisper(VALK_WHISPER, player->GetGUID());
|
||||
}
|
||||
FlyBackTimer = 5000;
|
||||
break;
|
||||
|
||||
@@ -470,8 +470,8 @@ public:
|
||||
wp_reached = false;
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
SaySound(SAY_ENTRANCE);
|
||||
if (Unit* plr = Unit::GetUnit((*me), PlayerGUID))
|
||||
DoStartMovement(plr);
|
||||
if (Unit* player = Unit::GetUnit((*me), PlayerGUID))
|
||||
DoStartMovement(player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -490,9 +490,9 @@ public:
|
||||
if (withhead && Phase != 0)
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
void KilledUnit(Unit* plr)
|
||||
void KilledUnit(Unit* player)
|
||||
{
|
||||
if (plr->GetTypeId() == TYPEID_PLAYER)
|
||||
if (player->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (withhead)
|
||||
SaySound(SAY_PLAYER_DEATH);
|
||||
@@ -625,19 +625,19 @@ public:
|
||||
if (say_timer <= diff)
|
||||
{
|
||||
say_timer = 3000;
|
||||
Player* plr = SelectRandomPlayer(100.0f, false);
|
||||
Player* player = SelectRandomPlayer(100.0f, false);
|
||||
if (count < 3)
|
||||
{
|
||||
if (plr)
|
||||
plr->Say(Text[count], 0);
|
||||
if (player)
|
||||
player->Say(Text[count], 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoCast(me, SPELL_RHYME_BIG);
|
||||
if (plr)
|
||||
if (player)
|
||||
{
|
||||
plr->Say(Text[count], 0);
|
||||
plr->HandleEmoteCommand(ANIM_EMOTE_SHOUT);
|
||||
player->Say(Text[count], 0);
|
||||
player->HandleEmoteCommand(ANIM_EMOTE_SHOUT);
|
||||
}
|
||||
wp_reached = true;
|
||||
IsFlying = true;
|
||||
@@ -671,8 +671,8 @@ public:
|
||||
case 2:
|
||||
if (conflagrate <= diff)
|
||||
{
|
||||
if (Unit* plr = SelectRandomPlayer(30.0f))
|
||||
DoCast(plr, SPELL_CONFLAGRATION, false);
|
||||
if (Unit* player = SelectRandomPlayer(30.0f))
|
||||
DoCast(player, SPELL_CONFLAGRATION, false);
|
||||
conflagrate = urand(10000, 16000);
|
||||
} else conflagrate -= diff;
|
||||
break;
|
||||
@@ -839,12 +839,12 @@ public:
|
||||
return true;
|
||||
pInstance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS);
|
||||
}
|
||||
/* if (soil->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER && plr->getLevel() > 64)
|
||||
/* if (soil->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER && player->getLevel() > 64)
|
||||
{
|
||||
plr->PrepareQuestMenu(soil->GetGUID());
|
||||
plr->SendPreparedQuest(soil->GetGUID());
|
||||
player->PrepareQuestMenu(soil->GetGUID());
|
||||
player->SendPreparedQuest(soil->GetGUID());
|
||||
}
|
||||
if (plr->GetQuestStatus(11405) == QUEST_STATUS_INCOMPLETE && plr->getLevel() > 64)
|
||||
if (player->GetQuestStatus(11405) == QUEST_STATUS_INCOMPLETE && player->getLevel() > 64)
|
||||
{ */
|
||||
pPlayer->AreaExploredOrEventHappens(11405);
|
||||
if (Creature* horseman = soil->SummonCreature(HH_MOUNTED, FlightPoint[20].x, FlightPoint[20].y, FlightPoint[20].z, 0, TEMPSUMMON_MANUAL_DESPAWN, 0))
|
||||
|
||||
@@ -128,9 +128,9 @@ public:
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
Player* plr = itr->getSource();
|
||||
if (plr && !plr->HasAura(45839, 0))
|
||||
return plr;
|
||||
Player* player = itr->getSource();
|
||||
if (player && !player->HasAura(45839, 0))
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,9 +130,9 @@ public:
|
||||
PlayerGUID = caster->GetGUID();
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* plr = Unit::GetUnit((*me), PlayerGUID);
|
||||
if (plr && CAST_PLR(plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
|
||||
DoCast(plr, 45110, true);
|
||||
Unit* player = Unit::GetUnit((*me), PlayerGUID);
|
||||
if (player && CAST_PLR(player)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
|
||||
DoCast(player, 45110, true);
|
||||
}
|
||||
DoCast(me, ENRAGE);
|
||||
Unit* Myrmidon = me->FindNearestCreature(DM, 70);
|
||||
|
||||
+2
-2
@@ -182,8 +182,8 @@ class instance_culling_of_stratholme : public InstanceMapScript
|
||||
// Summon Chromie and global whisper
|
||||
if (Creature* chromie = instance->SummonCreature(NPC_CHROMIE_2, ChromieSummonPos))
|
||||
if (!instance->GetPlayers().isEmpty())
|
||||
if (Player* plr = instance->GetPlayers().getFirst()->getSource())
|
||||
sCreatureTextMgr->SendChat(chromie, SAY_CRATES_COMPLETED, plr->GetGUID(), CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
|
||||
if (Player* player = instance->GetPlayers().getFirst()->getSource())
|
||||
sCreatureTextMgr->SendChat(chromie, SAY_CRATES_COMPLETED, player->GetGUID(), CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
|
||||
}
|
||||
DoUpdateWorldState(WORLDSTATE_CRATES_REVEALED, _crateCount);
|
||||
break;
|
||||
|
||||
+2
-2
@@ -78,8 +78,8 @@ public:
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
if (Player* plr = itr->getSource())
|
||||
return plr;
|
||||
if (Player* player = itr->getSource())
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
if (Player* plr = itr->getSource())
|
||||
return plr;
|
||||
if (Player* player = itr->getSource())
|
||||
return player;
|
||||
}
|
||||
}
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!");
|
||||
|
||||
@@ -522,14 +522,14 @@ public:
|
||||
|
||||
void HandleAnimation()
|
||||
{
|
||||
Player* plr = Unit::GetPlayer(*me, PlayerGUID);
|
||||
if (!plr)
|
||||
Player* player = Unit::GetPlayer(*me, PlayerGUID);
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
Unit* Fandral = plr->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f, me);
|
||||
Unit* Arygos = plr->FindNearestCreature(C_ARYGOS, 100.0f, me);
|
||||
Unit* Caelestrasz = plr->FindNearestCreature(C_CAELESTRASZ, 100.0f, me);
|
||||
Unit* Merithra = plr->FindNearestCreature(C_MERITHRA, 100.0f, me);
|
||||
Unit* Fandral = player->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f, me);
|
||||
Unit* Arygos = player->FindNearestCreature(C_ARYGOS, 100.0f, me);
|
||||
Unit* Caelestrasz = player->FindNearestCreature(C_CAELESTRASZ, 100.0f, me);
|
||||
Unit* Merithra = player->FindNearestCreature(C_MERITHRA, 100.0f, me);
|
||||
|
||||
if (!Fandral || !Arygos || !Caelestrasz || !Merithra)
|
||||
return;
|
||||
@@ -659,19 +659,19 @@ public:
|
||||
Caelestrasz->GetMotionMaster()->MoveCharge(-8050, 1473, 65, 15);
|
||||
break; //Text: sands will stop
|
||||
case 34:
|
||||
DoCast(plr, 23017, true);//Arcane Channeling
|
||||
DoCast(player, 23017, true);//Arcane Channeling
|
||||
break;
|
||||
case 35:
|
||||
me->CastSpell(-8088, 1520.43f, 2.67f, 25158, true);
|
||||
break;
|
||||
case 36:
|
||||
DoCast(plr, 25159, true);
|
||||
DoCast(player, 25159, true);
|
||||
break;
|
||||
case 37:
|
||||
me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0);
|
||||
break;
|
||||
case 38:
|
||||
DoCast(plr, 25166, true);
|
||||
DoCast(player, 25166, true);
|
||||
me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0);
|
||||
break;
|
||||
case 39:
|
||||
@@ -719,11 +719,11 @@ public:
|
||||
uint32 entries[4] = { 15423, 15424, 15414, 15422 };
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
mob = plr->FindNearestCreature(entries[i], 50, me);
|
||||
mob = player->FindNearestCreature(entries[i], 50, me);
|
||||
while (mob)
|
||||
{
|
||||
mob->RemoveFromWorld();
|
||||
mob = plr->FindNearestCreature(15423, 50, me);
|
||||
mob = player->FindNearestCreature(15423, 50, me);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -755,14 +755,14 @@ public:
|
||||
me->GetMotionMaster()->MoveCharge(-8117.99f, 1532.24f, 3.94f, 4);
|
||||
break;
|
||||
case 60:
|
||||
if (plr)
|
||||
DoScriptText(ANACHRONOS_SAY_10, me, plr);
|
||||
if (player)
|
||||
DoScriptText(ANACHRONOS_SAY_10, me, player);
|
||||
me->GetMotionMaster()->MoveCharge(-8113.46f, 1524.16f, 2.89f, 4);
|
||||
break;
|
||||
case 61:
|
||||
me->GetMotionMaster()->MoveCharge(-8057.1f, 1470.32f, 2.61f, 6);
|
||||
if (plr->IsInRange(me, 0, 15))
|
||||
plr->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD , me);
|
||||
if (player->IsInRange(me, 0, 15))
|
||||
player->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD , me);
|
||||
break;
|
||||
case 62:
|
||||
me->SetDisplayId(15500);
|
||||
@@ -842,7 +842,7 @@ public:
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
//Player* plr = me->GetPlayer(PlayerGUID);
|
||||
//Player* player = me->GetPlayer(PlayerGUID);
|
||||
|
||||
if (!Timers)
|
||||
{
|
||||
@@ -1083,12 +1083,12 @@ class go_crystalline_tear : public GameObjectScript
|
||||
public:
|
||||
go_crystalline_tear() : GameObjectScript("go_crystalline_tear") { }
|
||||
|
||||
bool OnQuestAccept(Player* plr, GameObject* go, Quest const* quest)
|
||||
bool OnQuestAccept(Player* player, GameObject* go, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD)
|
||||
{
|
||||
|
||||
if (Unit* Anachronos_Quest_Trigger = go->FindNearestCreature(15454, 100, plr))
|
||||
if (Unit* Anachronos_Quest_Trigger = go->FindNearestCreature(15454, 100, player))
|
||||
{
|
||||
|
||||
Unit* Merithra = Anachronos_Quest_Trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
|
||||
@@ -1123,9 +1123,9 @@ public:
|
||||
|
||||
if (Anachronos)
|
||||
{
|
||||
CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())->PlayerGUID = plr->GetGUID();
|
||||
CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())->PlayerGUID = player->GetGUID();
|
||||
CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->Failed=false;
|
||||
CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->PlayerGUID = plr->GetGUID();
|
||||
CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->PlayerGUID = player->GetGUID();
|
||||
CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->EventStarted=true;
|
||||
CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->Announced=true;
|
||||
}
|
||||
|
||||
@@ -123,14 +123,14 @@ public:
|
||||
Map::PlayerList const &players = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
{
|
||||
Player* plr = i->getSource();
|
||||
if (!plr || !plr->isAlive())
|
||||
Player* player = i->getSource();
|
||||
if (!player || !player->isAlive())
|
||||
continue;
|
||||
// Summon clone
|
||||
if (Unit* summon = me->SummonCreature(MOB_TWISTED_VISAGE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
{
|
||||
// clone
|
||||
plr->CastSpell(summon, SPELL_CLONE_PLAYER, true);
|
||||
player->CastSpell(summon, SPELL_CLONE_PLAYER, true);
|
||||
// set phase
|
||||
summon->SetPhaseMask((1<<(4+insanityHandled)), true);
|
||||
}
|
||||
|
||||
@@ -1705,7 +1705,7 @@ class achievement_twilight_assist : public AchievementCriteriaScript
|
||||
{
|
||||
}
|
||||
|
||||
bool OnCheck(Player* player, Unit* target)
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
@@ -1725,7 +1725,7 @@ class achievement_twilight_duo : public AchievementCriteriaScript
|
||||
{
|
||||
}
|
||||
|
||||
bool OnCheck(Player* player, Unit* target)
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
@@ -1745,7 +1745,7 @@ class achievement_twilight_zone : public AchievementCriteriaScript
|
||||
{
|
||||
}
|
||||
|
||||
bool OnCheck(Player* player, Unit* target)
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
@@ -186,8 +186,8 @@ class boss_blood_queen_lana_thel : public CreatureScript
|
||||
if (_creditBloodQuickening)
|
||||
{
|
||||
instance->SetData(DATA_BLOOD_QUICKENING_STATE, DONE);
|
||||
if (Player* plr = killer->ToPlayer())
|
||||
plr->RewardPlayerAndGroupAtEvent(NPC_INFILTRATOR_MINCHAR_BQ, plr);
|
||||
if (Player* player = killer->ToPlayer())
|
||||
player->RewardPlayerAndGroupAtEvent(NPC_INFILTRATOR_MINCHAR_BQ, player);
|
||||
if (Creature* minchar = me->FindNearestCreature(NPC_INFILTRATOR_MINCHAR_BQ, 200.0f))
|
||||
{
|
||||
minchar->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
|
||||
@@ -1393,8 +1393,8 @@ class spell_putricide_mutated_transformation : public SpellScriptLoader
|
||||
|
||||
if (putricide->AI()->GetData(DATA_ABOMINATION))
|
||||
{
|
||||
if (Player* plrCaster = caster->ToPlayer())
|
||||
Spell::SendCastResult(plrCaster, GetSpellInfo(), 0, SPELL_FAILED_CUSTOM_ERROR, SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS);
|
||||
if (Player* player = caster->ToPlayer())
|
||||
Spell::SendCastResult(player, GetSpellInfo(), 0, SPELL_FAILED_CUSTOM_ERROR, SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class boss_anomalus : public CreatureScript
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summoned, Unit* who)
|
||||
void SummonedCreatureDies(Creature* summoned, Unit* /*who*/)
|
||||
{
|
||||
if (summoned->GetEntry() == MOB_CHAOTIC_RIFT)
|
||||
chaosTheory = false;
|
||||
|
||||
@@ -428,11 +428,11 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader
|
||||
|
||||
void HandleForceCast(SpellEffIndex i)
|
||||
{
|
||||
Player* plr = GetHitPlayer();
|
||||
if (!plr)
|
||||
Player* player = GetHitPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
plr->CastSpell(GetTargetUnit(), GetSpellInfo()->EffectTriggerSpell[i], true); // Don't send m_originalCasterGUID param here or underlying
|
||||
player->CastSpell(GetTargetUnit(), GetSpellInfo()->EffectTriggerSpell[i], true); // Don't send m_originalCasterGUID param here or underlying
|
||||
PreventHitEffect(i); // AureEffect::HandleAuraControlVehicle will fail on caster == target
|
||||
}
|
||||
|
||||
|
||||
@@ -767,10 +767,10 @@ class spell_xt002_searing_light_spawn_life_spark : public SpellScriptLoader
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* plr = GetOwner()->ToPlayer())
|
||||
if (Player* player = GetOwner()->ToPlayer())
|
||||
if (Unit* xt002 = GetCaster())
|
||||
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
|
||||
plr->CastSpell(plr, SPELL_SUMMON_LIFE_SPARK, true);
|
||||
player->CastSpell(player, SPELL_SUMMON_LIFE_SPARK, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -803,10 +803,10 @@ class spell_xt002_gravity_bomb_aura : public SpellScriptLoader
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* plr = GetOwner()->ToPlayer())
|
||||
if (Player* player = GetOwner()->ToPlayer())
|
||||
if (Unit* xt002 = GetCaster())
|
||||
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
|
||||
plr->CastSpell(plr, SPELL_SUMMON_VOID_ZONE, true);
|
||||
player->CastSpell(player, SPELL_SUMMON_VOID_ZONE, true);
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
|
||||
@@ -113,8 +113,8 @@ public:
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
if (Player* plr = itr->getSource())
|
||||
return plr;
|
||||
if (Player* player = itr->getSource())
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,23 +127,23 @@ void OPvPCapturePointEP_EWT::UpdateTowerState()
|
||||
m_PvP->SendUpdateWorldState(EP_EWT_N , bool(m_TowerState & EP_TS_N));
|
||||
}
|
||||
|
||||
bool OPvPCapturePointEP_EWT::HandlePlayerEnter(Player* plr)
|
||||
bool OPvPCapturePointEP_EWT::HandlePlayerEnter(Player* player)
|
||||
{
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(plr))
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(player))
|
||||
{
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_EWT::HandlePlayerLeave(Player* plr)
|
||||
void OPvPCapturePointEP_EWT::HandlePlayerLeave(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(plr);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(player);
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_EWT::SummonSupportUnitAtNorthpassTower(uint32 team)
|
||||
@@ -276,23 +276,23 @@ void OPvPCapturePointEP_NPT::UpdateTowerState()
|
||||
m_PvP->SendUpdateWorldState(EP_NPT_N , bool(m_TowerState & EP_TS_N));
|
||||
}
|
||||
|
||||
bool OPvPCapturePointEP_NPT::HandlePlayerEnter(Player* plr)
|
||||
bool OPvPCapturePointEP_NPT::HandlePlayerEnter(Player* player)
|
||||
{
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(plr))
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(player))
|
||||
{
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_NPT::HandlePlayerLeave(Player* plr)
|
||||
void OPvPCapturePointEP_NPT::HandlePlayerLeave(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(plr);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(player);
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_NPT::SummonGO(uint32 team)
|
||||
@@ -408,23 +408,23 @@ void OPvPCapturePointEP_CGT::UpdateTowerState()
|
||||
m_PvP->SendUpdateWorldState(EP_CGT_N , bool(m_TowerState & EP_TS_N));
|
||||
}
|
||||
|
||||
bool OPvPCapturePointEP_CGT::HandlePlayerEnter(Player* plr)
|
||||
bool OPvPCapturePointEP_CGT::HandlePlayerEnter(Player* player)
|
||||
{
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(plr))
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(player))
|
||||
{
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_CGT::HandlePlayerLeave(Player* plr)
|
||||
void OPvPCapturePointEP_CGT::HandlePlayerLeave(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(plr);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(player);
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_CGT::LinkGraveYard(uint32 team)
|
||||
@@ -547,23 +547,23 @@ void OPvPCapturePointEP_PWT::UpdateTowerState()
|
||||
m_PvP->SendUpdateWorldState(EP_PWT_N , bool(m_TowerState & EP_TS_N));
|
||||
}
|
||||
|
||||
bool OPvPCapturePointEP_PWT::HandlePlayerEnter(Player* plr)
|
||||
bool OPvPCapturePointEP_PWT::HandlePlayerEnter(Player* player)
|
||||
{
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(plr))
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(player))
|
||||
{
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_PWT::HandlePlayerLeave(Player* plr)
|
||||
void OPvPCapturePointEP_PWT::HandlePlayerLeave(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(plr);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(player);
|
||||
}
|
||||
|
||||
void OPvPCapturePointEP_PWT::SummonFlightMaster(uint32 team)
|
||||
@@ -658,58 +658,58 @@ bool OutdoorPvPEP::Update(uint32 diff)
|
||||
return false;
|
||||
}
|
||||
|
||||
void OutdoorPvPEP::HandlePlayerEnterZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPEP::HandlePlayerEnterZone(Player* player, uint32 zone)
|
||||
{
|
||||
// add buffs
|
||||
if (plr->GetTeam() == ALLIANCE)
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
{
|
||||
if (m_AllianceTowersControlled && m_AllianceTowersControlled < 5)
|
||||
plr->CastSpell(plr, EP_AllianceBuffs[m_AllianceTowersControlled-1], true);
|
||||
player->CastSpell(player, EP_AllianceBuffs[m_AllianceTowersControlled-1], true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_HordeTowersControlled && m_HordeTowersControlled < 5)
|
||||
plr->CastSpell(plr, EP_HordeBuffs[m_HordeTowersControlled-1], true);
|
||||
player->CastSpell(player, EP_HordeBuffs[m_HordeTowersControlled-1], true);
|
||||
}
|
||||
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
||||
OutdoorPvP::HandlePlayerEnterZone(player, zone);
|
||||
}
|
||||
|
||||
void OutdoorPvPEP::HandlePlayerLeaveZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPEP::HandlePlayerLeaveZone(Player* player, uint32 zone)
|
||||
{
|
||||
// remove buffs
|
||||
if (plr->GetTeam() == ALLIANCE)
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
plr->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
|
||||
player->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
plr->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
|
||||
player->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
|
||||
}
|
||||
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
|
||||
}
|
||||
|
||||
void OutdoorPvPEP::BuffTeams()
|
||||
{
|
||||
for (PlayerSet::iterator itr = m_players[0].begin(); itr != m_players[0].end(); ++itr)
|
||||
{
|
||||
Player* plr = *itr;
|
||||
Player* player = *itr;
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
plr->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
|
||||
player->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
|
||||
if (m_AllianceTowersControlled && m_AllianceTowersControlled < 5)
|
||||
plr->CastSpell(plr, EP_AllianceBuffs[m_AllianceTowersControlled-1], true);
|
||||
player->CastSpell(player, EP_AllianceBuffs[m_AllianceTowersControlled-1], true);
|
||||
}
|
||||
}
|
||||
for (PlayerSet::iterator itr = m_players[1].begin(); itr != m_players[1].end(); ++itr)
|
||||
{
|
||||
Player* plr = *itr;
|
||||
Player* player = *itr;
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
plr->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
|
||||
player->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
|
||||
if (m_HordeTowersControlled && m_HordeTowersControlled < 5)
|
||||
plr->CastSpell(plr, EP_HordeBuffs[m_HordeTowersControlled-1], true);
|
||||
player->CastSpell(player, EP_HordeBuffs[m_HordeTowersControlled-1], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -727,37 +727,37 @@ void OutdoorPvPEP::FillInitialWorldStates(WorldPacket & data)
|
||||
}
|
||||
}
|
||||
|
||||
void OutdoorPvPEP::SendRemoveWorldStates(Player* plr)
|
||||
void OutdoorPvPEP::SendRemoveWorldStates(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_COUNT_A, 0);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_COUNT_H, 0);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, 0);
|
||||
plr->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, 0);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_COUNT_A, 0);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_COUNT_H, 0);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, 0);
|
||||
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, 0);
|
||||
|
||||
plr->SendUpdateWorldState(EP_EWT_A, 0);
|
||||
plr->SendUpdateWorldState(EP_EWT_H, 0);
|
||||
plr->SendUpdateWorldState(EP_EWT_N, 0);
|
||||
plr->SendUpdateWorldState(EP_EWT_N_A, 0);
|
||||
plr->SendUpdateWorldState(EP_EWT_N_H, 0);
|
||||
player->SendUpdateWorldState(EP_EWT_A, 0);
|
||||
player->SendUpdateWorldState(EP_EWT_H, 0);
|
||||
player->SendUpdateWorldState(EP_EWT_N, 0);
|
||||
player->SendUpdateWorldState(EP_EWT_N_A, 0);
|
||||
player->SendUpdateWorldState(EP_EWT_N_H, 0);
|
||||
|
||||
plr->SendUpdateWorldState(EP_PWT_A, 0);
|
||||
plr->SendUpdateWorldState(EP_PWT_H, 0);
|
||||
plr->SendUpdateWorldState(EP_PWT_N, 0);
|
||||
plr->SendUpdateWorldState(EP_PWT_N_A, 0);
|
||||
plr->SendUpdateWorldState(EP_PWT_N_H, 0);
|
||||
player->SendUpdateWorldState(EP_PWT_A, 0);
|
||||
player->SendUpdateWorldState(EP_PWT_H, 0);
|
||||
player->SendUpdateWorldState(EP_PWT_N, 0);
|
||||
player->SendUpdateWorldState(EP_PWT_N_A, 0);
|
||||
player->SendUpdateWorldState(EP_PWT_N_H, 0);
|
||||
|
||||
plr->SendUpdateWorldState(EP_NPT_A, 0);
|
||||
plr->SendUpdateWorldState(EP_NPT_H, 0);
|
||||
plr->SendUpdateWorldState(EP_NPT_N, 0);
|
||||
plr->SendUpdateWorldState(EP_NPT_N_A, 0);
|
||||
plr->SendUpdateWorldState(EP_NPT_N_H, 0);
|
||||
player->SendUpdateWorldState(EP_NPT_A, 0);
|
||||
player->SendUpdateWorldState(EP_NPT_H, 0);
|
||||
player->SendUpdateWorldState(EP_NPT_N, 0);
|
||||
player->SendUpdateWorldState(EP_NPT_N_A, 0);
|
||||
player->SendUpdateWorldState(EP_NPT_N_H, 0);
|
||||
|
||||
plr->SendUpdateWorldState(EP_CGT_A, 0);
|
||||
plr->SendUpdateWorldState(EP_CGT_H, 0);
|
||||
plr->SendUpdateWorldState(EP_CGT_N, 0);
|
||||
plr->SendUpdateWorldState(EP_CGT_N_A, 0);
|
||||
plr->SendUpdateWorldState(EP_CGT_N_H, 0);
|
||||
player->SendUpdateWorldState(EP_CGT_A, 0);
|
||||
player->SendUpdateWorldState(EP_CGT_H, 0);
|
||||
player->SendUpdateWorldState(EP_CGT_N, 0);
|
||||
player->SendUpdateWorldState(EP_CGT_N_A, 0);
|
||||
player->SendUpdateWorldState(EP_CGT_N_H, 0);
|
||||
}
|
||||
|
||||
class OutdoorPvP_eastern_plaguelands : public OutdoorPvPScript
|
||||
|
||||
@@ -197,8 +197,8 @@ class OPvPCapturePointEP_EWT : public OPvPCapturePoint
|
||||
void FillInitialWorldStates(WorldPacket & data);
|
||||
|
||||
// used when player is activated/inactivated in the area
|
||||
bool HandlePlayerEnter(Player* plr);
|
||||
void HandlePlayerLeave(Player* plr);
|
||||
bool HandlePlayerEnter(Player* player);
|
||||
void HandlePlayerLeave(Player* player);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -228,8 +228,8 @@ class OPvPCapturePointEP_NPT : public OPvPCapturePoint
|
||||
void FillInitialWorldStates(WorldPacket & data);
|
||||
|
||||
// used when player is activated/inactivated in the area
|
||||
bool HandlePlayerEnter(Player* plr);
|
||||
void HandlePlayerLeave(Player* plr);
|
||||
bool HandlePlayerEnter(Player* player);
|
||||
void HandlePlayerLeave(Player* player);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -259,8 +259,8 @@ class OPvPCapturePointEP_CGT : public OPvPCapturePoint
|
||||
void FillInitialWorldStates(WorldPacket & data);
|
||||
|
||||
// used when player is activated/inactivated in the area
|
||||
bool HandlePlayerEnter(Player* plr);
|
||||
void HandlePlayerLeave(Player* plr);
|
||||
bool HandlePlayerEnter(Player* player);
|
||||
void HandlePlayerLeave(Player* player);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -290,8 +290,8 @@ class OPvPCapturePointEP_PWT : public OPvPCapturePoint
|
||||
void FillInitialWorldStates(WorldPacket & data);
|
||||
|
||||
// used when player is activated/inactivated in the area
|
||||
bool HandlePlayerEnter(Player* plr);
|
||||
void HandlePlayerLeave(Player* plr);
|
||||
bool HandlePlayerEnter(Player* player);
|
||||
void HandlePlayerLeave(Player* player);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -319,14 +319,14 @@ class OutdoorPvPEP : public OutdoorPvP
|
||||
|
||||
bool SetupOutdoorPvP();
|
||||
|
||||
void HandlePlayerEnterZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerEnterZone(Player* player, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* player, uint32 zone);
|
||||
|
||||
bool Update(uint32 diff);
|
||||
|
||||
void FillInitialWorldStates(WorldPacket &data);
|
||||
|
||||
void SendRemoveWorldStates(Player* plr);
|
||||
void SendRemoveWorldStates(Player* player);
|
||||
|
||||
void BuffTeams();
|
||||
|
||||
|
||||
@@ -81,34 +81,34 @@ bool OutdoorPvPHP::SetupOutdoorPvP()
|
||||
return true;
|
||||
}
|
||||
|
||||
void OutdoorPvPHP::HandlePlayerEnterZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPHP::HandlePlayerEnterZone(Player* player, uint32 zone)
|
||||
{
|
||||
// add buffs
|
||||
if (plr->GetTeam() == ALLIANCE)
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
{
|
||||
if (m_AllianceTowersControlled >=3)
|
||||
plr->CastSpell(plr, AllianceBuff, true);
|
||||
player->CastSpell(player, AllianceBuff, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_HordeTowersControlled >=3)
|
||||
plr->CastSpell(plr, HordeBuff, true);
|
||||
player->CastSpell(player, HordeBuff, true);
|
||||
}
|
||||
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
||||
OutdoorPvP::HandlePlayerEnterZone(player, zone);
|
||||
}
|
||||
|
||||
void OutdoorPvPHP::HandlePlayerLeaveZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPHP::HandlePlayerLeaveZone(Player* player, uint32 zone)
|
||||
{
|
||||
// remove buffs
|
||||
if (plr->GetTeam() == ALLIANCE)
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(AllianceBuff);
|
||||
player->RemoveAurasDueToSpell(AllianceBuff);
|
||||
}
|
||||
else
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(HordeBuff);
|
||||
player->RemoveAurasDueToSpell(HordeBuff);
|
||||
}
|
||||
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
|
||||
}
|
||||
|
||||
bool OutdoorPvPHP::Update(uint32 diff)
|
||||
@@ -131,20 +131,20 @@ bool OutdoorPvPHP::Update(uint32 diff)
|
||||
return changed;
|
||||
}
|
||||
|
||||
void OutdoorPvPHP::SendRemoveWorldStates(Player* plr)
|
||||
void OutdoorPvPHP::SendRemoveWorldStates(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_A, 0);
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_H, 0);
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_COUNT_H, 0);
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_COUNT_A, 0);
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, 0);
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, 0);
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_A, 0);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_H, 0);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_COUNT_H, 0);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_COUNT_A, 0);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, 0);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, 0);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
for (int i = 0; i < HP_TOWER_NUM; ++i)
|
||||
{
|
||||
plr->SendUpdateWorldState(HP_MAP_N[i], 0);
|
||||
plr->SendUpdateWorldState(HP_MAP_A[i], 0);
|
||||
plr->SendUpdateWorldState(HP_MAP_H[i], 0);
|
||||
player->SendUpdateWorldState(HP_MAP_N[i], 0);
|
||||
player->SendUpdateWorldState(HP_MAP_A[i], 0);
|
||||
player->SendUpdateWorldState(HP_MAP_H[i], 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,34 +301,34 @@ void OPvPCapturePointHP::FillInitialWorldStates(WorldPacket &data)
|
||||
}
|
||||
}
|
||||
|
||||
bool OPvPCapturePointHP::HandlePlayerEnter(Player* plr)
|
||||
bool OPvPCapturePointHP::HandlePlayerEnter(Player* player)
|
||||
{
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(plr))
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(player))
|
||||
{
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, phase);
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, phase);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OPvPCapturePointHP::HandlePlayerLeave(Player* plr)
|
||||
void OPvPCapturePointHP::HandlePlayerLeave(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(plr);
|
||||
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(player);
|
||||
}
|
||||
|
||||
void OutdoorPvPHP::HandleKillImpl(Player* plr, Unit* killed)
|
||||
void OutdoorPvPHP::HandleKillImpl(Player* player, Unit* killed)
|
||||
{
|
||||
if (killed->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if (plr->GetTeam() == ALLIANCE && killed->ToPlayer()->GetTeam() != ALLIANCE)
|
||||
plr->CastSpell(plr, AlliancePlayerKillReward, true);
|
||||
else if (plr->GetTeam() == HORDE && killed->ToPlayer()->GetTeam() != HORDE)
|
||||
plr->CastSpell(plr, HordePlayerKillReward, true);
|
||||
if (player->GetTeam() == ALLIANCE && killed->ToPlayer()->GetTeam() != ALLIANCE)
|
||||
player->CastSpell(player, AlliancePlayerKillReward, true);
|
||||
else if (player->GetTeam() == HORDE && killed->ToPlayer()->GetTeam() != HORDE)
|
||||
player->CastSpell(player, HordePlayerKillReward, true);
|
||||
}
|
||||
|
||||
class OutdoorPvP_hellfire_peninsula : public OutdoorPvPScript
|
||||
|
||||
@@ -98,8 +98,8 @@ class OPvPCapturePointHP : public OPvPCapturePoint
|
||||
void FillInitialWorldStates(WorldPacket & data);
|
||||
|
||||
// used when player is activated/inactivated in the area
|
||||
bool HandlePlayerEnter(Player* plr);
|
||||
void HandlePlayerLeave(Player* plr);
|
||||
bool HandlePlayerEnter(Player* player);
|
||||
void HandlePlayerLeave(Player* player);
|
||||
|
||||
private:
|
||||
|
||||
@@ -116,16 +116,16 @@ class OutdoorPvPHP : public OutdoorPvP
|
||||
|
||||
bool SetupOutdoorPvP();
|
||||
|
||||
void HandlePlayerEnterZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerEnterZone(Player* player, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* player, uint32 zone);
|
||||
|
||||
bool Update(uint32 diff);
|
||||
|
||||
void FillInitialWorldStates(WorldPacket &data);
|
||||
|
||||
void SendRemoveWorldStates(Player* plr);
|
||||
void SendRemoveWorldStates(Player* player);
|
||||
|
||||
void HandleKillImpl(Player* plr, Unit* killed);
|
||||
void HandleKillImpl(Player* player, Unit* killed);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -29,15 +29,15 @@ OutdoorPvPNA::OutdoorPvPNA()
|
||||
m_TypeId = OUTDOOR_PVP_NA;
|
||||
}
|
||||
|
||||
void OutdoorPvPNA::HandleKillImpl(Player* plr, Unit* killed)
|
||||
void OutdoorPvPNA::HandleKillImpl(Player* player, Unit* killed)
|
||||
{
|
||||
if (killed->GetTypeId() == TYPEID_PLAYER && plr->GetTeam() != killed->ToPlayer()->GetTeam())
|
||||
if (killed->GetTypeId() == TYPEID_PLAYER && player->GetTeam() != killed->ToPlayer()->GetTeam())
|
||||
{
|
||||
plr->KilledMonsterCredit(NA_CREDIT_MARKER, 0); // 0 guid, btw it isn't even used in killedmonster function :S
|
||||
if (plr->GetTeam() == ALLIANCE)
|
||||
plr->CastSpell(plr, NA_KILL_TOKEN_ALLIANCE, true);
|
||||
player->KilledMonsterCredit(NA_CREDIT_MARKER, 0); // 0 guid, btw it isn't even used in killedmonster function :S
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
player->CastSpell(player, NA_KILL_TOKEN_ALLIANCE, true);
|
||||
else
|
||||
plr->CastSpell(plr, NA_KILL_TOKEN_HORDE, true);
|
||||
player->CastSpell(player, NA_KILL_TOKEN_HORDE, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,23 +178,23 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team)
|
||||
UpdateWyvernRoostWorldState(NA_ROOST_E);
|
||||
}
|
||||
|
||||
bool OPvPCapturePointNA::HandlePlayerEnter(Player* plr)
|
||||
bool OPvPCapturePointNA::HandlePlayerEnter(Player* player)
|
||||
{
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(plr))
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(player))
|
||||
{
|
||||
plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
|
||||
plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, phase);
|
||||
plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, phase);
|
||||
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OPvPCapturePointNA::HandlePlayerLeave(Player* plr)
|
||||
void OPvPCapturePointNA::HandlePlayerLeave(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(plr);
|
||||
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(player);
|
||||
}
|
||||
|
||||
OPvPCapturePointNA::OPvPCapturePointNA(OutdoorPvP *pvp) :
|
||||
@@ -220,19 +220,19 @@ bool OutdoorPvPNA::SetupOutdoorPvP()
|
||||
return true;
|
||||
}
|
||||
|
||||
void OutdoorPvPNA::HandlePlayerEnterZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPNA::HandlePlayerEnterZone(Player* player, uint32 zone)
|
||||
{
|
||||
// add buffs
|
||||
if (plr->GetTeam() == m_obj->m_ControllingFaction)
|
||||
plr->CastSpell(plr, NA_CAPTURE_BUFF, true);
|
||||
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
||||
if (player->GetTeam() == m_obj->m_ControllingFaction)
|
||||
player->CastSpell(player, NA_CAPTURE_BUFF, true);
|
||||
OutdoorPvP::HandlePlayerEnterZone(player, zone);
|
||||
}
|
||||
|
||||
void OutdoorPvPNA::HandlePlayerLeaveZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPNA::HandlePlayerLeaveZone(Player* player, uint32 zone)
|
||||
{
|
||||
// remove buffs
|
||||
plr->RemoveAurasDueToSpell(NA_CAPTURE_BUFF);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
||||
player->RemoveAurasDueToSpell(NA_CAPTURE_BUFF);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
|
||||
}
|
||||
|
||||
void OutdoorPvPNA::FillInitialWorldStates(WorldPacket &data)
|
||||
@@ -292,36 +292,36 @@ void OPvPCapturePointNA::FillInitialWorldStates(WorldPacket &data)
|
||||
data << NA_MAP_HALAA_ALLIANCE << uint32(bool(m_HalaaState & HALAA_A));
|
||||
}
|
||||
|
||||
void OutdoorPvPNA::SendRemoveWorldStates(Player* plr)
|
||||
void OutdoorPvPNA::SendRemoveWorldStates(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 0);
|
||||
plr->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 0);
|
||||
plr->SendUpdateWorldState(NA_UI_GUARDS_MAX, 0);
|
||||
plr->SendUpdateWorldState(NA_UI_GUARDS_LEFT, 0);
|
||||
plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, 0);
|
||||
plr->SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_H, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_A, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_H, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_A, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_H, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_A, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_H, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_A, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_H, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_A, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_WEST_H, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_WEST_A, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_H, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_A, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_EAST_H, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_WYVERN_EAST_A, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_HALAA_NEUTRAL, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_HALAA_NEU_A, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_HALAA_NEU_H, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_HALAA_HORDE, 0);
|
||||
plr->SendUpdateWorldState(NA_MAP_HALAA_ALLIANCE, 0);
|
||||
player->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 0);
|
||||
player->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 0);
|
||||
player->SendUpdateWorldState(NA_UI_GUARDS_MAX, 0);
|
||||
player->SendUpdateWorldState(NA_UI_GUARDS_LEFT, 0);
|
||||
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, 0);
|
||||
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_H, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_A, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_H, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_A, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_H, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_A, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_H, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_A, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_H, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_A, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_H, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_A, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_H, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_A, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_H, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_A, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_HALAA_NEUTRAL, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_HALAA_NEU_A, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_HALAA_NEU_H, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_HALAA_HORDE, 0);
|
||||
player->SendUpdateWorldState(NA_MAP_HALAA_ALLIANCE, 0);
|
||||
}
|
||||
|
||||
bool OutdoorPvPNA::Update(uint32 diff)
|
||||
@@ -329,7 +329,7 @@ bool OutdoorPvPNA::Update(uint32 diff)
|
||||
return m_obj->Update(diff);
|
||||
}
|
||||
|
||||
bool OPvPCapturePointNA::HandleCustomSpell(Player* plr, uint32 spellId, GameObject* /*go*/)
|
||||
bool OPvPCapturePointNA::HandleCustomSpell(Player* player, uint32 spellId, GameObject* /*go*/)
|
||||
{
|
||||
std::vector<uint32> nodes;
|
||||
nodes.resize(2);
|
||||
@@ -339,33 +339,33 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* plr, uint32 spellId, GameObje
|
||||
case NA_SPELL_FLY_NORTH:
|
||||
nodes[0] = FlightPathStartNodes[NA_ROOST_N];
|
||||
nodes[1] = FlightPathEndNodes[NA_ROOST_N];
|
||||
plr->ActivateTaxiPathTo(nodes);
|
||||
plr->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
plr->UpdatePvP(true, true);
|
||||
player->ActivateTaxiPathTo(nodes);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
player->UpdatePvP(true, true);
|
||||
retval = true;
|
||||
break;
|
||||
case NA_SPELL_FLY_SOUTH:
|
||||
nodes[0] = FlightPathStartNodes[NA_ROOST_S];
|
||||
nodes[1] = FlightPathEndNodes[NA_ROOST_S];
|
||||
plr->ActivateTaxiPathTo(nodes);
|
||||
plr->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
plr->UpdatePvP(true, true);
|
||||
player->ActivateTaxiPathTo(nodes);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
player->UpdatePvP(true, true);
|
||||
retval = true;
|
||||
break;
|
||||
case NA_SPELL_FLY_WEST:
|
||||
nodes[0] = FlightPathStartNodes[NA_ROOST_W];
|
||||
nodes[1] = FlightPathEndNodes[NA_ROOST_W];
|
||||
plr->ActivateTaxiPathTo(nodes);
|
||||
plr->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
plr->UpdatePvP(true, true);
|
||||
player->ActivateTaxiPathTo(nodes);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
player->UpdatePvP(true, true);
|
||||
retval = true;
|
||||
break;
|
||||
case NA_SPELL_FLY_EAST:
|
||||
nodes[0] = FlightPathStartNodes[NA_ROOST_E];
|
||||
nodes[1] = FlightPathEndNodes[NA_ROOST_E];
|
||||
plr->ActivateTaxiPathTo(nodes);
|
||||
plr->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
plr->UpdatePvP(true, true);
|
||||
player->ActivateTaxiPathTo(nodes);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
player->UpdatePvP(true, true);
|
||||
retval = true;
|
||||
break;
|
||||
default:
|
||||
@@ -383,7 +383,7 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* plr, uint32 spellId, GameObje
|
||||
int32 count = 10;
|
||||
uint32 itemid = 24538;
|
||||
// bomb id count
|
||||
uint8 msg = plr->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemid, count, &noSpaceForCount);
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemid, count, &noSpaceForCount);
|
||||
if (msg != EQUIP_ERR_OK) // convert to possible store amount
|
||||
count -= noSpaceForCount;
|
||||
|
||||
@@ -392,11 +392,11 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* plr, uint32 spellId, GameObje
|
||||
return true;
|
||||
}
|
||||
|
||||
Item* item = plr->StoreNewItem(dest, itemid, true);
|
||||
Item* item = player->StoreNewItem(dest, itemid, true);
|
||||
|
||||
if (count > 0 && item)
|
||||
{
|
||||
plr->SendNewItem(item, count, true, false);
|
||||
player->SendNewItem(item, count, true, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -404,9 +404,9 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* plr, uint32 spellId, GameObje
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 OPvPCapturePointNA::HandleOpenGo(Player* plr, uint64 guid)
|
||||
int32 OPvPCapturePointNA::HandleOpenGo(Player* player, uint64 guid)
|
||||
{
|
||||
int32 retval = OPvPCapturePoint::HandleOpenGo(plr, guid);
|
||||
int32 retval = OPvPCapturePoint::HandleOpenGo(player, guid);
|
||||
if (retval >= 0)
|
||||
{
|
||||
const go_type * gos = NULL;
|
||||
|
||||
@@ -267,12 +267,12 @@ class OPvPCapturePointNA : public OPvPCapturePoint
|
||||
void FillInitialWorldStates(WorldPacket & data);
|
||||
|
||||
// used when player is activated/inactivated in the area
|
||||
bool HandlePlayerEnter(Player* plr);
|
||||
void HandlePlayerLeave(Player* plr);
|
||||
bool HandlePlayerEnter(Player* player);
|
||||
void HandlePlayerLeave(Player* player);
|
||||
|
||||
bool HandleCustomSpell(Player* plr, uint32 spellId, GameObject* go);
|
||||
bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go);
|
||||
|
||||
int32 HandleOpenGo(Player* plr, uint64 guid);
|
||||
int32 HandleOpenGo(Player* player, uint64 guid);
|
||||
|
||||
uint32 GetAliveGuardsCount();
|
||||
|
||||
@@ -320,16 +320,16 @@ class OutdoorPvPNA : public OutdoorPvP
|
||||
|
||||
bool SetupOutdoorPvP();
|
||||
|
||||
void HandlePlayerEnterZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerEnterZone(Player* player, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* player, uint32 zone);
|
||||
|
||||
bool Update(uint32 diff);
|
||||
|
||||
void FillInitialWorldStates(WorldPacket &data);
|
||||
|
||||
void SendRemoveWorldStates(Player* plr);
|
||||
void SendRemoveWorldStates(Player* player);
|
||||
|
||||
void HandleKillImpl(Player* plr, Unit* killed);
|
||||
void HandleKillImpl(Player* player, Unit* killed);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -41,11 +41,11 @@ void OutdoorPvPSI::FillInitialWorldStates(WorldPacket &data)
|
||||
data << SI_SILITHYST_MAX << SI_MAX_RESOURCES;
|
||||
}
|
||||
|
||||
void OutdoorPvPSI::SendRemoveWorldStates(Player* plr)
|
||||
void OutdoorPvPSI::SendRemoveWorldStates(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(SI_GATHERED_A, 0);
|
||||
plr->SendUpdateWorldState(SI_GATHERED_H, 0);
|
||||
plr->SendUpdateWorldState(SI_SILITHYST_MAX, 0);
|
||||
player->SendUpdateWorldState(SI_GATHERED_A, 0);
|
||||
player->SendUpdateWorldState(SI_GATHERED_H, 0);
|
||||
player->SendUpdateWorldState(SI_SILITHYST_MAX, 0);
|
||||
}
|
||||
|
||||
void OutdoorPvPSI::UpdateWorldState()
|
||||
@@ -67,29 +67,29 @@ bool OutdoorPvPSI::Update(uint32 /*diff*/)
|
||||
return false;
|
||||
}
|
||||
|
||||
void OutdoorPvPSI::HandlePlayerEnterZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPSI::HandlePlayerEnterZone(Player* player, uint32 zone)
|
||||
{
|
||||
if (plr->GetTeam() == m_LastController)
|
||||
plr->CastSpell(plr, SI_CENARION_FAVOR, true);
|
||||
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
||||
if (player->GetTeam() == m_LastController)
|
||||
player->CastSpell(player, SI_CENARION_FAVOR, true);
|
||||
OutdoorPvP::HandlePlayerEnterZone(player, zone);
|
||||
}
|
||||
|
||||
void OutdoorPvPSI::HandlePlayerLeaveZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPSI::HandlePlayerLeaveZone(Player* player, uint32 zone)
|
||||
{
|
||||
// remove buffs
|
||||
plr->RemoveAurasDueToSpell(SI_CENARION_FAVOR);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
||||
player->RemoveAurasDueToSpell(SI_CENARION_FAVOR);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
|
||||
}
|
||||
|
||||
bool OutdoorPvPSI::HandleAreaTrigger(Player* plr, uint32 trigger)
|
||||
bool OutdoorPvPSI::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
{
|
||||
switch(trigger)
|
||||
{
|
||||
case SI_AREATRIGGER_A:
|
||||
if (plr->GetTeam() == ALLIANCE && plr->HasAura(SI_SILITHYST_FLAG))
|
||||
if (player->GetTeam() == ALLIANCE && player->HasAura(SI_SILITHYST_FLAG))
|
||||
{
|
||||
// remove aura
|
||||
plr->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
|
||||
player->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
|
||||
++ m_Gathered_A;
|
||||
if (m_Gathered_A >= SI_MAX_RESOURCES)
|
||||
{
|
||||
@@ -101,20 +101,20 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* plr, uint32 trigger)
|
||||
}
|
||||
UpdateWorldState();
|
||||
// reward player
|
||||
plr->CastSpell(plr, SI_TRACES_OF_SILITHYST, true);
|
||||
player->CastSpell(player, SI_TRACES_OF_SILITHYST, true);
|
||||
// add 19 honor
|
||||
plr->RewardHonor(NULL, 1, 19);
|
||||
player->RewardHonor(NULL, 1, 19);
|
||||
// add 20 cenarion circle repu
|
||||
plr->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609), 20);
|
||||
player->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609), 20);
|
||||
// complete quest
|
||||
plr->KilledMonsterCredit(SI_TURNIN_QUEST_CM_A, 0);
|
||||
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_A, 0);
|
||||
}
|
||||
return true;
|
||||
case SI_AREATRIGGER_H:
|
||||
if (plr->GetTeam() == HORDE && plr->HasAura(SI_SILITHYST_FLAG))
|
||||
if (player->GetTeam() == HORDE && player->HasAura(SI_SILITHYST_FLAG))
|
||||
{
|
||||
// remove aura
|
||||
plr->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
|
||||
player->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
|
||||
++ m_Gathered_H;
|
||||
if (m_Gathered_H >= SI_MAX_RESOURCES)
|
||||
{
|
||||
@@ -126,25 +126,25 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* plr, uint32 trigger)
|
||||
}
|
||||
UpdateWorldState();
|
||||
// reward player
|
||||
plr->CastSpell(plr, SI_TRACES_OF_SILITHYST, true);
|
||||
player->CastSpell(player, SI_TRACES_OF_SILITHYST, true);
|
||||
// add 19 honor
|
||||
plr->RewardHonor(NULL, 1, 19);
|
||||
player->RewardHonor(NULL, 1, 19);
|
||||
// add 20 cenarion circle repu
|
||||
plr->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609), 20);
|
||||
player->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609), 20);
|
||||
// complete quest
|
||||
plr->KilledMonsterCredit(SI_TURNIN_QUEST_CM_H, 0);
|
||||
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_H, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OutdoorPvPSI::HandleDropFlag(Player* plr, uint32 spellId)
|
||||
bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
|
||||
{
|
||||
if (spellId == SI_SILITHYST_FLAG)
|
||||
{
|
||||
// if it was dropped away from the player's turn-in point, then create a silithyst mound, if it was dropped near the areatrigger, then it was dispelled by the outdoorpvp, so do nothing
|
||||
switch(plr->GetTeam())
|
||||
switch(player->GetTeam())
|
||||
{
|
||||
case ALLIANCE:
|
||||
{
|
||||
@@ -152,18 +152,18 @@ bool OutdoorPvPSI::HandleDropFlag(Player* plr, uint32 spellId)
|
||||
if (atEntry)
|
||||
{
|
||||
// 5.0f is safe-distance
|
||||
if (plr->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius)
|
||||
if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius)
|
||||
{
|
||||
// he dropped it further, summon mound
|
||||
GameObject* go = new GameObject;
|
||||
Map * map = plr->GetMap();
|
||||
Map * map = player->GetMap();
|
||||
if (!map)
|
||||
{
|
||||
delete go;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), SI_SILITHYST_MOUND, map, plr->GetPhaseMask(), plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), plr->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
|
||||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
}
|
||||
@@ -182,17 +182,17 @@ bool OutdoorPvPSI::HandleDropFlag(Player* plr, uint32 spellId)
|
||||
if (atEntry)
|
||||
{
|
||||
// 5.0f is safe-distance
|
||||
if (plr->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius)
|
||||
if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius)
|
||||
{
|
||||
// he dropped it further, summon mound
|
||||
GameObject* go = new GameObject;
|
||||
Map * map = plr->GetMap();
|
||||
Map * map = player->GetMap();
|
||||
if (!map)
|
||||
{
|
||||
delete go;
|
||||
return true;
|
||||
}
|
||||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), SI_SILITHYST_MOUND, map, plr->GetPhaseMask() , plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), plr->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
|
||||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), SI_SILITHYST_MOUND, map, player->GetPhaseMask() , player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
}
|
||||
@@ -211,11 +211,11 @@ bool OutdoorPvPSI::HandleDropFlag(Player* plr, uint32 spellId)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OutdoorPvPSI::HandleCustomSpell(Player* plr, uint32 spellId, GameObject* go)
|
||||
bool OutdoorPvPSI::HandleCustomSpell(Player* player, uint32 spellId, GameObject* go)
|
||||
{
|
||||
if (!go || spellId != SI_SILITHYST_FLAG_GO_SPELL)
|
||||
return false;
|
||||
plr->CastSpell(plr, SI_SILITHYST_FLAG, true);
|
||||
player->CastSpell(player, SI_SILITHYST_FLAG, true);
|
||||
if (go->GetGOInfo()->entry == SI_SILITHYST_MOUND)
|
||||
{
|
||||
// despawn go
|
||||
|
||||
@@ -59,20 +59,20 @@ class OutdoorPvPSI : public OutdoorPvP
|
||||
|
||||
bool SetupOutdoorPvP();
|
||||
|
||||
void HandlePlayerEnterZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerEnterZone(Player* player, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* player, uint32 zone);
|
||||
|
||||
bool Update(uint32 diff);
|
||||
|
||||
void FillInitialWorldStates(WorldPacket &data);
|
||||
|
||||
void SendRemoveWorldStates(Player* plr);
|
||||
void SendRemoveWorldStates(Player* player);
|
||||
|
||||
bool HandleAreaTrigger(Player* plr, uint32 trigger);
|
||||
bool HandleAreaTrigger(Player* player, uint32 trigger);
|
||||
|
||||
bool HandleDropFlag(Player* plr, uint32 spellId);
|
||||
bool HandleDropFlag(Player* player, uint32 spellId);
|
||||
|
||||
bool HandleCustomSpell(Player* plr, uint32 spellId, GameObject* go);
|
||||
bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go);
|
||||
|
||||
void UpdateWorldState();
|
||||
|
||||
|
||||
@@ -67,29 +67,29 @@ void OutdoorPvPTF::FillInitialWorldStates(WorldPacket &data)
|
||||
}
|
||||
}
|
||||
|
||||
void OutdoorPvPTF::SendRemoveWorldStates(Player* plr)
|
||||
void OutdoorPvPTF::SendRemoveWorldStates(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, uint32(0));
|
||||
plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, uint32(0));
|
||||
plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, uint32(0));
|
||||
|
||||
plr->SendUpdateWorldState(TF_UI_TOWER_COUNT_H, uint32(0));
|
||||
plr->SendUpdateWorldState(TF_UI_TOWER_COUNT_A, uint32(0));
|
||||
plr->SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_TOWER_COUNT_H, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_TOWER_COUNT_A, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0));
|
||||
|
||||
plr->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, uint32(0));
|
||||
plr->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, uint32(0));
|
||||
plr->SendUpdateWorldState(TF_UI_LOCKED_TIME_HOURS, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_LOCKED_TIME_HOURS, uint32(0));
|
||||
|
||||
plr->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0));
|
||||
plr->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(0));
|
||||
plr->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(0));
|
||||
player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0));
|
||||
|
||||
for (int i = 0; i < TF_TOWER_NUM; ++i)
|
||||
{
|
||||
plr->SendUpdateWorldState(uint32(TFTowerWorldStates[i].n), uint32(0));
|
||||
plr->SendUpdateWorldState(uint32(TFTowerWorldStates[i].h), uint32(0));
|
||||
plr->SendUpdateWorldState(uint32(TFTowerWorldStates[i].a), uint32(0));
|
||||
player->SendUpdateWorldState(uint32(TFTowerWorldStates[i].n), uint32(0));
|
||||
player->SendUpdateWorldState(uint32(TFTowerWorldStates[i].h), uint32(0));
|
||||
player->SendUpdateWorldState(uint32(TFTowerWorldStates[i].a), uint32(0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,23 +100,23 @@ void OPvPCapturePointTF::UpdateTowerState()
|
||||
m_PvP->SendUpdateWorldState(uint32(TFTowerWorldStates[m_TowerType].a), uint32(bool(m_TowerState & TF_TOWERSTATE_A)));
|
||||
}
|
||||
|
||||
bool OPvPCapturePointTF::HandlePlayerEnter(Player* plr)
|
||||
bool OPvPCapturePointTF::HandlePlayerEnter(Player* player)
|
||||
{
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(plr))
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(player))
|
||||
{
|
||||
plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 1);
|
||||
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
|
||||
plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, phase);
|
||||
plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, phase);
|
||||
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OPvPCapturePointTF::HandlePlayerLeave(Player* plr)
|
||||
void OPvPCapturePointTF::HandlePlayerLeave(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(plr);
|
||||
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(player);
|
||||
}
|
||||
|
||||
bool OutdoorPvPTF::Update(uint32 diff)
|
||||
@@ -186,26 +186,26 @@ bool OutdoorPvPTF::Update(uint32 diff)
|
||||
return changed;
|
||||
}
|
||||
|
||||
void OutdoorPvPTF::HandlePlayerEnterZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPTF::HandlePlayerEnterZone(Player* player, uint32 zone)
|
||||
{
|
||||
if (plr->GetTeam() == ALLIANCE)
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
{
|
||||
if (m_AllianceTowersControlled >= TF_TOWER_NUM)
|
||||
plr->CastSpell(plr, TF_CAPTURE_BUFF, true);
|
||||
player->CastSpell(player, TF_CAPTURE_BUFF, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_HordeTowersControlled >= TF_TOWER_NUM)
|
||||
plr->CastSpell(plr, TF_CAPTURE_BUFF, true);
|
||||
player->CastSpell(player, TF_CAPTURE_BUFF, true);
|
||||
}
|
||||
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
||||
OutdoorPvP::HandlePlayerEnterZone(player, zone);
|
||||
}
|
||||
|
||||
void OutdoorPvPTF::HandlePlayerLeaveZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPTF::HandlePlayerLeaveZone(Player* player, uint32 zone)
|
||||
{
|
||||
// remove buffs
|
||||
plr->RemoveAurasDueToSpell(TF_CAPTURE_BUFF);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
||||
player->RemoveAurasDueToSpell(TF_CAPTURE_BUFF);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
|
||||
}
|
||||
|
||||
bool OutdoorPvPTF::SetupOutdoorPvP()
|
||||
|
||||
@@ -136,8 +136,8 @@ class OPvPCapturePointTF : public OPvPCapturePoint
|
||||
void FillInitialWorldStates(WorldPacket & data);
|
||||
|
||||
// used when player is activated/inactivated in the area
|
||||
bool HandlePlayerEnter(Player* plr);
|
||||
void HandlePlayerLeave(Player* plr);
|
||||
bool HandlePlayerEnter(Player* player);
|
||||
void HandlePlayerLeave(Player* player);
|
||||
|
||||
void UpdateTowerState();
|
||||
|
||||
@@ -158,14 +158,14 @@ class OutdoorPvPTF : public OutdoorPvP
|
||||
|
||||
bool SetupOutdoorPvP();
|
||||
|
||||
void HandlePlayerEnterZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerEnterZone(Player* player, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* player, uint32 zone);
|
||||
|
||||
bool Update(uint32 diff);
|
||||
|
||||
void FillInitialWorldStates(WorldPacket &data);
|
||||
|
||||
void SendRemoveWorldStates(Player* plr);
|
||||
void SendRemoveWorldStates(Player* player);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -52,23 +52,23 @@ void OPvPCapturePointZM_Beacon::UpdateTowerState()
|
||||
m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].map_tower_h), uint32(bool(m_TowerState & ZM_TOWERSTATE_H)));
|
||||
}
|
||||
|
||||
bool OPvPCapturePointZM_Beacon::HandlePlayerEnter(Player* plr)
|
||||
bool OPvPCapturePointZM_Beacon::HandlePlayerEnter(Player* player)
|
||||
{
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(plr))
|
||||
if (OPvPCapturePoint::HandlePlayerEnter(player))
|
||||
{
|
||||
plr->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_disp, 1);
|
||||
player->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_disp, 1);
|
||||
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
|
||||
plr->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_pos, phase);
|
||||
plr->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_n, m_neutralValuePct);
|
||||
player->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_pos, phase);
|
||||
player->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_n, m_neutralValuePct);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OPvPCapturePointZM_Beacon::HandlePlayerLeave(Player* plr)
|
||||
void OPvPCapturePointZM_Beacon::HandlePlayerLeave(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_disp, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(plr);
|
||||
player->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_disp, 0);
|
||||
OPvPCapturePoint::HandlePlayerLeave(player);
|
||||
}
|
||||
|
||||
void OPvPCapturePointZM_Beacon::ChangeState()
|
||||
@@ -139,29 +139,29 @@ bool OutdoorPvPZM::Update(uint32 diff)
|
||||
return changed;
|
||||
}
|
||||
|
||||
void OutdoorPvPZM::HandlePlayerEnterZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPZM::HandlePlayerEnterZone(Player* player, uint32 zone)
|
||||
{
|
||||
if (plr->GetTeam() == ALLIANCE)
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
{
|
||||
if (m_GraveYard->m_GraveYardState & ZM_GRAVEYARD_A)
|
||||
plr->CastSpell(plr, ZM_CAPTURE_BUFF, true);
|
||||
player->CastSpell(player, ZM_CAPTURE_BUFF, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_GraveYard->m_GraveYardState & ZM_GRAVEYARD_H)
|
||||
plr->CastSpell(plr, ZM_CAPTURE_BUFF, true);
|
||||
player->CastSpell(player, ZM_CAPTURE_BUFF, true);
|
||||
}
|
||||
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
||||
OutdoorPvP::HandlePlayerEnterZone(player, zone);
|
||||
}
|
||||
|
||||
void OutdoorPvPZM::HandlePlayerLeaveZone(Player* plr, uint32 zone)
|
||||
void OutdoorPvPZM::HandlePlayerLeaveZone(Player* player, uint32 zone)
|
||||
{
|
||||
// remove buffs
|
||||
plr->RemoveAurasDueToSpell(ZM_CAPTURE_BUFF);
|
||||
player->RemoveAurasDueToSpell(ZM_CAPTURE_BUFF);
|
||||
// remove flag
|
||||
plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
|
||||
plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
||||
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
|
||||
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
|
||||
}
|
||||
|
||||
OutdoorPvPZM::OutdoorPvPZM()
|
||||
@@ -190,15 +190,15 @@ bool OutdoorPvPZM::SetupOutdoorPvP()
|
||||
return true;
|
||||
}
|
||||
|
||||
void OutdoorPvPZM::HandleKillImpl(Player* plr, Unit* killed)
|
||||
void OutdoorPvPZM::HandleKillImpl(Player* player, Unit* killed)
|
||||
{
|
||||
if (killed->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if (plr->GetTeam() == ALLIANCE && killed->ToPlayer()->GetTeam() != ALLIANCE)
|
||||
plr->CastSpell(plr, ZM_AlliancePlayerKillReward, true);
|
||||
else if (plr->GetTeam() == HORDE && killed->ToPlayer()->GetTeam() != HORDE)
|
||||
plr->CastSpell(plr, ZM_HordePlayerKillReward, true);
|
||||
if (player->GetTeam() == ALLIANCE && killed->ToPlayer()->GetTeam() != ALLIANCE)
|
||||
player->CastSpell(player, ZM_AlliancePlayerKillReward, true);
|
||||
else if (player->GetTeam() == HORDE && killed->ToPlayer()->GetTeam() != HORDE)
|
||||
player->CastSpell(player, ZM_HordePlayerKillReward, true);
|
||||
}
|
||||
|
||||
bool OPvPCapturePointZM_GraveYard::Update(uint32 /*diff*/)
|
||||
@@ -208,12 +208,12 @@ bool OPvPCapturePointZM_GraveYard::Update(uint32 /*diff*/)
|
||||
return retval;
|
||||
}
|
||||
|
||||
int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* plr, uint64 guid)
|
||||
int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid)
|
||||
{
|
||||
int32 retval = OPvPCapturePoint::HandleOpenGo(plr, guid);
|
||||
int32 retval = OPvPCapturePoint::HandleOpenGo(player, guid);
|
||||
if (retval >= 0)
|
||||
{
|
||||
if (plr->HasAura(ZM_BATTLE_STANDARD_A) && m_GraveYardState != ZM_GRAVEYARD_A)
|
||||
if (player->HasAura(ZM_BATTLE_STANDARD_A) && m_GraveYardState != ZM_GRAVEYARD_A)
|
||||
{
|
||||
if (m_GraveYardState == ZM_GRAVEYARD_H)
|
||||
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_H));
|
||||
@@ -223,10 +223,10 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* plr, uint64 guid)
|
||||
sObjectMgr->RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE); // rem gy
|
||||
sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE, false); // add gy
|
||||
m_PvP->TeamApplyBuff(TEAM_ALLIANCE, ZM_CAPTURE_BUFF);
|
||||
plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
|
||||
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
|
||||
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A));
|
||||
}
|
||||
else if (plr->HasAura(ZM_BATTLE_STANDARD_H) && m_GraveYardState != ZM_GRAVEYARD_H)
|
||||
else if (player->HasAura(ZM_BATTLE_STANDARD_H) && m_GraveYardState != ZM_GRAVEYARD_H)
|
||||
{
|
||||
if (m_GraveYardState == ZM_GRAVEYARD_A)
|
||||
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_A));
|
||||
@@ -236,7 +236,7 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* plr, uint64 guid)
|
||||
sObjectMgr->RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE); // rem gy
|
||||
sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE, false); // add gy
|
||||
m_PvP->TeamApplyBuff(TEAM_HORDE, ZM_CAPTURE_BUFF);
|
||||
plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
|
||||
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
|
||||
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H));
|
||||
}
|
||||
UpdateTowerState();
|
||||
@@ -326,21 +326,21 @@ void OPvPCapturePointZM_GraveYard::SetBeaconState(uint32 controlling_faction)
|
||||
UpdateTowerState();
|
||||
}
|
||||
|
||||
bool OPvPCapturePointZM_GraveYard::CanTalkTo(Player* plr, Creature* c, GossipMenuItems const& /*gso*/)
|
||||
bool OPvPCapturePointZM_GraveYard::CanTalkTo(Player* player, Creature* c, GossipMenuItems const& /*gso*/)
|
||||
{
|
||||
uint64 guid = c->GetGUID();
|
||||
std::map<uint64, uint32>::iterator itr = m_CreatureTypes.find(guid);
|
||||
if (itr != m_CreatureTypes.end())
|
||||
{
|
||||
if (itr->second == ZM_ALLIANCE_FIELD_SCOUT && plr->GetTeam() == ALLIANCE && m_BothControllingFaction == ALLIANCE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_A)
|
||||
if (itr->second == ZM_ALLIANCE_FIELD_SCOUT && player->GetTeam() == ALLIANCE && m_BothControllingFaction == ALLIANCE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_A)
|
||||
return true;
|
||||
else if (itr->second == ZM_HORDE_FIELD_SCOUT && plr->GetTeam() == HORDE && m_BothControllingFaction == HORDE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_H)
|
||||
else if (itr->second == ZM_HORDE_FIELD_SCOUT && player->GetTeam() == HORDE && m_BothControllingFaction == HORDE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_H)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* plr, uint64 guid, uint32 /*gossipid*/)
|
||||
bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* player, uint64 guid, uint32 /*gossipid*/)
|
||||
{
|
||||
std::map<uint64, uint32>::iterator itr = m_CreatureTypes.find(guid);
|
||||
if (itr != m_CreatureTypes.end())
|
||||
@@ -353,22 +353,22 @@ bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* plr, uint64 guid,
|
||||
return true;
|
||||
if (itr->second == ZM_ALLIANCE_FIELD_SCOUT)
|
||||
{
|
||||
cr->CastSpell(plr, ZM_BATTLE_STANDARD_A, true);
|
||||
m_FlagCarrierGUID = plr->GetGUID();
|
||||
cr->CastSpell(player, ZM_BATTLE_STANDARD_A, true);
|
||||
m_FlagCarrierGUID = player->GetGUID();
|
||||
}
|
||||
else if (itr->second == ZM_HORDE_FIELD_SCOUT)
|
||||
{
|
||||
cr->CastSpell(plr, ZM_BATTLE_STANDARD_H, true);
|
||||
m_FlagCarrierGUID = plr->GetGUID();
|
||||
cr->CastSpell(player, ZM_BATTLE_STANDARD_H, true);
|
||||
m_FlagCarrierGUID = player->GetGUID();
|
||||
}
|
||||
UpdateTowerState();
|
||||
plr->PlayerTalkClass->SendCloseGossip();
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OPvPCapturePointZM_GraveYard::HandleDropFlag(Player* /*plr*/, uint32 spellId)
|
||||
bool OPvPCapturePointZM_GraveYard::HandleDropFlag(Player* /*player*/, uint32 spellId)
|
||||
{
|
||||
switch(spellId)
|
||||
{
|
||||
@@ -391,34 +391,34 @@ void OutdoorPvPZM::FillInitialWorldStates(WorldPacket &data)
|
||||
}
|
||||
}
|
||||
|
||||
void OutdoorPvPZM::SendRemoveWorldStates(Player* plr)
|
||||
void OutdoorPvPZM::SendRemoveWorldStates(Player* player)
|
||||
{
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_N_W, 0);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_POS_W, 0);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_DISPLAY_W, 0);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_N_E, 0);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_POS_E, 0);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_DISPLAY_E, 0);
|
||||
plr->SendUpdateWorldState(ZM_WORLDSTATE_UNK_1, 1);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_EAST_N, 0);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_EAST_H, 0);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_EAST_A, 0);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_WEST_N, 0);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_WEST_H, 0);
|
||||
plr->SendUpdateWorldState(ZM_UI_TOWER_WEST_A, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_TOWER_EAST_N, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_TOWER_EAST_H, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_TOWER_EAST_A, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_TOWER_WEST_N, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_TOWER_WEST_H, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_TOWER_WEST_A, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_READY, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_NOT_READY, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_NOT_READY, 0);
|
||||
plr->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_N_W, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_POS_W, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_DISPLAY_W, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_N_E, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_POS_E, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_DISPLAY_E, 0);
|
||||
player->SendUpdateWorldState(ZM_WORLDSTATE_UNK_1, 1);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_EAST_N, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_EAST_H, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_EAST_A, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_WEST_N, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_WEST_H, 0);
|
||||
player->SendUpdateWorldState(ZM_UI_TOWER_WEST_A, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_N, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_H, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_A, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_N, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_H, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_A, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_READY, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_NOT_READY, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_NOT_READY, 0);
|
||||
player->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY, 0);
|
||||
}
|
||||
|
||||
class OutdoorPvP_zangarmarsh : public OutdoorPvPScript
|
||||
|
||||
@@ -181,8 +181,8 @@ class OPvPCapturePointZM_Beacon : public OPvPCapturePoint
|
||||
void FillInitialWorldStates(WorldPacket & data);
|
||||
|
||||
// used when player is activated/inactivated in the area
|
||||
bool HandlePlayerEnter(Player* plr);
|
||||
void HandlePlayerLeave(Player* plr);
|
||||
bool HandlePlayerEnter(Player* player);
|
||||
void HandlePlayerLeave(Player* player);
|
||||
|
||||
void UpdateTowerState();
|
||||
|
||||
@@ -215,15 +215,15 @@ class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint
|
||||
|
||||
void UpdateTowerState();
|
||||
|
||||
int32 HandleOpenGo(Player* plr, uint64 guid);
|
||||
int32 HandleOpenGo(Player* player, uint64 guid);
|
||||
|
||||
void SetBeaconState(uint32 controlling_team); // not good atm
|
||||
|
||||
bool HandleGossipOption(Player* plr, uint64 guid, uint32 gossipid);
|
||||
bool HandleGossipOption(Player* player, uint64 guid, uint32 gossipid);
|
||||
|
||||
bool HandleDropFlag(Player* plr, uint32 spellId);
|
||||
bool HandleDropFlag(Player* player, uint32 spellId);
|
||||
|
||||
bool CanTalkTo(Player* plr, Creature* c, GossipMenuItems const& gso);
|
||||
bool CanTalkTo(Player* player, Creature* c, GossipMenuItems const& gso);
|
||||
|
||||
private:
|
||||
|
||||
@@ -246,16 +246,16 @@ class OutdoorPvPZM : public OutdoorPvP
|
||||
|
||||
bool SetupOutdoorPvP();
|
||||
|
||||
void HandlePlayerEnterZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* plr, uint32 zone);
|
||||
void HandlePlayerEnterZone(Player* player, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player* player, uint32 zone);
|
||||
|
||||
bool Update(uint32 diff);
|
||||
|
||||
void FillInitialWorldStates(WorldPacket &data);
|
||||
|
||||
void SendRemoveWorldStates(Player* plr);
|
||||
void SendRemoveWorldStates(Player* player);
|
||||
|
||||
void HandleKillImpl(Player* plr, Unit* killed);
|
||||
void HandleKillImpl(Player* player, Unit* killed);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -131,8 +131,8 @@ public:
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
if (Player* plr = itr->getSource())
|
||||
return plr;
|
||||
if (Player* player = itr->getSource())
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -264,9 +264,9 @@ public:
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* plr = Unit::GetUnit((*me), PlayerGUID);
|
||||
if (plr)
|
||||
DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true);
|
||||
Unit* player = Unit::GetUnit((*me), PlayerGUID);
|
||||
if (player)
|
||||
DoCast(player, SPELL_FORCE_OF_NELTHARAKU, true);
|
||||
|
||||
PlayerGUID = 0;
|
||||
}
|
||||
@@ -288,10 +288,10 @@ public:
|
||||
Tapped = false;
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Player* plr = Unit::GetPlayer(*me, PlayerGUID);
|
||||
if (plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE)
|
||||
Player* player = Unit::GetPlayer(*me, PlayerGUID);
|
||||
if (player && player->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true);
|
||||
DoCast(player, SPELL_FORCE_OF_NELTHARAKU, true);
|
||||
/*
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
@@ -391,9 +391,9 @@ public:
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Player* plr = Unit::GetPlayer(*me, PlayerGUID);
|
||||
if (plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
|
||||
plr->KilledMonsterCredit(23209, 0);
|
||||
Player* player = Unit::GetPlayer(*me, PlayerGUID);
|
||||
if (player && player->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
|
||||
player->KilledMonsterCredit(23209, 0);
|
||||
}
|
||||
PoisonTimer = 0;
|
||||
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
@@ -761,11 +761,11 @@ public:
|
||||
|
||||
uint32 NextStep(uint32 Step)
|
||||
{
|
||||
Unit* plr = Unit::GetUnit((*me), PlayerGUID);
|
||||
Unit* player = Unit::GetUnit((*me), PlayerGUID);
|
||||
|
||||
Unit* Illi = Unit::GetUnit((*me), IllidanGUID);
|
||||
|
||||
if (!plr || !Illi)
|
||||
if (!player || !Illi)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return 0;
|
||||
@@ -775,9 +775,9 @@ public:
|
||||
{
|
||||
case 0: return 0; break;
|
||||
case 1: me->GetMotionMaster()->MovePoint(0, -5104.41f, 595.297f, 85.6838f); return 9000; break;
|
||||
case 2: DoScriptText(OVERLORD_YELL_1, me, plr); return 4500; break;
|
||||
case 3: me->SetInFront(plr); return 3200; break;
|
||||
case 4: DoScriptText(OVERLORD_SAY_2, me, plr); return 2000; break;
|
||||
case 2: DoScriptText(OVERLORD_YELL_1, me, player); return 4500; break;
|
||||
case 3: me->SetInFront(player); return 3200; break;
|
||||
case 4: DoScriptText(OVERLORD_SAY_2, me, player); return 2000; break;
|
||||
case 5: Illi->SetVisible(true);
|
||||
Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break;
|
||||
case 6:
|
||||
@@ -789,20 +789,20 @@ public:
|
||||
case 8: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break;
|
||||
case 9: DoScriptText(OVERLORD_SAY_3, me); return 6500; break;
|
||||
case 10: DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000; break;
|
||||
case 11: DoScriptText(OVERLORD_SAY_4, me, plr); return 6000; break;
|
||||
case 11: DoScriptText(OVERLORD_SAY_4, me, player); return 6000; break;
|
||||
case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break;
|
||||
case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break;
|
||||
case 14: Illi->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 1500; break;
|
||||
case 15: DoScriptText(LORD_ILLIDAN_SAY_4, Illi); return 1500; break;
|
||||
case 16:
|
||||
if (plr)
|
||||
if (player)
|
||||
{
|
||||
Illi->CastSpell(plr, SPELL_TWO, true);
|
||||
plr->RemoveAurasDueToSpell(SPELL_THREE);
|
||||
plr->RemoveAurasDueToSpell(SPELL_FOUR);
|
||||
Illi->CastSpell(player, SPELL_TWO, true);
|
||||
player->RemoveAurasDueToSpell(SPELL_THREE);
|
||||
player->RemoveAurasDueToSpell(SPELL_FOUR);
|
||||
return 5000;
|
||||
}else{
|
||||
CAST_PLR(plr)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100;
|
||||
CAST_PLR(player)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100;
|
||||
}
|
||||
break;
|
||||
case 17: DoScriptText(LORD_ILLIDAN_SAY_5, Illi); return 5000; break;
|
||||
@@ -821,8 +821,8 @@ public:
|
||||
case 24: me->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); return 5000; break;
|
||||
case 25: DoScriptText(OVERLORD_SAY_6, me); return 2000; break;
|
||||
case 26:
|
||||
if (plr)
|
||||
CAST_PLR(plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, me);
|
||||
if (player)
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, me);
|
||||
return 6000; break;
|
||||
case 27:
|
||||
{
|
||||
@@ -832,16 +832,16 @@ public:
|
||||
return 500; }
|
||||
break;
|
||||
case 28:
|
||||
plr->RemoveAurasDueToSpell(SPELL_TWO);
|
||||
plr->RemoveAurasDueToSpell(41519);
|
||||
plr->CastSpell(plr, SPELL_THREE, true);
|
||||
plr->CastSpell(plr, SPELL_FOUR, true);
|
||||
player->RemoveAurasDueToSpell(SPELL_TWO);
|
||||
player->RemoveAurasDueToSpell(41519);
|
||||
player->CastSpell(player, SPELL_THREE, true);
|
||||
player->CastSpell(player, SPELL_FOUR, true);
|
||||
return 1000; break;
|
||||
case 29:
|
||||
{
|
||||
Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
|
||||
if (Yarzill)
|
||||
DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, plr);
|
||||
DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, player);
|
||||
return 5000; }
|
||||
break;
|
||||
case 30:
|
||||
@@ -855,7 +855,7 @@ public:
|
||||
{
|
||||
Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50);
|
||||
if (Yarzill)
|
||||
Yarzill->CastSpell(plr, 41540, true);
|
||||
Yarzill->CastSpell(player, 41540, true);
|
||||
return 1000;}
|
||||
break;
|
||||
case 32: me->GetMotionMaster()->MovePoint(0, -5085.77f, 577.231f, 86.6719f); return 5000; break;
|
||||
@@ -1661,15 +1661,15 @@ class go_crystal_prison : public GameObjectScript
|
||||
public:
|
||||
go_crystal_prison() : GameObjectScript("go_crystal_prison") { }
|
||||
|
||||
bool OnQuestAccept(Player* plr, GameObject* /*go*/, Quest const* quest)
|
||||
bool OnQuestAccept(Player* player, GameObject* /*go*/, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_BATTLE_OF_THE_CRIMSON_WATCH)
|
||||
{
|
||||
Creature* Illidan = plr->FindNearestCreature(22083, 50);
|
||||
Creature* Illidan = player->FindNearestCreature(22083, 50);
|
||||
|
||||
if (Illidan && !CAST_AI(npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted)
|
||||
{
|
||||
CAST_AI(npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI, Illidan->AI())->PlayerGUID = plr->GetGUID();
|
||||
CAST_AI(npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI, Illidan->AI())->PlayerGUID = player->GetGUID();
|
||||
CAST_AI(npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI, Illidan->AI())->LiveCount = 0;
|
||||
CAST_AI(npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI, Illidan->AI())->EventStarted=true;
|
||||
}
|
||||
|
||||
@@ -232,13 +232,13 @@ class spell_gen_pet_summoned : public SpellScriptLoader
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
Player* plr = caster->ToPlayer();
|
||||
if (plr->GetLastPetNumber())
|
||||
Player* player = caster->ToPlayer();
|
||||
if (player->GetLastPetNumber())
|
||||
{
|
||||
PetType newPetType = (plr->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
|
||||
if (Pet* newPet = new Pet(plr, newPetType))
|
||||
PetType newPetType = (player->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
|
||||
if (Pet* newPet = new Pet(player, newPetType))
|
||||
{
|
||||
if (newPet->LoadPetFromDB(plr, 0, plr->GetLastPetNumber(), true))
|
||||
if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true))
|
||||
{
|
||||
// revive the pet if it is dead
|
||||
if (newPet->getDeathState() == DEAD)
|
||||
@@ -896,9 +896,9 @@ class spell_generic_clone_weapon : public SpellScriptLoader
|
||||
case SPELL_COPY_WEAPON_2:
|
||||
case SPELL_COPY_WEAPON_3:
|
||||
{
|
||||
if (Player* plrCaster = caster->ToPlayer())
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
if (Item* mainItem = plrCaster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
|
||||
if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
|
||||
}
|
||||
else
|
||||
@@ -908,9 +908,9 @@ class spell_generic_clone_weapon : public SpellScriptLoader
|
||||
case SPELL_COPY_OFFHAND:
|
||||
case SPELL_COPY_OFFHAND_2:
|
||||
{
|
||||
if (Player* plrCaster = caster->ToPlayer())
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
if (Item* offItem = plrCaster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
|
||||
if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
|
||||
}
|
||||
else
|
||||
@@ -919,9 +919,9 @@ class spell_generic_clone_weapon : public SpellScriptLoader
|
||||
}
|
||||
case SPELL_COPY_RANGED:
|
||||
{
|
||||
if (Player* plrCaster = caster->ToPlayer())
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
if (Item* rangedItem = plrCaster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
|
||||
if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user