Skip to content

Commit fda99b2

Browse files
Wyrethtkrokli
authored andcommitted
Scripts/Northrend: talk event for quest A Suitable Test Subject (#20462)
- When using the quest item for A Suitable Test Subject and the spell aura vanishes, Bloodmage Laurith should turn toward the player and whisper a line. - This is handled via spell event for Bloodspore Ruination (45997)
1 parent cc89428 commit fda99b2

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- quest: A Suitable Test Subject (11719)
2+
DELETE FROM `spell_script_names` WHERE `ScriptName`="spell_q11719_bloodspore_ruination_45997";
3+
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
4+
(45997, "spell_q11719_bloodspore_ruination_45997");
5+
6+
UPDATE `creature_template` SET `ScriptName`="npc_bloodmage_laurith" WHERE `entry`=25381;
7+
8+
DELETE FROM `creature_text` WHERE `CreatureID`=25381;
9+
INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
10+
(25381, 0, 0, "How positively awful! You were totally incapacitated? Weak? Hot flashes?", 15, 0, 100, 21, 0, 0, 24992, 0, "Bloodmage Laurith");

src/server/scripts/Northrend/zone_borean_tundra.cpp

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,6 +2382,108 @@ class spell_windsoul_totem_aura : public SpellScriptLoader
23822382
}
23832383
};
23842384

2385+
enum BloodsporeRuination
2386+
{
2387+
NPC_BLOODMAGE_LAURITH = 25381,
2388+
SAY_BLOODMAGE_LAURITH = 0,
2389+
EVENT_TALK = 1,
2390+
EVENT_RESET_ORIENTATION
2391+
};
2392+
2393+
class spell_q11719_bloodspore_ruination_45997 : public SpellScriptLoader
2394+
{
2395+
public:
2396+
spell_q11719_bloodspore_ruination_45997() : SpellScriptLoader("spell_q11719_bloodspore_ruination_45997") { }
2397+
2398+
class spell_q11719_bloodspore_ruination_45997_SpellScript : public SpellScript
2399+
{
2400+
PrepareSpellScript(spell_q11719_bloodspore_ruination_45997_SpellScript);
2401+
2402+
void HandleEffect(SpellEffIndex /*effIndex*/)
2403+
{
2404+
if (Unit* caster = GetCaster())
2405+
if (Creature* laurith = caster->FindNearestCreature(NPC_BLOODMAGE_LAURITH, 100.0f))
2406+
laurith->AI()->SetGUID(caster->GetGUID());
2407+
}
2408+
2409+
void Register() override
2410+
{
2411+
OnEffectHit += SpellEffectFn(spell_q11719_bloodspore_ruination_45997_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT);
2412+
}
2413+
};
2414+
2415+
SpellScript* GetSpellScript() const override
2416+
{
2417+
return new spell_q11719_bloodspore_ruination_45997_SpellScript();
2418+
}
2419+
};
2420+
2421+
class npc_bloodmage_laurith : public CreatureScript
2422+
{
2423+
public:
2424+
npc_bloodmage_laurith() : CreatureScript("npc_bloodmage_laurith") { }
2425+
2426+
struct npc_bloodmage_laurithAI : public ScriptedAI
2427+
{
2428+
npc_bloodmage_laurithAI(Creature* creature) : ScriptedAI(creature) { }
2429+
2430+
void Reset() override
2431+
{
2432+
_events.Reset();
2433+
_playerGUID.Clear();
2434+
}
2435+
2436+
void SetGUID(ObjectGuid guid, int32 /*action*/) override
2437+
{
2438+
if (!_playerGUID.IsEmpty())
2439+
return;
2440+
2441+
_playerGUID = guid;
2442+
2443+
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
2444+
me->SetFacingToObject(player);
2445+
2446+
_events.ScheduleEvent(EVENT_TALK, Seconds(1));
2447+
}
2448+
2449+
void UpdateAI(uint32 diff) override
2450+
{
2451+
if (UpdateVictim())
2452+
{
2453+
DoMeleeAttackIfReady();
2454+
return;
2455+
}
2456+
2457+
_events.Update(diff);
2458+
2459+
if (uint32 eventId = _events.ExecuteEvent())
2460+
{
2461+
switch (eventId)
2462+
{
2463+
case EVENT_TALK:
2464+
if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID))
2465+
Talk(SAY_BLOODMAGE_LAURITH, player);
2466+
_playerGUID.Clear();
2467+
_events.ScheduleEvent(EVENT_RESET_ORIENTATION, Seconds(5));
2468+
break;
2469+
case EVENT_RESET_ORIENTATION:
2470+
me->SetFacingTo(me->GetHomePosition().GetOrientation());
2471+
break;
2472+
}
2473+
}
2474+
}
2475+
2476+
private:
2477+
EventMap _events;
2478+
ObjectGuid _playerGUID;
2479+
};
2480+
2481+
CreatureAI* GetAI(Creature* creature) const override
2482+
{
2483+
return new npc_bloodmage_laurithAI(creature);
2484+
}
2485+
};
2486+
23852487
void AddSC_borean_tundra()
23862488
{
23872489
new npc_sinkhole_kill_credit();
@@ -2407,4 +2509,6 @@ void AddSC_borean_tundra()
24072509
new npc_warmage_coldarra();
24082510
new npc_hidden_cultist();
24092511
new spell_windsoul_totem_aura();
2512+
new spell_q11719_bloodspore_ruination_45997();
2513+
new npc_bloodmage_laurith();
24102514
}

0 commit comments

Comments
 (0)