/* *||||||||||||||||||||||||| *|| || *|| UNDER DEVELOPMENT || *||---------------------|| *|| JAINA || *|| || *||||||||||||||||||||||||| */ #include "../../../sc_defines.h" #include "../../../../../../game/Player.h" #include "../../../../../../game/GossipDef.h" #include "/hyjal_functions.h" //Spells #define SPELL_SHADOWBOLT 21077 //I do not find any video so I dunno when shi cast it... #define SPELL_AURA 31308 //NPC's IDs #define NPC_ABOMINATION 17898 #define NPC_GHOUL 17895 #define NPC_NECROMANCER 17899 #define NPC_FIEND 17897 #define NPC_BANSHEE 17905 #define NPC_WINTERCHILL 17767 #define NPC_ANETHERON 17808 //Sounds #define SOUND_INCOMING 11008 //Stay alert! Another wave approaches! #define SOUND_DEATH 11010 //I did... My best. #define SOUND_RALLY_ONE 11006 //Don't give up! We must prevail! #define SOUND_RALLY_TWO 11050 //Hold them back as long as possible! #define SOUND_RALLY_THREE 11051 //We must hold strong! #define SOUND_ATTACKED_ONE 11007 //I'm in jeopardy! Help me if you can! #define SOUND_ATTACKED_TWO 11049 //They've broken through! #define SOUND_RETREAT 11009 //We are lost! Fall back! #define SOUND_WIN 11011 //We have won valuable time! Now we must pull back! //Says #define SAY_INCOMING "Stay alert! Another wave approaches!" #define SAY_DEATH "I did... My best." #define SAY_RALLY_ONE "Don\'t give up! We must prevail!" #define SAY_RALLY_TWO "Hold them back as long as possible!" #define SAY_RALLY_THREE "We must hold strong!" #define SAY_ATTACKED_ONE "I\'m in jeopardy! Help me if you can!" #define SAY_ATTACKED_TWO "They\'ve broken through!" #define SAY_RETREAT "We are lost! Fall back!" #define SAY_WIN "We have won valuable time! Now we must pull back!" //Gossips #define GOSSIP_ITEM "Start Rage Winterchill\'s encounter " #define GOSSIP_ITEM_TWO "Start Anetheron\'s encounter " #define GOSSIP_ITEM_THREE "Vanish Alliance NPCs " struct MANGOS_DLL_DECL npc_jaina_proudmooreAI : public ScriptedAI { npc_jaina_proudmooreAI(Creature *c) : ScriptedAI(c) {EnterEvadeMode();} uint32 WaveTimer; uint32 RageWinterchillGUID uint32 AnetheronGUID uint32 TrashWave; uint32 BossEncounter; void EnterEvadeMode() { m_creature->RemoveAllAuras(); m_creature->DeleteThreatList(); m_creature->CombatStop(); DoGoHome(); if (BossEncounter != 1 || BossEncounter != 2 || BossEncounter != 3) { //No Encounter active, so we can talk to start first encounter. BossEncounter = 0; } if (TrashWave != 10) { RageWinterchillGUID = 0; } } void BeginEncounter(uint32 Encounter) { //10 secs before we start to spawn WaveTimer = 10000; //First trash wave coming up! TrashWave = 1; BossEncounter == Encounter; } void AttackStart(Unit *who) { if (!who) return; if (who->isTargetableForAttack() && who!= m_creature) { //Begin melee attack if we are within range DoStartMeleeAttack(who); } } void MoveInLineOfSight(Unit *who) { //We simply use this function to find players until we can use Map->GetPlayers() if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who)) { //Add them to our threat list m_creature->AddThreat(who,0.0f); } } void JustDied(Unit* Killer) { DoPlaySoundToSet(m_creature,SOUND_DEATH); DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL); //Despawn all monsters } void UpdateAI(const uint32 diff) { //Return since we have no target if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) return; //Check if we're gonna spawn a trash wave if (WaveTimer < diff) { switch (BossEncounter) { case 1: switch (TrashWave) { case 1: //First Wave, 10 Ghouls SpawnMonster(NPC_GHOUL, 10, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 85000; break; case 2: //Second Wave, 10 Ghouls, 2 Crypt Fiends SpawnMonster(NPC_GHOUL, 10, 1); SpawnMonster(NPC_FIEND, 2, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 85000; break; case 3: //Third Wave, 6 Ghouls, 6 Crypt Fiends SpawnMonster(NPC_GHOUL, 6, 1); SpawnMonster(NPC_FIEND, 6, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 100000; break; case 4: //Fourth Wave, 6 Ghouls, 4 Crypt Fiends, 2 Necromancers SpawnMonster(NPC_GHOUL, 6, 1); SpawnMonster(NPC_FIEND, 4, 1); SpawnMonster(NPC_NECROMANCER, 2, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 115000; break; case 5: //Fifth Wave, 2 Ghouls, 6 Crypt Fiends, 4 Necromancers SpawnMonster(NPC_GHOUL, 2, 1); SpawnMonster(NPC_FIEND, 6, 1); SpawnMonster(NPC_NECROMANCER, 4, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 125000; break; case 6: //Sixth Wave, 6 Ghouls, 6 Abominations SpawnMonster(NPC_GHOUL, 6, 1); SpawnMonster(NPC_ABOMINATION, 6, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 135000; break; case 7: //Seventh Wave, 4 Ghouls, 4 Necromancers, 4 Abominations SpawnMonster(NPC_GHOUL, 6, 1); SpawnMonster(NPC_NECROMANCER, 6, 1); SpawnMonster(NPC_ABOMINATION, 4, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 125000; break; case 8: //Eigth Wave, 6 Ghouls, 4 Crypt Fiends, 2 Abominations, 2 Necromancers SpawnMonster(NPC_FIEND, 4, 1); SpawnMonster(NPC_GHOUL, 6, 1); SpawnMonster(NPC_ABOMINATION, 2, 1); SpawnMonster(NPC_NECROMANCER, 2, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; //Totally unsure about this Timer, let's be nice and give players 2:30min WaveTimer = 150000; break; case 9: //Ninth "Wave", Rage Winterchill! Creature* RageWinterchillSpawn = NULL; RageWinterchillSpawn = SpawnMonster(NPC_WINTERCHILL); RageWinterchillGUID = RageWinterchillSpawn->GetGUID(); TrashWave = 10; WaveTimer = 0; break; break; case 3: switch (TrashWave) { case 1: //First wave, 10 Ghouls. SpawnMonster(NPC_GHOUL, 10, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 85000; break; case 2: //Second wave, 4 Abominations, 8 Ghouls. SpawnMonster(NPC_GHOUL, 8, 1); SpawnMonster(NPC_ABOMINATION, 4, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 85000; break; case 3: //Third wave, 4 Shadowy Necromancers, 4 Crypt Fiends, 4 Ghouls. SpawnMonster(NPC_necromancer, 4, 1); SpawnMonster(NPC_FIEND, 4, 1); SpawnMonster(NPC_GHOUL, 4, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 100000; break; case 4: //Fourth wave, 2 Banshees, 6 Crypt Fiends, 4 Ghouls. SpawnMonster(NPC_GHOUL, 4, 1); SpawnMonster(NPC_FIEND, 6, 1); SpawnMonster(NPC_BANSHEE, 2, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 115000; break; case 5: //Fifth wave, 4 Banshees, 6 Crypt Fiends, 2 Shadowy Necromancers. SpawnMonster(NPC_NECROMANCER, 2, 1); SpawnMonster(NPC_FIEND, 6, 1); SpawnMonster(NPC_BANSHEE, 4, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 125000; break; case 6: //Sixth Wave, 6 Ghouls, 6 Abominations SpawnMonster(NPC_GHOUL, 6, 1); SpawnMonster(NPC_ABOMINATION, 6, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 135000; break; case 7: //Seventh Wave, 2 Abominations, 4 Shadowy Necromancers, 6 Ghouls. SpawnMonster(NPC_GHOUL, 6, 1); SpawnMonster(NPC_NECROMANCER, 4, 1); SpawnMonster(NPC_ABOMINATION, 2, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; WaveTimer = 125000; break; case 8: //Eigth Wave, 4 Abominations, 4 Crypt Fiends, 4 Banshees. SpawnMonster(NPC_BANSHEE, 4, 1); SpawnMonster(NPC_FIEND, 4, 1); SpawnMonster(NPC_ABOMINATION, 4, 1); DoPlaySoundToSet(m_creature,SOUND_INCOMING); TrashWave++; //Totally unsure about this Timer, let's be nice and give players 2:30min WaveTimer = 150000; break; case 9: //Ninth "Wave", Anetheron! Creature* RageWinterchillSpawn = NULL; AnetheronSpawn = SpawnMonster(NPC_ANETHERON); AnetheronGUID = AnetheronSpawn->GetGUID(); TrashWave = 10; WaveTimer = 0; break; } } }else WaveTimer -= diff; if (BossEncounter == 1 && TrashWave == 10) { Unit* RageWinterchill = NULL; RageWinterchill = Unit::GetUnit((*m_creature),RageWinterchillGUID); if(!RageWinterchill || !RageWinterchill->isAlive()) { RageWinterchillGUID = 0; BossEncounter = 3; TrashWave = 0; } } else if (BossEncounter == 3 && TrashWave == 10) { Unit* Anetheron = NULL; Anetheron = Unit::GetUnit((*m_creature),AnetheronGUID); if(!Anetheron || !Anetheron->isAlive()) { AnetheronGUID = 0; BossEncounter = 5; TrashWave = 0; } } } void UpdateAI(const uint32 diff) { //Return since we have no target if (!m_creature->SelectHostilTarget()) return; //Check if we have a current target if( m_creature->getVictim() && m_creature->isAlive()) //If we are within range melee the target if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) { //Make sure our attack is ready and we aren't currently casting if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) { DoCast(m_creature, SPELL_AURA); } DoMeleeAttackIfReady(); } } }; CreatureAI* GetAI_npc_jaina_proudmoore(Creature *_Creature) { return new npc_jaina_proudmooreAI (_Creature); } // // //=======================================================================================================// // // bool GossipSelect_npc_jaina_proudmoore(Player *player, Creature *_Creature, uint32 sender, uint32 action ) { if (action == GOSSIP_ACTION_INFO_DEF + 1)//Fight time { player->PlayerTalkClass->CloseGossip(); ((npc_jaina_proudmooreAI*)_Creature->AI())->BeginEncounter(1); } else if (action == GOSSIP_ACTION_INFO_DEF + 2)//Fight time { player->PlayerTalkClass->CloseGossip(); ((npc_jaina_proudmooreAI*)_Creature->AI())->BeginEncounter(3); } return true; } bool GossipHello_npc_jaina_proudmoore(Player *player, Creature *_Creature) { if (((npc_jaina_proudmooreAI*)_Creature->AI())->BossEncounter == 0) { //ADD_GOSSIP_ITEM points to AddMenuItem player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); //first in fuction points to npc_text table player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID()); } else if (((npc_jaina_proudmooreAI*)_Creature->AI())->BossEncounter == 3) { //ADD_GOSSIP_ITEM points to AddMenuItem player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_TWO , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); //first in fuction points to npc_text table player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID()); } else if (((npc_jaina_proudmooreAI*)_Creature->AI())->BossEncounter == 5) { //ADD_GOSSIP_ITEM points to AddMenuItem player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_THREE , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); //first in fuction points to npc_text table player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID()); } return true; } void AddSC_mount_hyjal() { Script *newscript; newscript = new Script; newscript->Name="npc_jaina_proudmoore"; newscript->GetAI = GetAI_npc_jaina_proudmoore; newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore; newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore; m_scripts[nrscripts++] = newscript; }