diff options
11 files changed, 569 insertions, 115 deletions
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp index d0712ad6129..0d846c956bb 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp @@ -210,9 +210,12 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI Channeler->RemoveCorpse(); Channeler->Respawn(); } + if(m_creature->isAlive()) + { Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } } } else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); @@ -388,6 +391,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI Akama->GetPosition(x,y,z); // They move towards AKama Defender->GetMotionMaster()->MovePoint(0, x, y, z); + Defender->AI()->AttackStart(Akama); }else move = false; }else move = false; if(!move) diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp index 057c65cf86d..b7348969c4f 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp @@ -79,7 +79,7 @@ EndScriptData */ #define TAINTED_ELEMENTAL 22009 #define COILFANG_STRIDER 22056 #define COILFANG_ELITE 22055 -#define FATHOM_SPOREBAT 22140 +#define TOXIC_SPOREBAT 22140 float ElementPos[8][4] = { @@ -127,6 +127,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI ScriptedInstance *pInstance; uint64 ShieldGeneratorChannel[4]; + uint64 AggroTargetGUID; uint32 ShockBlast_Timer; uint32 Entangle_Timer; @@ -139,10 +140,13 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI uint32 CoilfangStrider_Timer; uint32 SummonSporebat_Timer; uint32 SummonSporebat_StaticTimer; + uint32 AggroTimer; + uint8 EnchantedElemental_Pos; uint8 Phase; bool Entangle; + bool Intro; void Reset() { @@ -159,17 +163,23 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI SummonSporebat_StaticTimer = 30000; EnchantedElemental_Pos = 0; Phase = 0; + AggroTimer = 19000; + AggroTargetGUID = 0; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Start off unattackable so that the intro is done properly + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Entangle = false; + Intro = false; if(pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, 0); + pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); ShieldGeneratorChannel[0] = 0; ShieldGeneratorChannel[1] = 0; ShieldGeneratorChannel[2] = 0; ShieldGeneratorChannel[3] = 0; - } //Called when a tainted elemental dies @@ -180,6 +190,38 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI TaintedElemental_Timer = 50000; } + void MoveInLineOfSight(Unit *who) + { + if(!who || (!who->isAlive())) return; + + if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) + { + if(who->HasStealthAura()) + who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + + m_creature->AddThreat(who, 1.0f); + } + + if(!InCombat && !Intro && m_creature->IsWithinDistInMap(who, 40.0f) && (who->GetTypeId() == TYPEID_PLAYER)) + { + if(pInstance) + pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); + + m_creature->GetMotionMaster()->Clear(false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoYell(SAY_INTRO,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature, SOUND_INTRO); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); + AggroTargetGUID = who->GetGUID(); + Intro = true; + } + } + } + void KilledUnit(Unit *victim) { switch(rand()%2) @@ -202,10 +244,10 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL); if(pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, 0); + pInstance->SetData(DATA_LADYVASHJEVENT, DONE); } - void StartEvent() +/* void StartEvent() { switch(rand()%4) { @@ -230,17 +272,10 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI Phase = 1; if(pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, 1); - } + pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); + }*/ - void Aggro(Unit *who) - { - //Begin melee attack if we are within range - if(Phase != 2) - DoStartMovement(who); - - StartEvent(); - } + void Aggro(Unit *who){} void CastShootOrMultishot() { @@ -278,12 +313,58 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI { //to prevent abuses during phase 2 if(Phase == 2 && !m_creature->getVictim() && InCombat) - EnterEvadeMode(); + { + EnterEvadeMode(); + return; + } //Return since we have no target if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) return; + //Intro + if(Intro) + { + if(AggroTimer < diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + switch(rand()%4) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_AGGRO1); + DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_AGGRO2); + DoYell(SAY_AGGRO2, LANG_UNIVERSAL, NULL); + break; + case 2: + DoPlaySoundToSet(m_creature, SOUND_AGGRO3); + DoYell(SAY_AGGRO3, LANG_UNIVERSAL, NULL); + break; + case 3: + DoPlaySoundToSet(m_creature, SOUND_AGGRO4); + DoYell(SAY_AGGRO4, LANG_UNIVERSAL, NULL); + break; + } + Phase = 1; + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Intro = false; + //Begin melee attack if we are within range + if(AggroTargetGUID && Phase != 2) + { + Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID); + if(pUnit) + { + m_creature->GetMotionMaster()->MoveChase(pUnit); + AttackStart(pUnit); + } + DoZoneInCombat(); + }else EnterEvadeMode(); + }else AggroTimer -= diff; + } + if(Phase == 1 || Phase == 3) { //ShockBlast_Timer @@ -368,7 +449,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI if(SummonSporebat_Timer < diff) { Creature *Sporebat = NULL; - Sporebat = m_creature->SummonCreature(FATHOM_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + Sporebat = m_creature->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); if(Sporebat) { @@ -485,7 +566,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI { Creature *CoilfangStrider; uint32 pos = rand()%3; - CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); if(CoilfangStrider) { Unit *target = NULL; @@ -634,11 +715,11 @@ struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI } }; -//Fathom Sporebat +//Toxic Sporebat //Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. -struct TRINITY_DLL_DECL mob_fathom_sporebatAI : public ScriptedAI +struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI { - mob_fathom_sporebatAI(Creature *c) : ScriptedAI(c) + mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); @@ -651,7 +732,8 @@ struct TRINITY_DLL_DECL mob_fathom_sporebatAI : public ScriptedAI void Reset() { - m_creature->setFaction(14); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); + m_creature->setFaction(14); ToxicSpore_Timer = 5000; Check_Timer = 1000; } @@ -867,9 +949,9 @@ CreatureAI* GetAI_mob_tainted_elemental(Creature *_Creature) return new mob_tainted_elementalAI (_Creature); } -CreatureAI* GetAI_mob_fathom_sporebat(Creature *_Creature) +CreatureAI* GetAI_mob_toxic_sporebat(Creature *_Creature) { - return new mob_fathom_sporebatAI (_Creature); + return new mob_toxic_sporebatAI (_Creature); } CreatureAI* GetAI_mob_shield_generator_channel(Creature *_Creature) @@ -896,8 +978,8 @@ void AddSC_boss_lady_vashj() m_scripts[nrscripts++] = newscript; newscript = new Script; - newscript->Name="mob_fathom_sporebat"; - newscript->GetAI = GetAI_mob_fathom_sporebat; + newscript->Name="mob_toxic_sporebat"; + newscript->GetAI = GetAI_mob_toxic_sporebat; m_scripts[nrscripts++] = newscript; newscript = new Script; diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp index 4052c4cfa0b..49dd5d5950d 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp @@ -429,12 +429,11 @@ struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI void MoveInLineOfSight(Unit*) {} - // bugged - /*void DamageTaken(Unit*, uint32 &damage) + void DamageTaken(Unit*, uint32 &damage) { if(damage >= m_creature->GetHealth()) m_creature->CastSpell(m_creature, SPELL_SOUL_TRANSFER, true); - }*/ + } void JustDied(Unit*) { diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp index 798498df02f..b059b81c1bd 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp @@ -47,31 +47,6 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance TempSpell->EffectImplicitTargetA[0] = 6; TempSpell->EffectImplicitTargetB[0] = 0; } - TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SOUL_TRANSFER); - if(TempSpell && TempSpell->EffectImplicitTargetB[0] != 30) - { - TempSpell->EffectImplicitTargetA[0] = 1; - TempSpell->EffectImplicitTargetA[1] = 1; - TempSpell->EffectImplicitTargetA[2] = 1; - TempSpell->EffectImplicitTargetB[0] = 0; - TempSpell->EffectImplicitTargetB[1] = 0; - TempSpell->EffectImplicitTargetB[2] = 0; - } - // target 8, but core only push back the caster - TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_DEBRIS_DAMAGE); - if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 53) - { - TempSpell->EffectImplicitTargetA[0] = 53; - TempSpell->EffectImplicitTargetB[0] = 16; - } - TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_DEBRIS_KNOCKDOWN); - if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 53) - { - TempSpell->EffectImplicitTargetA[0] = 53; - TempSpell->EffectImplicitTargetB[0] = 16; - TempSpell->EffectImplicitTargetA[1] = 53; - TempSpell->EffectImplicitTargetB[1] = 16; - } } uint32 Encounters[ENCOUNTERS]; @@ -219,8 +194,9 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance Unit *Channeler = Unit::GetUnit(*player, *i); if(Channeler && Channeler->isAlive()) { - Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); + //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); data = IN_PROGRESS; + break; } }break; } diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp index 04c36bef4c2..8024b1d0bd2 100644 --- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp +++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: Shadowmoon_Valley SD%Complete: 100 -SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 11082. Vendor Drake Dealer Hurlunk. Teleporter TO Invasion Point: Cataclysm +SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 11082, 11108. Vendor Drake Dealer Hurlunk. Teleporter TO Invasion Point: Cataclysm SDCategory: Shadowmoon Valley EndScriptData */ @@ -384,6 +384,11 @@ struct TRINITY_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI } }; +CreatureAI* GetAI_mob_dragonmaw_peon(Creature* _Creature) +{ + return new mob_dragonmaw_peonAI(_Creature); +} + /*###### ## npc_drake_dealer_hurlunk ######*/ @@ -692,6 +697,403 @@ bool QuestAccept_npc_karynaku(Player* player, Creature* creature, Quest const* q return true; } +/*#### +# quest_lord_illidan_stormrage +####*/ +#define QUEST_LORD_ILLIDAN_STORMRAGE 11108 +#define LORD_ILLIDAN_STORMRAGE 22083 + +#define SPELL_ONE 39990 // Red Lightning Bolt +#define SPELL_TWO 41528 // Mark of Stormrage +#define SPELL_THREE 40216 // Dragonaw Faction +#define SPELL_FOUR 42016 // Dragonaw Trasform + +#define OVERLORD_SAY_1 "Come, $N. Lord Stormrage awaits." +#define OVERLORD_SAY_2 "Lord Illidan will be here shortly." +#define OVERLORD_SAY_3 "Lord Illidan, this is the Dragonmaw that I, and others, have told you about. He will lead us to victory!" +#define OVERLORD_SAY_4 "But... My lord, I do not understand. $N... He is the orc that has..." +#define OVERLORD_SAY_5 "It will be done, my lord." +#define OVERLORD_SAY_6 "So you thought to make a fool of Mor'ghor, eh? Before you are delivered to Lord Illidan, you will feel pain that you could not know to exist. I will take pleasure in exacting my own vengeance." + +#define OVERLORD_YELL_1 "Warriors of Dragonmaw, gather 'round! One among you has attained the rank of highlord! Bow your heads in reverence! Show your respect and allegiance to Highlord $N!" +#define OVERLORD_YELL_2 "All hail Lord Illidan!" + +#define LORD_ILLIDAN_SAY_1 "What is the meaning of this, Mor'ghor?" +#define LORD_ILLIDAN_SAY_2 "SILENCE!" +#define LORD_ILLIDAN_SAY_3 "Blathering idiot. You incomprehensibly incompetent buffoon..." +#define LORD_ILLIDAN_SAY_4 "THIS is your hero?" +#define LORD_ILLIDAN_SAY_5 "You have been deceived, imbecile." +#define LORD_ILLIDAN_SAY_6 "This... whole... operation... HAS BEEN COMPROMISED!" +#define LORD_ILLIDAN_SAY_7 "I expect to see this insect's carcass in pieces in my lair within the hour. Fail and you will suffer a fate so much worse than death." + +#define YARZILL_THE_MERC_SAY "You will not harm the boy, Mor'ghor! Quickly, $N, climb on my back!" + +#define GOSSIP_FLY "Lets Do! <MISSING TEXT>" + +bool GossipHello_npc_yarzill_fly(Player *player, Creature *_Creature) +{ + if (player->GetQuestStatus(QUEST_LORD_ILLIDAN_STORMRAGE) == QUEST_STATUS_COMPLETE) + { + player->ADD_GOSSIP_ITEM(0, GOSSIP_FLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->SEND_GOSSIP_MENU(3961,_Creature->GetGUID()); + return true; + }else{ + return false; + } +} + +bool GossipSelect_npc_yarzill_fly(Player *player, Creature *_Creature, uint32 sender, uint32 action) +{ + if (action == GOSSIP_ACTION_INFO_DEF + 1) + { + std::vector<uint32> nodes; + nodes.resize(2); + nodes[0] = 173; + nodes[1] = 174; + error_log("SD2: Player %s started quest 11108 which has disabled taxi node, need to be fixed in core", player->GetName()); + //player->ActivateTaxiPathTo(nodes, 23468); + return true; + } + return false; +} + +struct TRINITY_DLL_DECL Yarzill_The_MercAI : public ScriptedAI +{ + Yarzill_The_MercAI(Creature *c) : ScriptedAI(c) {Reset();} + +void Reset(){} + +void Aggro(Unit *who){} + +void DoSpeach(Unit *target) +{ +DoSay(YARZILL_THE_MERC_SAY,LANG_UNIVERSAL,target); +} +}; + +struct TRINITY_DLL_DECL Lord_IllidanAI : public ScriptedAI +{ +Lord_IllidanAI(Creature *c) : ScriptedAI(c) {Reset();} + +void Reset(){} + +void Aggro(Unit *who){} + +void DoSpeach(int phase) +{ + switch(phase) + { + case 1: + DoSay(LORD_ILLIDAN_SAY_1,LANG_UNIVERSAL,NULL); + break; + case 2: + DoSay(LORD_ILLIDAN_SAY_2,LANG_UNIVERSAL,NULL); + break; + case 3: + DoSay(LORD_ILLIDAN_SAY_3,LANG_UNIVERSAL,NULL); + break; + case 4: + DoSay(LORD_ILLIDAN_SAY_4,LANG_UNIVERSAL,NULL); + break; + case 5: + DoSay(LORD_ILLIDAN_SAY_5,LANG_UNIVERSAL,NULL); + break; + case 6: + DoSay(LORD_ILLIDAN_SAY_6,LANG_UNIVERSAL,NULL); + break; + case 7: + DoSay(LORD_ILLIDAN_SAY_7,LANG_UNIVERSAL,NULL); + break; + case 0: + default: + break; + } +} +}; + +struct TRINITY_DLL_DECL Overlord_MorghorAI : public ScriptedAI +{ +Overlord_MorghorAI(Creature *c) : ScriptedAI(c) {Reset();} + + Unit* m_player; + Unit* PlayerCheck; + + uint32 SpeachTimer; + uint32 SpeachNum; + + uint64 PlayerGUID; + uint64 YazillGUID; + + bool DoingSpeach; + bool Failed; + + Creature* Lord; + Creature* Yarzill; + +void Reset() +{ + if (Lord) + { + Lord->SetUInt64Value(UNIT_FIELD_TARGET, 0); + Lord->SetVisibility(VISIBILITY_OFF); + Lord->setDeathState(JUST_DIED); + } + + if (Yarzill) + { + Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0); + } + + m_creature->Relocate(-5085.77, 577.231, 86.6719, 2.32608); + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 2); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + m_player = NULL; + PlayerCheck = NULL; + PlayerGUID = 0; + YazillGUID = 0; + Lord = NULL; + Yarzill = NULL; + DoingSpeach = false; + Failed = false; + SpeachNum = 0; + SpeachTimer = 0; +} + +void BeginSpeach(Unit* target) +{ + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + DoSay(OVERLORD_SAY_1,LANG_UNIVERSAL,target); + m_player = target; + PlayerCheck = NULL; + PlayerGUID = target->GetGUID(); + SpeachTimer = 4200; + SpeachNum = 0; + DoingSpeach = true; +} + +void Aggro(Unit *who){} + +void MoveInLineOfSight(Unit *who) +{ + if (!who) + return; + + if (DoingSpeach) + { + if (who->GetEntry() == 23141 && m_creature->IsWithinDistInMap(who, 15)) + { + if (!YazillGUID) + { + YazillGUID = who->GetGUID(); + } + } + } +} + +void UpdateAI(const uint32 diff) +{ + //Speach + if (DoingSpeach) + { + if (SpeachTimer < diff) + { + if (YazillGUID && !Yarzill) + Yarzill = ((Creature*)Unit::GetUnit((*m_creature), YazillGUID)); + + if (!m_creature->IsWithinDistInMap(m_player, 50) && ((Player*)m_player)->GetQuestStatus(QUEST_LORD_ILLIDAN_STORMRAGE) == QUEST_STATUS_INCOMPLETE) + { + ((Player*)m_player)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); + SpeachNum = 30; + } + + switch (SpeachNum) + { + // Overlord Movement + case 0: + m_creature->GetMotionMaster()->MovePoint(0, -5104.41, 595.297, 85.6838); + SpeachTimer = 9000; SpeachNum++; break; + // Overlord Yell 1 + case 1: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SHOUT); + DoYell(OVERLORD_YELL_1,LANG_UNIVERSAL,m_player); + SpeachTimer = 4500; SpeachNum++; break; + // Overlord Angle + case 2: + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); + SpeachTimer = 3200; SpeachNum++; break; + // Overlord Say 2 + case 3: + DoSay(OVERLORD_SAY_2,LANG_UNIVERSAL,NULL); + SpeachTimer = 2000; SpeachNum++; break; + // Summon Illidan + case 4: + Lord = m_creature->SummonCreature(LORD_ILLIDAN_STORMRAGE, -5107.83, 602.584, 85.2393, 4.92598, TEMPSUMMON_CORPSE_DESPAWN, 0); + Lord->LoadCreaturesAddon(); + SpeachTimer = 350; SpeachNum++; break; + // Illidan Cast Red Bolt + case 5: + Lord->CastSpell(Lord, SPELL_ONE, true); + Lord->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Lord->GetGUID()); + SpeachTimer = 2000; SpeachNum++; break; + // Overlord Yell 2 + case 6: + DoYell(OVERLORD_YELL_2,LANG_UNIVERSAL,NULL); + SpeachTimer = 4500; SpeachNum++; break; + // Overlord Kneel + case 7: + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,8); + SpeachTimer = 2500; SpeachNum++; break; + // Overlord Say 3 + case 8: + DoSay(OVERLORD_SAY_3,LANG_UNIVERSAL,NULL); + SpeachTimer = 6500; SpeachNum++; break; + // Illidan Say 1 + case 9: + ((Lord_IllidanAI*)Lord->AI())->DoSpeach(1); + SpeachTimer = 5000; SpeachNum++; break; + // Overlord Say 4 + case 10: + DoSay(OVERLORD_SAY_4,LANG_UNIVERSAL,m_player); + SpeachTimer = 6000; SpeachNum++; break; + // Illidan Say 2 + case 11: + ((Lord_IllidanAI*)Lord->AI())->DoSpeach(2); + SpeachTimer = 5500; SpeachNum++; break; + // Illidan Say 3 + case 12: + ((Lord_IllidanAI*)Lord->AI())->DoSpeach(3); + SpeachTimer = 4000; SpeachNum++; break; + // Illidan Angle + case 13: + Lord->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); + SpeachTimer = 1500; SpeachNum++; break; + // Illidan Say 4 + case 14: + ((Lord_IllidanAI*)Lord->AI())->DoSpeach(4); + SpeachTimer = 1500; SpeachNum++; break; + // Illidan Cast + case 15: + PlayerCheck = Unit::GetUnit(*Lord, PlayerGUID); + if (PlayerCheck) + { + Lord->CastSpell(m_player, SPELL_TWO, true); + m_player->RemoveAurasDueToSpell(SPELL_THREE); + m_player->RemoveAurasDueToSpell(SPELL_FOUR); + SpeachTimer = 5000; SpeachNum++; + } + else + { + ((Player*)m_player)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); + SpeachTimer = 100; SpeachNum = 30; + } + break; + // Illidan Say 5 + case 16: + ((Lord_IllidanAI*)Lord->AI())->DoSpeach(5); + SpeachTimer = 5000; SpeachNum++; break; + // Illidan Say 6 + case 17: + ((Lord_IllidanAI*)Lord->AI())->DoSpeach(6); + SpeachTimer = 5000; SpeachNum++; break; + // Illidan Say 7 + case 18: + ((Lord_IllidanAI*)Lord->AI())->DoSpeach(7); + SpeachTimer = 5000; SpeachNum++; break; + // Illidan Fly + case 19: + Lord->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + Lord->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + SpeachTimer = 500; SpeachNum++; break; + // Overlord Say 5 + case 20: + DoSay(OVERLORD_SAY_5,LANG_UNIVERSAL,NULL); + SpeachTimer = 500; SpeachNum++; break; + // Illidan Despawn + case 21: + Lord->SetVisibility(VISIBILITY_OFF); + Lord->setDeathState(JUST_DIED); + Lord = NULL; + SpeachTimer = 1000; SpeachNum++; break; + // Overlord Stand Up + case 22: + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + SpeachTimer = 2000; SpeachNum++; break; + // Overlord Angle + case 23: + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); + SpeachTimer = 5000; SpeachNum++; break; + // Overlord Say 6 + case 24: + DoSay(OVERLORD_SAY_6,LANG_UNIVERSAL,NULL); + SpeachTimer = 2000; SpeachNum++; break; + // Complete Quest + case 25: + ((Player*)m_player)->CompleteQuest(QUEST_LORD_ILLIDAN_STORMRAGE); + SpeachTimer = 6000; SpeachNum++; break; + // Goblin Angle + case 26: + if (Yarzill) + Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); + SpeachTimer = 500; SpeachNum++; break; + // Cast Again Dragonaw Illusion + case 27: + m_player->RemoveAurasDueToSpell(SPELL_TWO); + m_player->RemoveAurasDueToSpell(41519); + m_player->CastSpell(m_player, SPELL_THREE, true); + m_player->CastSpell(m_player, SPELL_FOUR, true); + SpeachTimer = 1000; SpeachNum++; break; + // Goblin + case 28: + if (Yarzill) + ((Yarzill_The_MercAI*)Yarzill->AI())->DoSpeach(m_player); + SpeachTimer = 5000; SpeachNum++; break; + // Goblin Off + case 29: + if (Yarzill) + Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0); + SpeachTimer = 5000; SpeachNum++; break; + // Overlord Go Back + case 30: + m_creature->GetMotionMaster()->MovePoint(0, -5085.77, 577.231, 86.6719); + SpeachTimer = 5000; SpeachNum++; break; + // Reset + case 31: + Reset(); + break; + default: break; + } + }else SpeachTimer -= diff; +} +} +}; + +CreatureAI* GetAI_Overlord_Morghor(Creature *_Creature) +{ +return new Overlord_MorghorAI(_Creature); +} + +CreatureAI* GetAI_Lord_Illidan(Creature *_Creature) +{ +return new Lord_IllidanAI(_Creature); +} + +CreatureAI* GetAI_Yarzill_The_Merc(Creature *_Creature) +{ +return new Yarzill_The_MercAI(_Creature); +} +bool QuestAccept_Overlord_Morghor(Player *player, Creature *_Creature, const Quest *_Quest ) +{ + if(_Quest->GetQuestId() == QUEST_LORD_ILLIDAN_STORMRAGE) + { + ((Overlord_MorghorAI*)_Creature->AI())->BeginSpeach((Unit*)player); + return true; + } + return false; +} + void AddSC_shadowmoon_valley() { Script *newscript; @@ -706,6 +1108,11 @@ void AddSC_shadowmoon_valley() newscript->GetAI = GetAI_mob_enslaved_netherwing_drake; m_scripts[nrscripts++] = newscript; + newscript = new Script; + newscript->Name = "mob_dragonmaw_peon"; + newscript->GetAI = GetAI_mob_dragonmaw_peon; + m_scripts[nrscripts++] = newscript; + newscript = new Script; newscript->Name="npc_drake_dealer_hurlunk"; newscript->pGossipHello = &GossipHello_npc_drake_dealer_hurlunk; @@ -745,4 +1152,22 @@ void AddSC_shadowmoon_valley() newscript->pGossipHello = &GossipHello_npc_oronok_tornheart; newscript->pGossipSelect = &GossipSelect_npc_oronok_tornheart; m_scripts[nrscripts++] = newscript; + + newscript = new Script; + newscript->Name = "npc_overlord_morghor"; + newscript->GetAI = GetAI_Overlord_Morghor; + newscript->pQuestAccept = &QuestAccept_Overlord_Morghor; + m_scripts[nrscripts++] = newscript; + + newscript = new Script; + newscript->Name = "npc_lord_illidan_stormrage"; + newscript->GetAI = GetAI_Lord_Illidan; + m_scripts[nrscripts++] = newscript; + + newscript = new Script; + newscript->Name = "npc_yarzill_the_merc"; + newscript->GetAI = GetAI_Yarzill_The_Merc; + newscript->pGossipHello = &GossipHello_npc_yarzill_fly; + newscript->pGossipSelect = &GossipSelect_npc_yarzill_fly; + m_scripts[nrscripts++] = newscript; } diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp index 98c8b61586c..f9d0bd6fcb5 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp @@ -404,25 +404,17 @@ struct TRINITY_DLL_DECL boss_alythessAI : public ScriptedAI { Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) - Temp->getThreatManager().addThreat(who,0.0f); - } - } - - void AttackStart(Unit *who) - { - if (!who) - return; - - if (who->isTargetableForAttack() && who!= m_creature) - { - if (!InCombat) - { - DoStartNoMovement(who); - Aggro(who); - InCombat = true; - } - } - } + Temp->getThreatManager().addThreat(who,0.0f); + } + } + + void AttackStart(Unit *who) + { + if (!InCombat) + { + ScriptedAI::AttackStart(who); + } + } void MoveInLineOfSight(Unit *who) { diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp index 0114fa1abcf..d007f7c6d61 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp @@ -149,23 +149,10 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI void AttackStart(Unit* who) { - if(!who) - return; - - if(who->isTargetableForAttack()) - { - //Begin attack - if(Phase1) - DoStartNoMovement(who); - else - DoStartMovement(who); - - if(!InCombat) - { - Aggro(who); - InCombat = true; - } - } + if(Phase1) + ScriptedAI::AttackStart(who, false); + else + ScriptedAI::AttackStart(who, true); } void DamageTaken(Unit* pKiller, uint32 &damage) diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp index d77ea934715..cb1bf3d4375 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp @@ -66,7 +66,7 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); Pounding_Timer = 12000; - ArcaneOrb_Timer = 6000; + ArcaneOrb_Timer = 3000; KnockAway_Timer = 30000; Berserk_Timer = 600000; @@ -155,7 +155,7 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI if (target) m_creature->CastSpell(target, SPELL_ARCANE_ORB, true); - ArcaneOrb_Timer = 6000; + ArcaneOrb_Timer = 3000; }else ArcaneOrb_Timer -= diff; // Single Target knock back, reduces aggro diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp index 8abdadc013a..77b1be54906 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp @@ -77,12 +77,8 @@ struct TRINITY_DLL_DECL boss_halazziAI : public ScriptedAI { pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); - // wait for core patch be accepted - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SUMMON_TOTEM); - if(TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) - TempSpell->EffectImplicitTargetA[0] = 1; // need to find out what controls totem's spell cooldown - TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_LIGHTNING); + SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_LIGHTNING); if(TempSpell && TempSpell->CastingTimeIndex != 5) TempSpell->CastingTimeIndex = 5; // 2000 ms casting time } diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp index 7fe940268ec..349d1d0bf28 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp @@ -268,22 +268,10 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI void AttackStart(Unit *who) { - if(!who) - return; - - if (who->isTargetableForAttack()) - { - if(Phase == 2) - m_creature->Attack(who, false); - else - DoStartMovement(who); - - if (!InCombat) - { - Aggro(who); - InCombat = true; - } - } + if(Phase == 2) + ScriptedAI::AttackStart(who, false); + else + ScriptedAI::AttackStart(who, true); } void DoMeleeAttackIfReady() diff --git a/src/bindings/scripts/sql/Updates/r125_trinity.sql b/src/bindings/scripts/sql/Updates/r125_trinity.sql new file mode 100644 index 00000000000..bceb8dfe4c3 --- /dev/null +++ b/src/bindings/scripts/sql/Updates/r125_trinity.sql @@ -0,0 +1,5 @@ +update creature_template set speed='0.01' scriptname='mob_toxic_sporebat' WHERE entry=22140;
+update creature_template SET scriptname='npc_overlord_morghor' WHERE entry=23139;
+update creature_template SET scriptname='npc_lord_illidan_stormrage' WHERE entry=22083;
+update creature_template SET scriptname='npc_yarzill_the_merc' WHERE entry=23141;
+update quest_template SET StartScript=0 WHERE entry=11108;
\ No newline at end of file |