Scripts/Naxxramas: Frogger event improvements (#25202)

* Scripts/Naxxramas: Frogger event improvements
* Prevent Living Poison accumulation
* Now Living Poison cast Explode

* check for a nearby player

* move event to the frogger trigger's AI

* Initialize and removing unnecessary things

* applying suggestions

* remove unnecessary header

* Rename 9999_99_99_99_world.sql to 2020_08_05_00_world.sql
# Conflicts:
#	sql/updates/world/4.3.4/2020_08_05_00_world.sql
#	src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
This commit is contained in:
Gildor
2020-08-05 14:16:19 +02:00
committed by Ovahlord
parent eb2559ae80
commit 4a611f5596
5 changed files with 79 additions and 20 deletions

View File

@@ -1 +1,4 @@
UPDATE `creature_template` SET `RegenHealth`= 0 WHERE `entry`= 49539;
--
UPDATE `smart_scripts` SET `event_phase_mask`=0,`event_flags`=0 WHERE `entryorguid`=16027 AND `source_type`=0;
UPDATE `creature_template` SET `ScriptName`='npc_frogger_trigger_naxx' WHERE `entry`=16082;
UPDATE `creature_summon_groups` SET `summonerId`=16082,`summonerType`=0 WHERE `summonerId`=533 AND `summonerType`=2;

View File

@@ -22,7 +22,6 @@
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
#include "naxxramas.h"
#include "TemporarySummon.h"
@@ -126,9 +125,6 @@ class instance_naxxramas : public InstanceMapScript
CurrentWingTaunt = SAY_KELTHUZAD_FIRST_WING_TAUNT;
playerDied = 0;
nextFroggerWave = 0;
events.ScheduleEvent(EVENT_SUMMON_FROGGER_WAVE, Seconds(1));
}
void OnCreatureCreate(Creature* creature) override
@@ -473,16 +469,6 @@ class instance_naxxramas : public InstanceMapScript
kelthuzad->AI()->Talk(CurrentWingTaunt);
++CurrentWingTaunt;
break;
case EVENT_SUMMON_FROGGER_WAVE:
{
std::list<TempSummon*> spawns;
instance->SummonCreatureGroup(nextFroggerWave, &spawns);
if (!spawns.empty())
(*spawns.begin())->GetMotionMaster()->MovePath(10 * NPC_FROGGER + nextFroggerWave, false);
events.Repeat(Seconds(1) + Milliseconds(666));
nextFroggerWave = (nextFroggerWave+1) % 3;
break;
}
case EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD:
if (Creature* kelthuzad = instance->GetCreature(KelthuzadGUID))
kelthuzad->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_KELTHUZAD);
@@ -614,8 +600,6 @@ class instance_naxxramas : public InstanceMapScript
/* The Immortal / The Undying */
uint32 playerDied;
int8 nextFroggerWave;
EventMap events;
};

View File

@@ -0,0 +1,73 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
#include "naxxramas.h"
enum NaxxEvents
{
EVENT_SUMMON_FROGGER_WAVE = 1
};
struct npc_frogger_trigger_naxx : public ScriptedAI
{
npc_frogger_trigger_naxx(Creature* creature) : ScriptedAI(creature), _nextFroggerWave(0) { }
void Reset() override
{
_events.Reset();
_events.ScheduleEvent(EVENT_SUMMON_FROGGER_WAVE, 1s);
_nextFroggerWave = 0;
}
void UpdateAI(uint32 diff) override
{
_events.Update(diff);
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SUMMON_FROGGER_WAVE:
{
std::list<TempSummon*> spawns;
me->SummonCreatureGroup(_nextFroggerWave, &spawns);
if (!spawns.empty())
spawns.front()->GetMotionMaster()->MovePath(10 * NPC_FROGGER + _nextFroggerWave, false);
_events.Repeat(1666ms);
_nextFroggerWave = (_nextFroggerWave+1) % 3;
break;
}
default:
break;
}
}
}
private:
EventMap _events;
uint8 _nextFroggerWave;
};
void AddSC_naxxramas()
{
RegisterNaxxramasCreatureAI(npc_frogger_trigger_naxx);
}

View File

@@ -183,9 +183,6 @@ enum NAXInstanceEvents
// Dialogue that happens after each wing.
EVENT_KELTHUZAD_WING_TAUNT,
// Periodic Frogger summon
EVENT_SUMMON_FROGGER_WAVE,
// Dialogue that happens after Sapphiron's death.
EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD,
EVENT_DIALOGUE_SAPPHIRON_LICHKING,

View File

@@ -71,6 +71,7 @@ void AddSC_boss_faerlina();
void AddSC_boss_heigan();
void AddSC_boss_gothik();
void AddSC_boss_thaddius();
void AddSC_naxxramas();
void AddSC_instance_naxxramas();
void AddSC_boss_nexus_commanders(); // The Nexus Nexus
void AddSC_boss_magus_telestra();
@@ -253,6 +254,7 @@ void AddNorthrendScripts()
AddSC_boss_heigan();
AddSC_boss_gothik();
AddSC_boss_thaddius();
AddSC_naxxramas();
AddSC_instance_naxxramas();
AddSC_boss_nexus_commanders(); // The Nexus Nexus
AddSC_boss_magus_telestra();