diff --git a/sql/migrations/20180529201154_world.sql b/sql/migrations/20180529201154_world.sql new file mode 100644 index 000000000..2d1e81104 --- /dev/null +++ b/sql/migrations/20180529201154_world.sql @@ -0,0 +1,134 @@ +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`='20180529201154'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20180529201154'); +-- Add your query below. + + +-- These creatures were added in 1.12. +UPDATE `creature_addon` SET `patch`=10 WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id` IN (17068, 17069, 17070, 17072, 17074, 17079, 17080, 17081, 17082, 17090, 17209, 17231, 17255, 17266, 17598, 17635, 17647, 17688, 17689, 17690, 17691, 17696, 17697, 17698, 17699, 17765, 17766, 17794, 17795, 17995, 17996, 17804)); +UPDATE `creature_template` SET `patch`=10 WHERE `entry` IN (17068, 17069, 17070, 17072, 17074, 17079, 17080, 17081, 17082, 17090, 17209, 17231, 17255, 17266, 17598, 17635, 17647, 17688, 17689, 17690, 17691, 17696, 17697, 17698, 17699, 17765, 17766, 17794, 17795, 17995, 17996, 17804); +UPDATE `creature_template_addon` SET `patch`=10 WHERE `entry` IN (17068, 17069, 17070, 17072, 17074, 17079, 17080, 17081, 17082, 17090, 17209, 17231, 17255, 17266, 17598, 17635, 17647, 17688, 17689, 17690, 17691, 17696, 17697, 17698, 17699, 17765, 17766, 17794, 17795, 17995, 17996, 17804); +UPDATE `creature` SET `patch_min`=10 WHERE `id` IN (17068, 17069, 17070, 17072, 17074, 17079, 17080, 17081, 17082, 17090, 17209, 17231, 17255, 17266, 17598, 17635, 17647, 17688, 17689, 17690, 17691, 17696, 17697, 17698, 17699, 17765, 17766, 17794, 17795, 17995, 17996, 17804); +UPDATE `creature_loot_template` SET `patch_min`=10 WHERE `entry` IN (17070, 17079, 17080); + +-- These creatures were added in TBC or are custom. +DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id` IN (17108, 17111, 17112, 17113, 17115, 17124, 17125, 17126, 17252, 17645, 19405, 19985, 19994, 20002, 20003, 20004, 20175)); +DELETE FROM `creature` WHERE `id` IN (17108, 17111, 17112, 17113, 17115, 17124, 17125, 17126, 17252, 17645, 19405, 19985, 19994, 20002, 20003, 20004, 20175); +DELETE FROM `creature_template` WHERE `entry` IN (17108, 17111, 17112, 17113, 17115, 17124, 17125, 17126, 17252, 17645, 19405, 19985, 19994, 20002, 20003, 20004, 20175); +DELETE FROM `creature_template_addon` WHERE `entry` IN (17108, 17111, 17112, 17113, 17115, 17124, 17125, 17126, 17252, 17645, 19405, 19985, 19994, 20002, 20003, 20004, 20175); +DELETE FROM `creature_loot_template` WHERE `entry`=17115; +DELETE FROM `npc_vendor` WHERE `entry` IN (17108, 17111, 17112, 17113, 17115, 17124, 17125, 17126, 17252, 17645, 19405, 19985, 19994, 20002, 20003, 20004, 20175); +DELETE FROM `creature_movement` WHERE `id`=38909; + +-- These gameobjects were added in 1.12. +UPDATE `gameobject_template` SET `patch`=10 WHERE `entry` IN (182106, 182075, 182076, 182077, 182078, 182079, 182080, 182081, 181598, 181603, 181617); +UPDATE `gameobject` SET `patch_min`=10 WHERE `id` IN (182106, 182075, 182076, 182077, 182078, 182079, 182080, 182081, 181598, 181603, 181617); + +-- These gameobjects were added in TBC. +DELETE FROM `gameobject` WHERE `guid`=11755; +DELETE FROM `game_event_gameobject` WHERE guid IN (SELECT `guid` FROM `gameobject` WHERE `id` IN (181624, 181625, 181626, 181627, 181629, 181631, 181636, 181643, 181645, 181649, 181681, 181686, 181687, 181690, 181825, 181913, 181916, 181963, 182011, 182063, 182068, 182071, 182072, 184949, 185580, 186230, 186231, 186232, 186233, 186240, 186242, 186243, 186264, 186266, 186269, 186272, 186273, 186283, 186312, 186314, 186322, 186327, 186328, 186330, 186419, 186426, 186450, 186463, 186469, 186630, 186631, 186896, 186897, 186898, 186899, 186900, 186901, 186902, 186903, 186904)); +DELETE FROM `gameobject` WHERE `id` IN (181624, 181625, 181626, 181627, 181629, 181631, 181636, 181643, 181645, 181649, 181681, 181686, 181687, 181690, 181825, 181913, 181916, 181963, 182011, 182063, 182068, 182071, 182072, 184949, 185580, 186230, 186231, 186232, 186233, 186240, 186242, 186243, 186264, 186266, 186269, 186272, 186273, 186283, 186312, 186314, 186322, 186327, 186328, 186330, 186419, 186426, 186450, 186463, 186469, 186630, 186631, 186896, 186897, 186898, 186899, 186900, 186901, 186902, 186903, 186904); +DELETE FROM `gameobject_template` WHERE `entry` IN (181624, 181625, 181626, 181627, 181629, 181631, 181636, 181643, 181645, 181649, 181681, 181686, 181687, 181690, 181825, 181913, 181916, 181963, 182011, 182063, 182068, 182071, 182072, 184949, 185580, 186230, 186231, 186232, 186233, 186240, 186242, 186243, 186264, 186266, 186269, 186272, 186273, 186283, 186312, 186314, 186322, 186327, 186328, 186330, 186419, 186426, 186450, 186463, 186469, 186630, 186631, 186896, 186897, 186898, 186899, 186900, 186901, 186902, 186903, 186904); + +-- Add patch key to model info. +ALTER TABLE `creature_model_info` + ADD COLUMN `patch` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `modelid`, + DROP PRIMARY KEY, + ADD PRIMARY KEY (`modelid`, `patch`); +UPDATE `creature_model_info` SET `patch`=10 WHERE `modelid` IN (16786, 16793, 16794, 16806, 16834, 16835, 16836, 16837, 16908, 16941, 16942, 16943, 17008, 17144, 17146, 17158, 17166, 17202, 17203, 17250, 17251, 17273, 17328, 17404, 17405, 17445, 17548); + +-- Remove Felguard TBC pet from pet level stats table. +DELETE FROM `pet_levelstats` WHERE `creature_entry`=17252; + +-- Totem creature type added in 1.12. +DELETE FROM `creature_template` WHERE `entry` IN (14987, 15112); +INSERT INTO `creature_template` (`entry`, `patch`, `KillCredit1`, `KillCredit2`, `modelid_1`, `modelid_2`, `modelid_3`, `modelid_4`, `name`, `subname`, `gossip_menu_id`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spells_template`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Civilian`, `RacialLeader`, `RegenHealth`, `equipment_id`, `trainer_id`, `vendor_id`, `MechanicImmuneMask`, `SchoolImmuneMask`, `flags_extra`, `ScriptName`) VALUES (14987, 5, 0, 0, 15292, 0, 0, 0, 'Powerful Healing Ward', '', 0, 62, 63, 2800, 2800, 2514, 2514, 4091, 28, 28, 0, 0, 0, 0, 0, 9, 9, 0, 290, 1, 1430, 1573, 0, 0, 0, 0, 0, 0, 0, 0, 70.4704, 96.8968, 100, 10, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 24310, 0, 0, 0, 0, 0, 0, 0, 'TotemAI', 0, 3, 0, 0, 1, 0, 0, 0, 113458079, 0, 0, ''); +INSERT INTO `creature_template` (`entry`, `patch`, `KillCredit1`, `KillCredit2`, `modelid_1`, `modelid_2`, `modelid_3`, `modelid_4`, `name`, `subname`, `gossip_menu_id`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spells_template`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Civilian`, `RacialLeader`, `RegenHealth`, `equipment_id`, `trainer_id`, `vendor_id`, `MechanicImmuneMask`, `SchoolImmuneMask`, `flags_extra`, `ScriptName`) VALUES (14987, 10, 0, 0, 15292, 0, 0, 0, 'Powerful Healing Ward', '', 0, 62, 63, 2800, 2800, 2514, 2514, 4091, 28, 28, 0, 0, 0, 0, 0, 9, 9, 0, 290, 1, 1430, 1573, 0, 0, 0, 0, 0, 0, 0, 0, 70.4704, 96.8968, 100, 11, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 24310, 0, 0, 0, 0, 0, 0, 0, 'TotemAI', 0, 3, 0, 0, 1, 0, 0, 0, 113458079, 0, 0, ''); +INSERT INTO `creature_template` (`entry`, `patch`, `KillCredit1`, `KillCredit2`, `modelid_1`, `modelid_2`, `modelid_3`, `modelid_4`, `name`, `subname`, `gossip_menu_id`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spells_template`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Civilian`, `RacialLeader`, `RegenHealth`, `equipment_id`, `trainer_id`, `vendor_id`, `MechanicImmuneMask`, `SchoolImmuneMask`, `flags_extra`, `ScriptName`) VALUES (15112, 5, 0, 0, 15291, 0, 0, 0, 'Brain Wash Totem', '', 0, 62, 63, 3952, 4080, 300, 300, 0, 28, 28, 0, 0, 0, 0, 0, 9, 9, 0, 290, 1, 1410, 1551, 0, 0, 0, 0, 0, 0, 0, 0, 74.448, 102.366, 100, 10, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 24261, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 0, 0, 1, 0, 0, 0, 113458079, 0, 0, 'mob_brain_wash'); +INSERT INTO `creature_template` (`entry`, `patch`, `KillCredit1`, `KillCredit2`, `modelid_1`, `modelid_2`, `modelid_3`, `modelid_4`, `name`, `subname`, `gossip_menu_id`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spells_template`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Civilian`, `RacialLeader`, `RegenHealth`, `equipment_id`, `trainer_id`, `vendor_id`, `MechanicImmuneMask`, `SchoolImmuneMask`, `flags_extra`, `ScriptName`) VALUES (15112, 10, 0, 0, 15291, 0, 0, 0, 'Brain Wash Totem', '', 0, 62, 63, 3952, 4080, 300, 300, 0, 28, 28, 0, 0, 0, 0, 0, 9, 9, 0, 290, 1, 1410, 1551, 0, 0, 0, 0, 0, 0, 0, 0, 74.448, 102.366, 100, 11, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 24261, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 0, 0, 1, 0, 0, 0, 113458079, 0, 0, 'mob_brain_wash'); +UPDATE `creature_template_addon` SET `patch`=5 WHERE `entry` IN (14987, 15112); + +-- Squire Rowe was added in patch 1.12. +-- Previously Windsor would be spawned by the areatrigger at the stormwind gates. +-- https://web.archive.org/web/20051223051648/http://www.thottbot.com/index.cgi?q=3835 +INSERT INTO `scripted_areatrigger` VALUES (2786, 'at_stormwind_gates'); + +-- Aurora Skycaller and Kriss Goldenlight were spawned at the Northpass Tower before 1.12. +-- https://web.archive.org/web/20071105191002/http://wow.allakhazam.com:80/db/mob.html?wmob=11704 +-- https://web.archive.org/web/20051206182956/http://wow.allakhazam.com:80/db/mob.html?wmob=10304 +INSERT INTO `creature` (`guid`, `id`, `map`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecsmin`, `spawntimesecsmax`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`, `spawnFlags`, `visibilitymod`, `patch_min`, `patch_max`) VALUES (53732, 11704, 0, 0, 0, 3166.368, -4373.089, 139.631, 1.276, 345, 345, 0, 0, 3857, 0, 0, 0, 0, 0, 0, 9); +INSERT INTO `creature` (`guid`, `id`, `map`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecsmin`, `spawntimesecsmax`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`, `spawnFlags`, `visibilitymod`, `patch_min`, `patch_max`) VALUES (53733, 10304, 0, 0, 0, 3172.210, -4372.598, 139.632, 1.747, 345, 345, 0, 0, 4193, 0, 0, 0, 0, 0, 0, 9); +UPDATE `creature` SET `patch_min`=10 WHERE `guid` IN (53738, 53739); + +-- Assign gossip menu for Aurora Skycaller. +DELETE FROM `npc_gossip` WHERE `npc_guid`=53739; +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`) VALUES (805, 8, 5245, 0); +UPDATE `gossip_menu` SET `condition_id`=2 WHERE `entry`=4743 && `text_id`=5795; +UPDATE `gossip_menu` SET `condition_id`=805 WHERE `entry`=4743 && `text_id`=5817; +UPDATE `creature_template` SET `gossip_menu_id`=4743 WHERE `entry`=10304; + +-- The graveyard near Crown Guard Tower in EPL was added in 1.12. +ALTER TABLE `game_graveyard_zone` + ADD COLUMN `build_min` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Minimum game client build' AFTER `faction`; +UPDATE `game_graveyard_zone` SET `build_min`=5875 WHERE `id`=927; + +-- These flight paths were added in 1.12. +ALTER TABLE `taxi_path_transitions` + ADD COLUMN `build_min` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Minimum game client build' AFTER `comment`; +UPDATE `taxi_path_transitions` SET `build_min`=5875 WHERE `inPath` IN (499, 500); +UPDATE `taxi_path_transitions` SET `build_min`=5875 WHERE `outPath` IN (499, 500); + +-- This npc in Arathi Basin has waypoint movement type but no waypoints. +-- ERROR:WaypointMovementGenerator::LoadPath: Creature (Entry: 15086 Guid: 400086) doesn't have waypoint path 0 +UPDATE `creature` SET `MovementType`=0, `spawndist`=0 WHERE `guid`=400086; + +-- Remove Rapid Cast effectBasePoints hack. +DELETE FROM `spell_effect_mod` WHERE `Id`=8215; + +-- Tome of Conjure Food VII was added in patch 1.11. +INSERT INTO `forbidden_items` VALUES (22897, 8, 1); + +-- Patch 1.12: Lethargy Root has been removed from poison vendors and is now a gray item. +-- https://web.archive.org/web/20070701202527/http://www.thottbot.com:80/i3777 +-- https://web.archive.org/web/20070211010417/http://wow.allakhazam.com:80/db/item.html?witem=3777 +DELETE FROM `item_template` WHERE `entry`=3777; +INSERT INTO `item_template` (`entry`, `patch`, `class`, `subclass`, `name`, `displayid`, `Quality`, `Flags`, `BuyCount`, `BuyPrice`, `SellPrice`, `InventoryType`, `AllowableClass`, `AllowableRace`, `ItemLevel`, `RequiredLevel`, `RequiredSkill`, `RequiredSkillRank`, `requiredspell`, `requiredhonorrank`, `RequiredCityRank`, `RequiredReputationFaction`, `RequiredReputationRank`, `maxcount`, `stackable`, `ContainerSlots`, `stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`, `stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`, `stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`, `dmg_min1`, `dmg_max1`, `dmg_type1`, `dmg_min2`, `dmg_max2`, `dmg_type2`, `dmg_min3`, `dmg_max3`, `dmg_type3`, `dmg_min4`, `dmg_max4`, `dmg_type4`, `dmg_min5`, `dmg_max5`, `dmg_type5`, `armor`, `holy_res`, `fire_res`, `nature_res`, `frost_res`, `shadow_res`, `arcane_res`, `delay`, `ammo_type`, `RangedModRange`, `spellid_1`, `spelltrigger_1`, `spellcharges_1`, `spellppmRate_1`, `spellcooldown_1`, `spellcategory_1`, `spellcategorycooldown_1`, `spellid_2`, `spelltrigger_2`, `spellcharges_2`, `spellppmRate_2`, `spellcooldown_2`, `spellcategory_2`, `spellcategorycooldown_2`, `spellid_3`, `spelltrigger_3`, `spellcharges_3`, `spellppmRate_3`, `spellcooldown_3`, `spellcategory_3`, `spellcategorycooldown_3`, `spellid_4`, `spelltrigger_4`, `spellcharges_4`, `spellppmRate_4`, `spellcooldown_4`, `spellcategory_4`, `spellcategorycooldown_4`, `spellid_5`, `spelltrigger_5`, `spellcharges_5`, `spellppmRate_5`, `spellcooldown_5`, `spellcategory_5`, `spellcategorycooldown_5`, `bonding`, `description`, `PageText`, `LanguageID`, `PageMaterial`, `startquest`, `lockid`, `Material`, `sheath`, `RandomProperty`, `block`, `itemset`, `MaxDurability`, `area`, `Map`, `BagFamily`, `ScriptName`, `DisenchantID`, `FoodType`, `minMoneyLoot`, `maxMoneyLoot`, `Duration`, `ExtraFlags`, `OtherTeamEntry`) VALUES (3777, 0, 7, 0, 'Lethargy Root', 6371, 1, 0, 1, 40, 10, 0, 8, -1, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 'Used by rogues to brew poison.', 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); +INSERT INTO `item_template` (`entry`, `patch`, `class`, `subclass`, `name`, `displayid`, `Quality`, `Flags`, `BuyCount`, `BuyPrice`, `SellPrice`, `InventoryType`, `AllowableClass`, `AllowableRace`, `ItemLevel`, `RequiredLevel`, `RequiredSkill`, `RequiredSkillRank`, `requiredspell`, `requiredhonorrank`, `RequiredCityRank`, `RequiredReputationFaction`, `RequiredReputationRank`, `maxcount`, `stackable`, `ContainerSlots`, `stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`, `stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`, `stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`, `dmg_min1`, `dmg_max1`, `dmg_type1`, `dmg_min2`, `dmg_max2`, `dmg_type2`, `dmg_min3`, `dmg_max3`, `dmg_type3`, `dmg_min4`, `dmg_max4`, `dmg_type4`, `dmg_min5`, `dmg_max5`, `dmg_type5`, `armor`, `holy_res`, `fire_res`, `nature_res`, `frost_res`, `shadow_res`, `arcane_res`, `delay`, `ammo_type`, `RangedModRange`, `spellid_1`, `spelltrigger_1`, `spellcharges_1`, `spellppmRate_1`, `spellcooldown_1`, `spellcategory_1`, `spellcategorycooldown_1`, `spellid_2`, `spelltrigger_2`, `spellcharges_2`, `spellppmRate_2`, `spellcooldown_2`, `spellcategory_2`, `spellcategorycooldown_2`, `spellid_3`, `spelltrigger_3`, `spellcharges_3`, `spellppmRate_3`, `spellcooldown_3`, `spellcategory_3`, `spellcategorycooldown_3`, `spellid_4`, `spelltrigger_4`, `spellcharges_4`, `spellppmRate_4`, `spellcooldown_4`, `spellcategory_4`, `spellcategorycooldown_4`, `spellid_5`, `spelltrigger_5`, `spellcharges_5`, `spellppmRate_5`, `spellcooldown_5`, `spellcategory_5`, `spellcategorycooldown_5`, `bonding`, `description`, `PageText`, `LanguageID`, `PageMaterial`, `startquest`, `lockid`, `Material`, `sheath`, `RandomProperty`, `block`, `itemset`, `MaxDurability`, `area`, `Map`, `BagFamily`, `ScriptName`, `DisenchantID`, `FoodType`, `minMoneyLoot`, `maxMoneyLoot`, `Duration`, `ExtraFlags`, `OtherTeamEntry`) VALUES (3777, 10, 7, 0, 'Lethargy Root', 6371, 0, 0, 1, 40, 10, 0, 8, -1, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 'Used by rogues to brew poison.', 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 1); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (1148, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (1286, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (2225, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (2821, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (3367, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (4229, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (4561, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (5135, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (5139, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (5817, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (8145, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (8363, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (9636, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (10364, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (11189, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (12022, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (12028, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (12096, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (12097, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (12245, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (12941, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (12957, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (12958, 3777, 0, 0); +INSERT INTO `npc_vendor` (`entry`, `item`, `maxcount`, `incrtime`) VALUES (15179, 3777, 0, 0); +INSERT INTO `forbidden_items` VALUES (3777, 10, 0); + + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/src/game/Commands/Level2.cpp b/src/game/Commands/Level2.cpp index 04aa811bf..32042ecf8 100644 --- a/src/game/Commands/Level2.cpp +++ b/src/game/Commands/Level2.cpp @@ -3600,7 +3600,9 @@ bool ChatHandler::HandleModifyHonorCommand(char* args) if (amount < 0 || amount > 255) return false; // rank points is sent to client with same size of uint8(255) for each rank +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 target->SetByteValue(PLAYER_FIELD_BYTES2, 0, amount); +#endif } else if (hasStringAbbr(field, "rank")) { diff --git a/src/game/Commands/Level3.cpp b/src/game/Commands/Level3.cpp index c11bee0d2..5fd3e8356 100644 --- a/src/game/Commands/Level3.cpp +++ b/src/game/Commands/Level3.cpp @@ -7882,6 +7882,8 @@ bool ChatHandler::HandleModifyCastSpeedCommand(char *args) if (!ExtractFloat(&args, amount)) return false; + // This field is an Int32 before 1.12. +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 if (amount < 0) { SendSysMessage(LANG_BAD_VALUE); @@ -7890,6 +7892,9 @@ bool ChatHandler::HandleModifyCastSpeedCommand(char *args) } player->SetFloatValue(UNIT_MOD_CAST_SPEED, amount); +#else + player->SetInt32Value(UNIT_MOD_CAST_SPEED, amount); +#endif PSendSysMessage(LANG_YOU_CHANGE_CSPD, player->GetName(), amount); diff --git a/src/game/Database/DBCStores.cpp b/src/game/Database/DBCStores.cpp index f59cce7bc..e18062628 100644 --- a/src/game/Database/DBCStores.cpp +++ b/src/game/Database/DBCStores.cpp @@ -462,8 +462,14 @@ void LoadDBCStores(const std::string& dataPath) exit(1); } +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 + #define MAX_SKILL_LINE_ABILITY_ENTRY 15030 +#else + #define MAX_SKILL_LINE_ABILITY_ENTRY 13817 +#endif + // Check loaded DBC files proper version - if (!sSkillLineAbilityStore.LookupEntry(15030)) + if (!sSkillLineAbilityStore.LookupEntry(MAX_SKILL_LINE_ABILITY_ENTRY)) { sLog.outError("\nYou have _outdated_ DBC files. Please re-extract DBC files for one from client build: %s", AcceptableClientBuildsListStr().c_str()); Log::WaitBeforeContinueIfNeed(); diff --git a/src/game/Handlers/ItemHandler.cpp b/src/game/Handlers/ItemHandler.cpp index 280bbcf63..7bd64ff66 100644 --- a/src/game/Handlers/ItemHandler.cpp +++ b/src/game/Handlers/ItemHandler.cpp @@ -432,7 +432,9 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) data << pProto->ItemSet; data << pProto->MaxDurability; data << pProto->Area; +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 data << pProto->Map; // Added in 1.12.x & 2.0.1 client branch +#endif data << pProto->BagFamily; SendPacket(&data); } diff --git a/src/game/Handlers/MiscHandler.cpp b/src/game/Handlers/MiscHandler.cpp index 4ada28587..dbb72df78 100644 --- a/src/game/Handlers/MiscHandler.cpp +++ b/src/game/Handlers/MiscHandler.cpp @@ -1086,8 +1086,9 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) { data << pl->GetUInt32Value(PLAYER_FIELD_LAST_WEEK_RANK); // Rank progress bar +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 data << (uint8)pl->GetByteValue(PLAYER_FIELD_BYTES2, 0); - +#endif SendPacket(&data); } else DEBUG_LOG("%s not found!", guid.GetString().c_str()); diff --git a/src/game/Handlers/QueryHandler.cpp b/src/game/Handlers/QueryHandler.cpp index 1ae8eee73..6cb753303 100644 --- a/src/game/Handlers/QueryHandler.cpp +++ b/src/game/Handlers/QueryHandler.cpp @@ -42,10 +42,16 @@ void WorldSession::SendNameQueryOpcode(Player *p) return; // guess size +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8 + 25 + 1 + 4 + 4 + 4)); // guess size data << ObjectGuid(p->GetObjectGuid()); data << p->GetName(); // CString(48): played name data << uint8(0); // CString(256): realm name for cross realm BG usage +#else + WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8 + 25 + 4 + 4 + 4)); // guess size + data << ObjectGuid(p->GetObjectGuid()); + data << p->GetName(); // CString(48): played name +#endif data << uint32(p->getRace()); data << uint32(p->getGender()); data << uint32(p->getClass()); @@ -60,10 +66,16 @@ void WorldSession::SendNameQueryOpcodeFromDB(ObjectGuid guid) { std::string name = pData->sName; +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8 + (name.size() + 1) + 1 + 4 + 4 + 4)); data << ObjectGuid(HIGHGUID_PLAYER, pData->uiGuid); data << name; data << uint8(0); +#else + WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8 + (name.size() + 1) + 4 + 4 + 4)); + data << ObjectGuid(HIGHGUID_PLAYER, pData->uiGuid); + data << name; +#endif data << uint32(pData->uiRace); data << uint32(pData->uiGender); data << uint32(pData->uiClass); @@ -105,10 +117,16 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult *result, uint32 } // guess size +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8 + (name.size() + 1) + 1 + 4 + 4 + 4)); data << ObjectGuid(HIGHGUID_PLAYER, lowguid); data << name; data << uint8(0); // realm name for cross realm BG usage +#else + WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8 + (name.size() + 1) + 4 + 4 + 4)); + data << ObjectGuid(HIGHGUID_PLAYER, lowguid); + data << name; +#endif data << uint32(pRace); // race data << uint32(pGender); // gender data << uint32(pClass); // class @@ -235,8 +253,12 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) data << uint32(info->displayId); data << Name; data << uint8(0) << uint8(0) << uint8(0); // name2, name3, name4 +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 data << uint8(0); // one more name, client handles it a bit differently data.append(info->raw.data, 24); // these are read as int32 +#else + data.append(info->raw.data, 16); // these are read as int32 +#endif //data << float(info->size); // [-ZERO] go size: not in Zero SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); diff --git a/src/game/HonorMgr.cpp b/src/game/HonorMgr.cpp index 3ca096173..7c827efc9 100644 --- a/src/game/HonorMgr.cpp +++ b/src/game/HonorMgr.cpp @@ -806,8 +806,9 @@ void HonorMgr::Update() honorBar = uint8(((honorBar - m_rank.minRP) / (m_rank.maxRP - m_rank.minRP)) * (m_rank.positive ? 255 : -255)); // PLAYER_FIELD_HONOR_BAR +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 m_owner->SetUInt32Value(PLAYER_FIELD_BYTES2, honorBar); - +#endif // TODAY m_owner->SetUInt16Value(PLAYER_FIELD_SESSION_KILLS, 0, todayHK); m_owner->SetUInt16Value(PLAYER_FIELD_SESSION_KILLS, 1, todayDK); diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index ea290deb2..efccebe4e 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1485,7 +1485,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32 display_ void ObjectMgr::LoadCreatureModelInfo() { - sCreatureModelStorage.Load(); + sCreatureModelStorage.LoadProgressive(sWorld.GetWowPatch()); // post processing for (uint32 i = 1; i < sCreatureModelStorage.GetMaxEntry(); ++i) @@ -2732,7 +2732,8 @@ void ObjectMgr::LoadPetLevelInfo() uint32 creature_id = fields[0].GetUInt32(); if (!sCreatureStorage.LookupEntry(creature_id)) { - sLog.outErrorDb("Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id); + if (!IsExistingCreatureId(creature_id)) + sLog.outErrorDb("Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id); continue; } @@ -5330,7 +5331,7 @@ void ObjectMgr::LoadGraveyardZones() { mGraveYardMap.clear(); // need for reload case - QueryResult *result = WorldDatabase.Query("SELECT id,ghost_zone,faction FROM game_graveyard_zone"); + QueryResult *result = WorldDatabase.PQuery("SELECT id, ghost_zone, faction FROM game_graveyard_zone WHERE build_min <= %u", SUPPORTED_CLIENT_BUILD); uint32 count = 0; @@ -7015,7 +7016,7 @@ void ObjectMgr::LoadTaxiPathTransitions() uint32 count = 0; - QueryResult *result = WorldDatabase.PQuery("SELECT inPath, outPath, inNode, outNode FROM taxi_path_transitions"); + QueryResult *result = WorldDatabase.PQuery("SELECT inPath, outPath, inNode, outNode FROM taxi_path_transitions WHERE build_min <= %u", SUPPORTED_CLIENT_BUILD); if (!result) { @@ -8722,7 +8723,7 @@ bool ObjectMgr::IsVendorItemValid(bool isTemplate, char const* tableName, uint32 { if (pl) ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION); - else + else if (!IsExistingCreatureId(vendor_entry)) sLog.outErrorDb("Table `%s` has data for nonexistent creature (Entry: %u), ignoring", tableName, vendor_entry); return false; } @@ -8747,7 +8748,7 @@ bool ObjectMgr::IsVendorItemValid(bool isTemplate, char const* tableName, uint32 { if (pl) ChatHandler(pl).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id); - else + else if (!IsExistingItemId(item_id)) sLog.outErrorDb("Table `%s` for %s %u contain nonexistent item (%u), ignoring", tableName, idStr, vendor_entry, item_id); return false; diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 0645d2972..af53a8e63 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -561,12 +561,12 @@ class ObjectMgr // Stores all existing ids in the database, not necessarily valid or loaded. void LoadAllIdentifiers(); - bool IsExistingItemId(uint32 id) { return (m_ItemIdSet.find(id) != m_ItemIdSet.end()); } - bool IsExistingQuestId(uint32 id) { return (m_QuestIdSet.find(id) != m_QuestIdSet.end()); } - bool IsExistingCreatureId(uint32 id) { return (m_CreatureIdSet.find(id) != m_CreatureIdSet.end()); } - bool IsExistingGameObjectId(uint32 id) { return (m_GameObjectIdSet.find(id) != m_GameObjectIdSet.end()); } - bool IsExistingCreatureGuid(uint32 id) { return (m_CreatureGuidSet.find(id) != m_CreatureGuidSet.end()); } - bool IsExistingGameObjectGuid(uint32 id) { return (m_GameObjectGuidSet.find(id) != m_GameObjectGuidSet.end()); } + bool IsExistingItemId(uint32 id) const { return (m_ItemIdSet.find(id) != m_ItemIdSet.end()); } + bool IsExistingQuestId(uint32 id) const { return (m_QuestIdSet.find(id) != m_QuestIdSet.end()); } + bool IsExistingCreatureId(uint32 id) const { return (m_CreatureIdSet.find(id) != m_CreatureIdSet.end()); } + bool IsExistingGameObjectId(uint32 id) const { return (m_GameObjectIdSet.find(id) != m_GameObjectIdSet.end()); } + bool IsExistingCreatureGuid(uint32 id) const { return (m_CreatureGuidSet.find(id) != m_CreatureGuidSet.end()); } + bool IsExistingGameObjectGuid(uint32 id) const { return (m_GameObjectGuidSet.find(id) != m_GameObjectGuidSet.end()); } typedef UNORDERED_MAP ItemMap; diff --git a/src/game/Objects/Creature.cpp b/src/game/Objects/Creature.cpp index 0bfe2a4e1..0f20029e6 100644 --- a/src/game/Objects/Creature.cpp +++ b/src/game/Objects/Creature.cpp @@ -345,9 +345,11 @@ bool Creature::InitEntry(uint32 Entry, Team team, CreatureData const* data /*=NU } SetName(normalInfo->Name); // at normal entry always - +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); - +#else + SetInt32Value(UNIT_MOD_CAST_SPEED, 0); +#endif // update speed for the new CreatureInfo base speed mods UpdateSpeed(MOVE_WALK, false); UpdateSpeed(MOVE_RUN, false); @@ -3501,7 +3503,7 @@ SpellCastResult Creature::TryToCast(Unit* pTarget, const SpellEntry* pSpellInfo, // Can't cast while fleeing. if (GetMotionMaster()->GetCurrentMovementGeneratorType() == TIMED_FLEEING_MOTION_TYPE) - return SPELL_FAILED_NOT_WHILE_FATIGUED; + return SPELL_FAILED_FLEEING; // This spell is only used when target is in melee range. if ((uiCastFlags & CF_ONLY_IN_MELEE) && !CanReachWithMeleeAttack(pTarget)) diff --git a/src/game/Objects/GameObject.cpp b/src/game/Objects/GameObject.cpp index 37a993f54..ffc0300d5 100644 --- a/src/game/Objects/GameObject.cpp +++ b/src/game/Objects/GameObject.cpp @@ -167,6 +167,10 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float SetObjectScale(goinfo->size); +#if SUPPORTED_CLIENT_BUILD < CLIENT_BUILD_1_12_1 + SetUInt32Value(GAMEOBJECT_TIMESTAMP, (uint32)time(nullptr)); +#endif + SetFloatValue(GAMEOBJECT_POS_X, x); SetFloatValue(GAMEOBJECT_POS_Y, y); SetFloatValue(GAMEOBJECT_POS_Z, z); diff --git a/src/game/Objects/GameObject.h b/src/game/Objects/GameObject.h index 2b7321474..f60e870de 100644 --- a/src/game/Objects/GameObject.h +++ b/src/game/Objects/GameObject.h @@ -634,10 +634,18 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject void SetGoType(GameobjectTypes type) { SetUInt32Value(GAMEOBJECT_TYPE_ID, type); } GOState GetGoState() const { return GOState(GetUInt32Value(GAMEOBJECT_STATE)); } void SetGoState(GOState state); + +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 uint32 GetGoArtKit() const { return GetUInt32Value(GAMEOBJECT_ARTKIT); } void SetGoArtKit(uint32 artkit) { SetUInt32Value(GAMEOBJECT_ARTKIT, artkit); } uint32 GetGoAnimProgress() const { return GetUInt32Value(GAMEOBJECT_ANIMPROGRESS); } void SetGoAnimProgress(uint32 animprogress) { SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, animprogress); } +#else + uint32 GetGoArtKit() const { return 0; } + void SetGoArtKit(uint32 artkit) { } + uint32 GetGoAnimProgress() const { return 0; } + void SetGoAnimProgress(uint32 animprogress) { } +#endif uint32 GetDisplayId() const { return GetUInt32Value(GAMEOBJECT_DISPLAYID); } void SetDisplayId(uint32 modelId); diff --git a/src/game/Objects/Object.cpp b/src/game/Objects/Object.cpp index 26937c7a2..1d8b4d795 100644 --- a/src/game/Objects/Object.cpp +++ b/src/game/Objects/Object.cpp @@ -521,7 +521,9 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask * IsActivateToQuest = true; updateMask->SetBit(GAMEOBJECT_DYN_FLAGS); +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 updateMask->SetBit(GAMEOBJECT_ANIMPROGRESS); +#endif } } if (isType(TYPEMASK_GAMEOBJECT)) diff --git a/src/game/Objects/Pet.cpp b/src/game/Objects/Pet.cpp index 60069a16f..0b063a5c6 100644 --- a/src/game/Objects/Pet.cpp +++ b/src/game/Objects/Pet.cpp @@ -1241,8 +1241,12 @@ bool Pet::CreateBaseAtCreature(Creature* creature) SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_UNK3 | UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5); SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_RENAME | UNIT_FLAG_PET_ABANDON); - - SetUInt32Value(UNIT_MOD_CAST_SPEED, creature->GetUInt32Value(UNIT_MOD_CAST_SPEED)); +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 + SetFloatValue(UNIT_MOD_CAST_SPEED, creature->GetFloatValue(UNIT_MOD_CAST_SPEED)); +#else + SetInt32Value(UNIT_MOD_CAST_SPEED, creature->GetInt32Value(UNIT_MOD_CAST_SPEED)); +#endif + SetLoyaltyLevel(REBELLIOUS); } return true; @@ -1299,9 +1303,11 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) SetAttackTime(BASE_ATTACK, cinfo->baseattacktime); //BASE_ATTACK_TIME); SetAttackTime(OFF_ATTACK, cinfo->baseattacktime); //BASE_ATTACK_TIME); SetAttackTime(RANGED_ATTACK, cinfo->rangeattacktime); //BASE_ATTACK_TIME); - - SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0); - +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 + SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); +#else + SetInt32Value(UNIT_MOD_CAST_SPEED, 0); +#endif CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family); if (cFamily && cFamily->minScale > 0.0f && getPetType() == HUNTER_PET) { diff --git a/src/game/Objects/Player.cpp b/src/game/Objects/Player.cpp index f4403aa05..7b21f31c7 100644 --- a/src/game/Objects/Player.cpp +++ b/src/game/Objects/Player.cpp @@ -709,7 +709,13 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_UNK3 | UNIT_BYTE2_FLAG_UNK5 | UNIT_BYTE2_FLAG_PVP); SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); - SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); // fix cast time showed in spell tooltip on client + + // fix cast time showed in spell tooltip on client +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 + SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); +#else + SetInt32Value(UNIT_MOD_CAST_SPEED, 0); +#endif SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, -1); // -1 is default value @@ -2952,7 +2958,11 @@ void Player::InitStatsForLevel(bool reapplyMods) UpdateSkillsForLevel(); // set default cast time multiplier +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); +#else + SetInt32Value(UNIT_MOD_CAST_SPEED, 0); +#endif // save base values (bonuses already included in stored stats) for (int i = STAT_STRENGTH; i < MAX_STATS; ++i) @@ -3059,7 +3069,9 @@ void Player::InitStatsForLevel(bool reapplyMods) RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALL); // restore if need some important flags +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 SetUInt32Value(PLAYER_FIELD_BYTES2, 0); // flags empty by default +#endif if (reapplyMods) //reapply stats values only on .reset stats (level) command _ApplyAllStatBonuses(); @@ -4079,9 +4091,10 @@ void Player::InitVisibleBits() updateVisualBits.SetBit(PLAYER_GUILD_TIMESTAMP); // PLAYER_QUEST_LOG_x also visible bit on official (but only on party/raid)... +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 for (uint16 i = PLAYER_QUEST_LOG_1_1; i < PLAYER_QUEST_LOG_LAST_3; i += MAX_QUEST_OFFSET) updateVisualBits.SetBit(i); - +#endif //Players visible items are not inventory stuff //431) = 884 (0x374) = main weapon for (uint16 i = 0; i < EQUIPMENT_SLOT_END; i++) diff --git a/src/game/Objects/Unit.cpp b/src/game/Objects/Unit.cpp index ddb6e8c42..2d807f0d9 100644 --- a/src/game/Objects/Unit.cpp +++ b/src/game/Objects/Unit.cpp @@ -10150,7 +10150,17 @@ void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply void Unit::ApplyCastTimePercentMod(float val, bool apply) { - ApplyPercentModFloatValue(UNIT_MOD_CAST_SPEED, -val, apply); +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 + SetFloatValue(UNIT_MOD_CAST_SPEED, GetFloatValue(UNIT_MOD_CAST_SPEED) * (apply ? 100.0f / (100.0f + val) : (100.0f + val) / 100.0f)); +#else + val = -val; + SetInt32Value(UNIT_MOD_CAST_SPEED, (int32)round((((1.0f + GetInt32Value(UNIT_MOD_CAST_SPEED) / 100.0f) * (apply ? (100.0f + val) / 100.0f : 100.0f / (100.0f + val))) - 1.0f)*100.0f)); + /* + Code below will make a 50% positive effect cancel out a 50% negative one exactly. But it shouldn't before 1.12! + int32 intval = round(val); + SetInt32Value(UNIT_MOD_CAST_SPEED, (GetInt32Value(UNIT_MOD_CAST_SPEED) + (apply ? -intval : intval))); + */ +#endif } void Unit::UpdateAuraForGroup(uint8 slot) diff --git a/src/game/Objects/UpdateFields.h b/src/game/Objects/UpdateFields.h index c22752f9d..b05a4096c 100644 --- a/src/game/Objects/UpdateFields.h +++ b/src/game/Objects/UpdateFields.h @@ -133,7 +133,7 @@ enum EUnitFields UNIT_FIELD_PETNEXTLEVELEXP = 0x88 + OBJECT_END, // Size:1 UNIT_DYNAMIC_FLAGS = 0x89 + OBJECT_END, // Size:1 UNIT_CHANNEL_SPELL = 0x8a + OBJECT_END, // Size:1 - UNIT_MOD_CAST_SPEED = 0x8b + OBJECT_END, // Size:1 + UNIT_MOD_CAST_SPEED = 0x8b + OBJECT_END, // Size:1 Represented as Int32 before 1.12, after that it's Float. UNIT_CREATED_BY_SPELL = 0x8c + OBJECT_END, // Size:1 UNIT_NPC_FLAGS = 0x8d + OBJECT_END, // Size:1 UNIT_NPC_EMOTESTATE = 0x8e + OBJECT_END, // Size:1 @@ -178,6 +178,7 @@ enum EUnitFields UNIT_FIELD_PADDING = 0xb5 + OBJECT_END, UNIT_END = 0xb6 + OBJECT_END, +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 PLAYER_DUEL_ARBITER = 0x00 + UNIT_END, // Size:2 PLAYER_FLAGS = 0x02 + UNIT_END, // Size:1 PLAYER_GUILDID = 0x03 + UNIT_END, // Size:1 @@ -267,6 +268,246 @@ enum EUnitFields PLAYER_FIELD_COMBAT_RATING_1 = 0x432 + UNIT_END, // Size:20 PLAYER_END = 0x446 + UNIT_END +#else + PLAYER_SELECTION = 0x0 + UNIT_END, + PLAYER_DUEL_ARBITER = 0x2 + UNIT_END, + PLAYER_FLAGS = 0x4 + UNIT_END, + PLAYER_GUILDID = 0x5 + UNIT_END, + PLAYER_GUILDRANK = 0x6 + UNIT_END, + PLAYER_BYTES = 0x7 + UNIT_END, + PLAYER_BYTES_2 = 0x8 + UNIT_END, + PLAYER_BYTES_3 = 0x9 + UNIT_END, + PLAYER_DUEL_TEAM = 0xA + UNIT_END, + PLAYER_GUILD_TIMESTAMP = 0xB + UNIT_END, + PLAYER_QUEST_LOG_1_1 = 0xC + UNIT_END, + PLAYER_QUEST_LOG_1_2 = 0xD + UNIT_END, + PLAYER_QUEST_LOG_2_1 = 0xF + UNIT_END, + PLAYER_QUEST_LOG_2_2 = 0x10 + UNIT_END, + PLAYER_QUEST_LOG_3_1 = 0x12 + UNIT_END, + PLAYER_QUEST_LOG_3_2 = 0x13 + UNIT_END, + PLAYER_QUEST_LOG_4_1 = 0x15 + UNIT_END, + PLAYER_QUEST_LOG_4_2 = 0x16 + UNIT_END, + PLAYER_QUEST_LOG_5_1 = 0x18 + UNIT_END, + PLAYER_QUEST_LOG_5_2 = 0x19 + UNIT_END, + PLAYER_QUEST_LOG_6_1 = 0x1B + UNIT_END, + PLAYER_QUEST_LOG_6_2 = 0x1C + UNIT_END, + PLAYER_QUEST_LOG_7_1 = 0x1E + UNIT_END, + PLAYER_QUEST_LOG_7_2 = 0x1F + UNIT_END, + PLAYER_QUEST_LOG_8_1 = 0x21 + UNIT_END, + PLAYER_QUEST_LOG_8_2 = 0x22 + UNIT_END, + PLAYER_QUEST_LOG_9_1 = 0x24 + UNIT_END, + PLAYER_QUEST_LOG_9_2 = 0x25 + UNIT_END, + PLAYER_QUEST_LOG_10_1 = 0x27 + UNIT_END, + PLAYER_QUEST_LOG_10_2 = 0x28 + UNIT_END, + PLAYER_QUEST_LOG_11_1 = 0x2A + UNIT_END, + PLAYER_QUEST_LOG_11_2 = 0x2B + UNIT_END, + PLAYER_QUEST_LOG_12_1 = 0x2D + UNIT_END, + PLAYER_QUEST_LOG_12_2 = 0x2E + UNIT_END, + PLAYER_QUEST_LOG_13_1 = 0x30 + UNIT_END, + PLAYER_QUEST_LOG_13_2 = 0x31 + UNIT_END, + PLAYER_QUEST_LOG_14_1 = 0x33 + UNIT_END, + PLAYER_QUEST_LOG_14_2 = 0x34 + UNIT_END, + PLAYER_QUEST_LOG_15_1 = 0x36 + UNIT_END, + PLAYER_QUEST_LOG_15_2 = 0x37 + UNIT_END, + PLAYER_QUEST_LOG_16_1 = 0x39 + UNIT_END, + PLAYER_QUEST_LOG_16_2 = 0x3A + UNIT_END, + PLAYER_QUEST_LOG_17_1 = 0x3C + UNIT_END, + PLAYER_QUEST_LOG_17_2 = 0x3D + UNIT_END, + PLAYER_QUEST_LOG_18_1 = 0x3F + UNIT_END, + PLAYER_QUEST_LOG_18_2 = 0x40 + UNIT_END, + PLAYER_QUEST_LOG_19_1 = 0x42 + UNIT_END, + PLAYER_QUEST_LOG_19_2 = 0x43 + UNIT_END, + PLAYER_QUEST_LOG_20_1 = 0x45 + UNIT_END, + PLAYER_QUEST_LOG_20_2 = 0x46 + UNIT_END, + //260 + PLAYER_VISIBLE_ITEM_1_CREATOR = 0x48 + UNIT_END, + PLAYER_VISIBLE_ITEM_1_0 = 0x4A + UNIT_END, + PLAYER_VISIBLE_ITEM_1_PROPERTIES = 0x52 + UNIT_END, + //271 + PLAYER_VISIBLE_ITEM_1_PAD = 0x53 + UNIT_END, + //272 + PLAYER_VISIBLE_ITEM_2_CREATOR = 0x54 + UNIT_END, + PLAYER_VISIBLE_ITEM_2_0 = 0x56 + UNIT_END, + PLAYER_VISIBLE_ITEM_2_PROPERTIES = 0x5E + UNIT_END, + //283 + PLAYER_VISIBLE_ITEM_2_PAD = 0x5F + UNIT_END, + //284 + PLAYER_VISIBLE_ITEM_3_CREATOR = 0x60 + UNIT_END, + PLAYER_VISIBLE_ITEM_3_0 = 0x62 + UNIT_END, + PLAYER_VISIBLE_ITEM_3_PROPERTIES = 0x6A + UNIT_END, + //295 + PLAYER_VISIBLE_ITEM_3_PAD = 0x6B + UNIT_END, + //296 + PLAYER_VISIBLE_ITEM_4_CREATOR = 0x6C + UNIT_END, + PLAYER_VISIBLE_ITEM_4_0 = 0x6E + UNIT_END, + PLAYER_VISIBLE_ITEM_4_PROPERTIES = 0x76 + UNIT_END, + //307 + PLAYER_VISIBLE_ITEM_4_PAD = 0x77 + UNIT_END, + //308 + PLAYER_VISIBLE_ITEM_5_CREATOR = 0x78 + UNIT_END, + PLAYER_VISIBLE_ITEM_5_0 = 0x7A + UNIT_END, + PLAYER_VISIBLE_ITEM_5_PROPERTIES = 0x82 + UNIT_END, + //319 + PLAYER_VISIBLE_ITEM_5_PAD = 0x83 + UNIT_END, + //320 + PLAYER_VISIBLE_ITEM_6_CREATOR = 0x84 + UNIT_END, + PLAYER_VISIBLE_ITEM_6_0 = 0x86 + UNIT_END, + PLAYER_VISIBLE_ITEM_6_PROPERTIES = 0x8E + UNIT_END, + //331 + PLAYER_VISIBLE_ITEM_6_PAD = 0x8F + UNIT_END, + //332 + PLAYER_VISIBLE_ITEM_7_CREATOR = 0x90 + UNIT_END, + PLAYER_VISIBLE_ITEM_7_0 = 0x92 + UNIT_END, + PLAYER_VISIBLE_ITEM_7_PROPERTIES = 0x9A + UNIT_END, + //343 + PLAYER_VISIBLE_ITEM_7_PAD = 0x9B + UNIT_END, + //344 + PLAYER_VISIBLE_ITEM_8_CREATOR = 0x9C + UNIT_END, + PLAYER_VISIBLE_ITEM_8_0 = 0x9E + UNIT_END, + PLAYER_VISIBLE_ITEM_8_PROPERTIES = 0xA6 + UNIT_END, + //355 + PLAYER_VISIBLE_ITEM_8_PAD = 0xA7 + UNIT_END, + //356 + PLAYER_VISIBLE_ITEM_9_CREATOR = 0xA8 + UNIT_END, + PLAYER_VISIBLE_ITEM_9_0 = 0xAA + UNIT_END, + PLAYER_VISIBLE_ITEM_9_PROPERTIES = 0xB2 + UNIT_END, + //367 + PLAYER_VISIBLE_ITEM_9_PAD = 0xB3 + UNIT_END, + //368 + PLAYER_VISIBLE_ITEM_10_CREATOR = 0xB4 + UNIT_END, + PLAYER_VISIBLE_ITEM_10_0 = 0xB6 + UNIT_END, + PLAYER_VISIBLE_ITEM_10_PROPERTIES = 0xBE + UNIT_END, + //379 + PLAYER_VISIBLE_ITEM_10_PAD = 0xBF + UNIT_END, + //380 + PLAYER_VISIBLE_ITEM_11_CREATOR = 0xC0 + UNIT_END, + PLAYER_VISIBLE_ITEM_11_0 = 0xC2 + UNIT_END, + PLAYER_VISIBLE_ITEM_11_PROPERTIES = 0xCA + UNIT_END, + //391 + PLAYER_VISIBLE_ITEM_11_PAD = 0xCB + UNIT_END, + //392 + PLAYER_VISIBLE_ITEM_12_CREATOR = 0xCC + UNIT_END, + PLAYER_VISIBLE_ITEM_12_0 = 0xCE + UNIT_END, + PLAYER_VISIBLE_ITEM_12_PROPERTIES = 0xD6 + UNIT_END, + //403 + PLAYER_VISIBLE_ITEM_12_PAD = 0xD7 + UNIT_END, + //404 + PLAYER_VISIBLE_ITEM_13_CREATOR = 0xD8 + UNIT_END, + PLAYER_VISIBLE_ITEM_13_0 = 0xDA + UNIT_END, + PLAYER_VISIBLE_ITEM_13_PROPERTIES = 0xE2 + UNIT_END, + //415 + PLAYER_VISIBLE_ITEM_13_PAD = 0xE3 + UNIT_END, + //416 + PLAYER_VISIBLE_ITEM_14_CREATOR = 0xE4 + UNIT_END, + PLAYER_VISIBLE_ITEM_14_0 = 0xE6 + UNIT_END, + PLAYER_VISIBLE_ITEM_14_PROPERTIES = 0xEE + UNIT_END, + //427 + PLAYER_VISIBLE_ITEM_14_PAD = 0xEF + UNIT_END, + //428 + PLAYER_VISIBLE_ITEM_15_CREATOR = 0xF0 + UNIT_END, + PLAYER_VISIBLE_ITEM_15_0 = 0xF2 + UNIT_END, + PLAYER_VISIBLE_ITEM_15_PROPERTIES = 0xFA + UNIT_END, + //439 + PLAYER_VISIBLE_ITEM_15_PAD = 0xFB + UNIT_END, + //440 + PLAYER_VISIBLE_ITEM_16_CREATOR = 0xFC + UNIT_END, + PLAYER_VISIBLE_ITEM_16_0 = 0xFE + UNIT_END, + PLAYER_VISIBLE_ITEM_16_PROPERTIES = 0x106 + UNIT_END, + //451 + PLAYER_VISIBLE_ITEM_16_PAD = 0x107 + UNIT_END, + //452 + PLAYER_VISIBLE_ITEM_17_CREATOR = 0x108 + UNIT_END, + PLAYER_VISIBLE_ITEM_17_0 = 0x10A + UNIT_END, + PLAYER_VISIBLE_ITEM_17_PROPERTIES = 0x112 + UNIT_END, + //463 + PLAYER_VISIBLE_ITEM_17_PAD = 0x113 + UNIT_END, + //464 + PLAYER_VISIBLE_ITEM_18_CREATOR = 0x114 + UNIT_END, + //466 ranged + PLAYER_VISIBLE_ITEM_18_0 = 0x116 + UNIT_END, + PLAYER_VISIBLE_ITEM_18_PROPERTIES = 0x11E + UNIT_END, + //475 + PLAYER_VISIBLE_ITEM_18_PAD = 0x11F + UNIT_END, + //476 + PLAYER_VISIBLE_ITEM_19_CREATOR = 0x120 + UNIT_END, + PLAYER_VISIBLE_ITEM_19_0 = 0x122 + UNIT_END, + PLAYER_VISIBLE_ITEM_19_PROPERTIES = 0x12A + UNIT_END, + //487 + PLAYER_VISIBLE_ITEM_19_PAD = 0x12B + UNIT_END, + PLAYER_FIELD_INV_SLOT_HEAD = 0x12C + UNIT_END, + PLAYER_FIELD_PACK_SLOT_1 = 0x15A + UNIT_END, + PLAYER_FIELD_PACK_SLOT_2 = 0x15B + UNIT_END, + PLAYER_FIELD_BANK_SLOT_1 = 0x17A + UNIT_END, + PLAYER_FIELD_BANKBAG_SLOT_1 = 0x1AA + UNIT_END, + PLAYER_FIELD_VENDORBUYBACK_SLOT_1 = 0x1B6 + UNIT_END, // Size:24 + PLAYER_FIELD_VENDORBUYBACK_SLOT_LAST = 0x1CC + UNIT_END, + PLAYER_FIELD_KEYRING_SLOT_1 = 0x1CE + UNIT_END, // Size:64 + PLAYER_FIELD_KEYRING_SLOT_LAST = 0x20C + UNIT_END, + PLAYER_FARSIGHT = 0x1CE + UNIT_END + 64, + PLAYER_FIELD_COMBO_TARGET = 0x1D0 + UNIT_END + 64, + PLAYER_XP = 0x1D2 + UNIT_END + 64, + PLAYER_NEXT_LEVEL_XP = 0x1D3 + UNIT_END + 64, + PLAYER_SKILL_INFO_1_1 = 0x1D4 + UNIT_END + 64, + PLAYER_CHARACTER_POINTS1 = 0x354 + PLAYER_SELECTION + 64, + PLAYER_CHARACTER_POINTS2 = 0x355 + PLAYER_SELECTION + 64, + PLAYER_TRACK_CREATURES = 0x356 + PLAYER_SELECTION + 64, + PLAYER_TRACK_RESOURCES = 0x357 + PLAYER_SELECTION + 64, + PLAYER_BLOCK_PERCENTAGE = 0x358 + PLAYER_SELECTION + 64, + PLAYER_DODGE_PERCENTAGE = 0x359 + PLAYER_SELECTION + 64, + PLAYER_PARRY_PERCENTAGE = 0x35A + PLAYER_SELECTION + 64, + PLAYER_CRIT_PERCENTAGE = 0x35B + PLAYER_SELECTION + 64, + PLAYER_RANGED_CRIT_PERCENTAGE = 0x35C + PLAYER_SELECTION + 64, + PLAYER_EXPLORED_ZONES_1 = 0x35D + PLAYER_SELECTION + 64, + PLAYER_REST_STATE_EXPERIENCE = 0x39D + PLAYER_SELECTION + 64, + PLAYER_FIELD_COINAGE = 0x39E + PLAYER_SELECTION + 64, + PLAYER_FIELD_POSSTAT0 = 0x39F + PLAYER_SELECTION + 64, + PLAYER_FIELD_POSSTAT1 = 0x3A0 + PLAYER_SELECTION + 64, + PLAYER_FIELD_POSSTAT2 = 0x3A1 + PLAYER_SELECTION + 64, + PLAYER_FIELD_POSSTAT3 = 0x3A2 + PLAYER_SELECTION + 64, + PLAYER_FIELD_POSSTAT4 = 0x3A3 + PLAYER_SELECTION + 64, + PLAYER_FIELD_NEGSTAT0 = 0x3A4 + PLAYER_SELECTION + 64, + PLAYER_FIELD_NEGSTAT1 = 0x3A5 + PLAYER_SELECTION + 64, + PLAYER_FIELD_NEGSTAT2 = 0x3A6 + PLAYER_SELECTION + 64, + PLAYER_FIELD_NEGSTAT3 = 0x3A7 + PLAYER_SELECTION + 64, + PLAYER_FIELD_NEGSTAT4 = 0x3A8 + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE = 0x3A9 + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE_01 = 0x3AA + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE_02 = 0x3AB + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE_03 = 0x3AC + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE_04 = 0x3AD + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE_05 = 0x3AE + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE_06 = 0x3AF + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE = 0x3B0 + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE_01 = 0x3B1 + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE_02 = 0x3B2 + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE_03 = 0x3B3 + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE_04 = 0x3B4 + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE_05 = 0x3B5 + PLAYER_SELECTION + 64, + PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE_06 = 0x3B6 + PLAYER_SELECTION + 64, + PLAYER_FIELD_MOD_DAMAGE_DONE_POS = 0x3B7 + PLAYER_SELECTION + 64, + PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = 0x3BE + PLAYER_SELECTION + 64, + PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = 0x3C5 + PLAYER_SELECTION + 64, + PLAYER_FIELD_BYTES = 0x3CC + PLAYER_SELECTION + 64, + PLAYER_AMMO_ID = 0x3CD + PLAYER_SELECTION + 64, + PLAYER_SELF_RES_SPELL = 0x3CE + PLAYER_SELECTION + 64, + PLAYER_FIELD_PVP_MEDALS = 0x3CF + PLAYER_SELECTION + 64, + PLAYER_FIELD_BUYBACK_PRICE_1 = 0x3D0 + PLAYER_SELECTION + 64, + PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = 0x3DC + PLAYER_SELECTION + 64, + PLAYER_FIELD_SESSION_KILLS = 0x3E8 + PLAYER_SELECTION + 64, + PLAYER_FIELD_YESTERDAY_KILLS = 0x3E9 + PLAYER_SELECTION + 64, + PLAYER_FIELD_LAST_WEEK_KILLS = 0x3EA + PLAYER_SELECTION + 64, + PLAYER_FIELD_THIS_WEEK_KILLS = 0x3EB + PLAYER_SELECTION + 64, + PLAYER_FIELD_THIS_WEEK_CONTRIBUTION = 0x3EC + PLAYER_SELECTION + 64, + PLAYER_FIELD_LIFETIME_HONORABLE_KILLS = 0x3ED + PLAYER_SELECTION + 64, + PLAYER_FIELD_LIFETIME_DISHONORABLE_KILLS = 0x3EE + PLAYER_SELECTION + 64, + PLAYER_FIELD_YESTERDAY_CONTRIBUTION = 0x3EF + PLAYER_SELECTION + 64, + PLAYER_FIELD_LAST_WEEK_CONTRIBUTION = 0x3F0 + PLAYER_SELECTION + 64, + PLAYER_FIELD_LAST_WEEK_RANK = 0x3F1 + PLAYER_SELECTION + 64, + PLAYER_FIELD_HONOR_BAR = 0x3F2 + PLAYER_SELECTION + 64, + PLAYER_FIELD_WATCHED_FACTION_INDEX = 0x3F3 + PLAYER_SELECTION + 64, + + PLAYER_END = 0x3F4 + PLAYER_SELECTION + 64, +#endif }; enum EGameObjectFields @@ -276,6 +517,7 @@ enum EGameObjectFields GAMEOBJECT_FLAGS = OBJECT_END + 0x03, GAMEOBJECT_ROTATION = OBJECT_END + 0x04, GAMEOBJECT_STATE = OBJECT_END + 0x08, +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 GAMEOBJECT_POS_X = OBJECT_END + 0x09, GAMEOBJECT_POS_Y = OBJECT_END + 0x0A, GAMEOBJECT_POS_Z = OBJECT_END + 0x0B, @@ -288,6 +530,18 @@ enum EGameObjectFields GAMEOBJECT_ANIMPROGRESS = OBJECT_END + 0x12, GAMEOBJECT_PADDING = OBJECT_END + 0x13, GAMEOBJECT_END = OBJECT_END + 0x14, +#else + GAMEOBJECT_TIMESTAMP = OBJECT_END + 0x09, + GAMEOBJECT_POS_X = OBJECT_END + 0x0A, + GAMEOBJECT_POS_Y = OBJECT_END + 0x0B, + GAMEOBJECT_POS_Z = OBJECT_END + 0x0C, + GAMEOBJECT_FACING = OBJECT_END + 0x0D, + GAMEOBJECT_DYN_FLAGS = OBJECT_END + 0x0E, + GAMEOBJECT_FACTION = OBJECT_END + 0x0F, + GAMEOBJECT_TYPE_ID = OBJECT_END + 0x10, + GAMEOBJECT_LEVEL = OBJECT_END + 0x11, + GAMEOBJECT_END = OBJECT_END + 0x12, +#endif }; enum EDynamicObjectFields diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 28600967e..505bf065b 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -634,6 +634,7 @@ enum SpellCastResult SPELL_FAILED_BAD_TARGETS = 0x0A, // Invalid target SPELL_FAILED_CANT_BE_CHARMED = 0x0B, // Target can't be charmed SPELL_FAILED_CANT_BE_DISENCHANTED = 0x0C, // Item cannot be disenchanted +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 SPELL_FAILED_CANT_BE_PROSPECTED = 0x0D, // There are no gems in this SPELL_FAILED_CANT_CAST_ON_TAPPED = 0x0E, // Target is tapped SPELL_FAILED_CANT_DUEL_WHILE_INVISIBLE = 0x0F, // You can't start a duel while invisible @@ -767,6 +768,136 @@ enum SpellCastResult SPELL_FAILED_REPUTATION = 0x8F, // Your reputation isn't high enough SPELL_FAILED_MIN_SKILL = 0x90, // Your skill is not high enough. Requires %s (%d). SPELL_FAILED_UNKNOWN = 0x91, // Generic out of bounds response: Unknown reason +#else + SPELL_FAILED_CANT_CAST_ON_TAPPED = 0x0D, // Target is tapped + SPELL_FAILED_CANT_DUEL_WHILE_INVISIBLE = 0x0E, // You can't start a duel while invisible + SPELL_FAILED_CANT_DUEL_WHILE_STEALTHED = 0x0F, // You can't start a duel while stealthed + SPELL_FAILED_CANT_STEALTH = 0x10, // You are too close to enemies + SPELL_FAILED_CASTER_AURASTATE = 0x11, // You can't do that yet + SPELL_FAILED_CASTER_DEAD = 0x12, // You are dead + SPELL_FAILED_CHARMED = 0x13, // Can't do that while charmed + SPELL_FAILED_CHEST_IN_USE = 0x14, // That is already being used + SPELL_FAILED_CONFUSED = 0x15, // Can't do that while confused + SPELL_FAILED_DONT_REPORT = 0x16, // Message is hidden/unused + SPELL_FAILED_EQUIPPED_ITEM = 0x17, // Must have the proper item equipped + SPELL_FAILED_EQUIPPED_ITEM_CLASS = 0x18, // Must have a %s equipped + SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND = 0x19, // Must have a %s equipped in the main hand + SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND = 0x1A, // Must have a %s equipped in the offhand + SPELL_FAILED_ERROR = 0x1B, // Internal error + SPELL_FAILED_FIZZLE = 0x1C, // Fizzled + SPELL_FAILED_FLEEING = 0x1D, // Can't do that while fleeing + SPELL_FAILED_FOOD_LOWLEVEL = 0x1E, // That food's level is not high enough for your pet + SPELL_FAILED_HIGHLEVEL = 0x1F, // Target is too high level + SPELL_FAILED_HUNGER_SATIATED = 0x20, // Message is hidden/unused + SPELL_FAILED_IMMUNE = 0x21, // Immune + SPELL_FAILED_INTERRUPTED = 0x22, // Interrupted + SPELL_FAILED_INTERRUPTED_COMBAT = 0x23, // Interrupted + SPELL_FAILED_ITEM_ALREADY_ENCHANTED = 0x24, // Item is already enchanted + SPELL_FAILED_ITEM_GONE = 0x25, // Item is gone + SPELL_FAILED_ITEM_NOT_FOUND = 0x26, // Tried to enchant an item that didn't exist + SPELL_FAILED_ITEM_NOT_READY = 0x27, // Item is not ready yet. + SPELL_FAILED_LEVEL_REQUIREMENT = 0x28, // You are not high enough level + SPELL_FAILED_LINE_OF_SIGHT = 0x29, // Target not in line of sight + SPELL_FAILED_LOWLEVEL = 0x2A, // Target is too low level + SPELL_FAILED_LOW_CASTLEVEL = 0x2B, // Skill not high enough + SPELL_FAILED_MAINHAND_EMPTY = 0x2C, // Your weapon hand is empty + SPELL_FAILED_MOVING = 0x2D, // Can't do that while moving + SPELL_FAILED_NEED_AMMO = 0x2E, // Ammo needs to be in the paper doll ammo slot before it can be fired + SPELL_FAILED_NEED_AMMO_POUCH = 0x2F, // Requires: %s + SPELL_FAILED_NEED_EXOTIC_AMMO = 0x30, // Requires exotic ammo: %s + SPELL_FAILED_NOPATH = 0x31, // No path available + SPELL_FAILED_NOT_BEHIND = 0x32, // You must be behind your target + SPELL_FAILED_NOT_FISHABLE = 0x33, // Your cast didn't land in fishable water + SPELL_FAILED_NOT_HERE = 0x34, // You can't use that here + SPELL_FAILED_NOT_INFRONT = 0x35, // You must be in front of your target + SPELL_FAILED_NOT_IN_CONTROL = 0x36, // You are not in control of your actions + SPELL_FAILED_NOT_KNOWN = 0x37, // Spell not learned + SPELL_FAILED_NOT_MOUNTED = 0x38, // You are mounted + SPELL_FAILED_NOT_ON_TAXI = 0x39, // You are in flight + SPELL_FAILED_NOT_ON_TRANSPORT = 0x3A, // You are on a transport + SPELL_FAILED_NOT_READY = 0x3B, // Spell is not ready yet. + SPELL_FAILED_NOT_SHAPESHIFT = 0x3C, // You are in shapeshift form + SPELL_FAILED_NOT_STANDING = 0x3D, // You must be standing to do that + SPELL_FAILED_NOT_TRADEABLE = 0x3E, // You can only use this on an object you own + SPELL_FAILED_NOT_TRADING = 0x3F, // Tried to enchant a trade item, but not trading + SPELL_FAILED_NOT_UNSHEATHED = 0x40, // You have to be unsheathed to do that! + SPELL_FAILED_NOT_WHILE_GHOST = 0x41, // Can't cast as ghost + SPELL_FAILED_NO_AMMO = 0x42, // Out of ammo + SPELL_FAILED_NO_CHARGES_REMAIN = 0x43, // No charges remain + SPELL_FAILED_NO_CHAMPION = 0x44, // You haven't selected a champion + SPELL_FAILED_NO_COMBO_POINTS = 0x45, // That ability requires combo points + SPELL_FAILED_NO_DUELING = 0x46, // Dueling isn't allowed here + SPELL_FAILED_NO_ENDURANCE = 0x47, // Not enough endurance + SPELL_FAILED_NO_FISH = 0x48, // There aren't any fish here + SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED = 0x49, // Can't use items while shapeshifted + SPELL_FAILED_NO_MOUNTS_ALLOWED = 0x4A, // You can't mount here + SPELL_FAILED_NO_PET = 0x4B, // You do not have a pet + SPELL_FAILED_NO_POWER = 0x4C, // Dynamic pre-defined messages, no args: Not enough mana, Not enough rage, etc + SPELL_FAILED_NOTHING_TO_DISPEL = 0x4D, // Nothing to dispel + SPELL_FAILED_ONLY_ABOVEWATER = 0x4E, // Cannot use while swimming + SPELL_FAILED_ONLY_DAYTIME = 0x4F, // Can only use during the day + SPELL_FAILED_ONLY_INDOORS = 0x50, // Can only use indoors + SPELL_FAILED_ONLY_MOUNTED = 0x51, // Can only use while mounted + SPELL_FAILED_ONLY_NIGHTTIME = 0x52, // Can only use during the night + SPELL_FAILED_ONLY_OUTDOORS = 0x53, // Can only use outside + SPELL_FAILED_ONLY_SHAPESHIFT = 0x54, // Must be in %s + SPELL_FAILED_ONLY_STEALTHED = 0x55, // You must be in stealth mode + SPELL_FAILED_ONLY_UNDERWATER = 0x56, // Can only use while swimming + SPELL_FAILED_OUT_OF_RANGE = 0x57, // Out of range. + SPELL_FAILED_PACIFIED = 0x58, // Can't use that ability while pacified + SPELL_FAILED_POSSESSED = 0x59, // You are possessed + // SPELL_FAILED_REAGENTS = 0x5A, // Message is hidden/unused, supposedly implemented client-side only + SPELL_FAILED_REQUIRES_AREA = 0x5B, // You need to be in %s + SPELL_FAILED_REQUIRES_SPELL_FOCUS = 0x5C, // Requires %s + SPELL_FAILED_ROOTED = 0x5D, // You are unable to move + SPELL_FAILED_SILENCED = 0x5E, // Can't do that while silenced + SPELL_FAILED_SPELL_IN_PROGRESS = 0x5F, // Another action is in progress + SPELL_FAILED_SPELL_LEARNED = 0x60, // You have already learned the spell + SPELL_FAILED_SPELL_UNAVAILABLE = 0x61, // The spell is not available to you + SPELL_FAILED_STUNNED = 0x62, // Can't do that while stunned + SPELL_FAILED_TARGETS_DEAD = 0x63, // Your target is dead + SPELL_FAILED_TARGET_AFFECTING_COMBAT = 0x64, // Target is in combat + SPELL_FAILED_TARGET_AURASTATE = 0x65, // You can't do that yet + SPELL_FAILED_TARGET_DUELING = 0x66, // Target is currently dueling + SPELL_FAILED_TARGET_ENEMY = 0x67, // Target is hostile + SPELL_FAILED_TARGET_ENRAGED = 0x68, // Target is too enraged to be charmed + SPELL_FAILED_TARGET_FRIENDLY = 0x69, // Target is friendly + SPELL_FAILED_TARGET_IN_COMBAT = 0x6A, // The target can't be in combat + SPELL_FAILED_TARGET_IS_PLAYER = 0x6B, // Can't target players + SPELL_FAILED_TARGET_NOT_DEAD = 0x6C, // Target is alive + SPELL_FAILED_TARGET_NOT_IN_PARTY = 0x6D, // Target is not in your party + SPELL_FAILED_TARGET_NOT_LOOTED = 0x6E, // Creature must be looted first + SPELL_FAILED_TARGET_NOT_PLAYER = 0x6F, // Target is not a player + SPELL_FAILED_TARGET_NO_POCKETS = 0x70, // No pockets to pick + SPELL_FAILED_TARGET_NO_WEAPONS = 0x71, // Target has no weapons equipped + SPELL_FAILED_TARGET_UNSKINNABLE = 0x72, // Creature is not skinnable + SPELL_FAILED_THIRST_SATIATED = 0x73, // Message is hidden/unused + SPELL_FAILED_TOO_CLOSE = 0x74, // Target too close + SPELL_FAILED_TOO_MANY_OF_ITEM = 0x75, // You have too many of that item already + // SPELL_FAILED_TOTEMS = 0x76, // Message is hidden/unused, supposedly implemented client-side only + SPELL_FAILED_TRAINING_POINTS = 0x77, // Not enough training points + SPELL_FAILED_TRY_AGAIN = 0x78, // Failed attempt + SPELL_FAILED_UNIT_NOT_BEHIND = 0x79, // Target needs to be behind you + SPELL_FAILED_UNIT_NOT_INFRONT = 0x7A, // Target needs to be in front of you + SPELL_FAILED_WRONG_PET_FOOD = 0x7B, // Your pet doesn't like that food + SPELL_FAILED_NOT_WHILE_FATIGUED = 0x7C, // Can't cast while fatigued + SPELL_FAILED_TARGET_NOT_IN_INSTANCE = 0x7D, // Target must be in this instance + SPELL_FAILED_NOT_WHILE_TRADING = 0x7E, // Can't cast while trading + SPELL_FAILED_TARGET_NOT_IN_RAID = 0x7F, // Target is not in your party or raid group + SPELL_FAILED_DISENCHANT_WHILE_LOOTING = 0x80, // Cannot disenchant while looting + SPELL_FAILED_TARGET_FREEFORALL = 0x81, // Target is currently in free-for-all PvP combat + SPELL_FAILED_NO_EDIBLE_CORPSES = 0x82, // There are no nearby corpses to eat + SPELL_FAILED_ONLY_BATTLEGROUNDS = 0x83, // Can only use in battlegrounds + SPELL_FAILED_TARGET_NOT_GHOST = 0x84, // Target is not a ghost + SPELL_FAILED_TOO_MANY_SKILLS = 0x85, // Your pet can't learn any more skills + SPELL_FAILED_TRANSFORM_UNUSABLE = 0x86, // You can't use the new item + SPELL_FAILED_WRONG_WEATHER = 0x87, // The weather isn't right for that + SPELL_FAILED_DAMAGE_IMMUNE = 0x88, // You can't do that while you are immune + SPELL_FAILED_PREVENTED_BY_MECHANIC = 0x89, // Can't do that while %s + SPELL_FAILED_PLAY_TIME = 0x8A, // Maximum play time exceeded + SPELL_FAILED_REPUTATION = 0x8B, // Your reputation isn't high enough + SPELL_FAILED_UNKNOWN = 0x8C, // Generic out of bounds response: Unknown reason +#endif SPELL_CAST_OK = 0xFF // custom value, don't must be send to client }; @@ -2451,11 +2582,13 @@ enum TradeStatus TRADE_STATUS_ONLY_CONJURED = 22 // You can only trade conjured items... (cross realm BG related). }; -// we need to stick to 1 version or half of the stuff will work for someone -// others will not and opposite -// will only support 1.12.1 client (build 5875) and 1.12.2 client (build 6005) and 1.12.3 client (build 6141) .. - -#define EXPECTED_MANGOSD_CLIENT_BUILD { 5875, 6005, 6141, 0} +// This defines which client builds the world server will accept. +// Change the supported client build in Common.h before compiling. +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 + #define EXPECTED_MANGOSD_CLIENT_BUILD { 5875, 6005, 6141, 0} +#else + #define EXPECTED_MANGOSD_CLIENT_BUILD { 5464, 0} +#endif // TrinityCore #define MAKE_NEW_GUID(l, e, h) uint64(uint64(l) | (uint64(e) << 24) | (uint64(h) << 48)) diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index f6cedeae3..7d5d8f579 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -8181,7 +8181,11 @@ void Spell::TriggerGlobalCooldown() if (gcd >= 1000 && gcd <= 1500) { // apply haste rating +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 gcd = int32(float(gcd) * m_caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); +#else + gcd = int32(float(gcd) * (1.0f + m_caster->GetInt32Value(UNIT_MOD_CAST_SPEED)/100.0f)); +#endif if (gcd < 1000) gcd = 1000; diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index 27fb025ad..62e3005ec 100644 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -3462,10 +3462,10 @@ void Aura::HandleModStealth(bool apply, bool Real) if (Real) { target->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAGS_CREEP); - +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 if (target->GetTypeId() == TYPEID_PLAYER) target->SetByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_STEALTH); - +#endif // apply only if not in GM invisibility (and overwrite invisibility state) if (target->GetVisibility() != VISIBILITY_OFF) { @@ -3493,10 +3493,10 @@ void Aura::HandleModStealth(bool apply, bool Real) if (target->GetVisibility() != VISIBILITY_OFF) { target->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAGS_CREEP); - +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 if (target->GetTypeId() == TYPEID_PLAYER) target->RemoveByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_STEALTH); - +#endif // restore invisibility if any if (target->HasAuraType(SPELL_AURA_MOD_INVISIBILITY)) { @@ -3521,8 +3521,10 @@ void Aura::HandleInvisibility(bool apply, bool Real) if (Real && target->GetTypeId() == TYPEID_PLAYER) { +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 // apply glow vision target->SetByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW); +#endif } @@ -3545,10 +3547,11 @@ void Aura::HandleInvisibility(bool apply, bool Real) // only at real aura remove and if not have different invisibility auras. if (Real && target->m_invisibilityMask == 0) { +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 // remove glow vision if (target->GetTypeId() == TYPEID_PLAYER) target->RemoveByteFlag(PLAYER_FIELD_BYTES2, 1, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW); - +#endif // apply only if not in GM invisibility & not stealthed while invisible if (target->GetVisibility() != VISIBILITY_OFF) { diff --git a/src/game/Spells/SpellMgr.cpp b/src/game/Spells/SpellMgr.cpp index f932af3b8..a83f7dcb2 100644 --- a/src/game/Spells/SpellMgr.cpp +++ b/src/game/Spells/SpellMgr.cpp @@ -122,7 +122,11 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell* spell) modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell); if (!(spellInfo->Attributes & (SPELL_ATTR_IS_ABILITY | SPELL_ATTR_TRADESPELL))) +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 castTime = int32(castTime * spell->GetCaster()->GetFloatValue(UNIT_MOD_CAST_SPEED)); +#else + castTime = int32(castTime * (1.0f + spell->GetCaster()->GetInt32Value(UNIT_MOD_CAST_SPEED)/100.0f)); +#endif else { if (spell->IsRangedSpell() && !spell->IsAutoRepeat()) diff --git a/src/game/World.cpp b/src/game/World.cpp index 1b4d021f0..1e0bc431d 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -422,8 +422,18 @@ void World::LoadConfigSettings(bool reload) } } + // Set the available content patch. m_wowPatch = sConfig.GetIntDefault("WowPatch", WOW_PATCH_102); +#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 + WowPatch const maxPatch = WOW_PATCH_112; +#else + WowPatch const maxPatch = WOW_PATCH_111; +#endif + + if (m_wowPatch > maxPatch) + m_wowPatch = maxPatch; + ///- Read the player limit and the Message of the day from the config file SetPlayerLimit(sConfig.GetIntDefault("PlayerLimit", DEFAULT_PLAYER_LIMIT), true); SetMotd(sConfig.GetStringDefault("Motd", "Welcome to the Massive Network Game Object Server.") + std::string("\n") + std::string(GetPatchName()) + std::string(" is now live!")); @@ -719,8 +729,18 @@ void World::LoadConfigSettings(bool reload) setConfig(CONFIG_UINT32_TIMERBAR_FIRE_MAX, "TimerBar.Fire.Max", 1); setConfig(CONFIG_BOOL_PET_UNSUMMON_AT_MOUNT, "PetUnsummonAtMount", false); - setConfig(CONFIG_BOOL_OUTDOORPVP_EP_ENABLE, "OutdoorPvP.EP.Enable", true); - setConfig(CONFIG_BOOL_OUTDOORPVP_SI_ENABLE, "OutdoorPvP.SI.Enable", true); + + if (GetWowPatch() >= WOW_PATCH_112) + { + setConfig(CONFIG_BOOL_OUTDOORPVP_EP_ENABLE, "OutdoorPvP.EP.Enable", true); + setConfig(CONFIG_BOOL_OUTDOORPVP_SI_ENABLE, "OutdoorPvP.SI.Enable", true); + } + else + { + setConfig(CONFIG_BOOL_OUTDOORPVP_EP_ENABLE, false); + setConfig(CONFIG_BOOL_OUTDOORPVP_SI_ENABLE, false); + } + setConfig(CONFIG_UINT32_ANTIFLOOD_SANCTION, "Antiflood.Sanction", CHEAT_ACTION_KICK); m_relocation_ai_notify_delay = sConfig.GetIntDefault("Visibility.AIRelocationNotifyDelay", 1000u); @@ -1645,6 +1665,7 @@ void World::SetInitialWorldSettings() sLog.outString(); sLog.outString("=========================================================="); sLog.outString("Current content is set to %s.", GetPatchName()); + sLog.outString("Supported client build is set to %u.", SUPPORTED_CLIENT_BUILD); sLog.outString("=========================================================="); sLog.outString(); diff --git a/src/realmd/AuthSocket.cpp b/src/realmd/AuthSocket.cpp index b48874714..c6a472a6b 100644 --- a/src/realmd/AuthSocket.cpp +++ b/src/realmd/AuthSocket.cpp @@ -303,6 +303,7 @@ void AuthSocket::SendProof(Sha1Hash sha) { switch(_build) { + case 5464: // 1.11.2 case 5875: // 1.12.1 case 6005: // 1.12.2 case 6141: // 1.12.3 @@ -1077,6 +1078,7 @@ void AuthSocket::LoadRealmlist(ByteBuffer &pkt) { switch(_build) { + case 5464: // 1.11.2 case 5875: // 1.12.1 case 6005: // 1.12.2 case 6141: // 1.12.3 diff --git a/src/realmd/RealmList.cpp b/src/realmd/RealmList.cpp index ee725abbf..9cf9a0358 100644 --- a/src/realmd/RealmList.cpp +++ b/src/realmd/RealmList.cpp @@ -34,7 +34,7 @@ INSTANTIATE_SINGLETON_1( RealmList ); extern DatabaseType LoginDatabase; -// will only support WoW 1.12.1/1.12.2/1.12.3 , WoW:TBC 2.4.3 and official release for WoW:WotLK and later, client builds 10505, 8606, 6141, 6005, 5875 +// will only support WoW 1.11.2/1.12.1/1.12.2/1.12.3 , WoW:TBC 2.4.3 and official release for WoW:WotLK and later, client builds 10505, 8606, 6141, 6005, 5875 // if you need more from old build then add it in cases in realmd sources code // list sorted from high to low build and first build used as low bound for accepted by default range (any > it will accepted by realmd at least) @@ -48,6 +48,7 @@ static RealmBuildInfo ExpectedRealmdClientBuilds[] = { {6141, 1, 12, 3, ' '}, {6005, 1, 12, 2, ' '}, {5875, 1, 12, 1, ' '}, + {5464, 1, 11, 2, ' '}, {0, 0, 0, 0, ' '} // terminator }; diff --git a/src/scripts/eastern_kingdoms/stormwind_city/quest_stormwind_rendezvous.cpp b/src/scripts/eastern_kingdoms/stormwind_city/quest_stormwind_rendezvous.cpp index cd8d5d4cd..4c70380d9 100644 --- a/src/scripts/eastern_kingdoms/stormwind_city/quest_stormwind_rendezvous.cpp +++ b/src/scripts/eastern_kingdoms/stormwind_city/quest_stormwind_rendezvous.cpp @@ -971,6 +971,57 @@ CreatureAI* GetAI_npc_squire_rowe(Creature* pCreature) return new npc_squire_roweAI(pCreature); } +static time_t globalWindsorLastSpawnTime = time_t(0); + +bool AreaTrigger_at_stormwind_gates(Player* pPlayer, AreaTriggerEntry const* /*pAt*/) +{ + // Before patch 1.12, Windsor was spawned from the AreaTrigger at the Stormwind gates. + // Squire Rowe was added in patch 1.12, confirmed by both Allakhazam and Thottbot comments. + // His creature Id is also in the 1.12 range, and his display Id doesn't exist in prior clients. + if (sWorld.GetWowPatch() >= WOW_PATCH_112) + return false; + + // If player is dead, GM mode is ON, quest complete or no quest. + if (!pPlayer || !pPlayer->isAlive() || pPlayer->isGameMaster() || !pPlayer->IsCurrentQuest(QUEST_STORMWIND_RENDEZVOUS)) + return false; + + // Cooldown before Windsor can be spawned again. + if (globalWindsorLastSpawnTime + 15 * MINUTE > sWorld.GetGameTime()) + return false; + + // Check if Windsor is already spawned. + if (GetClosestCreatureWithEntry(pPlayer, NPC_REGINALD_WINDSOR, 200.0f)) + return false; + + if (Creature* pWindsor = pPlayer->SummonCreature(NPC_REGINALD_WINDSOR, + WindsorSummon.x, + WindsorSummon.y, + WindsorSummon.z, + WindsorSummon.o, TEMPSUMMON_MANUAL_DESPAWN, 1.5 * HOUR * IN_MILLISECONDS, true)) + { + auto pWindsorAI = static_cast(pWindsor->AI()); + + if (pWindsorAI) + { + pWindsorAI->playerGUID = pPlayer->GetGUID(); + pWindsorAI->m_squireRoweGuid = ObjectGuid(); + } + + pWindsor->Mount(MOUNT_WINDSOR); + pWindsor->SetWalk(false); + pWindsor->SetSpeedRate(MOVE_RUN, 1.0f, true); + pWindsor->GetMotionMaster()->MovePoint(0, WindsorDeplacement[0].x, WindsorDeplacement[0].y, WindsorDeplacement[0].z, MOVE_PATHFINDING); + pWindsor->SetRespawnDelay(100000000); + pWindsor->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + + globalWindsorLastSpawnTime = sWorld.GetGameTime(); + + return true; + } + + return false; +} + void AddSC_quest_stormwind_rendezvous() { Script *pNewScript; @@ -989,4 +1040,9 @@ void AddSC_quest_stormwind_rendezvous() pNewScript->pGossipHello = &GossipHello_npc_reginald_windsor; pNewScript->pGossipSelect = &GossipSelect_npc_reginald_windsor; pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_stormwind_gates"; + pNewScript->pAreaTrigger = &AreaTrigger_at_stormwind_gates; + pNewScript->RegisterSelf(); } diff --git a/src/shared/Common.h b/src/shared/Common.h index a2fa7cca8..9c44c34d6 100644 --- a/src/shared/Common.h +++ b/src/shared/Common.h @@ -163,6 +163,12 @@ inline float finiteAlways(float f) { return finite(f) ? f : 0.0f; } #define PAIR32_HIPART(x) (uint16)((uint32(x) >> 16) & 0x0000FFFF) #define PAIR32_LOPART(x) (uint16)(uint32(x) & 0x0000FFFF) +// Game client builds +#define CLIENT_BUILD_1_11_2 5464 +#define CLIENT_BUILD_1_12_1 5875 +// Change this to define which version players can use +#define SUPPORTED_CLIENT_BUILD CLIENT_BUILD_1_12_1 + enum TimeConstants { MINUTE = 60,