Skip to content

Commit

Permalink
Fix Stormwind and Orgrimmar world buffs not applying to pets.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Jul 5, 2024
1 parent 115fdc5 commit dd267cf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions sql/migrations/20240705213916_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
DROP PROCEDURE IF EXISTS add_migration;
DELIMITER ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20240705213916');
IF v = 0 THEN
INSERT INTO `migrations` VALUES ('20240705213916');
-- Add your query below.


-- Fix Stormwind and Orgrimmar world buffs not applying to pets.
UPDATE `generic_scripts` SET `datalong3`=1 WHERE `command`=92 && `id` IN (4974, 7782, 7496);
UPDATE `creature_movement_scripts` SET `datalong3`=1 WHERE `command`=92 && `id` IN (1439202, 1472002);


-- End of migration.
END IF;
END??
DELIMITER ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;
4 changes: 4 additions & 0 deletions src/game/Maps/ScriptCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2528,6 +2528,10 @@ bool Map::ScriptCommand_StartScriptOnZone(ScriptInfo const& script, WorldObject*
if (itr.getSource()->GetCachedZoneId() == script.startScriptOnZone.zoneId)
{
ScriptsStart(sGenericScripts, script.startScriptOnZone.scriptId, itr.getSource()->GetObjectGuid(), target ? target->GetObjectGuid() : ObjectGuid());

if (script.startScriptOnZone.withPets)
if (Pet* pPet = itr.getSource()->GetPet())
ScriptsStart(sGenericScripts, script.startScriptOnZone.scriptId, pPet->GetObjectGuid(), target ? target->GetObjectGuid() : ObjectGuid());
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/game/Maps/ScriptCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ enum eScriptCommand
SCRIPT_COMMAND_START_SCRIPT_ON_ZONE = 92, // source = Map
// datalong = generic_script_id
// datalong2 = zone_id
// datalong3 = (bool) with_pets

SCRIPT_COMMAND_MAX,

Expand Down Expand Up @@ -1074,6 +1075,7 @@ struct ScriptInfo
{
uint32 scriptId; // datalong
uint32 zoneId; // datalong2
uint32 withPets; // datalong3
} startScriptOnZone;

struct
Expand Down

0 comments on commit dd267cf

Please sign in to comment.