Script/Quest: improvements for Shizz Work:

- Proper cosmetic effects for Fel Guard Hound.
- Spell cast when looting the Felhound Poo.
- Felhound Poo now always contains loot.
This commit is contained in:
SnapperRy
2016-10-29 22:56:35 +02:00
parent 6801357b8a
commit 2729eb156f
2 changed files with 55 additions and 18 deletions

View File

@@ -0,0 +1,6 @@
--
UPDATE `gameobject_template` SET `AIName`="SmartGameObjectAI" WHERE `entry`=184980;
DELETE FROM `smart_scripts` WHERE `entryorguid`=184980;
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`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(184980, 1, 0, 0, 70, 0, 100, 0, 2, 0, 0, 0, 11, 37695, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Felhound Poo - On Gameobject State 2 - Cast 'Stanky'");
UPDATE `gameobject_loot_template` SET `Chance`=0, `GroupId`=1 WHERE `Entry`=21311;

View File

@@ -332,8 +332,14 @@ public:
enum FelGuard
{
SPELL_SUMMON_POO = 37688,
NPC_DERANGED_HELBOAR = 16863
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
@@ -350,8 +356,8 @@ public:
void Initialize()
{
checkTimer = 5000; //check for creature every 5 sec
helboarGUID.Clear();
_events.ScheduleEvent(EVENT_SEARCH_HELBOAR, Seconds(3));
}
void Reset() override
@@ -366,29 +372,54 @@ public:
if (Creature* helboar = ObjectAccessor::GetCreature(*me, helboarGUID))
{
helboar->RemoveCorpse();
DoCast(SPELL_SUMMON_POO);
if (Player* owner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f);
_events.CancelEvent(EVENT_SEARCH_HELBOAR);
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
me->CastSpell(helboar, SPELL_FAKE_BLOOD);
_events.ScheduleEvent(EVENT_HELBOAR_FOUND, Seconds(2));
}
}
void UpdateAI(uint32 diff) override
{
if (checkTimer <= diff)
_events.Update(diff);
while (uint32 eventId = _events.ExecuteEvent())
{
if (Creature* helboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
switch (eventId)
{
if (helboar->GetGUID() != helboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
{
helboarGUID = helboar->GetGUID();
me->GetMotionMaster()->MovePoint(1, helboar->GetPositionX(), helboar->GetPositionY(), helboar->GetPositionZ());
}
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, Seconds(1));
}
break;
case EVENT_SUMMON_POO:
DoCast(SPELL_SUMMON_POO);
_events.ScheduleEvent(EVENT_FOLLOW_PLAYER, Seconds(2));
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, Seconds(3));
break;
}
checkTimer = 5000;
}
else checkTimer -= diff;
if (!UpdateVictim())
return;
@@ -397,7 +428,7 @@ public:
}
private:
uint32 checkTimer;
EventMap _events;
ObjectGuid helboarGUID;
};