*code cleanup
*totally destroyed m_creature, use "me" for future coding --HG-- branch : trunk
This commit is contained in:
@@ -102,23 +102,23 @@ struct npc_giltharesAI : public npc_escortAI
|
||||
switch(uiPointId)
|
||||
{
|
||||
case 16:
|
||||
DoScriptText(SAY_GIL_AT_LAST, m_creature, pPlayer);
|
||||
DoScriptText(SAY_GIL_AT_LAST, me, pPlayer);
|
||||
break;
|
||||
case 17:
|
||||
DoScriptText(SAY_GIL_PROCEED, m_creature, pPlayer);
|
||||
DoScriptText(SAY_GIL_PROCEED, me, pPlayer);
|
||||
break;
|
||||
case 18:
|
||||
DoScriptText(SAY_GIL_FREEBOOTERS, m_creature, pPlayer);
|
||||
DoScriptText(SAY_GIL_FREEBOOTERS, me, pPlayer);
|
||||
break;
|
||||
case 37:
|
||||
DoScriptText(SAY_GIL_ALMOST, m_creature, pPlayer);
|
||||
DoScriptText(SAY_GIL_ALMOST, me, pPlayer);
|
||||
break;
|
||||
case 47:
|
||||
DoScriptText(SAY_GIL_SWEET, m_creature, pPlayer);
|
||||
DoScriptText(SAY_GIL_SWEET, me, pPlayer);
|
||||
break;
|
||||
case 53:
|
||||
DoScriptText(SAY_GIL_FREED, m_creature, pPlayer);
|
||||
pPlayer->GroupEventHappens(QUEST_FREE_FROM_HOLD, m_creature);
|
||||
DoScriptText(SAY_GIL_FREED, me, pPlayer);
|
||||
pPlayer->GroupEventHappens(QUEST_FREE_FROM_HOLD, me);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -130,10 +130,10 @@ struct npc_giltharesAI : public npc_escortAI
|
||||
return;
|
||||
|
||||
//only aggro text if not player and only in this area
|
||||
if (pWho->GetTypeId() != TYPEID_PLAYER && m_creature->GetAreaId() == AREA_MERCHANT_COAST)
|
||||
if (pWho->GetTypeId() != TYPEID_PLAYER && me->GetAreaId() == AREA_MERCHANT_COAST)
|
||||
{
|
||||
//appears to be pretty much random (possible only if escorter not in combat with pWho yet?)
|
||||
DoScriptText(RAND(SAY_GIL_AGGRO_1, SAY_GIL_AGGRO_2, SAY_GIL_AGGRO_3, SAY_GIL_AGGRO_4), m_creature, pWho);
|
||||
DoScriptText(RAND(SAY_GIL_AGGRO_1, SAY_GIL_AGGRO_2, SAY_GIL_AGGRO_3, SAY_GIL_AGGRO_4), me, pWho);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -214,20 +214,20 @@ struct npc_taskmaster_fizzuleAI : public ScriptedAI
|
||||
IsFriend = false;
|
||||
Reset_Timer = 120000;
|
||||
FlareCount = 0;
|
||||
m_creature->setFaction(factionNorm);
|
||||
me->setFaction(factionNorm);
|
||||
}
|
||||
|
||||
void DoFriend()
|
||||
{
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->DeleteThreatList();
|
||||
m_creature->CombatStop(true);
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(true);
|
||||
|
||||
m_creature->StopMoving();
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
me->StopMoving();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
|
||||
m_creature->setFaction(FACTION_FRIENDLY_F);
|
||||
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
|
||||
me->setFaction(FACTION_FRIENDLY_F);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
|
||||
}
|
||||
|
||||
void SpellHit(Unit *caster, const SpellEntry *spell)
|
||||
@@ -266,7 +266,7 @@ struct npc_taskmaster_fizzuleAI : public ScriptedAI
|
||||
{
|
||||
if (FlareCount >= 2)
|
||||
{
|
||||
if (m_creature->getFaction() == FACTION_FRIENDLY_F)
|
||||
if (me->getFaction() == FACTION_FRIENDLY_F)
|
||||
return;
|
||||
|
||||
DoFriend();
|
||||
@@ -345,7 +345,7 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
|
||||
{
|
||||
if (!who || (!who->isAlive())) return;
|
||||
|
||||
if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
|
||||
if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
|
||||
{
|
||||
PlayerGUID = who->GetGUID();
|
||||
EventInProgress = true;
|
||||
@@ -367,14 +367,14 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
|
||||
|
||||
if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) {
|
||||
EventInProgress = false;
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature);
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me);
|
||||
pWarrior->FailQuest(1719);
|
||||
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
{
|
||||
if (AffrayChallenger[i])
|
||||
{
|
||||
Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]);
|
||||
Creature* pCreature = Unit::GetCreature((*me), AffrayChallenger[i]);
|
||||
if (pCreature) {
|
||||
if (pCreature->isAlive())
|
||||
{
|
||||
@@ -390,7 +390,7 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
|
||||
|
||||
if (BigWill)
|
||||
{
|
||||
Creature* pCreature = Unit::GetCreature((*m_creature), BigWill);
|
||||
Creature* pCreature = Unit::GetCreature((*me), BigWill);
|
||||
if (pCreature) {
|
||||
if (pCreature->isAlive()) {
|
||||
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
@@ -409,11 +409,11 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
|
||||
|
||||
if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) {
|
||||
pWarrior->AreaExploredOrEventHappens(1719);
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, m_creature);
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, me);
|
||||
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
{
|
||||
Creature* pCreature = m_creature->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
|
||||
Creature* pCreature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
|
||||
if (!pCreature)
|
||||
continue;
|
||||
pCreature->setFaction(35);
|
||||
@@ -435,10 +435,10 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
|
||||
{
|
||||
if (AffrayChallenger[i])
|
||||
{
|
||||
Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]);
|
||||
Creature* pCreature = Unit::GetCreature((*me), AffrayChallenger[i]);
|
||||
if ((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i])
|
||||
{
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature);
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me);
|
||||
Challenger_down[i] = true;
|
||||
}
|
||||
}
|
||||
@@ -450,8 +450,8 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
|
||||
{
|
||||
if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill)
|
||||
{
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, m_creature);
|
||||
Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[Wave]);
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, me);
|
||||
Creature* pCreature = Unit::GetCreature((*me), AffrayChallenger[Wave]);
|
||||
if (pCreature && (pCreature->isAlive()))
|
||||
{
|
||||
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -464,7 +464,7 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
else if (Wave >= 6 && !EventBigWill) {
|
||||
if (Creature* pCreature = m_creature->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000))
|
||||
if (Creature* pCreature = me->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000))
|
||||
{
|
||||
BigWill = pCreature->GetGUID();
|
||||
//pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32);
|
||||
@@ -477,10 +477,10 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
|
||||
}
|
||||
else if (Wave >= 6 && EventBigWill && BigWill)
|
||||
{
|
||||
Creature* pCreature = Unit::GetCreature((*m_creature), BigWill);
|
||||
Creature* pCreature = Unit::GetCreature((*me), BigWill);
|
||||
if (!pCreature || !pCreature->isAlive())
|
||||
{
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, m_creature);
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, me);
|
||||
EventInProgress = false;
|
||||
EventBigWill = false;
|
||||
EventGrate = false;
|
||||
@@ -537,8 +537,8 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
|
||||
{
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
{
|
||||
if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD)
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
if (me->getStandState() == UNIT_STAND_STATE_DEAD)
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
m_bIsPostEvent = false;
|
||||
m_uiPostEventTimer = 1000;
|
||||
@@ -556,16 +556,16 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
|
||||
switch(uiPointId)
|
||||
{
|
||||
case 0:
|
||||
DoScriptText(SAY_STARTUP1, m_creature);
|
||||
DoScriptText(SAY_STARTUP1, me);
|
||||
break;
|
||||
case 9:
|
||||
SetRun(false);
|
||||
break;
|
||||
case 17:
|
||||
if (Creature* pTemp = m_creature->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
|
||||
if (Creature* pTemp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
|
||||
{
|
||||
DoScriptText(SAY_MERCENARY, pTemp);
|
||||
m_creature->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
|
||||
me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
@@ -584,10 +584,10 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
|
||||
switch(uiPointId)
|
||||
{
|
||||
case 9:
|
||||
DoScriptText(SAY_STARTUP2, m_creature, pPlayer);
|
||||
DoScriptText(SAY_STARTUP2, me, pPlayer);
|
||||
break;
|
||||
case 18:
|
||||
DoScriptText(SAY_PROGRESS_1, m_creature, pPlayer);
|
||||
DoScriptText(SAY_PROGRESS_1, me, pPlayer);
|
||||
SetRun();
|
||||
break;
|
||||
}
|
||||
@@ -596,10 +596,10 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
if (pSummoned->GetEntry() == NPC_PILOT_WIZZ)
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
me->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
|
||||
if (pSummoned->GetEntry() == NPC_MERCENARY)
|
||||
pSummoned->AI()->AttackStart(m_creature);
|
||||
pSummoned->AI()->AttackStart(me);
|
||||
}
|
||||
|
||||
void UpdateEscortAI(const uint32 uiDiff)
|
||||
@@ -613,19 +613,19 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
|
||||
switch(m_uiPostEventCount)
|
||||
{
|
||||
case 0:
|
||||
DoScriptText(SAY_PROGRESS_2, m_creature);
|
||||
DoScriptText(SAY_PROGRESS_2, me);
|
||||
break;
|
||||
case 1:
|
||||
DoScriptText(SAY_PROGRESS_3, m_creature);
|
||||
DoScriptText(SAY_PROGRESS_3, me);
|
||||
break;
|
||||
case 2:
|
||||
DoScriptText(SAY_END, m_creature);
|
||||
DoScriptText(SAY_END, me);
|
||||
break;
|
||||
case 3:
|
||||
if (Player* pPlayer = GetPlayerForEscort())
|
||||
{
|
||||
pPlayer->GroupEventHappens(QUEST_ESCAPE, m_creature);
|
||||
m_creature->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
||||
pPlayer->GroupEventHappens(QUEST_ESCAPE, me);
|
||||
me->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user