Skip to content

Commit

Permalink
fix(Scripts/Zul'Aman): Band-Aid fix for hostage loot. (#21060)
Browse files Browse the repository at this point in the history
  • Loading branch information
heyitsbench authored Dec 29, 2024
1 parent a710b98 commit d949192
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/sql/updates/pending_db_world/za-hostage-bandaid.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UPDATE `conditions` SET `ConditionValue1` = 17 WHERE `SourceTypeOrReferenceId` = 10 AND `SourceGroup` IN (35100, 35101, 35102) AND `ConditionTypeOrReference` = 13 AND `ConditionValue2` IN (1, 2, 3, 4);
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class instance_zulaman : public InstanceMapScript
LoadBossBoundaries(boundaries);
LoadDoorData(doorData);
LoadSummonData(summonData);
_chestLooted = 0;

for (uint8 i = 0; i < RAND_VENDOR; ++i)
RandVendor[i] = NOT_STARTED;
Expand Down Expand Up @@ -200,6 +201,8 @@ class instance_zulaman : public InstanceMapScript
else if (data == DONE)
_akilzonGauntlet = DONE;
}
else if (type == DATA_CHEST_LOOTED)
++_chestLooted;
}

void StartAkilzonGauntlet()
Expand Down Expand Up @@ -320,6 +323,8 @@ class instance_zulaman : public InstanceMapScript
return RandVendor[1];
else if (type == TYPE_AKILZON_GAUNTLET)
return _akilzonGauntlet;
else if (type == DATA_CHEST_LOOTED)
return _chestLooted;

return 0;
}
Expand All @@ -330,6 +335,7 @@ class instance_zulaman : public InstanceMapScript
}

private:
uint16 _chestLooted;
uint32 RandVendor[RAND_VENDOR];
GuidSet AkilzonTrash;
EncounterState _akilzonGauntlet = NOT_STARTED;
Expand Down
6 changes: 5 additions & 1 deletion src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,17 @@ class npc_zulaman_hostage : public CreatureScript

creature->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);

creature->GetInstanceScript()->SetData(DATA_CHEST_LOOTED, 0);

float x, y, z;
creature->GetPosition(x, y, z);
for (uint8 i = 0; i < 4; ++i)
{
if (HostageEntry[i] == creature->GetEntry())
{
creature->SummonGameObject(ChestEntry[i], x - 2, y, z, 0, 0, 0, 0, 0, 0);
GameObject* obj = creature->SummonGameObject(ChestEntry[i], x - 2, y, z, 0, 0, 0, 0, 0, 0);
if (obj)
obj->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/server/scripts/EasternKingdoms/ZulAman/zulaman.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ enum DataTypes
DATA_HARRISON_JONES = 13,
TYPE_AKILZON_GAUNTLET = 14,
DATA_LOOKOUT = 15,
DATA_ZULJIN_GATE = 16
DATA_ZULJIN_GATE = 16,
DATA_CHEST_LOOTED = 17 // Used for hostage loot DB conditions
};

enum CreatureIds
Expand Down

0 comments on commit d949192

Please sign in to comment.