include "../../../sc_defines.h" #include "../../../../../../game/Player.h" #include "../../../../../../game/GossipDef.h" #include "../../../../../../shared/WorldPacket.h" #include "../../../../../../game/GameObject.h" #define GOSSIP_HELP "Les naaru gardaient certaines des creatures les plus dangereuses de l'univers dans ces cellules. Je vais vous en presenter une nouvelle... " #define BLAZING_TRICKSTER 20905 #define WARP_STALKER 20906 #define WAVE1_X 479.3 #define WAVE1_Y -151.1 #define WAVE1_Z 42.58 #define WAVE1_ORIENT 3.043 #define MILLHOUSE_FANASTORM 20977 #define WAVE2_X 410.92 #define WAVE2_Y -150.44 #define WAVE2_Z 42.58 #define WAVE2_ORIENT 6.28 #define SULFURON_MAGMA_THROWER 20909 #define AKKIRIS_LIGHTNING_WALKER 20908 #define WAVE3_X 472 #define WAVE3_Y -170.88 #define WAVE3_Z 42.58 #define WAVE3_ORIENT 2.70 #define BLACKWING_DRACONAR 20911 #define TWILIGHT_DRACONAR 20910 #define WAVE4_X 418.74 #define WAVE4_Y -172.87 #define WAVE4_Z 42.58 #define WAVE4_ORIENT 0.53 #define HARBINGER_SKYRISS 20912 #define WAVE5_X 446.14 #define WAVE5_Y -160.48 #define WAVE5_Z 43.0641 #define WAVE5_ORIENT 1.70 struct MANGOS_DLL_DECL npc_warden_mellicharAI : public ScriptedAI { npc_warden_mellicharAI(Creature *c) : ScriptedAI(c) {EnterEvadeMode();} uint32 number; uint32 interwave_timer; Creature* Summon1; Creature* Summon2; Creature* Summon3; Creature* Summon4; Creature* Summon5; Creature* Summon6; Creature* Summon7; Creature* Summon8; void EnterEvadeMode() { number = 0; interwave_timer = 90000; } void LaunchWave(uint32 numberWave) { switch(numberWave) { case 1: switch(rand()%2) { case 0: Summon1 = DoSpawnCreature(BLAZING_TRICKSTER, WAVE1_X, WAVE1_Y, WAVE1_Z, WAVE1_ORIENT, TEMPSUMMON_CORPSE_DESPAWN, 300000); break; case 1: Summon2 = DoSpawnCreature(WARP_STALKER, WAVE1_X, WAVE1_Y, WAVE1_Z, WAVE1_ORIENT, TEMPSUMMON_CORPSE_DESPAWN, 300000); break; } interwave_timer = 90000; numero = 2; m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE); break; case 2: Summon3 = DoSpawnCreature(MILLHOUSE_FANASTORM, WAVE2_X, WAVE2_Y, WAVE2_Z, WAVE2_ORIENT, TEMPSUMMON_CORPSE_DESPAWN, 300000); break; case 3: switch(rand()%2) { case 0: Summon4 = DoSpawnCreature(SULFURON_MAGMA_THROWER, WAVE3_X, WAVE3_Y, WAVE3_Z, WAVE3_ORIENT, TEMPSUMMON_CORPSE_DESPAWN, 300000); break; case 1: Summon5 = DoSpawnCreature(AKKIRIS_LIGHTNING_WALKER, WAVE3_X, WAVE3_Y, WAVE3_Z, WAVE3_ORIENT, TEMPSUMMON_CORPSE_DESPAWN, 300000); break; } break; case 4: switch(rand()%2) { case 0: Summon6 = DoSpawnCreature(BLACKWING_DRACONAR, WAVE4_X, WAVE4_Y, WAVE4_Z, WAVE4_ORIENT, TEMPSUMMON_CORPSE_DESPAWN, 300000); break; case 1: Summon7 = DoSpawnCreature(TWILIGHT_DRACONAR, WAVE4_X, WAVE4_Y, WAVE4_Z, WAVE4_ORIENT, TEMPSUMMON_CORPSE_DESPAWN, 300000); break; } break; case 5: Summon8 = DoSpawnCreature(HARBINGER_SKYRISS, WAVE5_X, WAVE5_Y, WAVE5_Z, WAVE5_ORIENT, TEMPSUMMON_CORPSE_DESPAWN, 300000); break; } } void UpdateAI(const uint32 diff) { if(number == 2) { if(interwave_timer < 0) { LaunchWave(2); number = 3; interwave_timer = 20000; } else interwave_timer -= diff; } if(number == 3) { if(interwave_timer < 0) { LaunchWave(3); number = 4; interwave_timer = 90000; } else interwave_timer -= diff; } if(number == 4) { if(interwave_timer < 0) { LaunchWave(4); number = 5; interwave_timer = 120000; } else interwave_timer -= diff; } if(number == 5) { if(interwave_timer < 0) { LaunchWave(5); number = 6; } else interwave_timer -= diff; } } }; CreatureAI* GetAI_npc_warden_mellichar(Creature *_Creature) { return new npc_warden_mellicharAI (_Creature); } bool GossipSelect_npc_warden_mellichar(Player *player, Creature *_Creature, uint32 sender, uint32 action ) { if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->PlayerTalkClass->CloseGossip(); ((npc_warden_mellicharAI*)_Creature->AI())->LaunchWave(1); } return true; } bool GossipHello_npc_warden_mellichar(Player *player, Creature *_Creature) { player->ADD_GOSSIP_ITEM( 0, GOSSIP_HELP , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->PlayerTalkClass->SendGossipMenu(384,_Creature->GetGUID()); return true; } void AddSC_npc_warden_mellichar() { Script *newscript; newscript = new Script; newscript->Name="npc_warden_mellichar"; newscript->GetAI = GetAI_npc_warden_mellichar; newscript->pGossipHello = &GossipHello_npc_warden_mellichar; newscript->pGossipSelect = &GossipSelect_npc_warden_mellichar; m_scripts[nrscripts++] = newscript;