fix(Scripts/Events): Fix not being able to start the Apothecary Trio … (#10596)
* fix(Scripts/Events): Fix not being able to start the Apothecary Trio encounter * ops * Update love_in_air.cpp * Update love_in_air.cpp
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "PassiveAI.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
///////////////////////////////////////
|
||||
@@ -295,9 +296,14 @@ enum HummelSay
|
||||
SAY_HUMMEL_5 = 5
|
||||
};
|
||||
|
||||
struct npc_love_in_air_hummel : public ScriptedAI
|
||||
class npc_love_in_air_hummel : public CreatureScript
|
||||
{
|
||||
npc_love_in_air_hummel(Creature* creature) : ScriptedAI(creature), summons(me) { }
|
||||
public:
|
||||
npc_love_in_air_hummel() : CreatureScript("npc_love_in_air_hummel") { }
|
||||
|
||||
struct npc_love_in_air_hummelAI : public ScriptedAI
|
||||
{
|
||||
npc_love_in_air_hummelAI(Creature* creature) : ScriptedAI(creature), summons(me) { speachTimer = 0; }
|
||||
|
||||
SummonList summons;
|
||||
EventMap events;
|
||||
@@ -332,7 +338,7 @@ struct npc_love_in_air_hummel : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
me->AI()->Talk(SAY_HUMMEL_5);
|
||||
Talk(SAY_HUMMEL_5);
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
if (!players.IsEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
|
||||
sLFGMgr->FinishDungeon(players.begin()->GetSource()->GetGroup()->GetGUID(), lfg::LFG_DUNGEON_CROWN_CHEMICAL_CO, me->FindMap());
|
||||
@@ -353,17 +359,17 @@ struct npc_love_in_air_hummel : public ScriptedAI
|
||||
speachTimer += diff;
|
||||
if (speachTimer < 10000)
|
||||
{
|
||||
me->AI()->Talk(SAY_HUMMEL_0);
|
||||
Talk(SAY_HUMMEL_0);
|
||||
speachTimer = 10000;
|
||||
}
|
||||
else if (speachTimer >= 16000 && speachTimer < 20000)
|
||||
{
|
||||
me->AI()->Talk(SAY_HUMMEL_1);
|
||||
Talk(SAY_HUMMEL_1);
|
||||
speachTimer = 20000;
|
||||
}
|
||||
else if (speachTimer >= 26000 && speachTimer < 30000)
|
||||
{
|
||||
me->AI()->Talk(SAY_HUMMEL_2);
|
||||
Talk(SAY_HUMMEL_2);
|
||||
speachTimer = 0;
|
||||
me->SetFaction(FACTION_MONSTER_2);
|
||||
me->SetInCombatWithZone();
|
||||
@@ -405,17 +411,40 @@ struct npc_love_in_air_hummel : public ScriptedAI
|
||||
break;
|
||||
}
|
||||
case EVENT_SPELL_PERFUME_SPRAY:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ALLURING_PERFUME_SPRAY, false);
|
||||
DoCastVictim(SPELL_ALLURING_PERFUME_SPRAY);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
case EVENT_SPELL_CHAIN_REACTION:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CHAIN_REACTION, false);
|
||||
DoCastVictim(SPELL_CHAIN_REACTION);
|
||||
events.RepeatEvent(12000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
{
|
||||
creature->AI()->DoAction(ACTION_START_EVENT);
|
||||
CloseGossipMenuFor(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnQuestReward(Player* /*player*/, Creature* creature, const Quest* _Quest, uint32 /*slot*/) override
|
||||
{
|
||||
if (_Quest->GetQuestId() == QUEST_YOUVE_BEEN_SERVED)
|
||||
{
|
||||
creature->AI()->DoAction(ACTION_START_EVENT);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_love_in_air_hummelAI(creature);
|
||||
};
|
||||
};
|
||||
|
||||
enum HummelHelperSay
|
||||
@@ -482,11 +511,11 @@ struct npc_love_in_air_hummel_helper : public ScriptedAI
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_PERFUME_SPRAY:
|
||||
me->CastSpell(me->GetVictim(), SPELL_COLOGNE_SPRAY, false);
|
||||
DoCastVictim(SPELL_COLOGNE_SPRAY);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
case EVENT_SPELL_CHAIN_REACTION:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CHAIN_REACTION, false);
|
||||
DoCastVictim(SPELL_CHAIN_REACTION);
|
||||
events.RepeatEvent(12000);
|
||||
break;
|
||||
case EVENT_SPELL_THROW:
|
||||
@@ -745,7 +774,7 @@ void AddSC_event_love_in_the_air()
|
||||
RegisterCreatureAI(npc_love_in_air_snivel_real);
|
||||
|
||||
// Boss
|
||||
RegisterCreatureAI(npc_love_in_air_hummel);
|
||||
new npc_love_in_air_hummel;
|
||||
RegisterCreatureAI(npc_love_in_air_hummel_helper);
|
||||
|
||||
// Spells
|
||||
|
||||
Reference in New Issue
Block a user