Scripts/Serpentshrine Cavern: Move trash death counting script to c++

(cherry picked from commit bcc9a6054888e3346f0cb08d26873191c555e6ff)
This commit is contained in:
Shauren
2026-08-01 21:14:13 +02:00
parent 83fad44a0e
commit 36a5de288d
3 changed files with 17 additions and 7 deletions
@@ -0,0 +1,3 @@
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (21220,21301);
UPDATE `creature_template` SET `AIName`='' WHERE `entry` IN (21220,21301);
@@ -197,6 +197,20 @@ class instance_serpent_shrine : public InstanceMapScript
}
}
void OnUnitDeath(Unit* unit) override
{
switch (unit->GetEntry())
{
case NPC_COILFANG_PRIESTESS:
case NPC_COILFANG_SHATTERER:
if (TrashCount < MIN_KILLS)
++TrashCount;//+1 died
break;
default:
break;
}
}
bool SetBossState(uint32 id, EncounterState state) override
{
if (!InstanceScript::SetBossState(id, state))
@@ -237,10 +251,6 @@ class instance_serpent_shrine : public InstanceMapScript
{
switch (type)
{
case DATA_TRASH:
if (data == 1 && TrashCount < MIN_KILLS)
++TrashCount;//+1 died
break;
case DATA_WATER:
Water = data;
break;
@@ -47,9 +47,7 @@ enum SSDataTypes
DATA_SHARKKIS = 6,
DATA_TIDALVESS = 12,
DATA_WATER = 18,
DATA_TRASH = 19,
DATA_STRANGE_POOL,
DATA_BRIDGE_PART_1,
DATA_BRIDGE_PART_2,
DATA_BRIDGE_PART_3,
@@ -68,7 +66,6 @@ enum SSCreatureIds
enum SSGameObjectIds
{
GO_STRANGE_POOL = 184956,
GO_BRIDGE_PART_1 = 184203,
GO_BRIDGE_PART_2 = 184204,
GO_BRIDGE_PART_3 = 184205,