Created
August 1, 2010 23:57
-
-
Save Tasssadar/503920 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*######## | |
| ## npc_arei | |
| ########*/ | |
| #define QUEST_ANCIENT_SPIRIT 4261 | |
| #define C_TOXIC_HORROR 7132 | |
| #define C_IRONTREE_STOMPER 7139 | |
| #define S_AREI_TRANSFORM 14888 | |
| #define GOSSIP_SAVED 2809 | |
| #define SAY_START -1361000 | |
| #define SAY_AGGRO -1361001 | |
| #define SAY_FRAG -1361002 | |
| #define SAY_END1 -1361003 | |
| #define SAY_END2 -1361004 | |
| #define SAY_END3 -1361005 | |
| #define SAY_END4 -1361006 | |
| const float SpawnPoints[5][3]= | |
| { | |
| {6172.33f,-1276.82f,374.6550f}, | |
| {6156.52f,-1293.24f,375.9467f}, | |
| {6603.18f,-1218.79f,448.3316f}, | |
| {6577.01f,-1235.22f,446.2619f}, | |
| {6564.91f,-1184.70f,446.2590f} | |
| }; | |
| struct MANGOS_DLL_DECL npc_areiAI : public npc_escortAI | |
| { | |
| npc_areiAI(Creature* pCreature) : npc_escortAI(pCreature) {Reset();} | |
| bool Saved; | |
| uint8 RPphase; | |
| uint16 RPtimer; | |
| void WaypointReached(uint32 i) | |
| { | |
| Player* pPlayer = GetPlayerForEscort(); | |
| if (!pPlayer) | |
| return; | |
| Creature* pCreature; | |
| switch(i) | |
| { | |
| case 10: | |
| for (uint8 i = 0; i < 2 ; i++ ) | |
| { | |
| if (pCreature=m_creature->SummonCreature(C_TOXIC_HORROR,SpawnPoints[i][0],SpawnPoints[i][1],SpawnPoints[i][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000)) | |
| pCreature->AI()->AttackStart(m_creature); | |
| } | |
| break; | |
| case 23: | |
| for (uint8 i = 2; i < 5 ; i++ ) | |
| { | |
| if (pCreature=m_creature->SummonCreature(C_IRONTREE_STOMPER,SpawnPoints[i][0],SpawnPoints[i][1],SpawnPoints[i][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000)) | |
| pCreature->AI()->AttackStart(m_creature); | |
| } | |
| break; | |
| case 24: | |
| RPtimer=500; | |
| RPphase=0; | |
| break; | |
| } | |
| } | |
| void Aggro(Unit* who) | |
| { | |
| if (!(rand()%5)) | |
| DoScriptText(SAY_AGGRO, m_creature, who); | |
| } | |
| void KilledUnit(Unit* who) | |
| { | |
| if (!(rand()%5)) | |
| DoScriptText(SAY_FRAG, m_creature, who); | |
| } | |
| void UpdateEscortAI(const uint32 diff) | |
| { | |
| if (RPtimer) | |
| { | |
| if (RPtimer<=diff) | |
| { | |
| Player* pPlayer = GetPlayerForEscort(); | |
| if (!pPlayer) | |
| return; | |
| switch (RPphase) | |
| { | |
| case 0: | |
| DoScriptText(SAY_END1,m_creature, pPlayer); | |
| RPtimer=4500; | |
| RPphase++; | |
| break; | |
| case 1: | |
| DoScriptText(SAY_END2,m_creature, pPlayer); | |
| RPtimer=2500; | |
| RPphase++; | |
| break; | |
| case 2: | |
| DoCast(m_creature,S_AREI_TRANSFORM); | |
| RPphase++; | |
| RPtimer=3000; | |
| break; | |
| case 3: | |
| DoScriptText(SAY_END3,m_creature,pPlayer); | |
| RPphase++; | |
| RPtimer=6000; | |
| break; | |
| case 4: | |
| DoScriptText(SAY_END4,m_creature,pPlayer); | |
| RPtimer=0; | |
| Saved=true; | |
| pPlayer->GroupEventHappens(QUEST_ANCIENT_SPIRIT,m_creature); | |
| break; | |
| } | |
| } | |
| else RPtimer-=diff; | |
| } | |
| if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) | |
| return; | |
| DoMeleeAttackIfReady(); | |
| } | |
| void Reset() | |
| { | |
| Saved=false; | |
| RPtimer=0; | |
| } | |
| }; | |
| bool QuestAccept_npc_arei(Player* pPlayer, Creature* pCreature, const Quest* pQuest) | |
| { | |
| if (pQuest->GetQuestId() == QUEST_ANCIENT_SPIRIT) | |
| { | |
| if (npc_areiAI* pEscortAI = dynamic_cast<npc_areiAI*>(pCreature->AI())) | |
| pEscortAI->Start(true, pPlayer->GetGUID(), pQuest); | |
| DoScriptText(SAY_START, pCreature, pPlayer); | |
| } | |
| return true; | |
| } | |
| CreatureAI* GetAI_npc_arei(Creature* pCreature) | |
| { | |
| return new npc_areiAI(pCreature); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment