diff --git a/sql/migrations/20171005011618_world.sql b/sql/migrations/20171005011618_world.sql new file mode 100644 index 000000000..f6c0c2da1 --- /dev/null +++ b/sql/migrations/20171005011618_world.sql @@ -0,0 +1,89 @@ +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`='20171005011618'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20171005011618'); +-- Add your query below. + +-- Add gossip for Selina Dourman. +DELETE FROM `npc_gossip` WHERE `npc_guid`=56499; +DELETE FROM `gossip_menu` WHERE `entry` IN (6582, 6577, 6578, 6579, 6581, 7093, 7095, 8848); +INSERT INTO `gossip_menu` VALUES (6582, 7792, 0); +INSERT INTO `gossip_menu` VALUES (6577, 7793, 0); +INSERT INTO `gossip_menu` VALUES (6578, 7794, 0); +INSERT INTO `gossip_menu` VALUES (6579, 7795, 0); +INSERT INTO `gossip_menu` VALUES (6581, 7799, 0); +INSERT INTO `gossip_menu` VALUES (7093, 8347, 0); +INSERT INTO `gossip_menu` VALUES (7095, 8349, 0); +INSERT INTO `gossip_menu` VALUES (8848, 11472, 0); +REPLACE INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `lang0`, `prob0`, `em0_0`, `em0_1`, `em0_2`, `em0_3`, `em0_4`, `em0_5`, `text1_0`, `text1_1`, `lang1`, `prob1`, `em1_0`, `em1_1`, `em1_2`, `em1_3`, `em1_4`, `em1_5`, `text2_0`, `text2_1`, `lang2`, `prob2`, `em2_0`, `em2_1`, `em2_2`, `em2_3`, `em2_4`, `em2_5`, `text3_0`, `text3_1`, `lang3`, `prob3`, `em3_0`, `em3_1`, `em3_2`, `em3_3`, `em3_4`, `em3_5`, `text4_0`, `text4_1`, `lang4`, `prob4`, `em4_0`, `em4_1`, `em4_2`, `em4_3`, `em4_4`, `em4_5`, `text5_0`, `text5_1`, `lang5`, `prob5`, `em5_0`, `em5_1`, `em5_2`, `em5_3`, `em5_4`, `em5_5`, `text6_0`, `text6_1`, `lang6`, `prob6`, `em6_0`, `em6_1`, `em6_2`, `em6_3`, `em6_4`, `em6_5`, `text7_0`, `text7_1`, `lang7`, `prob7`, `em7_0`, `em7_1`, `em7_2`, `em7_3`, `em7_4`, `em7_5`) VALUES (11472, '', 'There are eight types of Darkmoon Cards; Beasts, Blessings, Elementals, Furies, Lunacy, Portals, Storms and Warlords, with eight cards, Ace to Eight in each suit. If you collect all eight of one suit then you can turn them into a deck that you can give to our Professor Thaddeus Paleo in exchange for a powerful trinket.$B', 0, 1, 0, 1, 0, 1, 0, 1, '', '', 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, 0, 0, 0, 0, 0, 0); +REPLACE INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `lang0`, `prob0`, `em0_0`, `em0_1`, `em0_2`, `em0_3`, `em0_4`, `em0_5`, `text1_0`, `text1_1`, `lang1`, `prob1`, `em1_0`, `em1_1`, `em1_2`, `em1_3`, `em1_4`, `em1_5`, `text2_0`, `text2_1`, `lang2`, `prob2`, `em2_0`, `em2_1`, `em2_2`, `em2_3`, `em2_4`, `em2_5`, `text3_0`, `text3_1`, `lang3`, `prob3`, `em3_0`, `em3_1`, `em3_2`, `em3_3`, `em3_4`, `em3_5`, `text4_0`, `text4_1`, `lang4`, `prob4`, `em4_0`, `em4_1`, `em4_2`, `em4_3`, `em4_4`, `em4_5`, `text5_0`, `text5_1`, `lang5`, `prob5`, `em5_0`, `em5_1`, `em5_2`, `em5_3`, `em5_4`, `em5_5`, `text6_0`, `text6_1`, `lang6`, `prob6`, `em6_0`, `em6_1`, `em6_2`, `em6_3`, `em6_4`, `em6_5`, `text7_0`, `text7_1`, `lang7`, `prob7`, `em7_0`, `em7_1`, `em7_2`, `em7_3`, `em7_4`, `em7_5`) VALUES (8349, '', 'The Blastenheimer 5000 Ultra Cannon is a state-of-the-art single person projectile device. Delivering its payload at near the speed of a dragon, the cannon is the pride and joy of the Blastenheimer family, world renown for their aeronautical and combustible feats!$B$BIf you\'d like to be launched through the skies to fly free as a bird, seek out Maxima Blastenheimer on the south edge of Thunder Bluff\'s central rise. She\'ll aim you at the target far to south on Stonebull Lake!', 0, 1, 0, 1, 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, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0); +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (6582, 6579, 6581); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `condition_id`) VALUES (6582, 0, 0, 'What can I purchase?', 1, 1, 6577, 0, 0, 0, 0, '', 0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `condition_id`) VALUES (6582, 1, 0, 'What are Darkmoon Faire Prize Tickets and how do I get them?', 1, 1, 6578, 0, 0, 0, 0, '', 0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `condition_id`) VALUES (6582, 2, 0, 'What are Darkmoon Cards?', 1, 1, 6579, 0, 0, 0, 0, '', 0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `condition_id`) VALUES (6582, 3, 0, 'What other things can I do at the faire?', 1, 1, 6581, 0, 0, 0, 0, '', 0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `condition_id`) VALUES (6579, 0, 0, '', 1, 1, 8848, 0, 0, 0, 0, '', 0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `condition_id`) VALUES (6581, 0, 0, 'What are these Tonk Control Consoles?', 1, 1, 7093, 0, 0, 0, 0, '', 0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `condition_id`) VALUES (6581, 1, 0, 'Tell me about the cannon.', 1, 1, 7095, 0, 0, 0, 0, '', 0); +UPDATE `creature_template` SET `gossip_menu_id`=6582 WHERE `entry`=10445; + +-- Steam Tonk controller and schematic. +DELETE FROM `item_template` WHERE `entry` IN (22728, 22729); +REPLACE 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 (22728, 9, 7, 3, 'Steam Tonk Controller', 35133, 1, 64, 1, 20000, 5000, 0, 32767, -1, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 24935, 0, -50, -50, 30000, 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, -1, 0, -1, 0, 'Take control of a Steam Tonk.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, '', 0, 0, 0, 0, 0, 0, 1); +REPLACE 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 (22729, 9, 9, 3, 'Schematic: Steam Tonk Controller', 1301, 1, 64, 1, 8000, 2000, 0, -1, -1, 55, 0, 202, 275, 0, 0, 0, 0, 0, 0, 1, 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, 28328, 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, -1, 0, -1, 0, 'Teaches you how to make a Steam Tonk Controller.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, '', 0, 0, 0, 0, 0, 0, 1); + +-- Steam Tonk related creatures. +REPLACE 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`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Civilian`, `RacialLeader`, `RegenHealth`, `equipment_id`, `trainer_id`, `vendor_id`, `MechanicImmuneMask`, `SchoolImmuneMask`, `flags_extra`, `ScriptName`) VALUES (15328, 0, 0, 0, 15381, 0, 0, 0, 'Darkmoon Steam Tonk', '', 0, 1, 1, 100, 100, 100, 100, 7, 35, 35, 0, 1, 1.14286, 1, 0, 2, 2, 0, 44, 1, 2000, 2000, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 0, 0, 1, 0, 0, 0, 8405008, 0, 64, 'npc_steam_tonk'); +REPLACE 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`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Civilian`, `RacialLeader`, `RegenHealth`, `equipment_id`, `trainer_id`, `vendor_id`, `MechanicImmuneMask`, `SchoolImmuneMask`, `flags_extra`, `ScriptName`) VALUES (15368, 0, 0, 0, 15402, 0, 0, 0, 'Tonk Mine', NULL, 0, 60, 60, 7500, 7500, 0, 0, 3750, 35, 35, 0, 1, 1.14286, 0, 0, 55, 79, 0, 272, 1, 2000, 2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 0, 0, 1, 0, 0, 0, 8405008, 0, 64, 'npc_tonk_mine'); +REPLACE 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`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Civilian`, `RacialLeader`, `RegenHealth`, `equipment_id`, `trainer_id`, `vendor_id`, `MechanicImmuneMask`, `SchoolImmuneMask`, `flags_extra`, `ScriptName`) VALUES (16121, 0, 0, 0, 15435, 0, 0, 0, 'Mortar', NULL, 0, 1, 1, 1, 1, 0, 0, 0, 1617, 1617, 0, 1, 1.14286, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 33554432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27745, 0, 0, 0, 0, 0, 0, '', 0, 4, 0, 0, 1, 0, 0, 0, 16384, 0, 64, 'npc_tonk_mortar'); +REPLACE INTO `creature_template_addon` (`entry`, `patch`, `mount`, `bytes1`, `b2_0_sheath`, `b2_1_flags`, `emote`, `moveflags`, `auras`) VALUES (15328, 0, 0, 0, 0, 5, 0, 0, '27747'); + +-- Tonk Control Console Trap. +REPLACE INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `faction`, `flags`, `size`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `mingold`, `maxgold`, `ScriptName`) VALUES (180525, 6, 1287, 'Tonk Control Console Trap', 35, 0, 1, 0, 0, 0, 24935, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195000, 180525, 0, -9578.63, -3.2352, 62.2595, 1.72431, 0, 0, 0.759247, 0.650802, 25, 0, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195001, 180525, 0, -9605.2, 31.1625, 62.1422, 0.311559, 0, 0, 0.15515, 0.987891, 25, 0, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195002, 180525, 0, -9544.44, 140.065, 58.8815, -2.04204, 0, 0, 0.85264, -0.522498, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195003, 180525, 0, -9533.17, 124.821, 58.9729, -2.9147, 0, 0, 0.993572, -0.113203, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195004, 180525, 0, -9584.94, 79.6764, 60.4523, -1.16937, 0, 0, 0.551937, -0.833886, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195005, 180525, 0, -9520.97, 91.3967, 59.3657, -2.46091, 0, 0, 0.942641, -0.333807, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195006, 180525, 0, -9546.56, 87.8324, 59.4187, -3.03687, 0, 0, 0.99863, -0.052336, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195007, 180525, 0, -9522.69, 74.1969, 59.1998, 2.46091, 0, 0, 0.942641, 0.333807, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195008, 180525, 0, -9552.22, 111.492, 58.8853, 0.261799, 0, 0, 0.130526, 0.991445, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195009, 180525, 0, -9553.61, 67.2332, 59.2847, 1.29154, 0, 0, 0.601815, 0.798636, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195010, 180525, 0, -9549.28, 28.2097, 59.4478, 2.79253, 0, 0, 0.984808, 0.173648, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195011, 180525, 0, -9533.64, 115.556, 58.9128, 2.89725, 0, 0, 0.992546, 0.121869, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195012, 180525, 0, -9574.56, 79.7395, 58.8815, 0.593412, 0, 0, 0.292372, 0.956305, 180, 100, 1, 0); +REPLACE INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `spawnFlags`) VALUES (195013, 180525, 0, -9566.92, 99.248, 58.8815, -0.925024, 0, 0, 0.446198, -0.894934, 180, 100, 1, 0); +-- Add Tonk Control Console Trap spawns to event Darkmoon Faire. +REPLACE INTO `game_event_gameobject` VALUES +(195000, 4), +(195001, 4), +(195002, 4), +(195003, 4), +(195004, 4), +(195005, 4), +(195006, 4), +(195007, 4), +(195008, 4), +(195009, 4), +(195010, 4), +(195011, 4), +(195012, 4), +(195013, 4); + +-- Spell script for the spell used by the control consoles. +DELETE FROM `spell_scripts` WHERE `id`=24935; +INSERT INTO `spell_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (24935, 0, 15, 24934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Cast Summon RC Tank'); +INSERT INTO `spell_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (24935, 2, 15, 24936, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Cast RC Tank Control'); + + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/src/game/Objects/Creature.cpp b/src/game/Objects/Creature.cpp index f30ede2ba..64ce7a935 100644 --- a/src/game/Objects/Creature.cpp +++ b/src/game/Objects/Creature.cpp @@ -164,7 +164,7 @@ bool CreatureCreatePos::Relocate(Creature* cr) const Creature::Creature(CreatureSubtype subtype) : Unit(), i_AI(nullptr), loot(this), lootForPickPocketed(false), lootForBody(false), lootForSkin(false), skinningForOthersTimer(5000), m_TargetNotReachableTimer(0), - _pacifiedTimer(0), _manaRegen(true), + _pacifiedTimer(0), _manaRegen(true), m_manaRegen(0), m_groupLootTimer(0), m_groupLootId(0), m_lootMoney(0), m_lootGroupRecipientId(0), m_corpseDecayTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(5.0f), m_combatStartTime(0), m_combatState(false), m_combatResetCount(0), m_subtype(subtype), @@ -871,12 +871,7 @@ void Creature::RegenerateMana() if (isInCombat() || GetCharmerOrOwnerGuid()) { if (!IsUnderLastManaUseEffect()) - { - float ManaIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_MANA); - float Spirit = GetStat(STAT_SPIRIT); - - addvalue = uint32((Spirit / 5.0f + 17.0f) * ManaIncreaseRate); - } + addvalue = m_manaRegen; } else addvalue = maxValue / 3; diff --git a/src/game/Objects/Creature.h b/src/game/Objects/Creature.h index f881e94a6..7f3e4db17 100644 --- a/src/game/Objects/Creature.h +++ b/src/game/Objects/Creature.h @@ -583,6 +583,7 @@ class MANGOS_DLL_SPEC Creature : public Unit void UpdateArmor() override; void UpdateMaxHealth() override; void UpdateMaxPower(Powers power) override; + void UpdateManaRegen() override; void UpdateAttackPowerAndDamage(bool ranged = false) override; void UpdateDamagePhysical(WeaponAttackType attType) override; uint32 GetCurrentEquipmentId() const { return m_equipmentId; } @@ -780,6 +781,7 @@ class MANGOS_DLL_SPEC Creature : public Unit uint32 _pacifiedTimer; void AllowManaRegen(bool v) { _manaRegen = v; } bool _manaRegen; + uint32 m_manaRegen; void RegenerateHealth(); void RegenerateMana(); diff --git a/src/game/Objects/Player.h b/src/game/Objects/Player.h index 3819e2050..1bc50535a 100644 --- a/src/game/Objects/Player.h +++ b/src/game/Objects/Player.h @@ -1537,6 +1537,7 @@ class MANGOS_DLL_SPEC Player final: public Unit void UpdateArmor(); void UpdateMaxHealth(); void UpdateMaxPower(Powers power); + void UpdateManaRegen() override; void UpdateAttackPowerAndDamage(bool ranged = false); void UpdateDamagePhysical(WeaponAttackType attType); void UpdateSpellDamageAndHealingBonus(); @@ -1558,7 +1559,6 @@ class MANGOS_DLL_SPEC Player final: public Unit void UpdateAllSpellCritChances(); void UpdateSpellCritChance(uint32 school); - void UpdateManaRegen(); ObjectGuid const& GetLootGuid() const { return m_lootGuid; } void SetLootGuid(ObjectGuid const& guid) { m_lootGuid = guid; } diff --git a/src/game/Objects/Unit.h b/src/game/Objects/Unit.h index 8d4770e7f..e3c7ff099 100644 --- a/src/game/Objects/Unit.h +++ b/src/game/Objects/Unit.h @@ -1552,6 +1552,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject virtual void UpdateArmor() = 0; virtual void UpdateMaxHealth() = 0; virtual void UpdateMaxPower(Powers power) = 0; + virtual void UpdateManaRegen() = 0; virtual void UpdateAttackPowerAndDamage(bool ranged = false) = 0; virtual void UpdateDamagePhysical(WeaponAttackType attType) = 0; float GetTotalAttackPowerValue(WeaponAttackType attType) const; diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index a8c5d8a58..566e217b2 100644 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -1218,10 +1218,28 @@ void Aura::TriggerSpell() // case 27601: break; // // Five Fat Finger Exploding Heart Technique // case 27673: break; -// // Nitrous Boost -// case 27746: break; -// // Steam Tank Passive -// case 27747: break; + // Nitrous Boost + case 27746: + { + if (target->GetPower(POWER_MANA) >= 10) + { + target->ModifyPower(POWER_MANA, -10); + target->SendEnergizeSpellLog(target, 27746, -10, POWER_MANA); + } + else + target->RemoveAurasDueToSpell(27746); + return; + } + // Steam Tank Passive + case 27747: + { + uint32 tonkmana = target->GetPower(POWER_MANA); + if (tonkmana < 100) + { + target->ModifyPower(POWER_MANA, tonkmana > 90 ? (100 - tonkmana) : 10); + } + return; + } case 27808: // Frost Blast { int32 bpDamage = triggerTarget->GetMaxHealth() * 26 / 100; @@ -1448,6 +1466,30 @@ void Aura::TriggerSpell() caster->ProcDamageAndSpell(target, (PROC_FLAG_ON_TRAP_ACTIVATION | PROC_FLAG_SUCCESSFUL_AOE), PROC_FLAG_NONE, PROC_EX_NORMAL_HIT, 1, BASE_ATTACK, GetSpellProto()); return; } + // Activate MG Turret + case 25026: + { + if (target->GetPower(POWER_MANA) >= 10) + { + target->ModifyPower(POWER_MANA, -10); + target->SendEnergizeSpellLog(target, 25026, -10, POWER_MANA); + } + else + target->RemoveAurasDueToSpell(25026); + break; + } + // Flamethrower + case 25027: + { + if (target->GetPower(POWER_MANA) >= 10) + { + target->ModifyPower(POWER_MANA, -10); + target->SendEnergizeSpellLog(target, 25027, -10, POWER_MANA); + } + else + target->RemoveAurasDueToSpell(25027); + break;; + } } } @@ -2674,6 +2716,13 @@ void Aura::HandleModPossess(bool apply, bool Real) return; caster->ModPossess(target, apply, m_removeMode); target->AddThreat(caster,target->GetHealth(), false, GetSpellSchoolMask(GetSpellProto())); + + if (!apply && GetId() == 24937) // Controlling Steam Tonk + { + target->CastSpell(target, 27771, true); // Cast Damaged Tonk + caster->CastSpell(caster, 9179, true); // Cast 3 sec Stun on self + caster->RemoveAurasDueToSpell(24935); // Unroot player + } } void Unit::ModPossess(Unit* target, bool apply, AuraRemoveMode m_removeMode) @@ -4241,8 +4290,8 @@ void Aura::HandleModPowerRegen(bool apply, bool Real) // drinking m_periodicTimer = 5000; - if (GetTarget()->GetTypeId() == TYPEID_PLAYER && m_modifier.m_miscvalue == POWER_MANA) - ((Player*)GetTarget())->UpdateManaRegen(); + if (m_modifier.m_miscvalue == POWER_MANA) + (GetTarget())->UpdateManaRegen(); m_isPeriodic = apply; } @@ -4253,12 +4302,9 @@ void Aura::HandleModPowerRegenPCT(bool /*apply*/, bool Real) if (!Real) return; - if (GetTarget()->GetTypeId() != TYPEID_PLAYER) - return; - // Update manaregen value if (m_modifier.m_miscvalue == POWER_MANA) - ((Player*)GetTarget())->UpdateManaRegen(); + (GetTarget())->UpdateManaRegen(); } void Aura::HandleAuraModIncreaseHealth(bool apply, bool Real) diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index c4c3c8f55..54f08c4ff 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -373,6 +373,11 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx) damage *= 0.25; break; } + case 24933: // Cannon (Darkmoon Steam Tonk) + { + m_caster->CastSpell(unitTarget, 27766, true); + break; + } } break; } @@ -4427,6 +4432,32 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) unitTarget->CastSpell(unitTarget, roll_chance_i(50) ? 24714 : 24715, true); return; } + case 24936: // RC Tank Control + { + if (Creature* pTonk = m_caster->FindNearestCreature(15328, 5, true)) + { + pTonk->SetWalk(false); + pTonk->m_spells[0] = 24933; + pTonk->m_spells[1] = 25003; + pTonk->m_spells[2] = 27746; + switch (urand(0, 3)) + { + case 0: + pTonk->m_spells[3] = 25026; + break; + case 1: + pTonk->m_spells[3] = 25027; + break; + case 2: + pTonk->m_spells[3] = 27759; + break; + case 3: + pTonk->m_spells[3] = 25024; + break; + } + m_caster->CastSpell(pTonk, 24937, true); + } + } case 26004: // Mistletoe { if (!unitTarget) diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 17f00ad5b..cc12d4fe5 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -26,6 +26,7 @@ #include "SharedDefines.h" #include "SpellAuras.h" #include "ObjectMgr.h" +#include "World.h" /*####################################### ######## ######## @@ -692,6 +693,9 @@ bool Creature::UpdateAllStats() for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i) UpdateResistances(i); + if (GetMaxPower(POWER_MANA)) + UpdateManaRegen(); + return true; } @@ -726,6 +730,18 @@ void Creature::UpdateMaxPower(Powers power) SetMaxPower(power, uint32(value)); } +void Creature::UpdateManaRegen() +{ + float ManaIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_MANA); + float Spirit = GetStat(STAT_SPIRIT); + // Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen + float power_regen = GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA); + // Mana regen from SPELL_AURA_MOD_POWER_REGEN aura + float power_regen_mp5 = GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) / 5.0f; + + m_manaRegen = uint32(((Spirit / 5.0f + 17.0f) * power_regen + power_regen_mp5) * ManaIncreaseRate); +} + void Creature::UpdateAttackPowerAndDamage(bool ranged) { UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER; diff --git a/src/scripts/world/npcs_special.cpp b/src/scripts/world/npcs_special.cpp index b74d45e53..f0250f548 100644 --- a/src/scripts/world/npcs_special.cpp +++ b/src/scripts/world/npcs_special.cpp @@ -878,6 +878,142 @@ CreatureAI* GetAI_npc_guardian(Creature* pCreature) return new npc_guardianAI(pCreature); } +/*###### +## npc_tonk_mine +######*/ + +#define SPELL_TONK_MINE_DETONATE 25099 +#define NPC_DARKMOON_STEAM_TONK 15328 + +struct npc_tonk_mineAI : public ScriptedAI +{ + npc_tonk_mineAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint32 m_uiArmTimer; + bool m_bArmed; + + void Reset() + { + m_uiArmTimer = 3000; + m_bArmed = false; + } + + void Aggro(Unit* pWho) override {} + + void MoveInLineOfSight(Unit* pWho) override + { + if (!m_bArmed || !pWho) + return; + + if ((m_creature->GetDistance(pWho) < 2.0f) && (pWho->GetEntry()== NPC_DARKMOON_STEAM_TONK)) + { + m_creature->CastSpell(pWho, SPELL_TONK_MINE_DETONATE, true); + m_creature->ForcedDespawn(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_bArmed) + if (m_uiArmTimer < uiDiff) + { + m_bArmed = true; + } + else + m_uiArmTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_tonk_mine(Creature* pCreature) +{ + return new npc_tonk_mineAI(pCreature); +} + +/*###### +## npc_tonk_mortar +######*/ + +#define SPELL_TONK_MORTAR_EXPLOSION 27745 + +struct npc_tonk_mortarAI : public ScriptedAI +{ + npc_tonk_mortarAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint32 m_uiExplosionTimer; + bool m_bExploded; + + void Reset() + { + m_uiExplosionTimer = 1500; + m_bExploded = false; + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiExplosionTimer < uiDiff) + { + if (m_bExploded) + m_creature->ForcedDespawn(); + + m_creature->CastSpell(m_creature, SPELL_TONK_MORTAR_EXPLOSION, true); + m_uiExplosionTimer = 5000; + m_bExploded = true; + } + else + m_uiExplosionTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_tonk_mortar(Creature* pCreature) +{ + return new npc_tonk_mortarAI(pCreature); +} + +/*###### +## npc_steam_tonk +######*/ + +struct npc_steam_tonkAI : public ScriptedAI +{ + npc_steam_tonkAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint32 m_uiPossesedCheck; + + void Reset() + { + m_uiPossesedCheck = 3000; + } + + void Aggro(Unit* /*pWho*/) override {} + void MoveInLineOfSight(Unit* /*pWho*/) override {} + void AttackStart(Unit* /*pWho*/) override {} + void EnterCombat(Unit* /*pWho*/) override {}; + + void UpdateAI(const uint32 uiDiff) override + { + if (m_uiPossesedCheck < uiDiff) + { + if (!m_creature->GetCharmer()) + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); + } + else + m_uiPossesedCheck -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_steam_tonk(Creature* pCreature) +{ + return new npc_steam_tonkAI(pCreature); +} /*###### ## npc_lunaclaw_spirit @@ -2748,6 +2884,21 @@ void AddSC_npcs_special() newscript->GetAI = &GetAI_npc_guardian; newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_tonk_mine"; + newscript->GetAI = &GetAI_npc_tonk_mine; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tonk_mortar"; + newscript->GetAI = &GetAI_npc_tonk_mortar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_steam_tonk"; + newscript->GetAI = &GetAI_npc_steam_tonk; + newscript->RegisterSelf(); + newscript = new Script; newscript->Name = "npc_lunaclaw_spirit"; newscript->pGossipHello = &GossipHello_npc_lunaclaw_spirit;