DB/Quest: Convert & update support for 'Shizz Work' to SAI

Closes #24638

(cherry picked from commit 049cba3ace)
This commit is contained in:
offl
2020-05-18 00:08:58 +02:00
committed by Shauren
parent b217e5842f
commit a0bee07b0c
2 changed files with 34 additions and 114 deletions

View File

@@ -0,0 +1,34 @@
-- Deranged Helboar SAI (Source: https://www.youtube.com/watch?v=R_c3kqvAr6g)
-- The 'Burning Spikes' aura already presents in creature_template_addon
SET @ID := 16863;
UPDATE `creature_template` SET `AIName` = "SmartAI" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ID,0,0,1,2,0,100,1,0,30,0,0,0,11,8599,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deranged Helboar - Between 0-30% Health - Cast 'Enrage' (No Repeat)"),
(@ID,0,1,0,61,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deranged Helboar - On Link - Say Line 0"),
(@ID,0,2,0,6,0,100,0,0,0,0,0,0,11,37689,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Deranged Helboar - On Death - Cast 'Tell dog I just died!'");
-- Fel Guard Hound SAI (Source: https://www.youtube.com/watch?v=R_c3kqvAr6g)
SET @ID := 21847;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID*100+0 AND `source_type` = 9;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
-- I was thinking static spawns will be problem, but they too can use this script as it shown in the video. Funny and fully supported
(@ID,0,0,0,54,0,100,0,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Just Summoned - Set Event Phase 1"),
(@ID,0,1,2,8,1,100,0,37689,0,0,0,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Spellhit 'Tell dog I just died!' - Stop Follow (Phase 1)"),
(@ID,0,2,3,61,1,100,0,0,0,0,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Link - Set Run Off (Phase 1)"),
-- Contact distance param: Seems like the min value with effect different from 0 is 0.5
-- But 1.5(seems like the correct value) in-game turns to 5.0
(@ID,0,3,4,61,1,100,0,0,0,0,0,0,69,1,0,0,0.5,0,0,7,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Link - Move To Invoker (Phase 1)"),
(@ID,0,4,0,61,1,100,0,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Link - Set Event Phase 2 (Phase 1)"),
(@ID,0,5,0,34,0,100,0,8,1,0,0,0,80,@ID*100+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Reached Point 1 - Run Script"),
(@ID*100+0,9,0,0,0,0,100,0,0,0,0,0,0,11,37692,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Script - Cast 'Fake Blood Spurt'"),
(@ID*100+0,9,1,0,0,0,100,0,0,0,0,0,0,5,51,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Script - Play Emote 51"),
(@ID*100+0,9,2,0,0,0,100,0,1500,1500,0,0,0,11,37692,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Script - Cast 'Fake Blood Spurt'"),
(@ID*100+0,9,3,0,0,0,100,0,0,0,0,0,0,5,51,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Script - Play Emote 51"),
(@ID*100+0,9,4,0,0,0,100,0,1000,1000,0,0,0,11,37688,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Script - Cast 'Create Poodad'"),
(@ID*100+0,9,5,0,0,0,100,0,1000,1000,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Script - Set Event Phase 1"),
(@ID*100+0,9,6,0,0,0,100,0,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Script - Set Run On"),
-- Not 'Start Follow Owner' because we want to provide full support to static spawns too
(@ID*100+0,9,7,0,0,0,100,0,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fel Guard Hound - On Script - Evade");

View File

@@ -26,7 +26,6 @@ EndScriptData */
npc_aeranas
npc_ancestral_wolf
npc_wounded_blood_elf
npc_fel_guard_hound
EndContentData */
#include "ScriptMgr.h"
@@ -330,118 +329,6 @@ public:
}
};
/*######
## npc_fel_guard_hound
######*/
enum FelGuard
{
SPELL_SUMMON_POO = 37688,
SPELL_FAKE_BLOOD = 37692,
NPC_DERANGED_HELBOAR = 16863,
EVENT_SEARCH_HELBOAR = 1,
EVENT_HELBOAR_FOUND = 2,
EVENT_SUMMON_POO = 3,
EVENT_FOLLOW_PLAYER = 4
};
class npc_fel_guard_hound : public CreatureScript
{
public:
npc_fel_guard_hound() : CreatureScript("npc_fel_guard_hound") { }
struct npc_fel_guard_houndAI : public ScriptedAI
{
npc_fel_guard_houndAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
helboarGUID.Clear();
_events.ScheduleEvent(EVENT_SEARCH_HELBOAR, 3s);
}
void Reset() override
{
Initialize();
}
void MovementInform(uint32 type, uint32 id) override
{
if (type != POINT_MOTION_TYPE || id != 1)
return;
if (Creature* helboar = ObjectAccessor::GetCreature(*me, helboarGUID))
{
_events.CancelEvent(EVENT_SEARCH_HELBOAR);
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
me->CastSpell(helboar, SPELL_FAKE_BLOOD);
_events.ScheduleEvent(EVENT_HELBOAR_FOUND, 2s);
}
}
void UpdateAI(uint32 diff) override
{
_events.Update(diff);
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SEARCH_HELBOAR:
if (Creature* helboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
{
if (helboar->GetGUID() != helboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
{
helboarGUID = helboar->GetGUID();
me->SetWalk(true);
me->GetMotionMaster()->MovePoint(1, helboar->GetPositionX(), helboar->GetPositionY(), helboar->GetPositionZ());
helboar->DespawnOrUnsummon(Seconds(10));
}
}
_events.Repeat(Seconds(3));
break;
case EVENT_HELBOAR_FOUND:
if (Creature* helboar = ObjectAccessor::GetCreature(*me, helboarGUID))
{
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
me->CastSpell(helboar, SPELL_FAKE_BLOOD);
_events.ScheduleEvent(EVENT_SUMMON_POO, 1s);
}
break;
case EVENT_SUMMON_POO:
DoCast(SPELL_SUMMON_POO);
_events.ScheduleEvent(EVENT_FOLLOW_PLAYER, 2s);
break;
case EVENT_FOLLOW_PLAYER:
me->SetWalk(false);
if (Player* owner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f);
_events.ScheduleEvent(EVENT_SEARCH_HELBOAR, 3s);
break;
}
}
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
private:
EventMap _events;
ObjectGuid helboarGUID;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_fel_guard_houndAI(creature);
}
};
enum ExorcismSpells
{
SPELL_JULES_GOES_PRONE = 39283,
@@ -1214,7 +1101,6 @@ void AddSC_hellfire_peninsula()
new npc_aeranas();
new npc_ancestral_wolf();
new npc_wounded_blood_elf();
new npc_fel_guard_hound();
new npc_colonel_jules();
new npc_barada();
new npc_magister_aledis();