diff --git a/sql/updates/world/custom/custom_2019_04_09_02_world.sql b/sql/updates/world/custom/custom_2019_04_09_02_world.sql new file mode 100644 index 00000000000..d0d5ad7bc4c --- /dev/null +++ b/sql/updates/world/custom/custom_2019_04_09_02_world.sql @@ -0,0 +1,67 @@ +-- Creature Jessica Rogers 54485 SAI +SET @ENTRY := 54485; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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`, `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 +(@ENTRY, 0, 0, 1, 62, 0, 100, 0, 13012, 1, 0, 0, 57, 71083, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "On gossip action 1 from menu 13012 selected - Action invoker: Remove item 1x71083 // "), +(@ENTRY, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 101808, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Cast spell Ring Toss Gossip (101808) on Action invoker // "), +(@ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, " Linked - Action invoker: Close gossip // "); + +-- Creature Mola 54601 SAI +SET @ENTRY := 54601; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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`, `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 +(@ENTRY, 0, 0, 1, 62, 0, 100, 0, 13018, 1, 0, 0, 28, 101612, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "On gossip action 1 from menu 13018 selected - Action invoker: Remove aura due to spell Whack-a-Gnoll! (101612) // "), +(@ENTRY, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 134, 110230, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Whack-a-Gnoll! (110230) to Action invoker // "), +(@ENTRY, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 11, 102188, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Cast spell Mallet Gossip (102188) on Action invoker // "), +(@ENTRY, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 57, 71083, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, " Linked - Action invoker: Remove item 1x71083 // "), +(@ENTRY, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 134, 101995, 2, 0, 0, 0, 0, 10, 290754, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Whack! Summon Gnoll Holder (101995) to Creature Whack-a-Gnoll Barrel 54546 (290754) // "), +(@ENTRY, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 134, 101995, 2, 0, 0, 0, 0, 10, 290755, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Whack! Summon Gnoll Holder (101995) to Creature Whack-a-Gnoll Barrel 54546 (290755) // "), +(@ENTRY, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 134, 101995, 2, 0, 0, 0, 0, 10, 290756, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Whack! Summon Gnoll Holder (101995) to Creature Whack-a-Gnoll Barrel 54546 (290756) // "), +(@ENTRY, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 134, 101995, 2, 0, 0, 0, 0, 10, 290757, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Whack! Summon Gnoll Holder (101995) to Creature Whack-a-Gnoll Barrel 54546 (290757) // "), +(@ENTRY, 0, 8, 9, 61, 0, 100, 0, 0, 0, 0, 0, 134, 101995, 2, 0, 0, 0, 0, 10, 290759, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Whack! Summon Gnoll Holder (101995) to Creature Whack-a-Gnoll Barrel 54546 (290759) // "), +(@ENTRY, 0, 9, 10, 61, 0, 100, 0, 0, 0, 0, 0, 134, 101995, 2, 0, 0, 0, 0, 10, 290760, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Whack! Summon Gnoll Holder (101995) to Creature Whack-a-Gnoll Barrel 54546 (290760) // "), +(@ENTRY, 0, 10, 11, 61, 0, 100, 0, 0, 0, 0, 0, 134, 101995, 2, 0, 0, 0, 0, 10, 290761, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Whack! Summon Gnoll Holder (101995) to Creature Whack-a-Gnoll Barrel 54546 (290761) // "), +(@ENTRY, 0, 11, 12, 61, 0, 100, 0, 0, 0, 0, 0, 134, 101995, 2, 0, 0, 0, 0, 10, 290763, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Whack! Summon Gnoll Holder (101995) to Creature Whack-a-Gnoll Barrel 54546 (290763) // "), +(@ENTRY, 0, 12, 13, 61, 0, 100, 0, 0, 0, 0, 0, 134, 101995, 2, 0, 0, 0, 0, 10, 290762, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Whack! Summon Gnoll Holder (101995) to Creature Whack-a-Gnoll Barrel 54546 (290762) // "), +(@ENTRY, 0, 13, 14, 61, 0, 100, 0, 0, 0, 0, 0, 134, 101996, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, " Linked - Invoker: Cast spell Gnoll Aura - Okay to Hit (101996) to Action invoker // "), +(@ENTRY, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, " Linked - Action invoker: Close gossip // "); + +DELETE FROM `gameobject_template` WHERE `entry`= 209296; +INSERT INTO `gameobject_template` (`entry`,`type`, `displayId`, `name`, `size`, `Data0`, `Data1`, `Data3`, `Data6`, `VerifiedBuild`) VALUES +(209296, 8, 2770, '[DND] Spell Focus', 1, 1731, 13, 1, -1, -18019); + +DELETE FROM `gameobject` WHERE `guid`= 200889; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `PhaseId`, `position_x`, `position_y`, `position_z`, `orientation`) VALUES +(200889, 209296, 974, 5861, 5870, 169, -3997.79, 6280.09, 13.08, 0.63); + +DELETE FROM `conditions` WHERE `SourceEntry` IN (101996, 102137, 102022) AND `SourceTypeOrReferenceId`= 13; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES +(13, 1, 101996, 0, 0, 31, 0, 3, 54547, 0, 0, 0, '', 'Gnoll Aura - Okay to Hit - Target Darkmoon Faire Gnoll Holder'), +(13, 1, 102022, 0, 0, 31, 0, 3, 54444, 0, 0, 0, '', 'Whack! - Target Darkmoon Faire Gnoll'), +(13, 1, 102022, 0, 1, 31, 0, 3, 54466, 0, 0, 0, '', 'Whack! - Target Darkmoon Faire Gnoll - Baby'), +(13, 1, 102022, 0, 2, 31, 0, 3, 54549, 0, 0, 0, '', 'Whack! - Target Darkmoon Faire Gnoll - Bonus'), +(13, 1, 102137, 0, 0, 31, 0, 3, 54547, 0, 0, 0, '', 'DMF - Whack-a-Gnoll - Player - action bar removed - Target Darkmoon Faire Gnoll Holder'), +(13, 2, 102137, 0, 0, 31, 0, 3, 54444, 0, 0, 0, '', 'DMF - Whack-a-Gnoll - Player - action bar removed - Target Darkmoon Faire Gnoll'), +(13, 2, 102137, 0, 1, 31, 0, 3, 54466, 0, 0, 0, '', 'DMF - Whack-a-Gnoll - Player - action bar removed - Target Darkmoon Faire Gnoll - Baby'), +(13, 2, 102137, 0, 2, 31, 0, 3, 54549, 0, 0, 0, '', 'DMF - Whack-a-Gnoll - Player - action bar removed - Target Darkmoon Faire Gnoll - Bonus'), +(13, 4, 102137, 0, 2, 31, 0, 3, 54601, 0, 0, 0, '', 'DMF - Whack-a-Gnoll - Player - action bar removed - Target Mola'); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN +('spell_darkmoon_island_whack_summon_aura', +'spell_darkmoon_island_gnoll_aura_okay_to_hit', +'spell_darkmoon_island_whack_dummy', +'spell_darkmoon_island_whack', +'spell_darkmoon_island_whack_a_gnoll', +'spell_darkmoon_island_whack_a_gnoll_player_action_bar_removed'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(101994, 'spell_darkmoon_island_whack_summon_aura'), +(101996, 'spell_darkmoon_island_gnoll_aura_okay_to_hit'), +(101604, 'spell_darkmoon_island_whack_dummy'), +(102022, 'spell_darkmoon_island_whack'), +(101612, 'spell_darkmoon_island_whack_a_gnoll'), +(102137, 'spell_darkmoon_island_whack_a_gnoll_player_action_bar_removed'); + +UPDATE `creature_template` SET `ScriptName`= 'npc_darkmoon_island_gnoll' WHERE `entry` IN (54444, 54466, 54549); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 9f92a704980..566d81bfe69 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -5201,6 +5201,11 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_1].BasePoints = 7; }); + ApplySpellFix({ 102022 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesCu |= SPELL_ATTR0_CU_CONE_LINE; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index a2beefa67b1..20011e5e9fa 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -1747,6 +1747,197 @@ private: bool _hasHit; }; +enum WhackAGnoll +{ + SPELL_WHACK_SUMMON_NORMAL = 102036, + SPELL_WHACK_SUMMON_BABY = 102043, + SPELL_WHACK_SUMMON_BONUS = 102044, + SPELL_GNOLL_AURA_OKAY_TO_HIT = 101996, + SPELL_WHACK_A_GNOLL_ACTION_BAR_REMOVED = 102137, + SPELL_WHACK_A_GNOLL_ACTION_BAR = 110230, + SPELL_WHACK_TRIGGERED = 102022, + SPELL_WHACK_ROOT = 101829 +}; + +class spell_darkmoon_island_whack_summon_aura : public AuraScript +{ + PrepareAuraScript(spell_darkmoon_island_whack_summon_aura); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_GNOLL_AURA_OKAY_TO_HIT }); + } + + void OnPeriodic(AuraEffect const* aurEff) + { + GetTarget()->CastSpell(GetTarget(), SPELL_GNOLL_AURA_OKAY_TO_HIT, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_darkmoon_island_whack_summon_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } +}; + +class GnollHolderTargetSelector +{ + public: + GnollHolderTargetSelector(Unit* caster) : _caster(caster) { } + + bool operator() (WorldObject* target) + { + return !_caster->CanSeeOrDetect(target); + } + + private: + Unit* _caster; +}; + +class spell_darkmoon_island_gnoll_aura_okay_to_hit : public SpellScript +{ + PrepareSpellScript(spell_darkmoon_island_gnoll_aura_okay_to_hit); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo( + { + SPELL_WHACK_SUMMON_NORMAL, + SPELL_WHACK_SUMMON_BABY, + SPELL_WHACK_SUMMON_BONUS + }); + } + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + targets.remove_if(GnollHolderTargetSelector(GetCaster())); + + if (targets.size()) + Trinity::Containers::RandomResize(targets, 1); + + } + + void HandleSummon(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + uint32 summonSpellId = SPELL_WHACK_SUMMON_NORMAL; + if (roll_chance_i(50)) + summonSpellId = RAND(SPELL_WHACK_SUMMON_BABY, SPELL_WHACK_SUMMON_BONUS); + + caster->CastSpell(GetHitUnit(), summonSpellId, true); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_darkmoon_island_gnoll_aura_okay_to_hit::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_darkmoon_island_gnoll_aura_okay_to_hit::HandleSummon, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + } +}; + +class spell_darkmoon_island_whack_dummy : public SpellScript +{ + PrepareSpellScript(spell_darkmoon_island_whack_dummy); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo( + { + SPELL_WHACK_TRIGGERED, + SPELL_WHACK_ROOT, + }); + } + + void HandleDummy() + { + Unit* caster = GetCaster(); + caster->CastSpell(caster, SPELL_WHACK_ROOT, true); + caster->CastSpell(caster, SPELL_WHACK_TRIGGERED); + } + + void Register() override + { + AfterCast += SpellCastFn(spell_darkmoon_island_whack_dummy::HandleDummy); + } +}; + +class spell_darkmoon_island_whack : public SpellScript +{ + PrepareSpellScript(spell_darkmoon_island_whack); + + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + targets.remove_if(GnollHolderTargetSelector(GetCaster())); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_darkmoon_island_whack::FilterTargets, EFFECT_0, TARGET_UNIT_CONE_ENTRY); + } +}; + +class spell_darkmoon_island_whack_a_gnoll : public AuraScript +{ + PrepareAuraScript(spell_darkmoon_island_whack_a_gnoll); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo( + { + SPELL_WHACK_A_GNOLL_ACTION_BAR, + SPELL_WHACK_A_GNOLL_ACTION_BAR_REMOVED + }); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->RemoveAurasDueToSpell(GetSpellInfo()->Effects[EFFECT_1].TriggerSpell); + target->RemoveAurasDueToSpell(SPELL_WHACK_A_GNOLL_ACTION_BAR); + target->CastSpell(target, SPELL_WHACK_A_GNOLL_ACTION_BAR_REMOVED, true); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_darkmoon_island_whack_a_gnoll::OnRemove, EFFECT_0, SPELL_AURA_OVERRIDE_SPELLS, AURA_EFFECT_HANDLE_REAL); + } +}; + +class spell_darkmoon_island_whack_a_gnoll_player_action_bar_removed : public SpellScript +{ + PrepareSpellScript(spell_darkmoon_island_whack_a_gnoll_player_action_bar_removed); + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + targets.remove_if(GnollHolderTargetSelector(GetCaster())); + } + + void DespawnUnits(SpellEffIndex /*effIndex*/) + { + if (Creature* creature = GetHitCreature()) + creature->DespawnOrUnsummon(); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_darkmoon_island_whack_a_gnoll_player_action_bar_removed::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_darkmoon_island_whack_a_gnoll_player_action_bar_removed::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_darkmoon_island_whack_a_gnoll_player_action_bar_removed::DespawnUnits, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_darkmoon_island_whack_a_gnoll_player_action_bar_removed::DespawnUnits, EFFECT_1, SPELL_EFFECT_DUMMY); + } +}; + void AddSC_holiday_spell_scripts() { // Love is in the Air @@ -1800,4 +1991,10 @@ void AddSC_holiday_spell_scripts() // Darkmoon Island RegisterSpellScript(spell_darkmoon_island_deathmatch); RegisterSpellScript(spell_darkmoon_island_ring_toss); + RegisterAuraScript(spell_darkmoon_island_whack_summon_aura); + RegisterSpellScript(spell_darkmoon_island_gnoll_aura_okay_to_hit); + RegisterSpellScript(spell_darkmoon_island_whack_dummy); + RegisterSpellScript(spell_darkmoon_island_whack); + RegisterAuraScript(spell_darkmoon_island_whack_a_gnoll); + RegisterSpellScript(spell_darkmoon_island_whack_a_gnoll_player_action_bar_removed); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 9c79907bbb9..d2bed98c00d 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -3147,6 +3147,119 @@ class npc_druid_treant : public CreatureScript } }; +enum WhackAGnoll +{ + NPC_DARKMOON_FAIRE_GNOLL = 54444, + NPC_DARKMOON_FAIRE_GNOLL_BABY = 54466, + NPC_DARKMOON_FAIRE_GNOLL_BONUS = 54549, + + SPELL_WHACK = 102022, + SPELL_WHACK_A_GNOLL_SPAWN = 102136, + SPELL_WHACK_A_GNOLL_KILL_CREDIT = 101835, + SPELL_WRONG_WHACK = 101679, + SPELL_EXPLODE_SMALL = 101640, + SPELL_EXPLODE_BIG = 101655, + + SOUND_ID_LAUGHTER = 11816, + SOUND_ID_SUBMERGE = 4791, + AI_ANIM_KIT_SUBMERGE = 529, + + EVENT_REGULAR_SUBMERGE = 1, + EVENT_TRIGGERED_SUBMERGE +}; + +struct npc_darkmoon_island_gnoll : public ScriptedAI +{ + npc_darkmoon_island_gnoll(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + _hit = false; + } + + void IsSummonedBy(Unit* /*summoner*/) override + { + DoCastSelf(SPELL_WHACK_A_GNOLL_SPAWN); + _events.ScheduleEvent(EVENT_REGULAR_SUBMERGE, 3s + 500ms); + } + + void SpellHit(Unit* caster, SpellInfo const* spell) override + { + if (_hit) + return; + + if (spell->Id == SPELL_WHACK) + { + _events.CancelEvent(EVENT_REGULAR_SUBMERGE); + + switch (me->GetEntry()) + { + case NPC_DARKMOON_FAIRE_GNOLL: + //DoCast(caster, SPELL_WHACK_A_GNOLL_KILL_CREDIT, true); + caster->CastSpell(caster, SPELL_WHACK_A_GNOLL_KILL_CREDIT, true); + DoCastSelf(SPELL_EXPLODE_SMALL); + me->KillSelf(); + me->DespawnOrUnsummon(2s); + break; + case NPC_DARKMOON_FAIRE_GNOLL_BONUS: + for (uint8 i = 0; i < 3; i++) + caster->CastSpell(caster, SPELL_WHACK_A_GNOLL_KILL_CREDIT, true); + //DoCast(caster, SPELL_WHACK_A_GNOLL_KILL_CREDIT, true); + DoCastSelf(SPELL_EXPLODE_BIG); + me->KillSelf(); + me->DespawnOrUnsummon(2s); + break; + case NPC_DARKMOON_FAIRE_GNOLL_BABY: + caster->CastSpell(caster, SPELL_WRONG_WHACK, true); + //DoCast(caster, SPELL_WRONG_WHACK, true); + if (Player* player = caster->ToPlayer()) + me->PlayDirectSound(SOUND_ID_LAUGHTER, player); + _events.ScheduleEvent(EVENT_TRIGGERED_SUBMERGE, 3s + 600ms); + break; + default: + break; + } + + _hit = true; + } + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_REGULAR_SUBMERGE: + _hit = true; + me->SetAIAnimKitId(AI_ANIM_KIT_SUBMERGE); + + if (TempSummon* summon = me->ToTempSummon()) + if (Unit* summoner = summon->GetSummoner()) + if (Player* player = summoner->ToPlayer()) + me->PlayDirectSound(SOUND_ID_SUBMERGE, player); + me->DespawnOrUnsummon(1s + 500ms); + break; + case EVENT_TRIGGERED_SUBMERGE: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED_NEW); + me->DespawnOrUnsummon(2s + 500ms); + break; + default: + break; + } + } + } + +private: + EventMap _events; + bool _hit; +}; + void AddSC_npcs_special() { new npc_air_force_bots(); @@ -3176,4 +3289,5 @@ void AddSC_npcs_special() new npc_bountiful_table(); new npc_mage_orb(); new npc_druid_treant(); + RegisterCreatureAI(npc_darkmoon_island_gnoll); }