Scripts/WanderingIsle: Implement Singing Pools AreaTriggers (#31629)

Co-authored-by: ModoX <moardox@gmail.com>
This commit is contained in:
.:::ReZaRr:::.
2026-02-01 16:22:10 +03:00
committed by GitHub
parent 65e3f1378f
commit 948f45239f
2 changed files with 88 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
DELETE FROM `areatrigger_scripts` WHERE `entry` IN (6986, 6987, 6988, 6989, 6990, 6991, 6992, 7011, 7012);
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
(6986, 'at_singing_pools_transform_frog'),
(6987, 'at_singing_pools_transform_frog'),
(6988, 'at_singing_pools_transform_skunk'),
(6989, 'at_singing_pools_transform_skunk'),
(6990, 'at_singing_pools_transform_crocodile'),
(6991, 'at_singing_pools_transform_crane'),
(6992, 'at_singing_pools_transform_crane'),
(7011, 'at_singing_pools_transform_turtle'),
(7012, 'at_singing_pools_transform_turtle');

View File

@@ -15,6 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AreaTrigger.h"
#include "AreaTriggerDataStore.h"
#include "CellImpl.h"
#include "Containers.h"
#include "CreatureAI.h"
@@ -32,6 +34,20 @@
#include "TaskScheduler.h"
#include "TemporarySummon.h"
namespace Scripts::Pandaria::TheWanderingIsle
{
namespace Spells
{
// Singing Pools
static constexpr uint32 CurseOfTheFrog = 102938;
static constexpr uint32 CurseOfTheSkunk = 102939;
static constexpr uint32 CurseOfTheTurtle = 102940;
static constexpr uint32 CurseOfTheCrane = 102941;
static constexpr uint32 CurseOfTheCrocodile = 102942;
static constexpr uint32 RideVehiclePole = 102717;
static constexpr uint32 TrainingBellPoleExitExclusion = 133381;
}
enum TraineeMisc
{
SAY_FINISH_FIGHT = 0,
@@ -1231,8 +1247,63 @@ class spell_flame_spout : public AuraScript
}
};
template<uint32 CurseSpellID>
class at_singing_pools_transform_base : public AreaTriggerScript
{
public:
at_singing_pools_transform_base(char const* scriptName) : AreaTriggerScript(scriptName) {}
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
{
if (!player->IsAlive() || player->HasAura(Spells::RideVehiclePole))
return true;
if (!player->HasAura(CurseSpellID))
player->CastSpell(player, CurseSpellID);
return true;
}
bool OnExit(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
{
player->RemoveAurasDueToSpell(CurseSpellID);
return true;
}
};
// 6986
// 6987
class at_singing_pools_transform_frog : public AreaTriggerScript
{
public:
at_singing_pools_transform_frog() : AreaTriggerScript("at_singing_pools_transform_frog") {}
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
{
if (!player->IsAlive() || player->HasAura(Spells::RideVehiclePole))
return true;
if (!player->HasAura(Spells::CurseOfTheFrog))
player->CastSpell(player, Spells::CurseOfTheFrog);
if (player->HasAura(Spells::TrainingBellPoleExitExclusion))
player->RemoveAura(Spells::TrainingBellPoleExitExclusion);
return true;
}
bool OnExit(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
{
player->RemoveAurasDueToSpell(Spells::CurseOfTheFrog);
return true;
}
};
};
void AddSC_zone_the_wandering_isle()
{
using namespace Scripts::Pandaria::TheWanderingIsle;
RegisterCreatureAI(npc_tushui_huojin_trainee);
RegisterCreatureAI(npc_huojin_trainee);
RegisterCreatureAI(npc_tushui_leading_trainee);
@@ -1254,4 +1325,10 @@ void AddSC_zone_the_wandering_isle()
new at_min_dimwind_captured();
new at_cave_of_meditation();
new at_inside_of_cave_of_meditation();
new at_singing_pools_transform_frog();
new at_singing_pools_transform_base<Spells::CurseOfTheSkunk>("at_singing_pools_transform_skunk");
new at_singing_pools_transform_base<Spells::CurseOfTheCrocodile>("at_singing_pools_transform_crocodile");
new at_singing_pools_transform_base<Spells::CurseOfTheCrane>("at_singing_pools_transform_crane");
new at_singing_pools_transform_base<Spells::CurseOfTheTurtle>("at_singing_pools_transform_turtle");
}