diff --git a/sql/migrations/20180129234747_world.sql b/sql/migrations/20180129234747_world.sql deleted file mode 100644 index 35bab694b..000000000 --- a/sql/migrations/20180129234747_world.sql +++ /dev/null @@ -1,33 +0,0 @@ -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`='20180129234747'); -IF v=0 THEN -INSERT INTO `migrations` VALUES ('20180129234747'); --- Add your query below. - - -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`, `spells_template`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Civilian`, `RacialLeader`, `RegenHealth`, -`equipment_id`, `trainer_id`, `vendor_id`, `MechanicImmuneMask`, `SchoolImmuneMask`, `flags_extra`, `ScriptName`) -VALUES (509001, 0, 0, 0, 1126, 0, 0, 0, 'Ossirian Agro Trigger', '', 0, 1, 1, 64, 64, 0, 0, 20, 35, 35, 0, 0.91, 1.14286, 1, 0, 2, 2, 0, 44, 1, 2000, 2200, 1, 0, 0, 0, 0, 0, 0, 0, 1.76, 2.42, 100, 10, -0, 0, 0, 100008, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 128, 'npc_ossirian_agro_trigger'); - -REPLACE 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 - (509001, 509001, 509, 0, 0, -9481.09, 1993.65, 92.7428, 2.38794, 1, 1, 5, 0, 64, 0, 0, 0, 0, 0, 0, 10), - (509002, 509001, 509, 0, 0, -9470.54, 2007.47, 91.8306, 2.36046, 1, 1, 5, 0, 64, 0, 0, 0, 0, 0, 0, 10), - (509003, 509001, 509, 0, 0, -9459.25, 2021.93, 92.8492, 2.37224, 1, 1, 5, 0, 64, 0, 0, 0, 0, 0, 0, 10); - - --- End of migration. -END IF; -END?? -delimiter ; -CALL add_migration(); -DROP PROCEDURE IF EXISTS add_migration; diff --git a/sql/migrations/20180304114614_world.sql b/sql/migrations/20180304114614_world.sql deleted file mode 100644 index eb1b66328..000000000 --- a/sql/migrations/20180304114614_world.sql +++ /dev/null @@ -1,19 +0,0 @@ -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`='20180304114614'); -IF v=0 THEN -INSERT INTO `migrations` VALUES ('20180304114614'); --- Add your query below. - --- Defias Enchanter is not an elite -UPDATE `creature_template` SET `rank`=0 WHERE `entry`=910; - --- End of migration. -END IF; -END?? -delimiter ; -CALL add_migration(); -DROP PROCEDURE IF EXISTS add_migration; diff --git a/sql/migrations/20180201055226_world.sql b/sql/old_migrations/20180201055226_world.sql similarity index 100% rename from sql/migrations/20180201055226_world.sql rename to sql/old_migrations/20180201055226_world.sql diff --git a/sql/migrations/20180201190458_world.sql b/sql/old_migrations/20180201190458_world.sql similarity index 100% rename from sql/migrations/20180201190458_world.sql rename to sql/old_migrations/20180201190458_world.sql diff --git a/sql/migrations/20180203182305_world.sql b/sql/old_migrations/20180203182305_world.sql similarity index 100% rename from sql/migrations/20180203182305_world.sql rename to sql/old_migrations/20180203182305_world.sql diff --git a/sql/migrations/20180204073550_world.sql b/sql/old_migrations/20180204073550_world.sql similarity index 100% rename from sql/migrations/20180204073550_world.sql rename to sql/old_migrations/20180204073550_world.sql diff --git a/sql/migrations/20180207115724_world.sql b/sql/old_migrations/20180207115724_world.sql similarity index 100% rename from sql/migrations/20180207115724_world.sql rename to sql/old_migrations/20180207115724_world.sql diff --git a/sql/migrations/20180208133833_world.sql b/sql/old_migrations/20180208133833_world.sql similarity index 100% rename from sql/migrations/20180208133833_world.sql rename to sql/old_migrations/20180208133833_world.sql diff --git a/sql/migrations/20180209140903_world.sql b/sql/old_migrations/20180209140903_world.sql similarity index 100% rename from sql/migrations/20180209140903_world.sql rename to sql/old_migrations/20180209140903_world.sql diff --git a/sql/migrations/20180210091515_world.sql b/sql/old_migrations/20180210091515_world.sql similarity index 100% rename from sql/migrations/20180210091515_world.sql rename to sql/old_migrations/20180210091515_world.sql diff --git a/sql/migrations/20180212154254_world.sql b/sql/old_migrations/20180212154254_world.sql similarity index 100% rename from sql/migrations/20180212154254_world.sql rename to sql/old_migrations/20180212154254_world.sql diff --git a/sql/migrations/20180213181146_world.sql b/sql/old_migrations/20180213181146_world.sql similarity index 100% rename from sql/migrations/20180213181146_world.sql rename to sql/old_migrations/20180213181146_world.sql diff --git a/sql/migrations/20180217174752_world.sql b/sql/old_migrations/20180217174752_world.sql similarity index 100% rename from sql/migrations/20180217174752_world.sql rename to sql/old_migrations/20180217174752_world.sql diff --git a/sql/migrations/20180218044951_world.sql b/sql/old_migrations/20180218044951_world.sql similarity index 100% rename from sql/migrations/20180218044951_world.sql rename to sql/old_migrations/20180218044951_world.sql diff --git a/sql/migrations/20180218164903_world.sql b/sql/old_migrations/20180218164903_world.sql similarity index 100% rename from sql/migrations/20180218164903_world.sql rename to sql/old_migrations/20180218164903_world.sql diff --git a/sql/migrations/20180218205220_world.sql b/sql/old_migrations/20180218205220_world.sql similarity index 100% rename from sql/migrations/20180218205220_world.sql rename to sql/old_migrations/20180218205220_world.sql diff --git a/sql/migrations/20180219001214_world.sql b/sql/old_migrations/20180219001214_world.sql similarity index 100% rename from sql/migrations/20180219001214_world.sql rename to sql/old_migrations/20180219001214_world.sql diff --git a/sql/migrations/20180219032202_world.sql b/sql/old_migrations/20180219032202_world.sql similarity index 100% rename from sql/migrations/20180219032202_world.sql rename to sql/old_migrations/20180219032202_world.sql diff --git a/sql/migrations/20180220205204_world.sql b/sql/old_migrations/20180220205204_world.sql similarity index 100% rename from sql/migrations/20180220205204_world.sql rename to sql/old_migrations/20180220205204_world.sql diff --git a/sql/migrations/20180222001921_world.sql b/sql/old_migrations/20180222001921_world.sql similarity index 100% rename from sql/migrations/20180222001921_world.sql rename to sql/old_migrations/20180222001921_world.sql diff --git a/sql/migrations/20180222004055_world.sql b/sql/old_migrations/20180222004055_world.sql similarity index 100% rename from sql/migrations/20180222004055_world.sql rename to sql/old_migrations/20180222004055_world.sql diff --git a/sql/migrations/20180224160415_world.sql b/sql/old_migrations/20180224160415_world.sql similarity index 100% rename from sql/migrations/20180224160415_world.sql rename to sql/old_migrations/20180224160415_world.sql diff --git a/sql/migrations/20180224233722_world.sql b/sql/old_migrations/20180224233722_world.sql similarity index 100% rename from sql/migrations/20180224233722_world.sql rename to sql/old_migrations/20180224233722_world.sql diff --git a/sql/migrations/20180225074146_world.sql b/sql/old_migrations/20180225074146_world.sql similarity index 100% rename from sql/migrations/20180225074146_world.sql rename to sql/old_migrations/20180225074146_world.sql diff --git a/sql/migrations/20180226050544_world.sql b/sql/old_migrations/20180226050544_world.sql similarity index 100% rename from sql/migrations/20180226050544_world.sql rename to sql/old_migrations/20180226050544_world.sql diff --git a/sql/migrations/20180227020029_world.sql b/sql/old_migrations/20180227020029_world.sql similarity index 100% rename from sql/migrations/20180227020029_world.sql rename to sql/old_migrations/20180227020029_world.sql diff --git a/sql/migrations/20180227062942_world.sql b/sql/old_migrations/20180227062942_world.sql similarity index 100% rename from sql/migrations/20180227062942_world.sql rename to sql/old_migrations/20180227062942_world.sql diff --git a/sql/migrations/20180228020350_world.sql b/sql/old_migrations/20180228020350_world.sql similarity index 100% rename from sql/migrations/20180228020350_world.sql rename to sql/old_migrations/20180228020350_world.sql diff --git a/sql/migrations/20180304085813_world.sql b/sql/old_migrations/20180304085813_world.sql similarity index 83% rename from sql/migrations/20180304085813_world.sql rename to sql/old_migrations/20180304085813_world.sql index 1f246549b..1b7e9a86e 100644 --- a/sql/migrations/20180304085813_world.sql +++ b/sql/old_migrations/20180304085813_world.sql @@ -8,9 +8,14 @@ IF v=0 THEN INSERT INTO `migrations` VALUES ('20180304085813'); -- Add your query below. + +-- Defias Enchanter is not an elite +UPDATE `creature_template` SET `rank`=0 WHERE `entry`=910; + -- Fix walk speed for Bloodvenom Post Brave UPDATE `creature_template` SET `speed_walk`=1 WHERE `entry`=11180; + -- End of migration. END IF; END?? diff --git a/sql/migrations/20180305195504_world.sql b/sql/old_migrations/20180305195504_world.sql similarity index 60% rename from sql/migrations/20180305195504_world.sql rename to sql/old_migrations/20180305195504_world.sql index d17da8821..351c878dc 100644 --- a/sql/migrations/20180305195504_world.sql +++ b/sql/old_migrations/20180305195504_world.sql @@ -12,28 +12,28 @@ INSERT INTO `migrations` VALUES ('20180305195504'); UPDATE `quest_template` SET `CompleteScript`=637 WHERE `entry`=637 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=637; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(637, 0, 0, 0, 0, 0, 0, 0, 792, 0, 0, 0, 0, 0, 0, 0, 'Sara Balloo: Emote text 1'), -(637, 3, 0, 0, 0, 0, 0, 0, 793, 0, 0, 0, 0, 0, 0, 0, 'Sara Balloo: Say text 1'); +(637, 0, 0, 0, 0, 0, 0, 0, 792, 0, 0, 0, 0, 0, 0, 0, 'Sully Balloos Letter - Sara Balloo: Emote text 1'), +(637, 3, 0, 0, 0, 0, 0, 0, 793, 0, 0, 0, 0, 0, 0, 0, 'Sully Balloos Letter - Sara Balloo: Say text 1'); -- Add emotes and text on quest Sara Balloo's Plea - ok UPDATE `quest_template` SET `CompleteScript`=683 WHERE `entry`=683 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=683; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(683, 1, 0, 0, 0, 0, 0, 0, 860, 0, 0, 0, 0, 0, 0, 0, 'King Magni Bronzebeard: Emote text 1'); +(683, 1, 0, 0, 0, 0, 0, 0, 860, 0, 0, 0, 0, 0, 0, 0, 'Sara Balloos Plea - King Magni Bronzebeard: Emote text 1'); -- Add emotes and script to quest Brother Anton - ok UPDATE `quest_template` SET `CompleteScript`=1052 WHERE `entry`=1052 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1052; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1052, 0, 4, 147, 2, 2, 3980, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Raleigh the Devout: npc_flag questgiver removed'), -(1052, 1, 0, 0, 0, 0, 0, 0, 0, 1377, 0, 0, 0, 0, 0, 0, 0, 'Raleigh the Devout: Emote text 1'), -(1052, 4, 0, 0, 0, 0, 0, 0, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 'Raleigh the Devout: Say text 1'), -(1052, 5, 0, 0, 0, 0, 0, 0, 0, 1379, 0, 0, 0, 0, 0, 0, 0, 'Raleigh the Devout: Emote text 2'), -(1052, 5, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Raleigh the Devout: Throw emote'), -(1052, 5, 9, 20263, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'resp gobject'), -- add object spawn -(1052, 6, 4, 147, 2, 1, 3980, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Raleigh the Devout: npc_flag questgiver added'); +(1052, 0, 4, 147, 2, 2, 3980, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Down the Scarlet Path - Raleigh the Devout: npc_flag questgiver removed'), +(1052, 1, 0, 0, 0, 0, 0, 0, 0, 1377, 0, 0, 0, 0, 0, 0, 0, 'Down the Scarlet Path - Raleigh the Devout: Emote text 1'), +(1052, 4, 0, 0, 0, 0, 0, 0, 0, 1378, 0, 0, 0, 0, 0, 0, 0, 'Down the Scarlet Path - Raleigh the Devout: Say text 1'), +(1052, 5, 0, 0, 0, 0, 0, 0, 0, 1379, 0, 0, 0, 0, 0, 0, 0, 'Down the Scarlet Path - Raleigh the Devout: Emote text 2'), +(1052, 5, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Down the Scarlet Path - Raleigh the Devout: Throw emote'), +(1052, 5, 9, 20263, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Down the Scarlet Path - Respawn Antons Letter of Commendation'), -- add object spawn +(1052, 6, 4, 147, 2, 1, 3980, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Down the Scarlet Path - Raleigh the Devout: npc_flag questgiver added'); DELETE FROM `gameobject` WHERE `guid`=20263; -- Empty guid INSERT INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation2`, `rotation3`, `spawntimesecsmin`, `spawntimesecsmax`, `animprogress`, `state`) VALUES @@ -58,17 +58,17 @@ UPDATE `quest_template` SET `RequiredRaces`=0 WHERE `entry`=863 AND `patch`=0; -- Emote and some delay added rest are LH script DELETE FROM `quest_end_scripts` WHERE `id`=502; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(502, 0, 0, 0, 0, 0, 0, 0, 580, 0, 0, 0, 0, 0, 0, 0, 'Stanley: Emote text 1'); +(502, 0, 0, 0, 0, 0, 0, 0, 580, 0, 0, 0, 0, 0, 0, 0, 'Elixir of Pain - Stanley: Emote text 1'); INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `data_flags`, `comments`) VALUES -(502, 3, 15, 17673, 4, 'Stanley: Visual transformation'); +(502, 3, 15, 17673, 4, 'Elixir of Pain - Stanley: Visual transformation'); INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `comments`) VALUES -(502, 4, 16, 1108, 'Stanley: Sound transformation'); +(502, 4, 16, 1108, 'Elixir of Pain - Stanley: Sound transformation'); INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `comments`) VALUES -(502, 5, 18, 'Stanley: Despawn'); +(502, 5, 18, 'Elixir of Pain - Stanley: Despawn'); INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `x`, `y`, `z`, `o`, `comments`) VALUES -(502, 5, 10, 2275, 30000, -353.534, 21.4088, 54.6594, 3.68102, 'Stanley: Enraged Stanley spawn'); +(502, 5, 10, 2275, 30000, -353.534, 21.4088, 54.6594, 3.68102, 'Elixir of Pain - Stanley: Enraged Stanley spawn'); INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `buddy_id`, `buddy_radius`, `comments`) VALUES -(502, 6, 22, 38, 2275, 5, 'Stanley: Enraged Stanley set agressive'); +(502, 6, 22, 38, 2275, 5, 'Elixir of Pain - Stanley: Enraged Stanley set agressive'); -- [0104] Updated quest_template for many quests - (2/6 ported) - ok @@ -77,20 +77,20 @@ INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `buddy_id UPDATE `quest_template` SET `StartScript`=993 WHERE `entry`=993 AND `patch`=0; DELETE FROM `quest_start_scripts` WHERE `id`=993; INSERT INTO `quest_start_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(993, 1, 0, 0, 0, 0, 0, 0, 1249, 0, 0, 0, 0, 0, 0, 0, 'Terenthis: Say text 1'), -(993, 1, 15, 4093, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Terenthis: Cast spell (Not correct one)'), -(993, 4, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Terenthis: Talk emote'), -(993, 4, 0, 0, 0, 0, 0, 0, 1289, 0, 0, 0, 0, 0, 0, 0, 'Terenthis: Say text 2'); +(993, 1, 0, 0, 0, 0, 0, 0, 1249, 0, 0, 0, 0, 0, 0, 0, 'A Lost Master 2 - Terenthis: Say text 1'), +(993, 1, 15, 4093, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'A Lost Master 2 - Terenthis: Cast spell (Not correct one)'), +(993, 4, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'A Lost Master 2 - Terenthis: Talk emote'), +(993, 4, 0, 0, 0, 0, 0, 0, 1289, 0, 0, 0, 0, 0, 0, 0, 'A Lost Master 2 - Terenthis: Say text 2'); -- Adds start script to quest 1221 (Blueleaf Tubers) UPDATE `quest_template` SET `StartScript`=1221 WHERE `entry`=1221 AND `patch`=0; DELETE FROM `quest_start_scripts` WHERE `id`=1221; INSERT INTO `quest_start_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1221, 0, 0, 0, 0, 0, 0, 0, 1788, 0, 0, 0, 0, 0, 0, 0, 'Mebok Mizzyrix: Say text 1'), -(1221, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mebok Mizzyrix: Wave emote'), -(1221, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -929.023, -3696.98, 7.97395, 1.7352, 'Mebok Mizzyrix: Rotate towards objects'), -(1221, 4, 1, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mebok Mizzyrix: Point emote'), -(1221, 8, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -928.982, -3697.23, 8.06642, 3.08923, 'Mebok Mizzyrix: Walk back'); +(1221, 0, 0, 0, 0, 0, 0, 0, 1788, 0, 0, 0, 0, 0, 0, 0, 'Blueleaf Tubers - Mebok Mizzyrix: Say text 1'), +(1221, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Blueleaf Tubers - Mebok Mizzyrix: Wave emote'), +(1221, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -929.023, -3696.98, 7.97395, 1.7352, 'Blueleaf Tubers - Mebok Mizzyrix: Rotate towards objects'), +(1221, 4, 1, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Blueleaf Tubers - Mebok Mizzyrix: Point emote'), +(1221, 8, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -928.982, -3697.23, 8.06642, 3.08923, 'Blueleaf Tubers - Mebok Mizzyrix: Walk back'); -- [0168] Added end script for 25 quests - 23/25 ported @@ -100,124 +100,124 @@ INSERT INTO `quest_start_scripts` (`id`, `delay`, `command`, `datalong`, `datalo UPDATE `quest_template` SET `CompleteScript`=621 WHERE `entry`=621 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=621; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(621, 1, 0, 0, 0, 0, 0, 0, 1469, 0, 0, 0, 0, 0, 0, 0, 'Crank Fizzlebub: Say text 1'), -(621, 2, 0, 0, 0, 0, 0, 0, 1470, 0, 0, 0, 0, 0, 0, 0, 'Crank Fizzlebub: Say text 2'); +(621, 1, 0, 0, 0, 0, 0, 0, 1469, 0, 0, 0, 0, 0, 0, 0, 'Zanzils Secret - Crank Fizzlebub: Say text 1'), +(621, 2, 0, 0, 0, 0, 0, 0, 1470, 0, 0, 0, 0, 0, 0, 0, 'Zanzils Secret - Crank Fizzlebub: Say text 2'); -- End script for quest 630 (Message in a bottle) - ok UPDATE `quest_template` SET `CompleteScript`=630 WHERE `entry`=630 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=630; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(630, 2, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Princess Poobah: Wave emote on quest end'), -(630, 5, 0, 0, 0, 0, 0, 0, 765, 0, 0, 0, 0, 0, 0, 0, 'Princess Poobah: Say text 1'); +(630, 2, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Message in a Bottle - Princess Poobah: Wave emote on quest end'), +(630, 5, 0, 0, 0, 0, 0, 0, 765, 0, 0, 0, 0, 0, 0, 0, 'Message in a Bottle - Princess Poobah: Say text 1'); -- End script for quest 640 (The Broken Sigil) - ok UPDATE `quest_template` SET `CompleteScript`=640 WHERE `entry`=640 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=640; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(640, 0, 4, 147, 2, 2, 2706, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Tor\'gan: npc_flag questgiver removed'), -(640, 1, 15, 4093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Tor\'gan: Cast spell'), -(640, 6, 0, 0, 0, 0, 0, 0, 0, 798, 0, 0, 0, 0, 0, 0, 0, 'Tor\'gan: Say text 1'), -(640, 6, 4, 147, 2, 1, 2706, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Tor\'gan: npc_flag questgiver added'); +(640, 0, 4, 147, 2, 2, 2706, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'The Broken Sigil - Tor\'gan: npc_flag questgiver removed'), +(640, 1, 15, 4093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'The Broken Sigil - Tor\'gan: Cast spell'), +(640, 6, 0, 0, 0, 0, 0, 0, 0, 798, 0, 0, 0, 0, 0, 0, 0, 'The Broken Sigil - Tor\'gan: Say text 1'), +(640, 6, 4, 147, 2, 1, 2706, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'The Broken Sigil - Tor\'gan: npc_flag questgiver added'); -- End script for quest 670 (Sunken Treasure) - ok UPDATE `quest_template` SET `CompleteScript`=670 WHERE `entry`=670 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=670; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(670, 1, 0, 0, 0, 0, 0, 0, 857, 0, 0, 0, 0, 0, 0, 0, 'Shakes O\'Breen: Say text 1'); +(670, 1, 0, 0, 0, 0, 0, 0, 857, 0, 0, 0, 0, 0, 0, 0, 'Sunken Treasure - Shakes O\'Breen: Say text 1'); -- End script for quest 702 (Guile of the Raptor) - ok UPDATE `quest_template` SET `CompleteScript`=702 WHERE `entry`=702 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=702; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(702, 0, 4, 147, 2, 2, 2792, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Gor\'mul: npc_flag questgiver removed'), -(702, 0, 15, 4153, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Gor\'mul: Cast spell on himself'), -(702, 5, 0, 0, 0, 0, 0, 0, 0, 1020, 0, 0, 0, 0, 0, 0, 0, 'Gor\'mul: Emote text 1'), -(702, 6, 4, 147, 2, 1, 2792, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Gor\'mul: npc_flag questgiver added'), -(702, 9, 0, 0, 0, 0, 0, 0, 0, 861, 0, 0, 0, 0, 0, 0, 0, 'Gor\'mul: Say text 1'), -(702, 13, 1, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Gor\'mul: Roar emote on quest end'), -(702, 14, 0, 0, 0, 0, 0, 0, 0, 862, 0, 0, 0, 0, 0, 0, 0, 'Gor\'mul: Say text 2'); +(702, 0, 4, 147, 2, 2, 2792, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Guile of the Raptor - Gor\'mul: npc_flag questgiver removed'), +(702, 0, 15, 4153, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Guile of the Raptor - Gor\'mul: Cast spell on himself'), +(702, 5, 0, 0, 0, 0, 0, 0, 0, 1020, 0, 0, 0, 0, 0, 0, 0, 'Guile of the Raptor - Gor\'mul: Emote text 1'), +(702, 6, 4, 147, 2, 1, 2792, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Guile of the Raptor - Gor\'mul: npc_flag questgiver added'), +(702, 9, 0, 0, 0, 0, 0, 0, 0, 861, 0, 0, 0, 0, 0, 0, 0, 'Guile of the Raptor - Gor\'mul: Say text 1'), +(702, 13, 1, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Guile of the Raptor - Gor\'mul: Roar emote on quest end'), +(702, 14, 0, 0, 0, 0, 0, 0, 0, 862, 0, 0, 0, 0, 0, 0, 0, 'Guile of the Raptor - Gor\'mul: Say text 2'); -- End script for quest 748 (Poison Water) - ok UPDATE `quest_template` SET `CompleteScript`=748 WHERE `entry`=748 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=748; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(748, 0, 4, 147, 2, 2, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: npc_flag questgiver removed'), -(748, 0, 15, 4983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: Cast spell'), -(748, 0, 0, 0, 0, 0, 0, 0, 0, 952, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: Emote text 1'), -(748, 8, 0, 0, 3, 0, 0, 0, 0, 1009, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: Say text 1'), -(748, 9, 4, 147, 2, 1, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: npc_flag questgiver added'); +(748, 0, 4, 147, 2, 2, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Poison Water - Mull Thunderhorn: npc_flag questgiver removed'), +(748, 0, 15, 4983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Poison Water - Mull Thunderhorn: Cast spell'), +(748, 0, 0, 0, 0, 0, 0, 0, 0, 952, 0, 0, 0, 0, 0, 0, 0, 'Poison Water - Mull Thunderhorn: Emote text 1'), +(748, 8, 0, 0, 3, 0, 0, 0, 0, 1009, 0, 0, 0, 0, 0, 0, 0, 'Poison Water - Mull Thunderhorn: Say text 1'), +(748, 9, 4, 147, 2, 1, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Poison Water - Mull Thunderhorn: npc_flag questgiver added'); -- End script for quest 756 (Thunderhorn Totem) - ok UPDATE `quest_template` SET `CompleteScript`=756 WHERE `entry`=756 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=756; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(756, 0, 4, 147, 2, 2, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: npc_flag questgiver removed'), -(756, 0, 15, 4983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: Cast spell'), -(756, 0, 0, 0, 0, 0, 0, 0, 0, 1004, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: Emote text 1'), -(756, 8, 0, 0, 3, 0, 0, 0, 0, 954, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: Say text 1'), -- Remove 3 -(756, 9, 4, 147, 2, 1, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: npc_flag questgiver added'); +(756, 0, 4, 147, 2, 2, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Thunderhorn Totem - Mull Thunderhorn: npc_flag questgiver removed'), +(756, 0, 15, 4983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Thunderhorn Totem - Mull Thunderhorn: Cast spell'), +(756, 0, 0, 0, 0, 0, 0, 0, 0, 1004, 0, 0, 0, 0, 0, 0, 0, 'Thunderhorn Totem - Mull Thunderhorn: Emote text 1'), +(756, 8, 0, 0, 3, 0, 0, 0, 0, 954, 0, 0, 0, 0, 0, 0, 0, 'Thunderhorn Totem - Mull Thunderhorn: Say text 1'), -- Remove 3 +(756, 9, 4, 147, 2, 1, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Thunderhorn Totem - Mull Thunderhorn: npc_flag questgiver added'); -- End script for quest 759 (Wildmane Totem) - ok UPDATE `quest_template` SET `CompleteScript`=759 WHERE `entry`=759 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=759; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(759, 0, 4, 147, 2, 2, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: npc_flag questgiver removed'), -(759, 0, 15, 4983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: Cast spell'), -(759, 0, 0, 0, 0, 0, 0, 0, 0, 1003, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: Emote text 1'), -(759, 8, 0, 0, 3, 0, 0, 0, 0, 1006, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: Say text 1'), -- Remove 3 -(759, 9, 4, 147, 2, 1, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mull Thunderhorn: npc_flag questgiver added'); +(759, 0, 4, 147, 2, 2, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Wildmane Totem - Mull Thunderhorn: npc_flag questgiver removed'), +(759, 0, 15, 4983, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Wildmane Totem - Mull Thunderhorn: Cast spell'), +(759, 0, 0, 0, 0, 0, 0, 0, 0, 1003, 0, 0, 0, 0, 0, 0, 0, 'Wildmane Totem - Mull Thunderhorn: Emote text 1'), +(759, 8, 0, 0, 3, 0, 0, 0, 0, 1006, 0, 0, 0, 0, 0, 0, 0, 'Wildmane Totem - Mull Thunderhorn: Say text 1'), -- Remove 3 +(759, 9, 4, 147, 2, 1, 2948, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Wildmane Totem - Mull Thunderhorn: npc_flag questgiver added'); -- End script for quest 950 (Return to Onu) - ok UPDATE `quest_template` SET `CompleteScript`=950 WHERE `entry`=950 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=950; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(950, 0, 4, 147, 2, 2, 3616, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Onu: npc_flag questgiver removed'), -(950, 1, 0, 0, 0, 0, 0, 0, 0, 1216, 0, 0, 0, 0, 0, 0, 0, 'Onu: Emote text 1'), -(950, 4, 0, 0, 0, 0, 0, 0, 0, 1217, 0, 0, 0, 0, 0, 0, 0, 'Onu: Emote text 2'), -(950, 4, 1, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Onu: Emote wound'), -(950, 4, 15, 4947, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Onu: Cast spell (guessed spell)'), -(950, 7, 0, 0, 0, 0, 0, 0, 0, 1218, 0, 0, 0, 0, 0, 0, 0, 'Onu: Say text 1'), -(950, 8, 4, 147, 2, 1, 3616, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Onu: npc_flag questgiver added'); +(950, 0, 4, 147, 2, 2, 3616, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Return to Onu - Onu: npc_flag questgiver removed'), +(950, 1, 0, 0, 0, 0, 0, 0, 0, 1216, 0, 0, 0, 0, 0, 0, 0, 'Return to Onu - Onu: Emote text 1'), +(950, 4, 0, 0, 0, 0, 0, 0, 0, 1217, 0, 0, 0, 0, 0, 0, 0, 'Return to Onu - Onu: Emote text 2'), +(950, 4, 1, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Return to Onu - Onu: Emote wound'), +(950, 4, 15, 4947, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Return to Onu - Onu: Cast spell (guessed spell)'), +(950, 7, 0, 0, 0, 0, 0, 0, 0, 1218, 0, 0, 0, 0, 0, 0, 0, 'Return to Onu - Onu: Say text 1'), +(950, 8, 4, 147, 2, 1, 3616, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Return to Onu - Onu: npc_flag questgiver added'); -- End script for quest 1062 (Goblin Invaders) - ok - 20180310 added emote and npc_flag removal per source -- Source: https://www.youtube.com/watch?v=5UWZaZjKS14&feature=youtu.be&list=PL49Ga_-r7iKkxrbckm9CkUhWzxqrOnw-n&t=3736 UPDATE `quest_template` SET `CompleteScript`=1062 WHERE `entry`=1062 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1062; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1062, 0, 4, 147, 2, 2, 4049, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Seereth Stonebreak: npc_flag questgiver removed'), -(1062, 1, 0, 0, 0, 0, 0, 0, 0, 1425, 0, 0, 0, 0, 0, 0, 0, 'Seereth Stonebreak: Say text 1'), -(1062, 3, 0, 0, 0, 0, 0, 0, 0, 1426, 0, 0, 0, 0, 0, 0, 0, 'Seereth Stonebreak: Say text 2'), -(1062, 3, 1, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Seereth Stonebreak: Roar emote'), -(1062, 4, 4, 147, 2, 1, 4049, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Seereth Stonebreak: npc_flag questgiver added'); +(1062, 0, 4, 147, 2, 2, 4049, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Invaders - Seereth Stonebreak: npc_flag questgiver removed'), +(1062, 1, 0, 0, 0, 0, 0, 0, 0, 1425, 0, 0, 0, 0, 0, 0, 0, 'Goblin Invaders - Seereth Stonebreak: Say text 1'), +(1062, 3, 0, 0, 0, 0, 0, 0, 0, 1426, 0, 0, 0, 0, 0, 0, 0, 'Goblin Invaders - Seereth Stonebreak: Say text 2'), +(1062, 3, 1, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Invaders - Seereth Stonebreak: Roar emote'), +(1062, 4, 4, 147, 2, 1, 4049, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Invaders - Seereth Stonebreak: npc_flag questgiver added'); -- End script for quest 1063 (The Elder Crone) - ok UPDATE `quest_template` SET `CompleteScript`=1063 WHERE `entry`=1063 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1063; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1063, 0, 0, 0, 0, 0, 0, 0, 1416, 0, 0, 0, 0, 0, 0, 0, 'Magatha Grimtotem: Emote text 1'), -(1063, 2, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 'Magatha Grimtotem: Say text 1'); +(1063, 0, 0, 0, 0, 0, 0, 0, 1416, 0, 0, 0, 0, 0, 0, 0, 'The Elder Crone - Magatha Grimtotem: Emote text 1'), +(1063, 2, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 'The Elder Crone - Magatha Grimtotem: Say text 1'); -- End script for quest 1066 (Blood of Innocents) - ok UPDATE `quest_template` SET `CompleteScript`=1066 WHERE `entry`=1066 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1066; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1066, 0, 4, 147, 2, 2, 2216, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Lydon: npc_flag questgiver removed'), -(1066, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Lydon: Emote text 1'), -(1066, 0, 1, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Lydon: Emote use'), -(1066, 4, 0, 0, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Lydon: Say text 1'), -(1066, 4, 1, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Lydon: Emote normal'), -(1066, 4, 4, 147, 2, 1, 2216, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Lydon: npc_flag questgiver added'); +(1066, 0, 4, 147, 2, 2, 2216, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Blood of Innocents - Apothecary Lydon: npc_flag questgiver removed'), +(1066, 0, 0, 0, 0, 0, 0, 0, 0, 1421, 0, 0, 0, 0, 0, 0, 0, 'Blood of Innocents - Apothecary Lydon: Emote text 1'), +(1066, 0, 1, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Blood of Innocents - Apothecary Lydon: Emote use'), +(1066, 4, 0, 0, 0, 0, 0, 0, 0, 1422, 0, 0, 0, 0, 0, 0, 0, 'Blood of Innocents - Apothecary Lydon: Say text 1'), +(1066, 4, 1, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Blood of Innocents - Apothecary Lydon: Emote normal'), +(1066, 4, 4, 147, 2, 1, 2216, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Blood of Innocents - Apothecary Lydon: npc_flag questgiver added'); -- End script for quest 1067 (Return to Thunder Bluff) - ok UPDATE `quest_template` SET `CompleteScript`=1067 WHERE `entry`=1067 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1067; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1067, 0, 4, 147, 2, 2, 3419, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Zamah: npc_flag questgiver removed'), -(1067, 0, 0, 0, 0, 0, 0, 0, 0, 1423, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Zamah: Emote text 1'), -(1067, 0, 1, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Zamah: Emote use'), -(1067, 4, 0, 0, 0, 0, 0, 0, 0, 1424, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Zamah: Say text 1'), -(1067, 4, 1, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Zamah: Emote normal'), -(1067, 4, 4, 147, 2, 1, 3419, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Zamah: npc_flag questgiver added'); +(1067, 0, 4, 147, 2, 2, 3419, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Return to Thunder Bluff - Apothecary Zamah: npc_flag questgiver removed'), +(1067, 0, 0, 0, 0, 0, 0, 0, 0, 1423, 0, 0, 0, 0, 0, 0, 0, 'Return to Thunder Bluff - Apothecary Zamah: Emote text 1'), +(1067, 0, 1, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Return to Thunder Bluff - Apothecary Zamah: Emote use'), +(1067, 4, 0, 0, 0, 0, 0, 0, 0, 1424, 0, 0, 0, 0, 0, 0, 0, 'Return to Thunder Bluff - Apothecary Zamah: Say text 1'), +(1067, 4, 1, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Return to Thunder Bluff - Apothecary Zamah: Emote normal'), +(1067, 4, 4, 147, 2, 1, 3419, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Return to Thunder Bluff - Apothecary Zamah: npc_flag questgiver added'); -- End script for quest 1112 (Parts for Kravel) - ok -- Source: https://www.youtube.com/watch?v=VBlnzRNTatI&feature=youtu.be&list=PL49Ga_-r7iKkxrbckm9CkUhWzxqrOnw-n&t=305 @@ -226,14 +226,14 @@ UPDATE `creature_addon` SET `bytes1`=0 WHERE `guid`=21570 AND `patch`=0; -- Krav UPDATE `quest_template` SET `CompleteScript`=1112 WHERE `entry`=1112 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1112; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1112, 0, 4, 147, 2, 2, 4452, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: npc_flag questgiver removed'), -(1112, 1, 0, 0, 0, 0, 0, 0, 0, 1479, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: Emote text 1'), -(1112, 2, 9, 20837, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'resp gobject'), -(1112, 3, 1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: Kneel start'), -(1112, 4, 0, 0, 0, 0, 0, 0, 0, 1477, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: Emote text 2'), -(1112, 7, 1, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: Kneel end'), -(1112, 8, 0, 0, 0, 0, 0, 0, 0, 1478, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: Say text 1'), -(1112, 8, 4, 147, 2, 1, 4452, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: npc_flag questgiver added'); +(1112, 0, 4, 147, 2, 2, 4452, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Parts for Kravel - Kravel Koalbeard: npc_flag questgiver removed'), +(1112, 1, 0, 0, 0, 0, 0, 0, 0, 1479, 0, 0, 0, 0, 0, 0, 0, 'Parts for Kravel - Kravel Koalbeard: Emote text 1'), +(1112, 2, 9, 20837, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Parts for Kravel - Respawn Parts Crate'), +(1112, 3, 1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Parts for Kravel - Kravel Koalbeard: Kneel start'), +(1112, 4, 0, 0, 0, 0, 0, 0, 0, 1477, 0, 0, 0, 0, 0, 0, 0, 'Parts for Kravel - Kravel Koalbeard: Emote text 2'), +(1112, 7, 1, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Parts for Kravel - Kravel Koalbeard: Kneel end'), +(1112, 8, 0, 0, 0, 0, 0, 0, 0, 1478, 0, 0, 0, 0, 0, 0, 0, 'Parts for Kravel - Kravel Koalbeard: Say text 1'), +(1112, 8, 4, 147, 2, 1, 4452, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Parts for Kravel - Kravel Koalbeard: npc_flag questgiver added'); DELETE FROM `gameobject` WHERE `guid`=20837; -- Empty guid INSERT INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation2`, `rotation3`, `spawntimesecsmin`, `spawntimesecsmax`, `animprogress`, `state`) VALUES @@ -243,112 +243,112 @@ INSERT INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `posi UPDATE `quest_template` SET `CompleteScript`=1116 WHERE `entry`=1116 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1116; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1116, 0, 4, 147, 2, 2, 773, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Krazek: npc_flag questgiver removed'), -(1116, 0, 0, 0, 0, 0, 0, 0, 0, 1548, 0, 0, 0, 0, 0, 0, 0, 'Krazek: Emote text 1'), -(1116, 1, 0, 0, 0, 0, 0, 0, 0, 1549, 0, 0, 0, 0, 0, 0, 0, 'Krazek: Emote text 2'), -(1116, 1, 15, 6903, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Krazek: Stunned'), -(1116, 4, 0, 0, 0, 0, 0, 0, 0, 1550, 0, 0, 0, 0, 0, 0, 0, 'Krazek: Say text 1'), -(1116, 7, 0, 0, 0, 0, 0, 0, 0, 1550, 0, 0, 0, 0, 0, 0, 0, 'Krazek: Say text 1 again'), -(1116, 9, 0, 0, 0, 0, 0, 0, 0, 1551, 0, 0, 0, 0, 0, 0, 0, 'Krazek: Say text 2'), -(1116, 9, 4, 147, 2, 1, 773, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Krazek: npc_flag questgiver added'); +(1116, 0, 4, 147, 2, 2, 773, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Dream Dust in the Swamp - Krazek: npc_flag questgiver removed'), +(1116, 0, 0, 0, 0, 0, 0, 0, 0, 1548, 0, 0, 0, 0, 0, 0, 0, 'Dream Dust in the Swamp - Krazek: Emote text 1'), +(1116, 1, 0, 0, 0, 0, 0, 0, 0, 1549, 0, 0, 0, 0, 0, 0, 0, 'Dream Dust in the Swamp - Krazek: Emote text 2'), +(1116, 1, 15, 6903, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Dream Dust in the Swamp - Krazek: Stunned'), +(1116, 4, 0, 0, 0, 0, 0, 0, 0, 1550, 0, 0, 0, 0, 0, 0, 0, 'Dream Dust in the Swamp - Krazek: Say text 1'), +(1116, 7, 0, 0, 0, 0, 0, 0, 0, 1550, 0, 0, 0, 0, 0, 0, 0, 'Dream Dust in the Swamp - Krazek: Say text 1 again'), +(1116, 9, 0, 0, 0, 0, 0, 0, 0, 1551, 0, 0, 0, 0, 0, 0, 0, 'Dream Dust in the Swamp - Krazek: Say text 2'), +(1116, 9, 4, 147, 2, 1, 773, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Dream Dust in the Swamp - Krazek: npc_flag questgiver added'); -- End script for quest 1117 (Rumors for Kravel) - ok UPDATE `quest_template` SET `CompleteScript`=1117 WHERE `entry`=1117 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1117; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1117, 0, 4, 147, 2, 2, 4452, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: npc_flag questgiver removed'), -(1117, 1, 0, 0, 0, 0, 0, 0, 0, 1480, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: Emote text 1'), -(1117, 1, 1, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: Emote dance state'), -(1117, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: Emote normal (stop dance)'), -(1117, 7, 0, 0, 0, 0, 0, 0, 0, 1481, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: Emote text 1'), -(1117, 7, 4, 147, 2, 1, 4452, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Kravel Koalbeard: npc_flag questgiver added'); +(1117, 0, 4, 147, 2, 2, 4452, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Rumors for Kravel - Kravel Koalbeard: npc_flag questgiver removed'), +(1117, 1, 0, 0, 0, 0, 0, 0, 0, 1480, 0, 0, 0, 0, 0, 0, 0, 'Rumors for Kravel - Kravel Koalbeard: Emote text 1'), +(1117, 1, 1, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Rumors for Kravel - Kravel Koalbeard: Emote dance state'), +(1117, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Rumors for Kravel - Kravel Koalbeard: Emote normal (stop dance)'), +(1117, 7, 0, 0, 0, 0, 0, 0, 0, 1481, 0, 0, 0, 0, 0, 0, 0, 'Rumors for Kravel - Kravel Koalbeard: Emote text 1'), +(1117, 7, 4, 147, 2, 1, 4452, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Rumors for Kravel - Kravel Koalbeard: npc_flag questgiver added'); -- End script for quest 1169 (Identifying the Brood) - ok UPDATE `quest_template` SET `CompleteScript`=1169 WHERE `entry`=1169 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1169; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1169, 0, 4, 147, 2, 2, 4501, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Draz\'Zilb: npc_flag questgiver removed'), -(1169, 0, 0, 0, 0, 0, 0, 0, 0, 1511, 0, 0, 0, 0, 0, 0, 0, 'Draz\'Zilb: Emote text 1'), -(1169, 1, 15, 6741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Draz\'Zilb: cast spell'), -(1169, 11, 0, 0, 0, 0, 0, 0, 0, 1512, 0, 0, 0, 0, 0, 0, 0, 'Draz\'Zilb: Say text 1'), -(1169, 11, 4, 147, 2, 1, 4501, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Draz\'Zilb: npc_flag questgiver added'); +(1169, 0, 4, 147, 2, 2, 4501, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Identifying the Brood - Draz\'Zilb: npc_flag questgiver removed'), +(1169, 0, 0, 0, 0, 0, 0, 0, 0, 1511, 0, 0, 0, 0, 0, 0, 0, 'Identifying the Brood - Draz\'Zilb: Emote text 1'), +(1169, 1, 15, 6741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Identifying the Brood - Draz\'Zilb: cast spell'), +(1169, 11, 0, 0, 0, 0, 0, 0, 0, 1512, 0, 0, 0, 0, 0, 0, 0, 'Identifying the Brood - Draz\'Zilb: Say text 1'), +(1169, 11, 4, 147, 2, 1, 4501, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Identifying the Brood - Draz\'Zilb: npc_flag questgiver added'); -- End script for quest 1176 (Load Lightening) - ok UPDATE `quest_template` SET `CompleteScript`=1176 WHERE `entry`=1176 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1176; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1176, 2, 0, 0, 0, 0, 0, 0, 1526, 0, 0, 0, 0, 0, 0, 0, 'Pozzik: Say text'); +(1176, 2, 0, 0, 0, 0, 0, 0, 1526, 0, 0, 0, 0, 0, 0, 0, 'Load Lightening - Pozzik: Say text'); -- End script for quest 1383 (Nothing But The Truth) - ok UPDATE `quest_template` SET `CompleteScript`=1383 WHERE `entry`=1383 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1383; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1383, 0, 4, 147, 2, 2, 5414, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Faustin: npc_flag questgiver removed'), -(1383, 1, 0, 0, 0, 0, 0, 0, 0, 1848, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Faustin: Say text 1'), -(1383, 4, 3, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, -10351.1, -1527.88, 92.7248, 6.23291, 'Apothecary Faustin: Face away'), -(1383, 6, 1, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Faustin: Emote use start'), -(1383, 10, 0, 0, 0, 0, 0, 0, 0, 1849, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Faustin: Say text 2'), -(1383, 10, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Faustin: Emote normal '), -(1383, 15, 3, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, -10351.1, -1527.88, 92.7248, 3.14159, 'Apothecary Faustin: Face back'), -(1383, 16, 0, 0, 0, 0, 0, 0, 0, 1850, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Faustin: Say text 3'), -(1383, 16, 4, 147, 2, 1, 5414, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Apothecary Faustin: npc_flag questgiver added'); +(1383, 0, 4, 147, 2, 2, 5414, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Apothecary Faustin: npc_flag questgiver removed'), +(1383, 1, 0, 0, 0, 0, 0, 0, 0, 1848, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Apothecary Faustin: Say text 1'), +(1383, 4, 3, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, -10351.1, -1527.88, 92.7248, 6.23291, 'Nothing But The Truth - Apothecary Faustin: Face away'), +(1383, 6, 1, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Apothecary Faustin: Emote use start'), +(1383, 10, 0, 0, 0, 0, 0, 0, 0, 1849, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Apothecary Faustin: Say text 2'), +(1383, 10, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Apothecary Faustin: Emote normal '), +(1383, 15, 3, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, -10351.1, -1527.88, 92.7248, 3.14159, 'Nothing But The Truth - Apothecary Faustin: Face back'), +(1383, 16, 0, 0, 0, 0, 0, 0, 0, 1850, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Apothecary Faustin: Say text 3'), +(1383, 16, 4, 147, 2, 1, 5414, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Apothecary Faustin: npc_flag questgiver added'); -- End script for quest 1391 (Nothing But The Truth) - ok UPDATE `quest_template` SET `CompleteScript`=1391 WHERE `entry`=1391 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1391; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1391, 0, 0, 0, 0, 0, 0, 0, 1857, 0, 0, 0, 0, 0, 0, 0, 'Infiltrator Marksen: Emote text 1'), -(1391, 2, 0, 0, 0, 0, 0, 0, 1858, 0, 0, 0, 0, 0, 0, 0, 'Infiltrator Marksen: Say text 1'), -(1391, 7, 0, 0, 0, 0, 0, 0, 1859, 0, 0, 0, 0, 0, 0, 0, 'Infiltrator Marksen: Say text 2'), -(1391, 8, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Infiltrator Marksen: Stunned'), -(1391, 13, 0, 0, 0, 0, 0, 0, 1860, 0, 0, 0, 0, 0, 0, 0, 'Infiltrator Marksen: Emote text 2'), -(1391, 14, 0, 0, 0, 0, 0, 0, 1861, 0, 0, 0, 0, 0, 0, 0, 'Infiltrator Marksen: Say text 3'), -(1391, 14, 15, 7293, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Infiltrator Marksen: Morph to undead (with spell)'), -(1391, 15, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Infiltrator Marksen: Normal'), -(1391, 16, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10423.5, -3240.63, 20.1786, 4.68979, 'Infiltrator Marksen: Wander'), -(1391, 17, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10420.6, -3240.03, 20.1786, 2.11212, 'Infiltrator Marksen: Wander'), -(1391, 19, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10422.1, -3237.58, 20.1786, 3.80072, 'Infiltrator Marksen: Wander'), -(1391, 20, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10424.4, -3239.73, 20.1786, 3.8633, 'Infiltrator Marksen: Wander'), -(1391, 22, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10422.4, -3238.96, 20.1786, 0.236333, 'Infiltrator Marksen: Wander'), -(1391, 26, 15, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Infiltrator Marksen: Die (with spell)'); +(1391, 0, 0, 0, 0, 0, 0, 0, 1857, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Infiltrator Marksen: Emote text 1'), +(1391, 2, 0, 0, 0, 0, 0, 0, 1858, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Infiltrator Marksen: Say text 1'), +(1391, 7, 0, 0, 0, 0, 0, 0, 1859, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Infiltrator Marksen: Say text 2'), +(1391, 8, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Infiltrator Marksen: Stunned'), +(1391, 13, 0, 0, 0, 0, 0, 0, 1860, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Infiltrator Marksen: Emote text 2'), +(1391, 14, 0, 0, 0, 0, 0, 0, 1861, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Infiltrator Marksen: Say text 3'), +(1391, 14, 15, 7293, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Infiltrator Marksen: Morph to undead (with spell)'), +(1391, 15, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Infiltrator Marksen: Normal'), +(1391, 16, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10423.5, -3240.63, 20.1786, 4.68979, 'Nothing But The Truth - Infiltrator Marksen: Wander'), +(1391, 17, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10420.6, -3240.03, 20.1786, 2.11212, 'Nothing But The Truth - Infiltrator Marksen: Wander'), +(1391, 19, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10422.1, -3237.58, 20.1786, 3.80072, 'Nothing But The Truth - Infiltrator Marksen: Wander'), +(1391, 20, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10424.4, -3239.73, 20.1786, 3.8633, 'Nothing But The Truth - Infiltrator Marksen: Wander'), +(1391, 22, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10422.4, -3238.96, 20.1786, 0.236333, 'Nothing But The Truth - Infiltrator Marksen: Wander'), +(1391, 26, 15, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Nothing But The Truth - Infiltrator Marksen: Die (with spell)'); -- End script for quest 1445 (The Temple of Atal'Hakkar) - ok UPDATE `quest_template` SET `CompleteScript`=1445 WHERE `entry`=1445 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=1445; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(1445, 0, 4, 147, 2, 2, 1443, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Fel\'zerul: npc_flag questgiver removed'), -(1445, 0, 0, 0, 0, 0, 0, 0, 0, 1949, 0, 0, 0, 0, 0, 0, 0, 'Fel\'zerul: Say text 1'), -(1445, 3, 15, 7437, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Fel\'zerul: Cast spell destroy stuff'), -(1445, 5, 4, 147, 2, 1, 1443, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Fel\'zerul: npc_flag questgiver added'); +(1445, 0, 4, 147, 2, 2, 1443, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'The Temple of Atal Hakkar - Fel\'zerul: npc_flag questgiver removed'), +(1445, 0, 0, 0, 0, 0, 0, 0, 0, 1949, 0, 0, 0, 0, 0, 0, 0, 'The Temple of Atal Hakkar - Fel\'zerul: Say text 1'), +(1445, 3, 15, 7437, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'The Temple of Atal Hakkar - Fel\'zerul: Cast spell destroy stuff'), +(1445, 5, 4, 147, 2, 1, 1443, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'The Temple of Atal Hakkar - Fel\'zerul: npc_flag questgiver added'); -- End script for quest 3908 (It's a Secret to Everybody) - ok UPDATE `quest_template` SET `CompleteScript`=3908 WHERE `entry`=3908 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=3908; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(3908, 1, 0, 0, 0, 0, 0, 0, 0, 6153, 0, 0, 0, 0, 0, 0, 0, 'Donova Snowden: Say text 1'), -(3908, 1, 4, 147, 3, 2, 9298, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Donova Snowden: npc_flag quest giver and gossip removed'), -(3908, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6384.54, -2527.25, 538.736, 2.52438, 'Donova Snowden: Move 1'), -(3908, 8, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6370.12, -2525.52, 532.268, 2.82283, 'Donova Snowden: Move 2'), -(3908, 15, 0, 0, 0, 0, 0, 0, 0, 6154, 0, 0, 0, 0, 0, 0, 0, 'Donova Snowden: Say text 2'), -(3908, 20, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Donova Snowden: Throw emote'), -(3908, 21, 0, 0, 0, 0, 0, 0, 0, 6155, 0, 0, 0, 0, 0, 0, 0, 'Donova Snowden: Emote text 1'), -(3908, 23, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6364.25, -2524, 527.058, 2.9265, 'Donova Snowden: Move 3'), -(3908, 26, 0, 0, 0, 0, 0, 0, 0, 6156, 0, 0, 0, 0, 0, 0, 0, 'Donova Snowden: Say text 3'), -(3908, 27, 1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Donova Snowden: Kneel emote'), -(3908, 30, 0, 0, 0, 0, 0, 0, 0, 6157, 0, 0, 0, 0, 0, 0, 0, 'Donova Snowden: Say text 4'), -(3908, 31, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6370.3, -2524.19, 532.27, 6.26836, 'Donova Snowden: Move 4'), -(3908, 34, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6385.99, -2529.26, 539.03, 5.66753, 'Donova Snowden: Move 5'), -(3908, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6395.57, -2536.75, 541.548, 5.66753, 'Donova Snowden: Move 6'), -(3908, 47, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6395.57, -2536.75, 541.548, 2.86475, 'Donova Snowden: Move 7'), -(3908, 48, 0, 0, 0, 0, 0, 0, 0, 6158, 0, 0, 0, 0, 0, 0, 0, 'Donova Snowden: Say text 5'), -(3908, 49, 4, 147, 3, 1, 9298, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Donova Snowden: npc_flag quest giver and gossip added'); +(3908, 1, 0, 0, 0, 0, 0, 0, 0, 6153, 0, 0, 0, 0, 0, 0, 0, 'Its a Secret to Everybody - Donova Snowden: Say text 1'), +(3908, 1, 4, 147, 3, 2, 9298, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Its a Secret to Everybody - Donova Snowden: npc_flag quest giver and gossip removed'), +(3908, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6384.54, -2527.25, 538.736, 2.52438, 'Its a Secret to Everybody - Donova Snowden: Move 1'), +(3908, 8, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6370.12, -2525.52, 532.268, 2.82283, 'Its a Secret to Everybody - Donova Snowden: Move 2'), +(3908, 15, 0, 0, 0, 0, 0, 0, 0, 6154, 0, 0, 0, 0, 0, 0, 0, 'Its a Secret to Everybody - Donova Snowden: Say text 2'), +(3908, 20, 1, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Its a Secret to Everybody - Donova Snowden: Throw emote'), +(3908, 21, 0, 0, 0, 0, 0, 0, 0, 6155, 0, 0, 0, 0, 0, 0, 0, 'Its a Secret to Everybody - Donova Snowden: Emote text 1'), +(3908, 23, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6364.25, -2524, 527.058, 2.9265, 'Its a Secret to Everybody - Donova Snowden: Move 3'), +(3908, 26, 0, 0, 0, 0, 0, 0, 0, 6156, 0, 0, 0, 0, 0, 0, 0, 'Its a Secret to Everybody - Donova Snowden: Say text 3'), +(3908, 27, 1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Its a Secret to Everybody - Donova Snowden: Kneel emote'), +(3908, 30, 0, 0, 0, 0, 0, 0, 0, 6157, 0, 0, 0, 0, 0, 0, 0, 'Its a Secret to Everybody - Donova Snowden: Say text 4'), +(3908, 31, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6370.3, -2524.19, 532.27, 6.26836, 'Its a Secret to Everybody - Donova Snowden: Move 4'), +(3908, 34, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6385.99, -2529.26, 539.03, 5.66753, 'Its a Secret to Everybody - Donova Snowden: Move 5'), +(3908, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6395.57, -2536.75, 541.548, 5.66753, 'Its a Secret to Everybody - Donova Snowden: Move 6'), +(3908, 47, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6395.57, -2536.75, 541.548, 2.86475, 'Its a Secret to Everybody - Donova Snowden: Move 7'), +(3908, 48, 0, 0, 0, 0, 0, 0, 0, 6158, 0, 0, 0, 0, 0, 0, 0, 'Its a Secret to Everybody - Donova Snowden: Say text 5'), +(3908, 49, 4, 147, 3, 1, 9298, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Its a Secret to Everybody - Donova Snowden: npc_flag quest giver and gossip added'); -- End script for quest 5341 (Barov Family Fortune) - ok UPDATE `quest_template` SET `CompleteScript`=5341 WHERE `entry`=5341 AND `patch`=0; DELETE FROM `quest_end_scripts` WHERE `id`=5341; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(5341, 1, 0, 0, 0, 0, 0, 0, 6554, 0, 0, 0, 0, 0, 0, 0, 'Alexi Barov: Say text 1'), -(5341, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Alexi Barov: Talk emote'); +(5341, 1, 0, 0, 0, 0, 0, 0, 6554, 0, 0, 0, 0, 0, 0, 0, 'Barov Family Fortune - Alexi Barov: Say text 1'), +(5341, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Barov Family Fortune - Alexi Barov: Talk emote'); -- [0265] Fixes from ProjectSilverpine - ok @@ -359,8 +359,8 @@ UPDATE `quest_template` SET `StartScript`=7041 WHERE `entry`=7041 AND `patch`=0; DELETE FROM `quest_start_scripts` WHERE `id` IN (7029, 7041); INSERT INTO `quest_start_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(7029, 0, 0, 0, 0, 0, 0, 0, 8923, 0, 0, 0, 0, 0, 0, 0, 'Vark Battlescar: Say text 1'), -(7041, 0, 0, 0, 0, 0, 0, 0, 8923, 0, 0, 0, 0, 0, 0, 0, 'Talendria: Say text 1'); +(7029, 0, 0, 0, 0, 0, 0, 0, 8923, 0, 0, 0, 0, 0, 0, 0, 'Vyletongue Corruption - Vark Battlescar: Say text 1'), +(7041, 0, 0, 0, 0, 0, 0, 0, 8923, 0, 0, 0, 0, 0, 0, 0, 'Vyletongue Corruption - Talendria: Say text 1'); -- [0285] Fix typo, replace "guage" with "gauge" @@ -380,14 +380,14 @@ DELETE FROM `creature_ai_scripts` WHERE `creature_id`=3946; -- Tome of Mel'Thandris starts event 663 DELETE FROM `event_scripts` WHERE `id`=663; INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(663, 0, 10, 3946, 22000, 0, 0, 0, 0, 0, 0, 0, 3161.682, -1211.122, 214.949, 4.669, 'Velinde Starsong: Spawn'), -(663, 2, 28, 8, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Kneel emote'), -(663, 5, 0, 0, 0, 3946, 10, 0, 1356, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Say text 1'), -(663, 5, 1, 1, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Talk emote 1'), -(663, 10, 0, 0, 0, 3946, 10, 0, 1357, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Say text 2'), -(663, 10, 1, 20, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Beg emote 1'), -(663, 15, 0, 0, 0, 3946, 10, 0, 1358, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Say text 3'), -(663, 15, 1, 1, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Talk emote 2'); +(663, 0, 10, 3946, 22000, 0, 0, 0, 0, 0, 0, 0, 3161.682, -1211.122, 214.949, 4.669, 'Tome of MelThandris - Velinde Starsong: Spawn'), +(663, 2, 28, 8, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Tome of MelThandris - Velinde Starsong: Kneel emote'), +(663, 5, 0, 0, 0, 3946, 10, 0, 1356, 0, 0, 0, 0, 0, 0, 0, 'Tome of MelThandris - Velinde Starsong: Say text 1'), +(663, 5, 1, 1, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Tome of MelThandris - Velinde Starsong: Talk emote 1'), +(663, 10, 0, 0, 0, 3946, 10, 0, 1357, 0, 0, 0, 0, 0, 0, 0, 'Tome of MelThandris - Velinde Starsong: Say text 2'), +(663, 10, 1, 20, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Tome of MelThandris - Velinde Starsong: Beg emote 1'), +(663, 15, 0, 0, 0, 3946, 10, 0, 1358, 0, 0, 0, 0, 0, 0, 0, 'Tome of MelThandris - Velinde Starsong: Say text 3'), +(663, 15, 1, 1, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Tome of MelThandris - Velinde Starsong: Talk emote 2'); -- Added script for quest 1043 (The Scythe of Elune) -- Source: http://www.wowwiki.com/Quest:The_Scythe_of_Elune @@ -395,23 +395,23 @@ INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, -- Mound of Dirt starts event 664 DELETE FROM `event_scripts` WHERE `id`=664; INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(664, 0, 10, 3946, 22000, 0, 0, 0, 0, 0, 0, 0, -11142.509, -1151.725, 43.598, 4.849, 'Velinde Starsong: Spawn'), -(664, 5, 0, 0, 0, 3946, 10, 0, 1359, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Say text 1'), -(664, 5, 1, 1, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Talk emote 1'), -(664, 10, 0, 0, 0, 3946, 10, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Say text 2'), -(664, 10, 1, 1, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Talk emote 2'), -(664, 15, 1, 18, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Velinde Starsong: Cry emote'); +(664, 0, 10, 3946, 22000, 0, 0, 0, 0, 0, 0, 0, -11142.509, -1151.725, 43.598, 4.849, 'Mound of Dirt - Velinde Starsong: Spawn'), +(664, 5, 0, 0, 0, 3946, 10, 0, 1359, 0, 0, 0, 0, 0, 0, 0, 'Mound of Dirt - Velinde Starsong: Say text 1'), +(664, 5, 1, 1, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mound of Dirt - Velinde Starsong: Talk emote 1'), +(664, 10, 0, 0, 0, 3946, 10, 0, 1360, 0, 0, 0, 0, 0, 0, 0, 'Mound of Dirt - Velinde Starsong: Say text 2'), +(664, 10, 1, 1, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mound of Dirt - Velinde Starsong: Talk emote 2'), +(664, 15, 1, 18, 0, 3946, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mound of Dirt - Velinde Starsong: Cry emote'); -- [0878] Improved script for quest 656 - Ok -- https://github.com/cmangos/classic-db/commit/c6d88fa9e8590c249bafbdfe3fb7ffe1b9cc0f6e DELETE FROM `event_scripts` WHERE `id`=420; INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(420, 0, 10, 2755, 3000000, 0, 0, 0, 0, 0, 0, 0, -931.73, -3111.81, 48.517, 3.27404, 'Myzrael: Spawn for quest 656'), -(420, 2, 0, 0, 0, 2755, 50, 1, 842, 0, 0, 0, 0, 0, 0, 0, 'Myzrael: Say text 1'), -(420, 5, 0, 0, 0, 2755, 50, 1, 843, 0, 0, 0, 0, 0, 0, 0, 'Myzrael: Say text 2'), -(420, 10, 0, 0, 0, 2755, 50, 1, 844, 0, 0, 0, 0, 0, 0, 0, 'Myzrael: Say text 3'), -(420, 11, 26, 0, 0, 2755, 50, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Myzrael: Attack'); +(420, 0, 10, 2755, 3000000, 0, 0, 0, 0, 0, 0, 0, -931.73, -3111.81, 48.517, 3.27404, 'Summoning the Princess - Myzrael: Spawn for quest 656'), +(420, 2, 0, 0, 0, 2755, 50, 1, 842, 0, 0, 0, 0, 0, 0, 0, 'Summoning the Princess - Myzrael: Say text 1'), +(420, 5, 0, 0, 0, 2755, 50, 1, 843, 0, 0, 0, 0, 0, 0, 0, 'Summoning the Princess - Myzrael: Say text 2'), +(420, 10, 0, 0, 0, 2755, 50, 1, 844, 0, 0, 0, 0, 0, 0, 0, 'Summoning the Princess - Myzrael: Say text 3'), +(420, 11, 26, 0, 0, 2755, 50, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Summoning the Princess - Myzrael: Attack'); -- [1194] Backported UDB updates @@ -421,31 +421,31 @@ INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, DELETE FROM `quest_end_scripts` WHERE `id`=4129; UPDATE `quest_template` SET `CompleteScript`=4129 WHERE `entry`=4129 AND `patch`=0; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(4129,0,4,147,6,2,0,0,0,0,0,0,0,0,0,0,0,'Quintis Jonespyre: npcflag removed (LH flag is 6)'), -(4129,2,0,0,0,0,0,0,0,5148,0,0,0,0,0,0,0,'Quintis Jonespyre: Say text 1'), -(4129,3,15,15050,0,0,0,0,0,0,0,0,0,0,0,0,0,'Quintis Jonespyre: Cast Psychometry spell'), -(4129,10,0,0,0,0,0,0,0,5149,0,0,0,0,0,0,0,'Quintis Jonespyre: Say text 2'), -(4129,12,4,147,6,1,0,0,0,0,0,0,0,0,0,0,0,'Quintis Jonespyre: npcflag added again'); +(4129,0,4,147,6,2,0,0,0,0,0,0,0,0,0,0,0,'The Knife Revealed - Quintis Jonespyre: npcflag removed (LH flag is 6)'), +(4129,2,0,0,0,0,0,0,0,5148,0,0,0,0,0,0,0,'The Knife Revealed - Quintis Jonespyre: Say text 1'), +(4129,3,15,15050,0,0,0,0,0,0,0,0,0,0,0,0,0,'The Knife Revealed - Quintis Jonespyre: Cast Psychometry spell'), +(4129,10,0,0,0,0,0,0,0,5149,0,0,0,0,0,0,0,'The Knife Revealed - Quintis Jonespyre: Say text 2'), +(4129,12,4,147,6,1,0,0,0,0,0,0,0,0,0,0,0,'The Knife Revealed - Quintis Jonespyre: npcflag added again'); -- q.2943 'Return to Troyas' - ok DELETE FROM `quest_end_scripts` WHERE id=2943; UPDATE `quest_template` SET `CompleteScript`=2943 WHERE `entry`=2943 AND `patch`=0; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(2943,0,4,147,2,2,0,0,0,0,0,0,0,0,0,0,0,'Troyas Moonbreeze: npcFlags removed (LH flag is 2)'), -(2943,1,0,0,0,0,0,0,0,4039,0,0,0,0,0,0,0,'Troyas Moonbreeze: Say text 1'), -(2943,2,3,0,0,0,0,0,0,0,0,0,0,-4476.23,3230.55,13.7301,4.20931,'Troyas Moonbreeze: Move to table'), -(2943,4,3,0,0,0,0,0,0,0,0,0,0,-4476.23,3230.55,13.7301,4.99471,'Troyas Moonbreeze: Rotate'), -(2943,5,0,0,0,0,0,0,0,4040,0,0,0,0,0,0,0,'Troyas Moonbreeze: Emote text 1'), -(2943,10,0,0,0,0,0,0,0,4041,0,0,0,0,0,0,0,'Troyas Moonbreeze: Say text 2'), -(2943,12,3,0,0,0,0,0,0,0,0,0,0,-4474.9,3232.88,13.7295,0.951991,'Troyas Moonbreeze: Move back'), -(2943,14,4,147,2,1,0,0,0,0,0,0,0,0,0,0,0,'Troyas Moonbreeze: npcFlags added (LH flag is 2)'); +(2943,0,4,147,2,2,0,0,0,0,0,0,0,0,0,0,0,'Return to Troyas - Troyas Moonbreeze: npcFlags removed (LH flag is 2)'), +(2943,1,0,0,0,0,0,0,0,4039,0,0,0,0,0,0,0,'Return to Troyas - Troyas Moonbreeze: Say text 1'), +(2943,2,3,0,0,0,0,0,0,0,0,0,0,-4476.23,3230.55,13.7301,4.20931,'Return to Troyas - Troyas Moonbreeze: Move to table'), +(2943,4,3,0,0,0,0,0,0,0,0,0,0,-4476.23,3230.55,13.7301,4.99471,'Return to Troyas - Troyas Moonbreeze: Rotate'), +(2943,5,0,0,0,0,0,0,0,4040,0,0,0,0,0,0,0,'Return to Troyas - Troyas Moonbreeze: Emote text 1'), +(2943,10,0,0,0,0,0,0,0,4041,0,0,0,0,0,0,0,'Return to Troyas - Troyas Moonbreeze: Say text 2'), +(2943,12,3,0,0,0,0,0,0,0,0,0,0,-4474.9,3232.88,13.7295,0.951991,'Return to Troyas - Troyas Moonbreeze: Move back'), +(2943,14,4,147,2,1,0,0,0,0,0,0,0,0,0,0,0,'Return to Troyas - Troyas Moonbreeze: npcFlags added (LH flag is 2)'); -- q.3463 'Set Them Ablaze!' - ok DELETE FROM `quest_end_scripts` WHERE id=3463; INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `buddy_id`, `buddy_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES -(3463,1,31,8479,100,0,0,0,0,0,0,0,0,0,0,0,'search for Kalaran Windblade'), -(3463,2,18,0,0,8479,5921,1 | 0x10,0,0,0,0,0,0,0,0,'despawn Kalaran Windblade'), -(3463,3,10,8480,54000,0,0,0,0,0,0,0,-6679.93,-1194.36,240.297,2.96706,'summon Kalaran the Deceiver'); +(3463,1,31,8479,100,0,0,0,0,0,0,0,0,0,0,0,'Set Them Ablaze - Search for Kalaran Windblade'), +(3463,2,18,0,0,8479,5921,1 | 0x10,0,0,0,0,0,0,0,0,'Set Them Ablaze - Despawn Kalaran Windblade'), +(3463,3,10,8480,54000,0,0,0,0,0,0,0,-6679.93,-1194.36,240.297,2.96706,'Set Them Ablaze - Summon Kalaran the Deceiver'); UPDATE `quest_template` SET `CompleteScript`=3463 WHERE `entry`=3463; -- Kalaran Windblade set lower respawn since he will be despawned @@ -548,6 +548,11 @@ INSERT INTO `quest_greeting` (`entry`, `content_default`, `content_loc1`, `conte -- (7825, ' ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0), -- Oran Snakewrithe (9536, 'The quest for wealth is the only goal for a respectable goblin.$B$BWell, maybe wealth... and a big, loud death!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0); -- Maxwort Uberglint +-- Unrelated startup error. +-- ERROR:Table `creature` have creature (GUID: 590004 Entry: 6228) with low current mana (1926), `creature_template`.`minmana`=2457. +UPDATE `creature` SET `curmana`=2457 WHERE `guid`=590004; + + -- End of migration. END IF; END?? diff --git a/sql/migrations/20180306191347_world.sql b/sql/old_migrations/20180306191347_world.sql similarity index 78% rename from sql/migrations/20180306191347_world.sql rename to sql/old_migrations/20180306191347_world.sql index 3c3357299..2172fdf6a 100644 --- a/sql/migrations/20180306191347_world.sql +++ b/sql/old_migrations/20180306191347_world.sql @@ -12,20 +12,6 @@ INSERT INTO `migrations` VALUES ('20180306191347'); -- Your Place In The World UPDATE `quest_template` SET `DetailsEmote1`=1, `CompleteEmote`=0, `OfferRewardEmote1`=6 WHERE `entry`=4641 AND `patch`=0; --- Cutting Teeth -UPDATE `quest_template` SET `CompleteEmote`=0, `CompleteScript`=788 WHERE `entry`=788 AND `patch`=0; - -DELETE FROM `quest_end_scripts` WHERE `id`=788; -INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `comments`) VALUES -(788, 1, 1, 11, 'Gornek: Laugh emote on quest end'); - --- Sting of the Scorpid -UPDATE `quest_template` SET `StartScript`=789, `CompleteEmote`=0 WHERE `entry`=789 AND `patch`=0; - -DELETE FROM `quest_start_scripts` WHERE `id`=789; -INSERT INTO `quest_start_scripts` (`id`, `command`, `datalong`, `comments`) VALUES -(789, 1, 1, 'Gornek: Talk emote on quest accept'); - -- Class quests: Should have race requirement (Otherwise both Orc and Troll version would be available in video) - CHECK -- Assumption: All class quest will be given same emotes, cause fair -- 11/11 @@ -82,13 +68,6 @@ INSERT INTO `quest_start_scripts` (`id`, `delay`, `command`, `datalong`, `datain INSERT INTO `quest_start_scripts` (`id`, `delay`, `command`, `datalong`, `buddy_id`, `buddy_radius`, `comments`) VALUES (804, 15, 28, 7, 3287, 5, 'Hana\'zua: Kneel state off'); --- Galgar's Cactus Apple Surprise -UPDATE `quest_template` SET `StartScript`=4402, `DetailsEmote1`=5, `CompleteEmote`=6, `OfferRewardEmote1`=1 WHERE `entry`=4402 AND `patch`=0; - -DELETE FROM `quest_start_scripts` WHERE `id`=4402; -INSERT INTO `quest_start_scripts` (`id`, `delay`, `command`, `datalong`, `comments`) VALUES -(4402, 2, 1, 1, 'Galgar: Talk emote on quest accept'); - -- Throwables present on LH -- Burning Blade Medallion @@ -117,18 +96,11 @@ UPDATE `quest_template` SET `DetailsEmote1`=1, `CompleteEmote`=1, `OfferRewardEm UPDATE `quest_template` SET `DetailsEmote1`=1, `CompleteEmote`=1, `OfferRewardEmote1`=1 WHERE `entry`=817; -- A Peon's Burden -UPDATE `quest_template` SET `CompleteScript`=2161, `DetailsEmote1`=6, `OfferRewardEmote1`=6 WHERE `entry`=2161; - -DELETE FROM `quest_end_scripts` WHERE `id`=2161; -INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `comments`) VALUES -(2161, 0, 1, 1, 'Innkeeper Grosk: Talk emote on quest end'); +UPDATE `quest_template` SET `DetailsEmote1`=6, `OfferRewardEmote1`=6, `OfferRewardEmote2`=1 WHERE `entry`=2161; -- Vanquish the Betrayers UPDATE `quest_template` SET `DetailsEmote1`=5, `IncompleteEmote`=25, `OfferRewardEmote1`=66 WHERE `entry`=784 AND `patch`=0; --- Break a Few Eggs -UPDATE `quest_template` SET `DetailsEmote1`=5 WHERE `entry`=815 AND `patch`=0; - -- Carry Your Weight UPDATE `quest_template` SET `DetailsEmote1`=2, `OfferRewardEmote1`=4 WHERE `entry`=791 AND `patch`=0; @@ -144,13 +116,6 @@ INSERT INTO `quest_end_scripts` (`id`, `delay`, `dataint`, `comments`) VALUES INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `comments`) VALUES (806, 4, 1, 61, 'Orgnil Soulscar: Throw emote'); --- From the Wreckage.... -UPDATE `quest_template` SET `DetailsEmote1`=1, `CompleteEmote`=1, `IncompleteEmote`=1, `CompleteScript`=825 WHERE entry=825 AND `patch`=0; - -DELETE FROM `quest_end_scripts` WHERE `id`=825; -INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `comments`) VALUES -(825, 0, 1, 66, 'Gar\'Thok: Salute emote on quest end'); - -- The Admiral's Orders UPDATE `quest_template` SET `CompleteEmote`=6, `OfferRewardEmote1`=1 WHERE `entry`=830 AND `patch`=0; @@ -182,14 +147,7 @@ UPDATE `quest_template` SET `DetailsEmote1`=1, CompleteEmote=0, `OfferRewardEmot UPDATE `quest_template` SET `DetailsEmote1`=1, `OfferRewardEmote1`=273 WHERE `entry`=6081 AND `patch`=0; -- Need for a Cure -UPDATE `quest_template` SET `DetailsEmote1`=1, CompleteEmote=1, `OfferRewardEmote1`=2,`CompleteScript`=812 WHERE `entry`=812 AND `patch`=0; - -DELETE FROM `quest_end_scripts` WHERE `id`=812; -INSERT INTO `quest_end_scripts` (`id`, `delay`, `command`, `datalong`, `comments`) VALUES -(812, 1, 1, 1, 'Rhinag: Talk emote on quest end'); - --- The Admiral's Orders 2 -UPDATE `quest_template` SET `OfferRewardEmote1`=5 WHERE `entry`=831 AND `patch`=0; +UPDATE `quest_template` SET `DetailsEmote1`=1, CompleteEmote=1, `OfferRewardEmote1`=2, `OfferRewardEmote2`=1 WHERE `entry`=812 AND `patch`=0; -- Hidden Enemies UPDATE `quest_template` SET `DetailsEmote1`=1,`CompleteEmote`=6, `OfferRewardEmote1`=15 WHERE entry=5726; @@ -253,11 +211,55 @@ INSERT INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `posi (12468, 3240, 1, -1520.69, -5293.85, 7.05261, 2.21025, 0.89352, 0.449022, 300, 300, 100, 1, 8); -- Conscript of the Horde -UPDATE `quest_template` SET `StartScript`=840,`DetailsEmote1`=0, `CompleteEmote`=15, `OfferRewardEmote1`=6 WHERE `entry`=840 AND `patch`=0; +UPDATE `quest_template` SET `DetailsEmote1`=25, `DetailsEmoteDelay1`=3000, `CompleteEmote`=15, `OfferRewardEmote1`=6 WHERE `entry`=840 AND `patch`=0; + + +-- More emote fixes by brotalnia below. + + +-- Kaltunk should do two talk emotes, followed by a laugh and point emote when offering quest Your Place In The World +-- Gornek should do shrug emote when turning in quest Your Place In The World +UPDATE `quest_template` SET `DetailsEmote1`=1, `DetailsEmote2`=1, `DetailsEmote3`=11, `DetailsEmote4`=25, `OfferRewardEmote1`=6 WHERE `entry`=4641; + +-- Gornek should do talk emote when offering quest Cutting Teeth. +-- Gornek should do laugh emote when turning in quest Cutting Teeth. +UPDATE `quest_template` SET `DetailsEmote1`=1, `OfferRewardEmote1`=1, `OfferRewardEmoteDelay1`=2000 WHERE `entry`=788; + +-- Gornek should do talk emote when offering quest Sting of the Scorpid +UPDATE `quest_template` SET `DetailsEmote1`=1,`DetailsEmoteDelay1`=1000 WHERE `entry`=789; + +-- Galgar should do shout emote when offering quest Galgar's Cactus Apple Surprise +-- Galgar should do shrug emote on completed quest Galgar's Cactus Apple Surprise +-- Galgar should do talk emote when turning in quest Galgar's Cactus Apple Surprise +UPDATE `quest_template` SET `DetailsEmote1`=5, `CompleteEmote`=6, `OfferRewardEmote1`=1 WHERE `entry`=4402; + +-- Master Gadrin should do talk emote when turning in quest Report to Sen'Jin Village +UPDATE `quest_template` SET `OfferRewardEmote1`=1 WHERE `entry`=805; + +-- Cook Torka should do shout emote, followed by two talk emotes when offering quest Break a Few Eggs +-- Cook Torka should not do an emote on completed quest Break a Few Eggs +-- Cook Torka should do two talk emotes when turning in quest Break a Few Eggs +UPDATE `quest_template` SET `DetailsEmote1`=5, `DetailsEmote2`=1, `DetailsEmote3`=1, `CompleteEmote`=0, `OfferRewardEmote1`=1, `OfferRewardEmote2`=1 WHERE `entry`=815; + +-- Gar'Thok should do talk emote when offering quest From The Wreckage +-- Gar'Thok should do talk emote on incomplete quest From The Wreckage +-- Gar'Thok should do salute emote when turning in quest From The Wreckage +UPDATE `quest_template` SET `DetailsEmote1`=1, `IncompleteEmote`=1, `OfferRewardEmote1`=66, `OfferRewardEmoteDelay1`=3000 WHERE `entry`=825; + +-- Gar'Thok should do cheer emote when offering quest The Admiral's Orders 2 +-- Nazgrel should do shrug emote on completed quest The Admiral's Orders 2 +-- Nazgrel should do yell emote when turning in quest The Admiral's Orders 2 +UPDATE `quest_template` SET `DetailsEmote1`=4, `DetailsEmoteDelay1`=2000, `CompleteEmote`=6, `OfferRewardEmote1`=5 WHERE `entry`=831; + +-- Lar Prowltusk should do salute emote when turning in quest Thwarting Kolkar Aggression +UPDATE `quest_template` SET `OfferRewardEmote1`=66 WHERE `entry`=786; + +-- Master Gadrin should not do an emote on completed quest Zalazane +UPDATE `quest_template` SET `CompleteEmote`=0 WHERE `entry`=826; + +-- Sentinel Elissa Starbreeze should do bow emote when offering quest The Tower of Althalaxx +UPDATE `quest_template` SET `DetailsEmote1`=2 WHERE `entry`=965; -DELETE FROM `quest_start_scripts` WHERE `id`=840; -INSERT INTO `quest_start_scripts` (`id`, `delay`, `command`, `datalong`, `comments`) VALUES -(840, 0, 1, 25, 'Takrin Pathseeker: Point emote on quest start'); -- End of migration. END IF; diff --git a/sql/migrations/20180307015602_world.sql b/sql/old_migrations/20180307015602_world.sql similarity index 100% rename from sql/migrations/20180307015602_world.sql rename to sql/old_migrations/20180307015602_world.sql diff --git a/sql/old_migrations/20180307093632_world.sql b/sql/old_migrations/20180307093632_world.sql new file mode 100644 index 000000000..e74ae1e4a --- /dev/null +++ b/sql/old_migrations/20180307093632_world.sql @@ -0,0 +1,22 @@ +DROP PROCEDURE IF EXISTS add_migration; +delimiter ?? +CREATE PROCEDURE `add_migration`() +BEGIN +DECLARE v INT DEFAULT 1; +SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20180307093632'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20180307093632'); +-- Add your query below. + +-- Fix Alliance First Aid trainers. +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`, `condition_id`) VALUES (4762, 0, 3, 'I require training', 6503, 5, 16, 0, 0, 0, 0, 0, NULL, 0, 0); + +-- Fix Betina Bigglezink gossip option for Dawn's Gambit. +UPDATE `gossip_scripts` SET `data_flags`=0 WHERE `id`=50407; + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/sql/migrations/20180310163906_world.sql b/sql/old_migrations/20180310163906_world.sql similarity index 100% rename from sql/migrations/20180310163906_world.sql rename to sql/old_migrations/20180310163906_world.sql diff --git a/sql/migrations/20180310165536_world.sql b/sql/old_migrations/20180310165536_world.sql similarity index 100% rename from sql/migrations/20180310165536_world.sql rename to sql/old_migrations/20180310165536_world.sql diff --git a/sql/world.sql b/sql/world.sql deleted file mode 100644 index f0f5d6bcb..000000000 --- a/sql/world.sql +++ /dev/null @@ -1,3342 +0,0 @@ --- -------------------------------------------------------- --- Хост: 127.0.0.1 --- Server version: 5.5.53 - MySQL Community Server (GPL) --- Server OS: Win32 --- HeidiSQL Версия: 9.3.0.4998 --- -------------------------------------------------------- - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET NAMES utf8mb4 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; - --- Dumping structure for table mangos.areatrigger_bg_entrance -DROP TABLE IF EXISTS `areatrigger_bg_entrance`; -CREATE TABLE IF NOT EXISTS `areatrigger_bg_entrance` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', - `name` text, - `team` mediumint(8) unsigned NOT NULL DEFAULT '0', - `bg_template` mediumint(8) unsigned NOT NULL DEFAULT '0', - `exit_map` float NOT NULL DEFAULT '0', - `exit_position_x` float NOT NULL DEFAULT '0', - `exit_position_y` float NOT NULL DEFAULT '0', - `exit_position_z` float NOT NULL DEFAULT '0', - `exit_orientation` float NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.areatrigger_involvedrelation -DROP TABLE IF EXISTS `areatrigger_involvedrelation`; -CREATE TABLE IF NOT EXISTS `areatrigger_involvedrelation` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', - `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.areatrigger_tavern -DROP TABLE IF EXISTS `areatrigger_tavern`; -CREATE TABLE IF NOT EXISTS `areatrigger_tavern` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', - `name` text, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.areatrigger_teleport -DROP TABLE IF EXISTS `areatrigger_teleport`; -CREATE TABLE IF NOT EXISTS `areatrigger_teleport` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `name` text, - `required_level` tinyint(3) unsigned NOT NULL DEFAULT '0', - `required_item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `required_item2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `required_quest_done` int(11) unsigned NOT NULL DEFAULT '0', - `required_event` int(11) DEFAULT '0', - `required_pvp_rank` mediumint(8) unsigned DEFAULT '0', - `required_team` mediumint(8) unsigned DEFAULT '0', - `required_failed_text` text, - `target_map` smallint(5) unsigned NOT NULL DEFAULT '0', - `target_position_x` float NOT NULL DEFAULT '0', - `target_position_y` float NOT NULL DEFAULT '0', - `target_position_z` float NOT NULL DEFAULT '0', - `target_orientation` float NOT NULL DEFAULT '0', - PRIMARY KEY (`id`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.area_template -DROP TABLE IF EXISTS `area_template`; -CREATE TABLE IF NOT EXISTS `area_template` ( - `Entry` mediumint(8) NOT NULL DEFAULT '0', - `MapId` mediumint(8) NOT NULL DEFAULT '0', - `ZoneId` mediumint(8) NOT NULL DEFAULT '0', - `ExploreFlag` mediumint(8) NOT NULL DEFAULT '0', - `Flags` mediumint(8) NOT NULL DEFAULT '0', - `AreaLevel` mediumint(8) NOT NULL DEFAULT '0', - `Name` varchar(100) NOT NULL DEFAULT '', - `Team` tinyint(3) NOT NULL DEFAULT '0', - `LiquidTypeId` tinyint(3) NOT NULL DEFAULT '0', - PRIMARY KEY (`Entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.auctionhousebot -DROP TABLE IF EXISTS `auctionhousebot`; -CREATE TABLE IF NOT EXISTS `auctionhousebot` ( - `item` int(11) DEFAULT NULL COMMENT 'ID de l''item', - `stack` int(11) DEFAULT NULL COMMENT 'Empillement', - `bid` int(11) DEFAULT NULL COMMENT 'Prix a encherir', - `buyout` int(11) DEFAULT NULL COMMENT 'Achat immediat' -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.autobroadcast -DROP TABLE IF EXISTS `autobroadcast`; -CREATE TABLE IF NOT EXISTS `autobroadcast` ( - `delay` int(11) DEFAULT NULL, - `commentaire` varchar(255) DEFAULT NULL, - `stringId` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.battleground_events -DROP TABLE IF EXISTS `battleground_events`; -CREATE TABLE IF NOT EXISTS `battleground_events` ( - `map` smallint(5) NOT NULL, - `event1` tinyint(3) unsigned NOT NULL, - `event2` tinyint(3) unsigned NOT NULL, - `description` varchar(255) NOT NULL, - PRIMARY KEY (`map`,`event1`,`event2`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.battleground_template -DROP TABLE IF EXISTS `battleground_template`; -CREATE TABLE IF NOT EXISTS `battleground_template` ( - `id` mediumint(8) unsigned NOT NULL, - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `MinPlayersPerTeam` smallint(5) unsigned NOT NULL DEFAULT '0', - `MaxPlayersPerTeam` smallint(5) unsigned NOT NULL DEFAULT '0', - `MinLvl` tinyint(3) unsigned NOT NULL DEFAULT '0', - `MaxLvl` tinyint(3) unsigned NOT NULL DEFAULT '0', - `AllianceWinSpell` smallint(5) unsigned NOT NULL DEFAULT '0', - `AllianceLoseSpell` smallint(5) unsigned NOT NULL DEFAULT '0', - `HordeWinSpell` smallint(5) unsigned NOT NULL DEFAULT '0', - `HordeLoseSpell` smallint(5) unsigned NOT NULL DEFAULT '0', - `AllianceStartLoc` mediumint(8) unsigned NOT NULL, - `AllianceStartO` float NOT NULL, - `HordeStartLoc` mediumint(8) unsigned NOT NULL, - `HordeStartO` float NOT NULL, - PRIMARY KEY (`id`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.battlemaster_entry -DROP TABLE IF EXISTS `battlemaster_entry`; -CREATE TABLE IF NOT EXISTS `battlemaster_entry` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Entry of a creature', - `bg_template` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Battleground template id', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.broadcast_text -DROP TABLE IF EXISTS `broadcast_text`; -CREATE TABLE IF NOT EXISTS `broadcast_text` ( - `ID` mediumint(8) unsigned NOT NULL DEFAULT '0', - `MaleText` longtext, - `FemaleText` longtext, - `Sound` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Type` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Language` mediumint(8) unsigned NOT NULL DEFAULT '0', - `EmoteId0` mediumint(8) unsigned NOT NULL DEFAULT '0', - `EmoteId1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `EmoteId2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `EmoteDelay0` mediumint(8) unsigned NOT NULL DEFAULT '0', - `EmoteDelay1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `EmoteDelay2` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`ID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.cinematic_waypoints -DROP TABLE IF EXISTS `cinematic_waypoints`; -CREATE TABLE IF NOT EXISTS `cinematic_waypoints` ( - `cinematic` int(11) DEFAULT '0', - `timer` int(11) DEFAULT '0', - `posx` float DEFAULT NULL, - `posy` float DEFAULT NULL, - `posz` float DEFAULT NULL, - `comment` varchar(255) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.command -DROP TABLE IF EXISTS `command`; -CREATE TABLE IF NOT EXISTS `command` ( - `name` varchar(50) NOT NULL DEFAULT '', - `security` tinyint(3) unsigned NOT NULL DEFAULT '0', - `help` longtext, - `flags` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Chat System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.conditions -DROP TABLE IF EXISTS `conditions`; -CREATE TABLE IF NOT EXISTS `conditions` ( - `condition_entry` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', - `type` tinyint(3) NOT NULL DEFAULT '0' COMMENT 'Type of the condition', - `value1` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'data field one for the condition', - `value2` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'data field two for the condition', - PRIMARY KEY (`condition_entry`), - UNIQUE KEY `unique_conditions` (`type`,`value1`,`value2`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Condition System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature -DROP TABLE IF EXISTS `creature`; -CREATE TABLE IF NOT EXISTS `creature` ( - `guid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Global Unique Identifier', - `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature Identifier', - `map` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', - `modelid` mediumint(8) unsigned NOT NULL DEFAULT '0', - `equipment_id` mediumint(9) NOT NULL DEFAULT '0', - `position_x` float NOT NULL DEFAULT '0', - `position_y` float NOT NULL DEFAULT '0', - `position_z` float NOT NULL DEFAULT '0', - `orientation` float NOT NULL DEFAULT '0', - `spawntimesecsmin` int(10) unsigned NOT NULL DEFAULT '120', - `spawntimesecsmax` int(10) unsigned NOT NULL DEFAULT '120', - `spawndist` float NOT NULL DEFAULT '5', - `currentwaypoint` mediumint(8) unsigned NOT NULL DEFAULT '0', - `curhealth` int(10) unsigned NOT NULL DEFAULT '1', - `curmana` int(10) unsigned NOT NULL DEFAULT '0', - `DeathState` tinyint(3) unsigned NOT NULL DEFAULT '0', - `MovementType` tinyint(3) unsigned NOT NULL DEFAULT '0', - `spawnFlags` int(10) unsigned NOT NULL DEFAULT '0', - `visibilitymod` float DEFAULT '0', - `patch_min` tinyint(3) unsigned NOT NULL DEFAULT '0', - `patch_max` tinyint(3) unsigned NOT NULL DEFAULT '10', - PRIMARY KEY (`guid`), - KEY `idx_map` (`map`), - KEY `idx_id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_addon -DROP TABLE IF EXISTS `creature_addon`; -CREATE TABLE IF NOT EXISTS `creature_addon` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mount` mediumint(8) unsigned NOT NULL DEFAULT '0', - `bytes1` int(10) unsigned NOT NULL DEFAULT '0', - `b2_0_sheath` tinyint(3) unsigned NOT NULL DEFAULT '0', - `b2_1_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `emote` int(10) unsigned NOT NULL DEFAULT '0', - `moveflags` int(10) unsigned NOT NULL DEFAULT '0', - `auras` text, - PRIMARY KEY (`guid`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_ai_scripts -DROP TABLE IF EXISTS `creature_ai_scripts`; -CREATE TABLE IF NOT EXISTS `creature_ai_scripts` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', - `creature_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature Template Identifier', - `event_type` tinyint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Event Type', - `event_inverse_phase_mask` int(11) NOT NULL DEFAULT '0' COMMENT 'Mask which phases this event will not trigger in', - `event_chance` int(3) unsigned NOT NULL DEFAULT '100', - `event_flags` int(3) unsigned NOT NULL DEFAULT '0', - `event_param1` int(11) NOT NULL DEFAULT '0', - `event_param2` int(11) NOT NULL DEFAULT '0', - `event_param3` int(11) NOT NULL DEFAULT '0', - `event_param4` int(11) NOT NULL DEFAULT '0', - `action1_type` tinyint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type', - `action1_param1` int(11) NOT NULL DEFAULT '0', - `action1_param2` int(11) NOT NULL DEFAULT '0', - `action1_param3` int(11) NOT NULL DEFAULT '0', - `action2_type` tinyint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type', - `action2_param1` int(11) NOT NULL DEFAULT '0', - `action2_param2` int(11) NOT NULL DEFAULT '0', - `action2_param3` int(11) NOT NULL DEFAULT '0', - `action3_type` tinyint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type', - `action3_param1` int(11) NOT NULL DEFAULT '0', - `action3_param2` int(11) NOT NULL DEFAULT '0', - `action3_param3` int(11) NOT NULL DEFAULT '0', - `comment` varchar(255) NOT NULL DEFAULT '' COMMENT 'Event Comment', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Scripts'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_ai_summons -DROP TABLE IF EXISTS `creature_ai_summons`; -CREATE TABLE IF NOT EXISTS `creature_ai_summons` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Location Identifier', - `position_x` float NOT NULL DEFAULT '0', - `position_y` float NOT NULL DEFAULT '0', - `position_z` float NOT NULL DEFAULT '0', - `orientation` float NOT NULL DEFAULT '0', - `spawntimesecs` int(11) unsigned NOT NULL DEFAULT '120', - `comment` varchar(255) NOT NULL DEFAULT '' COMMENT 'Summon Comment', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Summoning Locations'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_ai_texts -DROP TABLE IF EXISTS `creature_ai_texts`; -CREATE TABLE IF NOT EXISTS `creature_ai_texts` ( - `entry` mediumint(8) NOT NULL, - `content_default` text NOT NULL, - `content_loc1` text, - `content_loc2` text, - `content_loc3` text, - `content_loc4` text, - `content_loc5` text, - `content_loc6` text, - `content_loc7` text, - `content_loc8` text, - `sound` mediumint(8) unsigned NOT NULL DEFAULT '0', - `type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `language` tinyint(3) unsigned NOT NULL DEFAULT '0', - `emote` smallint(5) NOT NULL DEFAULT '0', - `comment` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_battleground -DROP TABLE IF EXISTS `creature_battleground`; -CREATE TABLE IF NOT EXISTS `creature_battleground` ( - `guid` int(10) unsigned NOT NULL COMMENT 'Creature''s GUID', - `event1` tinyint(3) unsigned NOT NULL COMMENT 'main event', - `event2` tinyint(3) unsigned NOT NULL COMMENT 'sub event', - PRIMARY KEY (`guid`,`event1`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature battleground indexing system'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_equip_template -DROP TABLE IF EXISTS `creature_equip_template`; -CREATE TABLE IF NOT EXISTS `creature_equip_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Unique entry', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `equipentry1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `equipentry2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `equipentry3` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Equipment)'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_equip_template_raw -DROP TABLE IF EXISTS `creature_equip_template_raw`; -CREATE TABLE IF NOT EXISTS `creature_equip_template_raw` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Unique entry', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `equipmodel1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `equipmodel2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `equipmodel3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `equipinfo1` int(10) unsigned NOT NULL DEFAULT '0', - `equipinfo2` int(10) unsigned NOT NULL DEFAULT '0', - `equipinfo3` int(10) unsigned NOT NULL DEFAULT '0', - `equipslot1` int(11) NOT NULL DEFAULT '0', - `equipslot2` int(11) NOT NULL DEFAULT '0', - `equipslot3` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Equipment)'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_groups -DROP TABLE IF EXISTS `creature_groups`; -CREATE TABLE IF NOT EXISTS `creature_groups` ( - `leaderGUID` int(11) unsigned NOT NULL, - `memberGUID` int(11) unsigned NOT NULL, - `dist` float unsigned NOT NULL, - `angle` float unsigned NOT NULL, - `flags` int(11) unsigned NOT NULL, - PRIMARY KEY (`memberGUID`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_involvedrelation -DROP TABLE IF EXISTS `creature_involvedrelation`; -CREATE TABLE IF NOT EXISTS `creature_involvedrelation` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', - `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`,`quest`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_linking -DROP TABLE IF EXISTS `creature_linking`; -CREATE TABLE IF NOT EXISTS `creature_linking` ( - `guid` int(10) unsigned NOT NULL COMMENT 'creature.guid of the slave mob that is linked', - `master_guid` int(10) unsigned NOT NULL COMMENT 'master to trigger events', - `flag` mediumint(8) unsigned NOT NULL COMMENT 'flag - describing what should happen when', - PRIMARY KEY (`guid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature Linking System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_linking_template -DROP TABLE IF EXISTS `creature_linking_template`; -CREATE TABLE IF NOT EXISTS `creature_linking_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template.entry of the slave mob that is linked', - `map` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Id of map of the mobs', - `master_entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'master to trigger events', - `flag` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'flag - describing what should happen when', - `search_range` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'search_range - describing in which range (spawn-coords) master and slave are linked together', - PRIMARY KEY (`entry`,`map`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature Linking System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_loot_template -DROP TABLE IF EXISTS `creature_loot_template`; -CREATE TABLE IF NOT EXISTS `creature_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'entry 0 used for player insignia loot', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ChanceOrQuestChance` float NOT NULL DEFAULT '100', - `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`,`groupid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_model_info -DROP TABLE IF EXISTS `creature_model_info`; -CREATE TABLE IF NOT EXISTS `creature_model_info` ( - `modelid` mediumint(8) unsigned NOT NULL DEFAULT '0', - `bounding_radius` float NOT NULL DEFAULT '0', - `combat_reach` float NOT NULL DEFAULT '0', - `gender` tinyint(3) unsigned NOT NULL DEFAULT '2', - `modelid_other_gender` mediumint(8) unsigned NOT NULL DEFAULT '0', - `modelid_other_team` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`modelid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Model related info)'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_movement -DROP TABLE IF EXISTS `creature_movement`; -CREATE TABLE IF NOT EXISTS `creature_movement` ( - `id` int(10) unsigned NOT NULL COMMENT 'Creature GUID', - `point` mediumint(8) unsigned NOT NULL DEFAULT '0', - `position_x` float NOT NULL DEFAULT '0', - `position_y` float NOT NULL DEFAULT '0', - `position_z` float NOT NULL DEFAULT '0', - `waittime` int(10) unsigned NOT NULL DEFAULT '0', - `script_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `textid1` int(11) NOT NULL DEFAULT '0', - `textid2` int(11) NOT NULL DEFAULT '0', - `textid3` int(11) NOT NULL DEFAULT '0', - `textid4` int(11) NOT NULL DEFAULT '0', - `textid5` int(11) NOT NULL DEFAULT '0', - `emote` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spell` mediumint(8) unsigned NOT NULL DEFAULT '0', - `wpguid` int(11) NOT NULL DEFAULT '0', - `orientation` float NOT NULL DEFAULT '0', - `model1` mediumint(9) NOT NULL DEFAULT '0', - `model2` mediumint(9) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`,`point`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_movement_scripts -DROP TABLE IF EXISTS `creature_movement_scripts`; -CREATE TABLE IF NOT EXISTS `creature_movement_scripts` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `delay` int(10) unsigned NOT NULL DEFAULT '0', - `command` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong2` int(10) unsigned NOT NULL DEFAULT '0', - `datalong3` int(10) unsigned NOT NULL DEFAULT '0', - `datalong4` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_id` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_radius` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `data_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dataint` int(11) NOT NULL DEFAULT '0', - `dataint2` int(11) NOT NULL DEFAULT '0', - `dataint3` int(11) NOT NULL DEFAULT '0', - `dataint4` int(11) NOT NULL DEFAULT '0', - `x` float NOT NULL DEFAULT '0', - `y` float NOT NULL DEFAULT '0', - `z` float NOT NULL DEFAULT '0', - `o` float NOT NULL DEFAULT '0', - `comments` varchar(255) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_movement_template -DROP TABLE IF EXISTS `creature_movement_template`; -CREATE TABLE IF NOT EXISTS `creature_movement_template` ( - `entry` mediumint(8) unsigned NOT NULL COMMENT 'Creature entry', - `point` mediumint(8) unsigned NOT NULL DEFAULT '0', - `position_x` float NOT NULL DEFAULT '0', - `position_y` float NOT NULL DEFAULT '0', - `position_z` float NOT NULL DEFAULT '0', - `waittime` int(10) unsigned NOT NULL DEFAULT '0', - `script_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `textid1` int(11) NOT NULL DEFAULT '0', - `textid2` int(11) NOT NULL DEFAULT '0', - `textid3` int(11) NOT NULL DEFAULT '0', - `textid4` int(11) NOT NULL DEFAULT '0', - `textid5` int(11) NOT NULL DEFAULT '0', - `emote` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spell` mediumint(8) unsigned NOT NULL DEFAULT '0', - `wpguid` int(11) NOT NULL DEFAULT '0', - `orientation` float NOT NULL DEFAULT '0', - `model1` mediumint(9) NOT NULL DEFAULT '0', - `model2` mediumint(9) NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`point`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature waypoint system'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_onkill_reputation -DROP TABLE IF EXISTS `creature_onkill_reputation`; -CREATE TABLE IF NOT EXISTS `creature_onkill_reputation` ( - `creature_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature Identifier', - `RewOnKillRepFaction1` smallint(6) NOT NULL DEFAULT '0', - `RewOnKillRepFaction2` smallint(6) NOT NULL DEFAULT '0', - `MaxStanding1` tinyint(4) NOT NULL DEFAULT '0', - `IsTeamAward1` tinyint(4) NOT NULL DEFAULT '0', - `RewOnKillRepValue1` mediumint(9) NOT NULL DEFAULT '0', - `MaxStanding2` tinyint(4) NOT NULL DEFAULT '0', - `IsTeamAward2` tinyint(4) NOT NULL DEFAULT '0', - `RewOnKillRepValue2` mediumint(9) NOT NULL DEFAULT '0', - `TeamDependent` tinyint(3) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`creature_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature OnKill Reputation gain'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_questrelation -DROP TABLE IF EXISTS `creature_questrelation`; -CREATE TABLE IF NOT EXISTS `creature_questrelation` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', - `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`,`quest`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_spells -DROP TABLE IF EXISTS `creature_spells`; -CREATE TABLE IF NOT EXISTS `creature_spells` ( - `entry` int(11) unsigned NOT NULL DEFAULT '0', - `name` varchar(255) NOT NULL DEFAULT '', - `spellId_1` smallint(5) unsigned NOT NULL DEFAULT '0', - `probability_1` tinyint(3) unsigned NOT NULL DEFAULT '100', - `castTarget_1` tinyint(2) unsigned NOT NULL DEFAULT '1', - `castFlags_1` tinyint(2) unsigned NOT NULL DEFAULT '0', - `delayInitialMin_1` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayInitialMax_1` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMin_1` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMax_1` smallint(5) unsigned NOT NULL DEFAULT '0', - `scriptId_1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spellId_2` smallint(5) unsigned NOT NULL DEFAULT '0', - `probability_2` tinyint(3) unsigned NOT NULL DEFAULT '100', - `castTarget_2` tinyint(2) unsigned NOT NULL DEFAULT '1', - `castFlags_2` tinyint(2) unsigned NOT NULL DEFAULT '0', - `delayInitialMin_2` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayInitialMax_2` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMin_2` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMax_2` smallint(5) unsigned NOT NULL DEFAULT '0', - `scriptId_2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spellId_3` smallint(5) unsigned NOT NULL DEFAULT '0', - `probability_3` tinyint(3) unsigned NOT NULL DEFAULT '100', - `castTarget_3` tinyint(2) unsigned NOT NULL DEFAULT '1', - `castFlags_3` tinyint(2) unsigned NOT NULL DEFAULT '0', - `delayInitialMin_3` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayInitialMax_3` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMin_3` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMax_3` smallint(5) unsigned NOT NULL DEFAULT '0', - `scriptId_3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spellId_4` smallint(5) unsigned NOT NULL DEFAULT '0', - `probability_4` tinyint(3) unsigned NOT NULL DEFAULT '100', - `castTarget_4` tinyint(2) unsigned NOT NULL DEFAULT '1', - `castFlags_4` tinyint(2) unsigned NOT NULL DEFAULT '0', - `delayInitialMin_4` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayInitialMax_4` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMin_4` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMax_4` smallint(5) unsigned NOT NULL DEFAULT '0', - `scriptId_4` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spellId_5` smallint(5) unsigned NOT NULL DEFAULT '0', - `probability_5` tinyint(3) unsigned NOT NULL DEFAULT '100', - `castTarget_5` tinyint(2) unsigned NOT NULL DEFAULT '1', - `castFlags_5` tinyint(2) unsigned NOT NULL DEFAULT '0', - `delayInitialMin_5` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayInitialMax_5` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMin_5` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMax_5` smallint(5) unsigned NOT NULL DEFAULT '0', - `scriptId_5` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spellId_6` smallint(5) unsigned NOT NULL DEFAULT '0', - `probability_6` tinyint(3) unsigned NOT NULL DEFAULT '100', - `castTarget_6` tinyint(2) unsigned NOT NULL DEFAULT '1', - `castFlags_6` tinyint(2) unsigned NOT NULL DEFAULT '0', - `delayInitialMin_6` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayInitialMax_6` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMin_6` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMax_6` smallint(5) unsigned NOT NULL DEFAULT '0', - `scriptId_6` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spellId_7` smallint(5) unsigned NOT NULL DEFAULT '0', - `probability_7` tinyint(3) unsigned NOT NULL DEFAULT '100', - `castTarget_7` tinyint(2) unsigned NOT NULL DEFAULT '1', - `castFlags_7` tinyint(2) unsigned NOT NULL DEFAULT '0', - `delayInitialMin_7` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayInitialMax_7` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMin_7` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMax_7` smallint(5) unsigned NOT NULL DEFAULT '0', - `scriptId_7` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spellId_8` smallint(5) unsigned NOT NULL DEFAULT '0', - `probability_8` tinyint(3) unsigned NOT NULL DEFAULT '100', - `castTarget_8` tinyint(2) unsigned NOT NULL DEFAULT '1', - `castFlags_8` tinyint(2) unsigned NOT NULL DEFAULT '0', - `delayInitialMin_8` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayInitialMax_8` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMin_8` smallint(5) unsigned NOT NULL DEFAULT '0', - `delayRepeatMax_8` smallint(5) unsigned NOT NULL DEFAULT '0', - `scriptId_8` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_spells_scripts -DROP TABLE IF EXISTS `creature_spells_scripts`; -CREATE TABLE IF NOT EXISTS `creature_spells_scripts` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `delay` int(10) unsigned NOT NULL DEFAULT '0', - `command` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong2` int(10) unsigned NOT NULL DEFAULT '0', - `datalong3` int(10) unsigned NOT NULL DEFAULT '0', - `datalong4` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_id` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_radius` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `data_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dataint` int(11) NOT NULL DEFAULT '0', - `dataint2` int(11) NOT NULL DEFAULT '0', - `dataint3` int(11) NOT NULL DEFAULT '0', - `dataint4` int(11) NOT NULL DEFAULT '0', - `x` float NOT NULL DEFAULT '0', - `y` float NOT NULL DEFAULT '0', - `z` float NOT NULL DEFAULT '0', - `o` float NOT NULL DEFAULT '0', - `comments` varchar(255) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_template -DROP TABLE IF EXISTS `creature_template`; -CREATE TABLE IF NOT EXISTS `creature_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `KillCredit1` int(11) unsigned NOT NULL DEFAULT '0', - `KillCredit2` int(11) unsigned NOT NULL DEFAULT '0', - `modelid_1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `modelid_2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `modelid_3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `modelid_4` mediumint(8) unsigned NOT NULL DEFAULT '0', - `name` char(100) NOT NULL DEFAULT '0', - `subname` char(100) DEFAULT NULL, - `gossip_menu_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `minlevel` tinyint(3) unsigned NOT NULL DEFAULT '1', - `maxlevel` tinyint(3) unsigned NOT NULL DEFAULT '1', - `minhealth` int(10) unsigned NOT NULL DEFAULT '0', - `maxhealth` int(10) unsigned NOT NULL DEFAULT '0', - `minmana` int(10) unsigned NOT NULL DEFAULT '0', - `maxmana` int(10) unsigned NOT NULL DEFAULT '0', - `armor` mediumint(8) unsigned NOT NULL DEFAULT '0', - `faction_A` smallint(5) unsigned NOT NULL DEFAULT '0', - `faction_H` smallint(5) unsigned NOT NULL DEFAULT '0', - `npcflag` int(10) unsigned NOT NULL DEFAULT '0', - `speed_walk` float NOT NULL DEFAULT '1' COMMENT 'Result of 2.5/2.5, most common value', - `speed_run` float NOT NULL DEFAULT '1.14286' COMMENT 'Result of 8.0/7.0, most common value', - `scale` float NOT NULL DEFAULT '1', - `rank` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mindmg` float NOT NULL DEFAULT '0', - `maxdmg` float NOT NULL DEFAULT '0', - `dmgschool` tinyint(4) NOT NULL DEFAULT '0', - `attackpower` int(10) unsigned NOT NULL DEFAULT '0', - `dmg_multiplier` float NOT NULL DEFAULT '1', - `baseattacktime` int(10) unsigned NOT NULL DEFAULT '0', - `rangeattacktime` int(10) unsigned NOT NULL DEFAULT '0', - `unit_class` tinyint(3) unsigned NOT NULL DEFAULT '0', - `unit_flags` int(10) unsigned NOT NULL DEFAULT '0', - `dynamicflags` int(10) unsigned NOT NULL DEFAULT '0', - `family` tinyint(4) NOT NULL DEFAULT '0', - `trainer_type` tinyint(4) NOT NULL DEFAULT '0', - `trainer_spell` mediumint(8) unsigned NOT NULL DEFAULT '0', - `trainer_class` tinyint(3) unsigned NOT NULL DEFAULT '0', - `trainer_race` tinyint(3) unsigned NOT NULL DEFAULT '0', - `minrangedmg` float NOT NULL DEFAULT '0', - `maxrangedmg` float NOT NULL DEFAULT '0', - `rangedattackpower` smallint(5) unsigned NOT NULL DEFAULT '0', - `type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `type_flags` int(10) unsigned NOT NULL DEFAULT '0', - `lootid` mediumint(8) unsigned NOT NULL DEFAULT '0', - `pickpocketloot` mediumint(8) unsigned NOT NULL DEFAULT '0', - `skinloot` mediumint(8) unsigned NOT NULL DEFAULT '0', - `resistance1` smallint(5) NOT NULL DEFAULT '0', - `resistance2` smallint(5) NOT NULL DEFAULT '0', - `resistance3` smallint(5) NOT NULL DEFAULT '0', - `resistance4` smallint(5) NOT NULL DEFAULT '0', - `resistance5` smallint(5) NOT NULL DEFAULT '0', - `resistance6` smallint(5) NOT NULL DEFAULT '0', - `spell1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spell2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spell3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spell4` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spells_template` int(11) unsigned NOT NULL DEFAULT '0', - `PetSpellDataId` mediumint(8) unsigned NOT NULL DEFAULT '0', - `mingold` mediumint(8) unsigned NOT NULL DEFAULT '0', - `maxgold` mediumint(8) unsigned NOT NULL DEFAULT '0', - `AIName` char(64) NOT NULL DEFAULT '', - `MovementType` tinyint(3) unsigned DEFAULT '0', - `InhabitType` tinyint(3) unsigned NOT NULL DEFAULT '3', - `Civilian` tinyint(3) unsigned NOT NULL DEFAULT '0', - `RacialLeader` tinyint(3) unsigned NOT NULL DEFAULT '0', - `RegenHealth` tinyint(3) unsigned NOT NULL DEFAULT '1', - `equipment_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `trainer_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `vendor_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `MechanicImmuneMask` int(10) unsigned NOT NULL DEFAULT '0', - `SchoolImmuneMask` int(10) unsigned NOT NULL DEFAULT '0', - `flags_extra` int(10) unsigned NOT NULL DEFAULT '0', - `ScriptName` char(64) NOT NULL DEFAULT '', - PRIMARY KEY (`entry`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.creature_template_addon -DROP TABLE IF EXISTS `creature_template_addon`; -CREATE TABLE IF NOT EXISTS `creature_template_addon` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mount` mediumint(8) unsigned NOT NULL DEFAULT '0', - `bytes1` int(10) unsigned NOT NULL DEFAULT '0', - `b2_0_sheath` tinyint(3) unsigned NOT NULL DEFAULT '0', - `b2_1_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `emote` mediumint(8) unsigned NOT NULL DEFAULT '0', - `moveflags` int(10) unsigned NOT NULL DEFAULT '0', - `auras` text, - PRIMARY KEY (`entry`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.custom_texts -DROP TABLE IF EXISTS `custom_texts`; -CREATE TABLE IF NOT EXISTS `custom_texts` ( - `entry` mediumint(8) NOT NULL, - `content_default` text NOT NULL, - `content_loc1` text, - `content_loc2` text, - `content_loc3` text, - `content_loc4` text, - `content_loc5` text, - `content_loc6` text, - `content_loc7` text, - `content_loc8` text, - `sound` mediumint(8) unsigned NOT NULL DEFAULT '0', - `type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `language` tinyint(3) unsigned NOT NULL DEFAULT '0', - `emote` smallint(5) unsigned NOT NULL DEFAULT '0', - `comment` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Custom Texts'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.disenchant_loot_template -DROP TABLE IF EXISTS `disenchant_loot_template`; -CREATE TABLE IF NOT EXISTS `disenchant_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Recommended id selection: item_level*100 + item_quality', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ChanceOrQuestChance` float NOT NULL DEFAULT '100', - `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.event_scripts -DROP TABLE IF EXISTS `event_scripts`; -CREATE TABLE IF NOT EXISTS `event_scripts` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `delay` int(10) unsigned NOT NULL DEFAULT '0', - `command` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong2` int(10) unsigned NOT NULL DEFAULT '0', - `datalong3` int(10) unsigned NOT NULL DEFAULT '0', - `datalong4` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_id` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_radius` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `data_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dataint` int(11) NOT NULL DEFAULT '0', - `dataint2` int(11) NOT NULL DEFAULT '0', - `dataint3` int(11) NOT NULL DEFAULT '0', - `dataint4` int(11) NOT NULL DEFAULT '0', - `x` float NOT NULL DEFAULT '0', - `y` float NOT NULL DEFAULT '0', - `z` float NOT NULL DEFAULT '0', - `o` float NOT NULL DEFAULT '0', - `comments` varchar(255) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.exploration_basexp -DROP TABLE IF EXISTS `exploration_basexp`; -CREATE TABLE IF NOT EXISTS `exploration_basexp` ( - `level` tinyint(4) NOT NULL DEFAULT '0', - `basexp` mediumint(9) NOT NULL DEFAULT '0', - PRIMARY KEY (`level`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Exploration System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.fishing_loot_template -DROP TABLE IF EXISTS `fishing_loot_template`; -CREATE TABLE IF NOT EXISTS `fishing_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'entry 0 used for junk loot at fishing fail (if allowed by config option)', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ChanceOrQuestChance` float NOT NULL DEFAULT '100', - `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.forbidden_items -DROP TABLE IF EXISTS `forbidden_items`; -CREATE TABLE IF NOT EXISTS `forbidden_items` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `AfterOrBefore` tinyint(3) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`AfterOrBefore`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gameobject -DROP TABLE IF EXISTS `gameobject`; -CREATE TABLE IF NOT EXISTS `gameobject` ( - `guid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Global Unique Identifier', - `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Gameobject Identifier', - `map` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', - `position_x` float NOT NULL DEFAULT '0', - `position_y` float NOT NULL DEFAULT '0', - `position_z` float NOT NULL DEFAULT '0', - `orientation` float NOT NULL DEFAULT '0', - `rotation0` float NOT NULL DEFAULT '0', - `rotation1` float NOT NULL DEFAULT '0', - `rotation2` float NOT NULL DEFAULT '0', - `rotation3` float NOT NULL DEFAULT '0', - `spawntimesecsmin` int(11) NOT NULL DEFAULT '0', - `spawntimesecsmax` int(11) NOT NULL DEFAULT '0', - `animprogress` tinyint(3) unsigned NOT NULL DEFAULT '0', - `state` tinyint(3) unsigned NOT NULL DEFAULT '0', - `spawnFlags` int(10) unsigned NOT NULL DEFAULT '0', - `visibilitymod` float DEFAULT '0', - `patch_min` tinyint(3) unsigned NOT NULL DEFAULT '0', - `patch_max` tinyint(3) unsigned NOT NULL DEFAULT '10', - PRIMARY KEY (`guid`), - KEY `idx_map` (`map`), - KEY `idx_id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gameobject_battleground -DROP TABLE IF EXISTS `gameobject_battleground`; -CREATE TABLE IF NOT EXISTS `gameobject_battleground` ( - `guid` int(10) unsigned NOT NULL COMMENT 'GameObject''s GUID', - `event1` tinyint(3) unsigned NOT NULL COMMENT 'main event', - `event2` tinyint(3) unsigned NOT NULL COMMENT 'sub event', - PRIMARY KEY (`guid`,`event1`,`event2`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='GameObject battleground indexing system'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gameobject_involvedrelation -DROP TABLE IF EXISTS `gameobject_involvedrelation`; -CREATE TABLE IF NOT EXISTS `gameobject_involvedrelation` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`,`quest`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gameobject_loot_template -DROP TABLE IF EXISTS `gameobject_loot_template`; -CREATE TABLE IF NOT EXISTS `gameobject_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ChanceOrQuestChance` float NOT NULL DEFAULT '100', - `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gameobject_questrelation -DROP TABLE IF EXISTS `gameobject_questrelation`; -CREATE TABLE IF NOT EXISTS `gameobject_questrelation` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`,`quest`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gameobject_requirement -DROP TABLE IF EXISTS `gameobject_requirement`; -CREATE TABLE IF NOT EXISTS `gameobject_requirement` ( - `guid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Global Unique Identifier', - `reqType` int(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Gameobject Identifier', - `reqGuid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Gameobject Identifier', - PRIMARY KEY (`guid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gameobject_scripts -DROP TABLE IF EXISTS `gameobject_scripts`; -CREATE TABLE IF NOT EXISTS `gameobject_scripts` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `delay` int(10) unsigned NOT NULL DEFAULT '0', - `command` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong2` int(10) unsigned NOT NULL DEFAULT '0', - `datalong3` int(10) unsigned NOT NULL DEFAULT '0', - `datalong4` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_id` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_radius` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `data_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dataint` int(11) NOT NULL DEFAULT '0', - `dataint2` int(11) NOT NULL DEFAULT '0', - `dataint3` int(11) NOT NULL DEFAULT '0', - `dataint4` int(11) NOT NULL DEFAULT '0', - `x` float NOT NULL DEFAULT '0', - `y` float NOT NULL DEFAULT '0', - `z` float NOT NULL DEFAULT '0', - `o` float NOT NULL DEFAULT '0', - `comments` varchar(255) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gameobject_template -DROP TABLE IF EXISTS `gameobject_template`; -CREATE TABLE IF NOT EXISTS `gameobject_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `displayId` mediumint(8) unsigned NOT NULL DEFAULT '0', - `name` varchar(100) NOT NULL DEFAULT '', - `faction` smallint(5) unsigned NOT NULL DEFAULT '0', - `flags` int(10) unsigned NOT NULL DEFAULT '0', - `size` float NOT NULL DEFAULT '1', - `data0` int(10) unsigned NOT NULL DEFAULT '0', - `data1` int(10) unsigned NOT NULL DEFAULT '0', - `data2` int(10) unsigned NOT NULL DEFAULT '0', - `data3` int(10) unsigned NOT NULL DEFAULT '0', - `data4` int(10) unsigned NOT NULL DEFAULT '0', - `data5` int(10) unsigned NOT NULL DEFAULT '0', - `data6` int(10) unsigned NOT NULL DEFAULT '0', - `data7` int(10) unsigned NOT NULL DEFAULT '0', - `data8` int(10) unsigned NOT NULL DEFAULT '0', - `data9` int(10) unsigned NOT NULL DEFAULT '0', - `data10` int(10) unsigned NOT NULL DEFAULT '0', - `data11` int(10) unsigned NOT NULL DEFAULT '0', - `data12` int(10) unsigned NOT NULL DEFAULT '0', - `data13` int(10) unsigned NOT NULL DEFAULT '0', - `data14` int(10) unsigned NOT NULL DEFAULT '0', - `data15` int(10) unsigned NOT NULL DEFAULT '0', - `data16` int(10) unsigned NOT NULL DEFAULT '0', - `data17` int(10) unsigned NOT NULL DEFAULT '0', - `data18` int(10) unsigned NOT NULL DEFAULT '0', - `data19` int(10) unsigned NOT NULL DEFAULT '0', - `data20` int(10) unsigned NOT NULL DEFAULT '0', - `data21` int(10) unsigned NOT NULL DEFAULT '0', - `data22` int(10) unsigned NOT NULL DEFAULT '0', - `data23` int(10) unsigned NOT NULL DEFAULT '0', - `mingold` mediumint(8) unsigned NOT NULL DEFAULT '0', - `maxgold` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ScriptName` varchar(64) NOT NULL DEFAULT '', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.game_event -DROP TABLE IF EXISTS `game_event`; -CREATE TABLE IF NOT EXISTS `game_event` ( - `entry` mediumint(8) unsigned NOT NULL COMMENT 'Entry of the game event', - `start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Absolute start date, the event will never start before', - `end_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Absolute end date, the event will never start afler', - `occurence` bigint(20) unsigned NOT NULL DEFAULT '5184000' COMMENT 'Delay in minutes between occurences of the event', - `length` bigint(20) unsigned NOT NULL DEFAULT '2592000' COMMENT 'Length in minutes of the event', - `holiday` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Client side holiday id', - `description` varchar(255) DEFAULT NULL COMMENT 'Description of the event displayed in console', - `hardcoded` tinyint(3) NOT NULL DEFAULT '0', - `disabled` tinyint(3) NOT NULL DEFAULT '0', - `patch_min` tinyint(3) unsigned NOT NULL DEFAULT '0', - `patch_max` tinyint(3) unsigned NOT NULL DEFAULT '10', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.game_event_creature -DROP TABLE IF EXISTS `game_event_creature`; -CREATE TABLE IF NOT EXISTS `game_event_creature` ( - `guid` int(10) unsigned NOT NULL, - `event` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Put negatives values to remove during event', - PRIMARY KEY (`guid`,`event`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.game_event_creature_data -DROP TABLE IF EXISTS `game_event_creature_data`; -CREATE TABLE IF NOT EXISTS `game_event_creature_data` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0', - `entry_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `modelid` mediumint(8) unsigned NOT NULL DEFAULT '0', - `equipment_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spell_start` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spell_end` mediumint(8) unsigned NOT NULL DEFAULT '0', - `event` smallint(5) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`guid`,`event`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.game_event_gameobject -DROP TABLE IF EXISTS `game_event_gameobject`; -CREATE TABLE IF NOT EXISTS `game_event_gameobject` ( - `guid` int(10) unsigned NOT NULL, - `event` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Put negatives values to remove during event', - PRIMARY KEY (`guid`,`event`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.game_event_mail -DROP TABLE IF EXISTS `game_event_mail`; -CREATE TABLE IF NOT EXISTS `game_event_mail` ( - `event` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Negatives value to send at event stop, positive value for send at event start.', - `raceMask` mediumint(8) unsigned NOT NULL DEFAULT '0', - `quest` mediumint(8) unsigned NOT NULL DEFAULT '0', - `mailTemplateId` mediumint(8) unsigned NOT NULL DEFAULT '0', - `senderEntry` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`event`,`raceMask`,`quest`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Game event system'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.game_event_quest -DROP TABLE IF EXISTS `game_event_quest`; -CREATE TABLE IF NOT EXISTS `game_event_quest` ( - `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'entry from quest_template', - `event` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'entry from game_event', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`quest`,`event`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Game event system'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.game_graveyard_zone -DROP TABLE IF EXISTS `game_graveyard_zone`; -CREATE TABLE IF NOT EXISTS `game_graveyard_zone` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ghost_zone` mediumint(8) unsigned NOT NULL DEFAULT '0', - `faction` smallint(5) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`,`ghost_zone`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Trigger System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.game_tele -DROP TABLE IF EXISTS `game_tele`; -CREATE TABLE IF NOT EXISTS `game_tele` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `position_x` float NOT NULL DEFAULT '0', - `position_y` float NOT NULL DEFAULT '0', - `position_z` float NOT NULL DEFAULT '0', - `orientation` float NOT NULL DEFAULT '0', - `map` smallint(5) unsigned NOT NULL DEFAULT '0', - `name` varchar(100) NOT NULL DEFAULT '', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Tele Command'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.game_weather -DROP TABLE IF EXISTS `game_weather`; -CREATE TABLE IF NOT EXISTS `game_weather` ( - `zone` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spring_rain_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `spring_snow_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `spring_storm_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `summer_rain_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `summer_snow_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `summer_storm_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `fall_rain_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `fall_snow_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `fall_storm_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `winter_rain_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `winter_snow_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - `winter_storm_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', - PRIMARY KEY (`zone`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Weather System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gm_subsurveys -DROP TABLE IF EXISTS `gm_subsurveys`; -CREATE TABLE IF NOT EXISTS `gm_subsurveys` ( - `surveyId` int(10) unsigned NOT NULL AUTO_INCREMENT, - `subsurveyId` int(10) unsigned NOT NULL DEFAULT '0', - `rank` int(10) unsigned NOT NULL DEFAULT '0', - `comment` text NOT NULL, - PRIMARY KEY (`surveyId`,`subsurveyId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Player System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gm_surveys -DROP TABLE IF EXISTS `gm_surveys`; -CREATE TABLE IF NOT EXISTS `gm_surveys` ( - `surveyId` int(10) unsigned NOT NULL AUTO_INCREMENT, - `guid` int(10) unsigned NOT NULL DEFAULT '0', - `mainSurvey` int(10) unsigned NOT NULL DEFAULT '0', - `overallComment` longtext NOT NULL, - `createTime` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`surveyId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Player System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gm_tickets -DROP TABLE IF EXISTS `gm_tickets`; -CREATE TABLE IF NOT EXISTS `gm_tickets` ( - `ticketId` int(10) unsigned NOT NULL AUTO_INCREMENT, - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier of ticket creator', - `name` varchar(12) NOT NULL COMMENT 'Name of ticket creator', - `message` text NOT NULL, - `createTime` int(10) unsigned NOT NULL DEFAULT '0', - `mapId` smallint(5) unsigned NOT NULL DEFAULT '0', - `posX` float NOT NULL DEFAULT '0', - `posY` float NOT NULL DEFAULT '0', - `posZ` float NOT NULL DEFAULT '0', - `lastModifiedTime` int(10) unsigned NOT NULL DEFAULT '0', - `closedBy` int(10) NOT NULL DEFAULT '0', - `assignedTo` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'GUID of admin to whom ticket is assigned', - `comment` text NOT NULL, - `response` text NOT NULL, - `completed` tinyint(3) unsigned NOT NULL DEFAULT '0', - `escalated` tinyint(3) unsigned NOT NULL DEFAULT '0', - `viewed` tinyint(3) unsigned NOT NULL DEFAULT '0', - `haveTicket` tinyint(3) unsigned NOT NULL DEFAULT '0', - `ticketType` tinyint(3) unsigned NOT NULL DEFAULT '0', - `securityNeeded` tinyint(3) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`ticketId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Player System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gossip_menu -DROP TABLE IF EXISTS `gossip_menu`; -CREATE TABLE IF NOT EXISTS `gossip_menu` ( - `entry` smallint(6) unsigned NOT NULL DEFAULT '0', - `text_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`text_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gossip_menu_option -DROP TABLE IF EXISTS `gossip_menu_option`; -CREATE TABLE IF NOT EXISTS `gossip_menu_option` ( - `menu_id` smallint(6) unsigned NOT NULL DEFAULT '0', - `id` smallint(6) unsigned NOT NULL DEFAULT '0', - `option_icon` mediumint(8) unsigned NOT NULL DEFAULT '0', - `option_text` text CHARACTER SET utf8, - `OptionBroadcastTextID` mediumint(6) unsigned NOT NULL DEFAULT '0', - `option_id` tinyint(3) unsigned NOT NULL DEFAULT '0', - `npc_option_npcflag` int(10) unsigned NOT NULL DEFAULT '0', - `action_menu_id` mediumint(8) NOT NULL DEFAULT '0', - `action_poi_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `action_script_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `box_coded` tinyint(3) unsigned NOT NULL DEFAULT '0', - `box_money` int(11) unsigned NOT NULL DEFAULT '0', - `box_text` text CHARACTER SET utf8, - `BoxBroadcastTextID` mediumint(6) unsigned NOT NULL DEFAULT '0', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`menu_id`,`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gossip_scripts -DROP TABLE IF EXISTS `gossip_scripts`; -CREATE TABLE IF NOT EXISTS `gossip_scripts` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `delay` int(10) unsigned NOT NULL DEFAULT '0', - `command` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong2` int(10) unsigned NOT NULL DEFAULT '0', - `datalong3` int(10) unsigned NOT NULL DEFAULT '0', - `datalong4` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_id` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_radius` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `data_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dataint` int(11) NOT NULL DEFAULT '0', - `dataint2` int(11) NOT NULL DEFAULT '0', - `dataint3` int(11) NOT NULL DEFAULT '0', - `dataint4` int(11) NOT NULL DEFAULT '0', - `x` float NOT NULL DEFAULT '0', - `y` float NOT NULL DEFAULT '0', - `z` float NOT NULL DEFAULT '0', - `o` float NOT NULL DEFAULT '0', - `comments` varchar(255) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.gossip_texts -DROP TABLE IF EXISTS `gossip_texts`; -CREATE TABLE IF NOT EXISTS `gossip_texts` ( - `entry` mediumint(8) NOT NULL, - `content_default` text NOT NULL, - `content_loc1` text, - `content_loc2` text, - `content_loc3` text, - `content_loc4` text, - `content_loc5` text, - `content_loc6` text, - `content_loc7` text, - `content_loc8` text, - `comment` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gossip Texts'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.instance_buff_removal -DROP TABLE IF EXISTS `instance_buff_removal`; -CREATE TABLE IF NOT EXISTS `instance_buff_removal` ( - `mapId` int(10) unsigned NOT NULL COMMENT 'MapId to remove aura from', - `auraId` int(10) unsigned NOT NULL COMMENT 'aura id to remove on entering MapId', - `enabled` tinyint(1) NOT NULL COMMENT 'aura removal enabled or not', - `flags` int(10) NOT NULL COMMENT 'flags, see AuraRemovalMgr.h', - `comment` varchar(256) NOT NULL COMMENT 'description, what is removed', - PRIMARY KEY (`mapId`,`auraId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Aura removal on map entry'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.instance_creature_kills -DROP TABLE IF EXISTS `instance_creature_kills`; -CREATE TABLE IF NOT EXISTS `instance_creature_kills` ( - `mapId` int(10) unsigned NOT NULL COMMENT 'MapId to where creature exist', - `creatureEntry` int(10) unsigned NOT NULL COMMENT 'entry of the creature who performed the kill', - `spellEntry` int(10) NOT NULL COMMENT 'entry of spell which did the kill. 0 for melee or unknown', - `count` int(10) unsigned NOT NULL COMMENT 'number of kills', - PRIMARY KEY (`mapId`,`creatureEntry`,`spellEntry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='creatures killing players statistics'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.instance_custom_counters -DROP TABLE IF EXISTS `instance_custom_counters`; -CREATE TABLE IF NOT EXISTS `instance_custom_counters` ( - `index` int(10) unsigned NOT NULL COMMENT 'index as defined in InstanceStatistics.h', - `count` int(10) unsigned NOT NULL COMMENT 'counter', - PRIMARY KEY (`index`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='custom counters for instance statistics'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.instance_wipes -DROP TABLE IF EXISTS `instance_wipes`; -CREATE TABLE IF NOT EXISTS `instance_wipes` ( - `mapId` int(10) unsigned NOT NULL COMMENT 'MapId to where creature exist', - `creatureEntry` int(10) unsigned NOT NULL COMMENT 'creature which the wipe occured against', - `count` int(10) unsigned NOT NULL COMMENT 'number of wipes', - PRIMARY KEY (`mapId`,`creatureEntry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='players wiping against creatures statistics'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.item_display_info -DROP TABLE IF EXISTS `item_display_info`; -CREATE TABLE IF NOT EXISTS `item_display_info` ( - `field0` int(11) NOT NULL, - `field5` varchar(255) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.item_enchantment_template -DROP TABLE IF EXISTS `item_enchantment_template`; -CREATE TABLE IF NOT EXISTS `item_enchantment_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ench` mediumint(8) unsigned NOT NULL DEFAULT '0', - `chance` float unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`ench`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item Random Enchantment System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.item_loot_template -DROP TABLE IF EXISTS `item_loot_template`; -CREATE TABLE IF NOT EXISTS `item_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ChanceOrQuestChance` float NOT NULL DEFAULT '100', - `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.item_required_target -DROP TABLE IF EXISTS `item_required_target`; -CREATE TABLE IF NOT EXISTS `item_required_target` ( - `entry` mediumint(8) unsigned NOT NULL, - `type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `targetEntry` mediumint(8) unsigned NOT NULL DEFAULT '0', - UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.item_template -DROP TABLE IF EXISTS `item_template`; -CREATE TABLE IF NOT EXISTS `item_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `class` tinyint(3) unsigned NOT NULL DEFAULT '0', - `subclass` tinyint(3) unsigned NOT NULL DEFAULT '0', - `name` varchar(255) NOT NULL DEFAULT '', - `displayid` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Quality` tinyint(3) unsigned NOT NULL DEFAULT '0', - `Flags` int(10) unsigned NOT NULL DEFAULT '0', - `BuyCount` tinyint(3) unsigned NOT NULL DEFAULT '1', - `BuyPrice` int(10) unsigned NOT NULL DEFAULT '0', - `SellPrice` int(10) unsigned NOT NULL DEFAULT '0', - `InventoryType` tinyint(3) unsigned NOT NULL DEFAULT '0', - `AllowableClass` mediumint(9) NOT NULL DEFAULT '-1', - `AllowableRace` mediumint(9) NOT NULL DEFAULT '-1', - `ItemLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', - `RequiredLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', - `RequiredSkill` smallint(5) unsigned NOT NULL DEFAULT '0', - `RequiredSkillRank` smallint(5) unsigned NOT NULL DEFAULT '0', - `requiredspell` mediumint(8) unsigned NOT NULL DEFAULT '0', - `requiredhonorrank` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RequiredCityRank` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RequiredReputationFaction` smallint(5) unsigned NOT NULL DEFAULT '0', - `RequiredReputationRank` smallint(5) unsigned NOT NULL DEFAULT '0', - `maxcount` smallint(5) unsigned NOT NULL DEFAULT '0', - `stackable` smallint(5) unsigned NOT NULL DEFAULT '1', - `ContainerSlots` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_type1` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_value1` smallint(6) NOT NULL DEFAULT '0', - `stat_type2` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_value2` smallint(6) NOT NULL DEFAULT '0', - `stat_type3` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_value3` smallint(6) NOT NULL DEFAULT '0', - `stat_type4` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_value4` smallint(6) NOT NULL DEFAULT '0', - `stat_type5` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_value5` smallint(6) NOT NULL DEFAULT '0', - `stat_type6` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_value6` smallint(6) NOT NULL DEFAULT '0', - `stat_type7` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_value7` smallint(6) NOT NULL DEFAULT '0', - `stat_type8` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_value8` smallint(6) NOT NULL DEFAULT '0', - `stat_type9` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_value9` smallint(6) NOT NULL DEFAULT '0', - `stat_type10` tinyint(3) unsigned NOT NULL DEFAULT '0', - `stat_value10` smallint(6) NOT NULL DEFAULT '0', - `dmg_min1` float NOT NULL DEFAULT '0', - `dmg_max1` float NOT NULL DEFAULT '0', - `dmg_type1` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dmg_min2` float NOT NULL DEFAULT '0', - `dmg_max2` float NOT NULL DEFAULT '0', - `dmg_type2` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dmg_min3` float NOT NULL DEFAULT '0', - `dmg_max3` float NOT NULL DEFAULT '0', - `dmg_type3` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dmg_min4` float NOT NULL DEFAULT '0', - `dmg_max4` float NOT NULL DEFAULT '0', - `dmg_type4` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dmg_min5` float NOT NULL DEFAULT '0', - `dmg_max5` float NOT NULL DEFAULT '0', - `dmg_type5` tinyint(3) unsigned NOT NULL DEFAULT '0', - `armor` smallint(5) unsigned NOT NULL DEFAULT '0', - `holy_res` tinyint(3) unsigned NOT NULL DEFAULT '0', - `fire_res` tinyint(3) unsigned NOT NULL DEFAULT '0', - `nature_res` tinyint(3) unsigned NOT NULL DEFAULT '0', - `frost_res` tinyint(3) unsigned NOT NULL DEFAULT '0', - `shadow_res` tinyint(3) unsigned NOT NULL DEFAULT '0', - `arcane_res` tinyint(3) unsigned NOT NULL DEFAULT '0', - `delay` smallint(5) unsigned NOT NULL DEFAULT '1000', - `ammo_type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `RangedModRange` float NOT NULL DEFAULT '0', - `spellid_1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spelltrigger_1` tinyint(3) unsigned NOT NULL DEFAULT '0', - `spellcharges_1` tinyint(4) NOT NULL DEFAULT '0', - `spellppmRate_1` float NOT NULL DEFAULT '0', - `spellcooldown_1` int(11) NOT NULL DEFAULT '-1', - `spellcategory_1` smallint(5) unsigned NOT NULL DEFAULT '0', - `spellcategorycooldown_1` int(11) NOT NULL DEFAULT '-1', - `spellid_2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spelltrigger_2` tinyint(3) unsigned NOT NULL DEFAULT '0', - `spellcharges_2` tinyint(4) NOT NULL DEFAULT '0', - `spellppmRate_2` float NOT NULL DEFAULT '0', - `spellcooldown_2` int(11) NOT NULL DEFAULT '-1', - `spellcategory_2` smallint(5) unsigned NOT NULL DEFAULT '0', - `spellcategorycooldown_2` int(11) NOT NULL DEFAULT '-1', - `spellid_3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spelltrigger_3` tinyint(3) unsigned NOT NULL DEFAULT '0', - `spellcharges_3` tinyint(4) NOT NULL DEFAULT '0', - `spellppmRate_3` float NOT NULL DEFAULT '0', - `spellcooldown_3` int(11) NOT NULL DEFAULT '-1', - `spellcategory_3` smallint(5) unsigned NOT NULL DEFAULT '0', - `spellcategorycooldown_3` int(11) NOT NULL DEFAULT '-1', - `spellid_4` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spelltrigger_4` tinyint(3) unsigned NOT NULL DEFAULT '0', - `spellcharges_4` tinyint(4) NOT NULL DEFAULT '0', - `spellppmRate_4` float NOT NULL DEFAULT '0', - `spellcooldown_4` int(11) NOT NULL DEFAULT '-1', - `spellcategory_4` smallint(5) unsigned NOT NULL DEFAULT '0', - `spellcategorycooldown_4` int(11) NOT NULL DEFAULT '-1', - `spellid_5` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spelltrigger_5` tinyint(3) unsigned NOT NULL DEFAULT '0', - `spellcharges_5` tinyint(4) NOT NULL DEFAULT '0', - `spellppmRate_5` float NOT NULL DEFAULT '0', - `spellcooldown_5` int(11) NOT NULL DEFAULT '-1', - `spellcategory_5` smallint(5) unsigned NOT NULL DEFAULT '0', - `spellcategorycooldown_5` int(11) NOT NULL DEFAULT '-1', - `bonding` tinyint(3) unsigned NOT NULL DEFAULT '0', - `description` varchar(255) NOT NULL DEFAULT '', - `PageText` mediumint(8) unsigned NOT NULL DEFAULT '0', - `LanguageID` tinyint(3) unsigned NOT NULL DEFAULT '0', - `PageMaterial` tinyint(3) unsigned NOT NULL DEFAULT '0', - `startquest` mediumint(8) unsigned NOT NULL DEFAULT '0', - `lockid` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Material` tinyint(4) NOT NULL DEFAULT '0', - `sheath` tinyint(3) unsigned NOT NULL DEFAULT '0', - `RandomProperty` mediumint(8) unsigned NOT NULL DEFAULT '0', - `block` mediumint(8) unsigned NOT NULL DEFAULT '0', - `itemset` mediumint(8) unsigned NOT NULL DEFAULT '0', - `MaxDurability` smallint(5) unsigned NOT NULL DEFAULT '0', - `area` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Map` smallint(6) NOT NULL DEFAULT '0', - `BagFamily` mediumint(9) NOT NULL DEFAULT '0', - `ScriptName` varchar(64) NOT NULL DEFAULT '', - `DisenchantID` mediumint(8) unsigned NOT NULL DEFAULT '0', - `FoodType` tinyint(3) unsigned NOT NULL DEFAULT '0', - `minMoneyLoot` int(10) unsigned NOT NULL DEFAULT '0', - `maxMoneyLoot` int(10) unsigned NOT NULL DEFAULT '0', - `Duration` int(11) unsigned NOT NULL DEFAULT '0', - `ExtraFlags` tinyint(1) unsigned NOT NULL DEFAULT '0', - `OtherTeamEntry` int(11) unsigned DEFAULT '1', - PRIMARY KEY (`entry`,`patch`), - KEY `items_index` (`class`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.locales_area -DROP TABLE IF EXISTS `locales_area`; -CREATE TABLE IF NOT EXISTS `locales_area` ( - `Entry` mediumint(8) NOT NULL DEFAULT '0', - `NameLoc1` varchar(100) NOT NULL DEFAULT '', - `NameLoc2` varchar(100) NOT NULL DEFAULT '', - `NameLoc3` varchar(100) NOT NULL DEFAULT '', - `NameLoc4` varchar(100) NOT NULL DEFAULT '', - `NameLoc5` varchar(100) NOT NULL DEFAULT '', - `NameLoc6` varchar(100) NOT NULL DEFAULT '', - `NameLoc7` varchar(100) NOT NULL DEFAULT '', - `NameLoc8` varchar(100) NOT NULL DEFAULT '', - PRIMARY KEY (`Entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.locales_broadcast_text -DROP TABLE IF EXISTS `locales_broadcast_text`; -CREATE TABLE IF NOT EXISTS `locales_broadcast_text` ( - `ID` mediumint(8) unsigned NOT NULL DEFAULT '0', - `MaleText_loc1` longtext, - `MaleText_loc2` longtext, - `MaleText_loc3` longtext, - `MaleText_loc4` longtext, - `MaleText_loc5` longtext, - `MaleText_loc6` longtext, - `MaleText_loc7` longtext, - `MaleText_loc8` longtext, - `FemaleText_loc1` longtext, - `FemaleText_loc2` longtext, - `FemaleText_loc3` longtext, - `FemaleText_loc4` longtext, - `FemaleText_loc5` longtext, - `FemaleText_loc6` longtext, - `FemaleText_loc7` longtext, - `FemaleText_loc8` longtext, - `VerifiedBuild` smallint(5) DEFAULT '0', - PRIMARY KEY (`ID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.locales_creature -DROP TABLE IF EXISTS `locales_creature`; -CREATE TABLE IF NOT EXISTS `locales_creature` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `name_loc1` varchar(100) NOT NULL DEFAULT '', - `name_loc2` varchar(100) NOT NULL DEFAULT '', - `name_loc3` varchar(100) NOT NULL DEFAULT '', - `name_loc4` varchar(100) NOT NULL DEFAULT '', - `name_loc5` varchar(100) NOT NULL DEFAULT '', - `name_loc6` varchar(100) NOT NULL DEFAULT '', - `name_loc7` varchar(100) NOT NULL DEFAULT '', - `name_loc8` varchar(100) NOT NULL DEFAULT '', - `subname_loc1` varchar(100) DEFAULT NULL, - `subname_loc2` varchar(100) DEFAULT NULL, - `subname_loc3` varchar(100) DEFAULT NULL, - `subname_loc4` varchar(100) DEFAULT NULL, - `subname_loc5` varchar(100) DEFAULT NULL, - `subname_loc6` varchar(100) DEFAULT NULL, - `subname_loc7` varchar(100) DEFAULT NULL, - `subname_loc8` varchar(100) DEFAULT NULL, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.locales_gameobject -DROP TABLE IF EXISTS `locales_gameobject`; -CREATE TABLE IF NOT EXISTS `locales_gameobject` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `name_loc1` varchar(100) NOT NULL DEFAULT '', - `name_loc2` varchar(100) NOT NULL DEFAULT '', - `name_loc3` varchar(100) NOT NULL DEFAULT '', - `name_loc4` varchar(100) NOT NULL DEFAULT '', - `name_loc5` varchar(100) NOT NULL DEFAULT '', - `name_loc6` varchar(100) NOT NULL DEFAULT '', - `name_loc7` varchar(100) NOT NULL DEFAULT '', - `name_loc8` varchar(100) NOT NULL DEFAULT '', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.locales_gossip_menu_option -DROP TABLE IF EXISTS `locales_gossip_menu_option`; -CREATE TABLE IF NOT EXISTS `locales_gossip_menu_option` ( - `menu_id` smallint(6) unsigned NOT NULL DEFAULT '0', - `id` smallint(6) unsigned NOT NULL DEFAULT '0', - `option_text_loc1` text, - `option_text_loc2` text, - `option_text_loc3` text, - `option_text_loc4` text, - `option_text_loc5` text, - `option_text_loc6` text, - `option_text_loc7` text, - `option_text_loc8` text, - `box_text_loc1` text, - `box_text_loc2` text, - `box_text_loc3` text, - `box_text_loc4` text, - `box_text_loc5` text, - `box_text_loc6` text, - `box_text_loc7` text, - `box_text_loc8` text, - PRIMARY KEY (`menu_id`,`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.locales_item -DROP TABLE IF EXISTS `locales_item`; -CREATE TABLE IF NOT EXISTS `locales_item` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `name_loc1` varchar(100) NOT NULL DEFAULT '', - `name_loc2` varchar(100) NOT NULL DEFAULT '', - `name_loc3` varchar(100) NOT NULL DEFAULT '', - `name_loc4` varchar(100) NOT NULL DEFAULT '', - `name_loc5` varchar(100) NOT NULL DEFAULT '', - `name_loc6` varchar(100) NOT NULL DEFAULT '', - `name_loc7` varchar(100) NOT NULL DEFAULT '', - `name_loc8` varchar(100) NOT NULL DEFAULT '', - `description_loc1` varchar(255) DEFAULT NULL, - `description_loc2` varchar(255) DEFAULT NULL, - `description_loc3` varchar(255) DEFAULT NULL, - `description_loc4` varchar(255) DEFAULT NULL, - `description_loc5` varchar(255) DEFAULT NULL, - `description_loc6` varchar(255) DEFAULT NULL, - `description_loc7` varchar(255) DEFAULT NULL, - `description_loc8` varchar(255) DEFAULT NULL, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.locales_page_text -DROP TABLE IF EXISTS `locales_page_text`; -CREATE TABLE IF NOT EXISTS `locales_page_text` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Text_loc1` longtext, - `Text_loc2` longtext, - `Text_loc3` longtext, - `Text_loc4` longtext, - `Text_loc5` longtext, - `Text_loc6` longtext, - `Text_loc7` longtext, - `Text_loc8` longtext, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.locales_points_of_interest -DROP TABLE IF EXISTS `locales_points_of_interest`; -CREATE TABLE IF NOT EXISTS `locales_points_of_interest` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `icon_name_loc1` text, - `icon_name_loc2` text, - `icon_name_loc3` text, - `icon_name_loc4` text, - `icon_name_loc5` text, - `icon_name_loc6` text, - `icon_name_loc7` text, - `icon_name_loc8` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.locales_quest -DROP TABLE IF EXISTS `locales_quest`; -CREATE TABLE IF NOT EXISTS `locales_quest` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Title_loc1` text, - `Title_loc2` text, - `Title_loc3` text, - `Title_loc4` text, - `Title_loc5` text, - `Title_loc6` text, - `Title_loc7` text, - `Title_loc8` text, - `Details_loc1` text, - `Details_loc2` text, - `Details_loc3` text, - `Details_loc4` text, - `Details_loc5` text, - `Details_loc6` text, - `Details_loc7` text, - `Details_loc8` text, - `Objectives_loc1` text, - `Objectives_loc2` text, - `Objectives_loc3` text, - `Objectives_loc4` text, - `Objectives_loc5` text, - `Objectives_loc6` text, - `Objectives_loc7` text, - `Objectives_loc8` text, - `OfferRewardText_loc1` text, - `OfferRewardText_loc2` text, - `OfferRewardText_loc3` text, - `OfferRewardText_loc4` text, - `OfferRewardText_loc5` text, - `OfferRewardText_loc6` text, - `OfferRewardText_loc7` text, - `OfferRewardText_loc8` text, - `RequestItemsText_loc1` text, - `RequestItemsText_loc2` text, - `RequestItemsText_loc3` text, - `RequestItemsText_loc4` text, - `RequestItemsText_loc5` text, - `RequestItemsText_loc6` text, - `RequestItemsText_loc7` text, - `RequestItemsText_loc8` text, - `EndText_loc1` text, - `EndText_loc2` text, - `EndText_loc3` text, - `EndText_loc4` text, - `EndText_loc5` text, - `EndText_loc6` text, - `EndText_loc7` text, - `EndText_loc8` text, - `ObjectiveText1_loc1` text, - `ObjectiveText1_loc2` text, - `ObjectiveText1_loc3` text, - `ObjectiveText1_loc4` text, - `ObjectiveText1_loc5` text, - `ObjectiveText1_loc6` text, - `ObjectiveText1_loc7` text, - `ObjectiveText1_loc8` text, - `ObjectiveText2_loc1` text, - `ObjectiveText2_loc2` text, - `ObjectiveText2_loc3` text, - `ObjectiveText2_loc4` text, - `ObjectiveText2_loc5` text, - `ObjectiveText2_loc6` text, - `ObjectiveText2_loc7` text, - `ObjectiveText2_loc8` text, - `ObjectiveText3_loc1` text, - `ObjectiveText3_loc2` text, - `ObjectiveText3_loc3` text, - `ObjectiveText3_loc4` text, - `ObjectiveText3_loc5` text, - `ObjectiveText3_loc6` text, - `ObjectiveText3_loc7` text, - `ObjectiveText3_loc8` text, - `ObjectiveText4_loc1` text, - `ObjectiveText4_loc2` text, - `ObjectiveText4_loc3` text, - `ObjectiveText4_loc4` text, - `ObjectiveText4_loc5` text, - `ObjectiveText4_loc6` text, - `ObjectiveText4_loc7` text, - `ObjectiveText4_loc8` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.mail_loot_template -DROP TABLE IF EXISTS `mail_loot_template`; -CREATE TABLE IF NOT EXISTS `mail_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ChanceOrQuestChance` float NOT NULL DEFAULT '100', - `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.mangos_string -DROP TABLE IF EXISTS `mangos_string`; -CREATE TABLE IF NOT EXISTS `mangos_string` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `content_default` text NOT NULL, - `content_loc1` text, - `content_loc2` text, - `content_loc3` text, - `content_loc4` text, - `content_loc5` text, - `content_loc6` text, - `content_loc7` text, - `content_loc8` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.map_loot_disabled -DROP TABLE IF EXISTS `map_loot_disabled`; -CREATE TABLE IF NOT EXISTS `map_loot_disabled` ( - `mapid` int(11) NOT NULL DEFAULT '0', - `comment` varchar(255) DEFAULT NULL, - PRIMARY KEY (`mapid`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.map_template -DROP TABLE IF EXISTS `map_template`; -CREATE TABLE IF NOT EXISTS `map_template` ( - `Entry` smallint(5) unsigned NOT NULL, - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `Parent` int(10) unsigned NOT NULL DEFAULT '0', - `MapType` tinyint(3) unsigned NOT NULL DEFAULT '0', - `LinkedZone` int(10) unsigned NOT NULL DEFAULT '0', - `LevelMin` tinyint(3) unsigned NOT NULL DEFAULT '0', - `LevelMax` tinyint(3) unsigned NOT NULL DEFAULT '0', - `MaxPlayers` tinyint(3) unsigned NOT NULL DEFAULT '0', - `ResetDelay` int(10) unsigned NOT NULL DEFAULT '0', - `GhostEntranceMap` smallint(5) NOT NULL DEFAULT '-1', - `GhostEntranceX` float NOT NULL DEFAULT '0', - `GhostEntranceY` float NOT NULL DEFAULT '0', - `MapName` varchar(128) NOT NULL DEFAULT '', - `ScriptName` varchar(128) NOT NULL DEFAULT '', - PRIMARY KEY (`Entry`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.migrations -DROP TABLE IF EXISTS `migrations`; -CREATE TABLE IF NOT EXISTS `migrations` ( - `id` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.nostalrius_string -DROP TABLE IF EXISTS `nostalrius_string`; -CREATE TABLE IF NOT EXISTS `nostalrius_string` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `content_default` text NOT NULL, - `content_loc1` text, - `content_loc2` text, - `content_loc3` text, - `content_loc4` text, - `content_loc5` text, - `content_loc6` text, - `content_loc7` text, - `content_loc8` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.npc_gossip -DROP TABLE IF EXISTS `npc_gossip`; -CREATE TABLE IF NOT EXISTS `npc_gossip` ( - `npc_guid` int(10) unsigned NOT NULL DEFAULT '0', - `textid` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`npc_guid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.npc_text -DROP TABLE IF EXISTS `npc_text`; -CREATE TABLE IF NOT EXISTS `npc_text` ( - `ID` mediumint(8) unsigned NOT NULL DEFAULT '0', - `BroadcastTextID0` mediumint(6) unsigned NOT NULL DEFAULT '0', - `Probability0` float NOT NULL DEFAULT '0', - `BroadcastTextID1` mediumint(6) unsigned NOT NULL DEFAULT '0', - `Probability1` float NOT NULL DEFAULT '0', - `BroadcastTextID2` mediumint(6) unsigned NOT NULL DEFAULT '0', - `Probability2` float NOT NULL DEFAULT '0', - `BroadcastTextID3` mediumint(6) unsigned NOT NULL DEFAULT '0', - `Probability3` float NOT NULL DEFAULT '0', - `BroadcastTextID4` mediumint(6) unsigned NOT NULL DEFAULT '0', - `Probability4` float NOT NULL DEFAULT '0', - `BroadcastTextID5` mediumint(6) unsigned NOT NULL DEFAULT '0', - `Probability5` float NOT NULL DEFAULT '0', - `BroadcastTextID6` mediumint(6) unsigned NOT NULL DEFAULT '0', - `Probability6` float NOT NULL DEFAULT '0', - `BroadcastTextID7` mediumint(6) unsigned NOT NULL DEFAULT '0', - `Probability7` float NOT NULL DEFAULT '0', - PRIMARY KEY (`ID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.npc_trainer -DROP TABLE IF EXISTS `npc_trainer`; -CREATE TABLE IF NOT EXISTS `npc_trainer` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spell` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spellcost` int(10) unsigned NOT NULL DEFAULT '0', - `reqskill` smallint(5) unsigned NOT NULL DEFAULT '0', - `reqskillvalue` smallint(5) unsigned NOT NULL DEFAULT '0', - `reqlevel` tinyint(3) unsigned NOT NULL DEFAULT '0', - UNIQUE KEY `entry_spell` (`entry`,`spell`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.npc_trainer_template -DROP TABLE IF EXISTS `npc_trainer_template`; -CREATE TABLE IF NOT EXISTS `npc_trainer_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spell` mediumint(8) unsigned NOT NULL DEFAULT '0', - `spellcost` int(10) unsigned NOT NULL DEFAULT '0', - `reqskill` smallint(5) unsigned NOT NULL DEFAULT '0', - `reqskillvalue` smallint(5) unsigned NOT NULL DEFAULT '0', - `reqlevel` tinyint(3) unsigned NOT NULL DEFAULT '0', - UNIQUE KEY `entry_spell` (`entry`,`spell`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.npc_vendor -DROP TABLE IF EXISTS `npc_vendor`; -CREATE TABLE IF NOT EXISTS `npc_vendor` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '0', - `incrtime` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Npc System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.npc_vendor_template -DROP TABLE IF EXISTS `npc_vendor_template`; -CREATE TABLE IF NOT EXISTS `npc_vendor_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '0', - `incrtime` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Npc System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.page_text -DROP TABLE IF EXISTS `page_text`; -CREATE TABLE IF NOT EXISTS `page_text` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `text` longtext NOT NULL, - `next_page` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Item System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.petcreateinfo_spell -DROP TABLE IF EXISTS `petcreateinfo_spell`; -CREATE TABLE IF NOT EXISTS `petcreateinfo_spell` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Spell1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Spell2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Spell3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Spell4` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Pet Create Spells'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.pet_levelstats -DROP TABLE IF EXISTS `pet_levelstats`; -CREATE TABLE IF NOT EXISTS `pet_levelstats` ( - `creature_entry` mediumint(8) unsigned NOT NULL, - `level` tinyint(3) unsigned NOT NULL, - `hp` smallint(5) unsigned NOT NULL, - `mana` smallint(5) unsigned NOT NULL, - `armor` int(10) unsigned NOT NULL DEFAULT '0', - `str` smallint(5) unsigned NOT NULL, - `agi` smallint(5) unsigned NOT NULL, - `sta` smallint(5) unsigned NOT NULL, - `inte` smallint(5) unsigned NOT NULL, - `spi` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`creature_entry`,`level`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores pet levels stats.'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.pet_name_generation -DROP TABLE IF EXISTS `pet_name_generation`; -CREATE TABLE IF NOT EXISTS `pet_name_generation` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `word` tinytext NOT NULL, - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `half` tinyint(4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.pickpocketing_loot_template -DROP TABLE IF EXISTS `pickpocketing_loot_template`; -CREATE TABLE IF NOT EXISTS `pickpocketing_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ChanceOrQuestChance` float NOT NULL DEFAULT '100', - `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.playerbot -DROP TABLE IF EXISTS `playerbot`; -CREATE TABLE IF NOT EXISTS `playerbot` ( - `char_guid` bigint(20) unsigned NOT NULL, - `chance` int(10) unsigned NOT NULL DEFAULT '10', - `comment` varchar(255) DEFAULT NULL, - PRIMARY KEY (`char_guid`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.playercreateinfo -DROP TABLE IF EXISTS `playercreateinfo`; -CREATE TABLE IF NOT EXISTS `playercreateinfo` ( - `race` tinyint(3) unsigned NOT NULL DEFAULT '0', - `class` tinyint(3) unsigned NOT NULL DEFAULT '0', - `map` smallint(5) unsigned NOT NULL DEFAULT '0', - `zone` mediumint(8) unsigned NOT NULL DEFAULT '0', - `position_x` float NOT NULL DEFAULT '0', - `position_y` float NOT NULL DEFAULT '0', - `position_z` float NOT NULL DEFAULT '0', - `orientation` float NOT NULL DEFAULT '0', - PRIMARY KEY (`race`,`class`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.playercreateinfo_action -DROP TABLE IF EXISTS `playercreateinfo_action`; -CREATE TABLE IF NOT EXISTS `playercreateinfo_action` ( - `race` tinyint(3) unsigned NOT NULL DEFAULT '0', - `class` tinyint(3) unsigned NOT NULL DEFAULT '0', - `button` smallint(5) unsigned NOT NULL DEFAULT '0', - `action` int(11) unsigned NOT NULL DEFAULT '0', - `type` smallint(5) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`race`,`class`,`button`), - KEY `playercreateinfo_race_class_index` (`race`,`class`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.playercreateinfo_item -DROP TABLE IF EXISTS `playercreateinfo_item`; -CREATE TABLE IF NOT EXISTS `playercreateinfo_item` ( - `race` tinyint(3) unsigned NOT NULL DEFAULT '0', - `class` tinyint(3) unsigned NOT NULL DEFAULT '0', - `itemid` mediumint(8) unsigned NOT NULL DEFAULT '0', - `amount` tinyint(3) unsigned NOT NULL DEFAULT '1', - KEY `playercreateinfo_race_class_index` (`race`,`class`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.playercreateinfo_spell -DROP TABLE IF EXISTS `playercreateinfo_spell`; -CREATE TABLE IF NOT EXISTS `playercreateinfo_spell` ( - `race` tinyint(3) unsigned NOT NULL DEFAULT '0', - `class` tinyint(3) unsigned NOT NULL DEFAULT '0', - `Spell` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Note` varchar(255) DEFAULT NULL, - PRIMARY KEY (`race`,`class`,`Spell`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.player_classlevelstats -DROP TABLE IF EXISTS `player_classlevelstats`; -CREATE TABLE IF NOT EXISTS `player_classlevelstats` ( - `class` tinyint(3) unsigned NOT NULL, - `level` tinyint(3) unsigned NOT NULL, - `basehp` smallint(5) unsigned NOT NULL, - `basemana` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`class`,`level`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.player_factionchange_items -DROP TABLE IF EXISTS `player_factionchange_items`; -CREATE TABLE IF NOT EXISTS `player_factionchange_items` ( - `alliance_id` int(8) NOT NULL, - `horde_id` int(8) NOT NULL, - `comment` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`alliance_id`,`horde_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.player_factionchange_mounts -DROP TABLE IF EXISTS `player_factionchange_mounts`; -CREATE TABLE IF NOT EXISTS `player_factionchange_mounts` ( - `RaceId` int(8) NOT NULL, - `MountNum` int(8) NOT NULL, - `ItemEntry` int(8) NOT NULL, - `Comment` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`RaceId`,`MountNum`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.player_factionchange_quests -DROP TABLE IF EXISTS `player_factionchange_quests`; -CREATE TABLE IF NOT EXISTS `player_factionchange_quests` ( - `alliance_id` int(8) NOT NULL, - `horde_id` int(8) NOT NULL, - `comment` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`alliance_id`,`horde_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.player_factionchange_reputations -DROP TABLE IF EXISTS `player_factionchange_reputations`; -CREATE TABLE IF NOT EXISTS `player_factionchange_reputations` ( - `alliance_id` int(8) NOT NULL, - `horde_id` int(8) NOT NULL, - PRIMARY KEY (`alliance_id`,`horde_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.player_factionchange_spells -DROP TABLE IF EXISTS `player_factionchange_spells`; -CREATE TABLE IF NOT EXISTS `player_factionchange_spells` ( - `alliance_id` int(8) NOT NULL, - `horde_id` int(8) NOT NULL, - `comment` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`alliance_id`,`horde_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.player_levelstats -DROP TABLE IF EXISTS `player_levelstats`; -CREATE TABLE IF NOT EXISTS `player_levelstats` ( - `race` tinyint(3) unsigned NOT NULL, - `class` tinyint(3) unsigned NOT NULL, - `level` tinyint(3) unsigned NOT NULL, - `str` tinyint(3) unsigned NOT NULL, - `agi` tinyint(3) unsigned NOT NULL, - `sta` tinyint(3) unsigned NOT NULL, - `inte` tinyint(3) unsigned NOT NULL, - `spi` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`race`,`class`,`level`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.player_xp_for_level -DROP TABLE IF EXISTS `player_xp_for_level`; -CREATE TABLE IF NOT EXISTS `player_xp_for_level` ( - `lvl` int(3) unsigned NOT NULL, - `xp_for_next_level` int(10) unsigned NOT NULL, - PRIMARY KEY (`lvl`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.points_of_interest -DROP TABLE IF EXISTS `points_of_interest`; -CREATE TABLE IF NOT EXISTS `points_of_interest` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `x` float NOT NULL DEFAULT '0', - `y` float NOT NULL DEFAULT '0', - `icon` mediumint(8) unsigned NOT NULL DEFAULT '0', - `flags` mediumint(8) unsigned NOT NULL DEFAULT '0', - `data` mediumint(8) unsigned NOT NULL DEFAULT '0', - `icon_name` text NOT NULL, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.pool_creature -DROP TABLE IF EXISTS `pool_creature`; -CREATE TABLE IF NOT EXISTS `pool_creature` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0', - `pool_entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `chance` float unsigned NOT NULL DEFAULT '0', - `description` varchar(255) CHARACTER SET utf8 NOT NULL, - `flags` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'FLAG_SPAWN_ENABLE_IF_WORLD_POP_OVER_BLIZZLIKE = 1', - PRIMARY KEY (`guid`), - KEY `pool_idx` (`pool_entry`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.pool_creature_template -DROP TABLE IF EXISTS `pool_creature_template`; -CREATE TABLE IF NOT EXISTS `pool_creature_template` ( - `id` int(10) unsigned NOT NULL DEFAULT '0', - `pool_entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `chance` float unsigned NOT NULL DEFAULT '0', - `description` varchar(255) NOT NULL, - `flags` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'FLAG_SPAWN_ENABLE_IF_WORLD_POP_OVER_BLIZZLIKE = 1', - PRIMARY KEY (`id`), - KEY `pool_idx` (`pool_entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.pool_gameobject -DROP TABLE IF EXISTS `pool_gameobject`; -CREATE TABLE IF NOT EXISTS `pool_gameobject` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0', - `pool_entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `chance` float unsigned NOT NULL DEFAULT '0', - `description` varchar(255) CHARACTER SET utf8 NOT NULL, - `flags` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'FLAG_SPAWN_ENABLE_IF_WORLD_POP_OVER_BLIZZLIKE = 1', - PRIMARY KEY (`guid`), - KEY `pool_idx` (`pool_entry`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.pool_gameobject_template -DROP TABLE IF EXISTS `pool_gameobject_template`; -CREATE TABLE IF NOT EXISTS `pool_gameobject_template` ( - `id` int(10) unsigned NOT NULL DEFAULT '0', - `pool_entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `chance` float unsigned NOT NULL DEFAULT '0', - `description` varchar(255) NOT NULL, - `flags` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'FLAG_SPAWN_ENABLE_IF_WORLD_POP_OVER_BLIZZLIKE = 1', - PRIMARY KEY (`id`), - KEY `pool_idx` (`pool_entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.pool_pool -DROP TABLE IF EXISTS `pool_pool`; -CREATE TABLE IF NOT EXISTS `pool_pool` ( - `pool_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `mother_pool` mediumint(8) unsigned NOT NULL DEFAULT '0', - `chance` float NOT NULL DEFAULT '0', - `description` varchar(255) CHARACTER SET utf8 NOT NULL, - `flags` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'FLAG_SPAWN_ENABLE_IF_WORLD_POP_OVER_BLIZZLIKE = 1', - PRIMARY KEY (`pool_id`), - KEY `pool_idx` (`mother_pool`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.pool_template -DROP TABLE IF EXISTS `pool_template`; -CREATE TABLE IF NOT EXISTS `pool_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Pool entry', - `max_limit` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Max number of objects (0) is no limit', - `description` varchar(255) NOT NULL, - `flags` int(11) unsigned NOT NULL DEFAULT '0', - `instance` mediumint(8) NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.quest_end_scripts -DROP TABLE IF EXISTS `quest_end_scripts`; -CREATE TABLE IF NOT EXISTS `quest_end_scripts` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `delay` int(10) unsigned NOT NULL DEFAULT '0', - `command` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong2` int(10) unsigned NOT NULL DEFAULT '0', - `datalong3` int(10) unsigned NOT NULL DEFAULT '0', - `datalong4` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_id` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_radius` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `data_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dataint` int(11) NOT NULL DEFAULT '0', - `dataint2` int(11) NOT NULL DEFAULT '0', - `dataint3` int(11) NOT NULL DEFAULT '0', - `dataint4` int(11) NOT NULL DEFAULT '0', - `x` float NOT NULL DEFAULT '0', - `y` float NOT NULL DEFAULT '0', - `z` float NOT NULL DEFAULT '0', - `o` float NOT NULL DEFAULT '0', - `comments` varchar(255) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.quest_greeting -DROP TABLE IF EXISTS `quest_greeting`; -CREATE TABLE IF NOT EXISTS `quest_greeting` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `content_default` text NOT NULL, - `content_loc1` text, - `content_loc2` text, - `content_loc3` text, - `content_loc4` text, - `content_loc5` text, - `content_loc6` text, - `content_loc7` text, - `content_loc8` text, - `Emote` smallint(5) unsigned NOT NULL DEFAULT '0', - `EmoteDelay` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`type`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.quest_start_scripts -DROP TABLE IF EXISTS `quest_start_scripts`; -CREATE TABLE IF NOT EXISTS `quest_start_scripts` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `delay` int(10) unsigned NOT NULL DEFAULT '0', - `command` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong2` int(10) unsigned NOT NULL DEFAULT '0', - `datalong3` int(10) unsigned NOT NULL DEFAULT '0', - `datalong4` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_id` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_radius` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `data_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dataint` int(11) NOT NULL DEFAULT '0', - `dataint2` int(11) NOT NULL DEFAULT '0', - `dataint3` int(11) NOT NULL DEFAULT '0', - `dataint4` int(11) NOT NULL DEFAULT '0', - `x` float NOT NULL DEFAULT '0', - `y` float NOT NULL DEFAULT '0', - `z` float NOT NULL DEFAULT '0', - `o` float NOT NULL DEFAULT '0', - `comments` varchar(255) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.quest_template -DROP TABLE IF EXISTS `quest_template`; -CREATE TABLE IF NOT EXISTS `quest_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `patch` tinyint(3) unsigned NOT NULL DEFAULT '0', - `Method` tinyint(3) unsigned NOT NULL DEFAULT '2', - `ZoneOrSort` smallint(6) NOT NULL DEFAULT '0', - `MinLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', - `MaxLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', - `QuestLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', - `Type` smallint(5) unsigned NOT NULL DEFAULT '0', - `RequiredClasses` smallint(5) unsigned NOT NULL DEFAULT '0', - `RequiredRaces` smallint(5) unsigned NOT NULL DEFAULT '0', - `RequiredSkill` smallint(5) unsigned NOT NULL DEFAULT '0', - `RequiredSkillValue` smallint(5) unsigned NOT NULL DEFAULT '0', - `RepObjectiveFaction` smallint(5) unsigned NOT NULL DEFAULT '0', - `RepObjectiveValue` mediumint(9) NOT NULL DEFAULT '0', - `RequiredMinRepFaction` smallint(5) unsigned NOT NULL DEFAULT '0', - `RequiredMinRepValue` mediumint(9) NOT NULL DEFAULT '0', - `RequiredMaxRepFaction` smallint(5) unsigned NOT NULL DEFAULT '0', - `RequiredMaxRepValue` mediumint(9) NOT NULL DEFAULT '0', - `SuggestedPlayers` tinyint(3) unsigned NOT NULL DEFAULT '0', - `LimitTime` int(10) unsigned NOT NULL DEFAULT '0', - `QuestFlags` smallint(5) unsigned NOT NULL DEFAULT '0', - `SpecialFlags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `PrevQuestId` mediumint(9) NOT NULL DEFAULT '0', - `NextQuestId` mediumint(9) NOT NULL DEFAULT '0', - `ExclusiveGroup` mediumint(9) NOT NULL DEFAULT '0', - `NextQuestInChain` mediumint(8) unsigned NOT NULL DEFAULT '0', - `SrcItemId` mediumint(8) unsigned NOT NULL DEFAULT '0', - `SrcItemCount` tinyint(3) unsigned NOT NULL DEFAULT '0', - `SrcSpell` mediumint(8) unsigned NOT NULL DEFAULT '0', - `Title` text, - `Details` text, - `Objectives` text, - `OfferRewardText` text, - `RequestItemsText` text, - `EndText` text, - `ObjectiveText1` text, - `ObjectiveText2` text, - `ObjectiveText3` text, - `ObjectiveText4` text, - `ReqItemId1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqItemId2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqItemId3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqItemId4` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqItemCount1` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqItemCount2` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqItemCount3` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqItemCount4` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqSourceId1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqSourceId2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqSourceId3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqSourceId4` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqSourceCount1` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqSourceCount2` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqSourceCount3` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqSourceCount4` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqCreatureOrGOId1` mediumint(9) NOT NULL DEFAULT '0', - `ReqCreatureOrGOId2` mediumint(9) NOT NULL DEFAULT '0', - `ReqCreatureOrGOId3` mediumint(9) NOT NULL DEFAULT '0', - `ReqCreatureOrGOId4` mediumint(9) NOT NULL DEFAULT '0', - `ReqCreatureOrGOCount1` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqCreatureOrGOCount2` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqCreatureOrGOCount3` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqCreatureOrGOCount4` smallint(5) unsigned NOT NULL DEFAULT '0', - `ReqSpellCast1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqSpellCast2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqSpellCast3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ReqSpellCast4` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemId1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemId2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemId3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemId4` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemId5` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemId6` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemCount1` smallint(5) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemCount2` smallint(5) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemCount3` smallint(5) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemCount4` smallint(5) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemCount5` smallint(5) unsigned NOT NULL DEFAULT '0', - `RewChoiceItemCount6` smallint(5) unsigned NOT NULL DEFAULT '0', - `RewItemId1` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewItemId2` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewItemId3` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewItemId4` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewItemCount1` smallint(5) unsigned NOT NULL DEFAULT '0', - `RewItemCount2` smallint(5) unsigned NOT NULL DEFAULT '0', - `RewItemCount3` smallint(5) unsigned NOT NULL DEFAULT '0', - `RewItemCount4` smallint(5) unsigned NOT NULL DEFAULT '0', - `RewRepFaction1` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction id from Faction.dbc in this case', - `RewRepFaction2` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction id from Faction.dbc in this case', - `RewRepFaction3` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction id from Faction.dbc in this case', - `RewRepFaction4` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction id from Faction.dbc in this case', - `RewRepFaction5` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction id from Faction.dbc in this case', - `RewRepValue1` mediumint(9) NOT NULL DEFAULT '0', - `RewRepValue2` mediumint(9) NOT NULL DEFAULT '0', - `RewRepValue3` mediumint(9) NOT NULL DEFAULT '0', - `RewRepValue4` mediumint(9) NOT NULL DEFAULT '0', - `RewRepValue5` mediumint(9) NOT NULL DEFAULT '0', - `RewOrReqMoney` int(11) NOT NULL DEFAULT '0', - `RewMoneyMaxLevel` int(10) unsigned NOT NULL DEFAULT '0', - `RewSpell` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewSpellCast` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewMailTemplateId` mediumint(8) unsigned NOT NULL DEFAULT '0', - `RewMailDelaySecs` int(11) unsigned NOT NULL DEFAULT '0', - `PointMapId` smallint(5) unsigned NOT NULL DEFAULT '0', - `PointX` float NOT NULL DEFAULT '0', - `PointY` float NOT NULL DEFAULT '0', - `PointOpt` mediumint(8) unsigned NOT NULL DEFAULT '0', - `DetailsEmote1` smallint(5) unsigned NOT NULL DEFAULT '0', - `DetailsEmote2` smallint(5) unsigned NOT NULL DEFAULT '0', - `DetailsEmote3` smallint(5) unsigned NOT NULL DEFAULT '0', - `DetailsEmote4` smallint(5) unsigned NOT NULL DEFAULT '0', - `DetailsEmoteDelay1` int(11) unsigned NOT NULL DEFAULT '0', - `DetailsEmoteDelay2` int(11) unsigned NOT NULL DEFAULT '0', - `DetailsEmoteDelay3` int(11) unsigned NOT NULL DEFAULT '0', - `DetailsEmoteDelay4` int(11) unsigned NOT NULL DEFAULT '0', - `IncompleteEmote` smallint(5) unsigned NOT NULL DEFAULT '0', - `CompleteEmote` smallint(5) unsigned NOT NULL DEFAULT '0', - `OfferRewardEmote1` smallint(5) unsigned NOT NULL DEFAULT '0', - `OfferRewardEmote2` smallint(5) unsigned NOT NULL DEFAULT '0', - `OfferRewardEmote3` smallint(5) unsigned NOT NULL DEFAULT '0', - `OfferRewardEmote4` smallint(5) unsigned NOT NULL DEFAULT '0', - `OfferRewardEmoteDelay1` int(11) unsigned NOT NULL DEFAULT '0', - `OfferRewardEmoteDelay2` int(11) unsigned NOT NULL DEFAULT '0', - `OfferRewardEmoteDelay3` int(11) unsigned NOT NULL DEFAULT '0', - `OfferRewardEmoteDelay4` int(11) unsigned NOT NULL DEFAULT '0', - `StartScript` mediumint(8) unsigned NOT NULL DEFAULT '0', - `CompleteScript` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`patch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Quest System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.reference_loot_template -DROP TABLE IF EXISTS `reference_loot_template`; -CREATE TABLE IF NOT EXISTS `reference_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ChanceOrQuestChance` float NOT NULL DEFAULT '100', - `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.reputation_reward_rate -DROP TABLE IF EXISTS `reputation_reward_rate`; -CREATE TABLE IF NOT EXISTS `reputation_reward_rate` ( - `faction` mediumint(8) unsigned NOT NULL DEFAULT '0', - `quest_rate` float NOT NULL DEFAULT '1', - `creature_rate` float NOT NULL DEFAULT '1', - `spell_rate` float NOT NULL DEFAULT '1', - PRIMARY KEY (`faction`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.reputation_spillover_template -DROP TABLE IF EXISTS `reputation_spillover_template`; -CREATE TABLE IF NOT EXISTS `reputation_spillover_template` ( - `faction` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT 'faction entry', - `faction1` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT 'faction to give spillover for', - `rate_1` float NOT NULL DEFAULT '0' COMMENT 'the given rep points * rate', - `rank_1` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'max rank, above this will not give any spillover', - `faction2` smallint(6) unsigned NOT NULL DEFAULT '0', - `rate_2` float NOT NULL DEFAULT '0', - `rank_2` tinyint(3) unsigned NOT NULL DEFAULT '0', - `faction3` smallint(6) unsigned NOT NULL DEFAULT '0', - `rate_3` float NOT NULL DEFAULT '0', - `rank_3` tinyint(3) unsigned NOT NULL DEFAULT '0', - `faction4` smallint(6) unsigned NOT NULL DEFAULT '0', - `rate_4` float NOT NULL DEFAULT '0', - `rank_4` tinyint(3) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`faction`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Reputation spillover reputation gain'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.reserved_name -DROP TABLE IF EXISTS `reserved_name`; -CREATE TABLE IF NOT EXISTS `reserved_name` ( - `name` varchar(12) NOT NULL DEFAULT '', - PRIMARY KEY (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player Reserved Names'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.scripted_areatrigger -DROP TABLE IF EXISTS `scripted_areatrigger`; -CREATE TABLE IF NOT EXISTS `scripted_areatrigger` ( - `entry` mediumint(8) NOT NULL, - `ScriptName` char(64) NOT NULL, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.scripted_event_id -DROP TABLE IF EXISTS `scripted_event_id`; -CREATE TABLE IF NOT EXISTS `scripted_event_id` ( - `id` mediumint(8) NOT NULL, - `ScriptName` char(64) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Script library scripted events'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.script_escort_data -DROP TABLE IF EXISTS `script_escort_data`; -CREATE TABLE IF NOT EXISTS `script_escort_data` ( - `creature_id` int(11) DEFAULT NULL, - `quest` int(11) DEFAULT NULL, - `escort_faction` int(11) DEFAULT NULL, - UNIQUE KEY `creature_id` (`creature_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.script_texts -DROP TABLE IF EXISTS `script_texts`; -CREATE TABLE IF NOT EXISTS `script_texts` ( - `entry` mediumint(8) NOT NULL, - `content_default` text NOT NULL, - `content_loc1` text, - `content_loc2` text, - `content_loc3` text, - `content_loc4` text, - `content_loc5` text, - `content_loc6` text, - `content_loc7` text, - `content_loc8` text, - `sound` mediumint(8) unsigned NOT NULL DEFAULT '0', - `type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `language` tinyint(3) unsigned NOT NULL DEFAULT '0', - `emote` smallint(5) unsigned NOT NULL DEFAULT '0', - `comment` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.script_waypoint -DROP TABLE IF EXISTS `script_waypoint`; -CREATE TABLE IF NOT EXISTS `script_waypoint` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template entry', - `pointid` mediumint(8) unsigned NOT NULL DEFAULT '0', - `location_x` float NOT NULL DEFAULT '0', - `location_y` float NOT NULL DEFAULT '0', - `location_z` float NOT NULL DEFAULT '0', - `waittime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'waittime in millisecs', - `point_comment` text, - PRIMARY KEY (`entry`,`pointid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.skill_discovery_template -DROP TABLE IF EXISTS `skill_discovery_template`; -CREATE TABLE IF NOT EXISTS `skill_discovery_template` ( - `spellId` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'SpellId of the discoverable spell', - `reqSpell` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'spell requirement', - `chance` float NOT NULL DEFAULT '0' COMMENT 'chance to discover', - PRIMARY KEY (`spellId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Skill Discovery System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.skill_extra_item_template -DROP TABLE IF EXISTS `skill_extra_item_template`; -CREATE TABLE IF NOT EXISTS `skill_extra_item_template` ( - `spellId` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'SpellId of the item creation spell', - `requiredSpecialization` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Specialization spell id', - `additionalCreateChance` float NOT NULL DEFAULT '0' COMMENT 'chance to create add', - `additionalMaxNum` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'max num of adds', - PRIMARY KEY (`spellId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Skill Specialization System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.skill_fishing_base_level -DROP TABLE IF EXISTS `skill_fishing_base_level`; -CREATE TABLE IF NOT EXISTS `skill_fishing_base_level` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Area identifier', - `skill` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Base skill level requirement', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Fishing system'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.skinning_loot_template -DROP TABLE IF EXISTS `skinning_loot_template`; -CREATE TABLE IF NOT EXISTS `skinning_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `item` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ChanceOrQuestChance` float NOT NULL DEFAULT '100', - `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', - `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', - `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', - `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_affect -DROP TABLE IF EXISTS `spell_affect`; -CREATE TABLE IF NOT EXISTS `spell_affect` ( - `entry` smallint(5) unsigned NOT NULL DEFAULT '0', - `effectId` tinyint(3) unsigned NOT NULL DEFAULT '0', - `SpellFamilyMask` bigint(20) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`,`effectId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_area -DROP TABLE IF EXISTS `spell_area`; -CREATE TABLE IF NOT EXISTS `spell_area` ( - `spell` mediumint(8) unsigned NOT NULL DEFAULT '0', - `area` mediumint(8) unsigned NOT NULL DEFAULT '0', - `quest_start` mediumint(8) unsigned NOT NULL DEFAULT '0', - `quest_start_active` tinyint(1) unsigned NOT NULL DEFAULT '0', - `quest_end` mediumint(8) unsigned NOT NULL DEFAULT '0', - `aura_spell` mediumint(8) NOT NULL DEFAULT '0', - `racemask` mediumint(8) unsigned NOT NULL DEFAULT '0', - `gender` tinyint(1) unsigned NOT NULL DEFAULT '2', - `autocast` tinyint(1) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`spell`,`area`,`quest_start`,`quest_start_active`,`aura_spell`,`racemask`,`gender`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_bonus_data -DROP TABLE IF EXISTS `spell_bonus_data`; -CREATE TABLE IF NOT EXISTS `spell_bonus_data` ( - `entry` smallint(5) unsigned NOT NULL, - `direct_bonus` float NOT NULL DEFAULT '0', - `dot_bonus` float NOT NULL DEFAULT '0', - `ap_bonus` float NOT NULL DEFAULT '0', - `ap_dot_bonus` float NOT NULL DEFAULT '0', - `comments` varchar(255) DEFAULT NULL, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_chain -DROP TABLE IF EXISTS `spell_chain`; -CREATE TABLE IF NOT EXISTS `spell_chain` ( - `spell_id` mediumint(9) NOT NULL DEFAULT '0', - `prev_spell` mediumint(9) NOT NULL DEFAULT '0', - `first_spell` mediumint(9) NOT NULL DEFAULT '0', - `rank` tinyint(4) NOT NULL DEFAULT '0', - `req_spell` mediumint(9) NOT NULL DEFAULT '0', - PRIMARY KEY (`spell_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell Additinal Data'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_check -DROP TABLE IF EXISTS `spell_check`; -CREATE TABLE IF NOT EXISTS `spell_check` ( - `spellid` mediumint(7) unsigned NOT NULL DEFAULT '0', - `SpellFamilyName` smallint(5) NOT NULL DEFAULT '-1', - `SpellFamilyMask` bigint(30) NOT NULL DEFAULT '-1', - `SpellIcon` int(10) NOT NULL DEFAULT '-1', - `SpellVisual` int(10) NOT NULL DEFAULT '-1', - `SpellCategory` int(10) NOT NULL DEFAULT '-1', - `EffectType` int(10) NOT NULL DEFAULT '-1', - `EffectAura` int(10) NOT NULL DEFAULT '-1', - `EffectIdx` tinyint(3) NOT NULL DEFAULT '-1', - `Name` varchar(40) NOT NULL DEFAULT '', - `Code` varchar(40) NOT NULL DEFAULT '', - PRIMARY KEY (`spellid`,`SpellFamilyName`,`SpellFamilyMask`,`SpellIcon`,`SpellVisual`,`SpellCategory`,`Code`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_disabled -DROP TABLE IF EXISTS `spell_disabled`; -CREATE TABLE IF NOT EXISTS `spell_disabled` ( - `entry` int(10) unsigned NOT NULL COMMENT 'Disabled spell', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_effect_mod -DROP TABLE IF EXISTS `spell_effect_mod`; -CREATE TABLE IF NOT EXISTS `spell_effect_mod` ( - `Id` int(10) unsigned NOT NULL DEFAULT '0', - `EffectIndex` int(3) unsigned NOT NULL DEFAULT '0', - `Effect` int(3) NOT NULL DEFAULT '-1', - `EffectDieSides` int(10) NOT NULL DEFAULT '-1', - `EffectBaseDice` int(10) NOT NULL DEFAULT '-1', - `EffectDicePerLevel` float NOT NULL DEFAULT '-1', - `EffectRealPointsPerLevel` float NOT NULL DEFAULT '-1', - `EffectBasePoints` int(10) NOT NULL DEFAULT '-1', - `EffectAmplitude` int(10) NOT NULL DEFAULT '-1', - `EffectPointsPerComboPoint` float NOT NULL DEFAULT '-1', - `EffectChainTarget` int(10) NOT NULL DEFAULT '-1', - `EffectMultipleValue` float NOT NULL DEFAULT '-1', - `EffectMechanic` int(10) NOT NULL DEFAULT '-1', - `EffectImplicitTargetA` int(10) NOT NULL DEFAULT '-1', - `EffectImplicitTargetB` int(10) NOT NULL DEFAULT '-1', - `EffectRadiusIndex` int(10) NOT NULL DEFAULT '-1', - `EffectApplyAuraName` int(10) NOT NULL DEFAULT '-1', - `EffectItemType` int(10) NOT NULL DEFAULT '-1', - `EffectMiscValue` int(10) NOT NULL DEFAULT '-1', - `EffectTriggerSpell` int(10) NOT NULL DEFAULT '-1', - `Comment` varchar(255) DEFAULT NULL, - PRIMARY KEY (`Id`,`EffectIndex`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_elixir -DROP TABLE IF EXISTS `spell_elixir`; -CREATE TABLE IF NOT EXISTS `spell_elixir` ( - `entry` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'SpellId of potion', - `mask` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Mask 0x1 battle 0x2 guardian 0x3 flask 0x7 unstable flasks 0xB shattrath flasks', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_facing -DROP TABLE IF EXISTS `spell_facing`; -CREATE TABLE IF NOT EXISTS `spell_facing` ( - `entry` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Spell ID', - `facingcasterflag` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'flag for facing state, usually 1', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_group -DROP TABLE IF EXISTS `spell_group`; -CREATE TABLE IF NOT EXISTS `spell_group` ( - `group_id` int(11) unsigned NOT NULL DEFAULT '0', - `group_spell_id` int(11) unsigned NOT NULL DEFAULT '0', - `spell_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`group_id`,`group_spell_id`,`spell_id`), - UNIQUE KEY `group_id` (`group_id`,`group_spell_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_group_stack_rules -DROP TABLE IF EXISTS `spell_group_stack_rules`; -CREATE TABLE IF NOT EXISTS `spell_group_stack_rules` ( - `group_id` int(11) unsigned NOT NULL DEFAULT '0', - `stack_rule` tinyint(3) NOT NULL DEFAULT '1', - PRIMARY KEY (`group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_learn_spell -DROP TABLE IF EXISTS `spell_learn_spell`; -CREATE TABLE IF NOT EXISTS `spell_learn_spell` ( - `entry` smallint(5) unsigned NOT NULL DEFAULT '0', - `SpellID` smallint(5) unsigned NOT NULL DEFAULT '0', - `Active` tinyint(3) unsigned NOT NULL DEFAULT '1', - PRIMARY KEY (`entry`,`SpellID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_mod -DROP TABLE IF EXISTS `spell_mod`; -CREATE TABLE IF NOT EXISTS `spell_mod` ( - `Id` int(11) NOT NULL DEFAULT '0', - `procChance` int(11) DEFAULT '-1', - `procFlags` int(11) DEFAULT '-1', - `procCharges` int(11) DEFAULT '-1', - `DurationIndex` int(11) DEFAULT '-1', - `Category` int(11) DEFAULT '-1', - `CastingTimeIndex` int(11) DEFAULT '-1', - `StackAmount` int(11) DEFAULT '-1', - `SpellIconID` int(11) DEFAULT '-1', - `activeIconID` int(11) DEFAULT '-1', - `manaCost` int(11) DEFAULT '-1', - `Attributes` int(11) DEFAULT '-1', - `AttributesEx` int(11) DEFAULT '-1', - `AttributesEx2` int(11) DEFAULT '-1', - `AttributesEx3` int(11) DEFAULT '-1', - `AttributesEx4` int(11) DEFAULT '-1', - `Custom` int(11) DEFAULT '0', - `InterruptFlags` int(11) DEFAULT '-1', - `AuraInterruptFlags` int(11) DEFAULT '-1', - `ChannelInterruptFlags` int(11) DEFAULT '-1', - `Dispel` int(10) NOT NULL DEFAULT '-1', - `Stances` int(11) DEFAULT '-1', - `StancesNot` int(11) DEFAULT '-1', - `SpellVisual` int(11) DEFAULT '-1', - `ManaCostPercentage` int(11) DEFAULT '-1', - `StartRecoveryCategory` int(11) DEFAULT '-1', - `StartRecoveryTime` int(11) DEFAULT '-1', - `MaxAffectedTargets` int(11) DEFAULT '-1', - `MaxTargetLevel` int(11) DEFAULT '-1', - `DmgClass` int(11) DEFAULT '-1', - `rangeIndex` int(11) DEFAULT '-1', - `RecoveryTime` int(11) NOT NULL DEFAULT '-1', - `CategoryRecoveryTime` int(11) NOT NULL DEFAULT '-1', - `SpellFamilyName` int(11) NOT NULL DEFAULT '-1', - `SpellFamilyFlags` bigint(20) unsigned DEFAULT '0', - `Mechanic` int(2) DEFAULT '-1', - `EquippedItemClass` int(2) DEFAULT '-1', - `Comment` varchar(255) DEFAULT NULL, - PRIMARY KEY (`Id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_pet_auras -DROP TABLE IF EXISTS `spell_pet_auras`; -CREATE TABLE IF NOT EXISTS `spell_pet_auras` ( - `spell` mediumint(8) unsigned NOT NULL COMMENT 'dummy spell id', - `pet` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'pet id; 0 = all', - `aura` mediumint(8) unsigned NOT NULL COMMENT 'pet aura id', - PRIMARY KEY (`spell`,`pet`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_proc_event -DROP TABLE IF EXISTS `spell_proc_event`; -CREATE TABLE IF NOT EXISTS `spell_proc_event` ( - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `SchoolMask` tinyint(4) unsigned NOT NULL DEFAULT '0', - `SpellFamilyName` smallint(5) unsigned NOT NULL DEFAULT '0', - `SpellFamilyMask0` bigint(40) unsigned NOT NULL DEFAULT '0', - `SpellFamilyMask1` bigint(40) unsigned NOT NULL DEFAULT '0', - `SpellFamilyMask2` bigint(40) unsigned NOT NULL DEFAULT '0', - `procFlags` int(10) unsigned NOT NULL DEFAULT '0', - `procEx` int(10) unsigned NOT NULL DEFAULT '0', - `ppmRate` float NOT NULL DEFAULT '0', - `CustomChance` float NOT NULL DEFAULT '0', - `Cooldown` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_proc_item_enchant -DROP TABLE IF EXISTS `spell_proc_item_enchant`; -CREATE TABLE IF NOT EXISTS `spell_proc_item_enchant` ( - `entry` mediumint(8) unsigned NOT NULL, - `ppmRate` float NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_scripts -DROP TABLE IF EXISTS `spell_scripts`; -CREATE TABLE IF NOT EXISTS `spell_scripts` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `delay` int(10) unsigned NOT NULL DEFAULT '0', - `command` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', - `datalong2` int(10) unsigned NOT NULL DEFAULT '0', - `datalong3` int(10) unsigned NOT NULL DEFAULT '0', - `datalong4` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_id` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_radius` int(10) unsigned NOT NULL DEFAULT '0', - `buddy_type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `data_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', - `dataint` int(11) NOT NULL DEFAULT '0', - `dataint2` int(11) NOT NULL DEFAULT '0', - `dataint3` int(11) NOT NULL DEFAULT '0', - `dataint4` int(11) NOT NULL DEFAULT '0', - `x` float NOT NULL DEFAULT '0', - `y` float NOT NULL DEFAULT '0', - `z` float NOT NULL DEFAULT '0', - `o` float NOT NULL DEFAULT '0', - `comments` varchar(255) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_script_target -DROP TABLE IF EXISTS `spell_script_target`; -CREATE TABLE IF NOT EXISTS `spell_script_target` ( - `entry` mediumint(8) unsigned NOT NULL, - `type` tinyint(3) unsigned NOT NULL DEFAULT '0', - `targetEntry` mediumint(8) unsigned NOT NULL DEFAULT '0', - UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Spell System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_target_position -DROP TABLE IF EXISTS `spell_target_position`; -CREATE TABLE IF NOT EXISTS `spell_target_position` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', - `target_map` smallint(5) unsigned NOT NULL DEFAULT '0', - `target_position_x` float NOT NULL DEFAULT '0', - `target_position_y` float NOT NULL DEFAULT '0', - `target_position_z` float NOT NULL DEFAULT '0', - `target_orientation` float NOT NULL DEFAULT '0', - PRIMARY KEY (`id`,`target_map`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_template -DROP TABLE IF EXISTS `spell_template`; -CREATE TABLE IF NOT EXISTS `spell_template` ( - `ID` int(4) unsigned NOT NULL DEFAULT '0', - `school` int(4) unsigned DEFAULT '0' COMMENT 'Resistances.dbc', - `category` int(4) unsigned DEFAULT '0' COMMENT 'SpellCategory.dbc', - `castUI` int(4) unsigned DEFAULT '0', - `dispel` int(4) unsigned DEFAULT '0' COMMENT 'SpellDispelType.dbc', - `mechanic` int(4) unsigned DEFAULT '0' COMMENT 'SpellMechanic.dbc', - `attributes` int(4) unsigned DEFAULT '0', - `attributesEx` int(4) unsigned DEFAULT '0', - `attributesEx2` int(4) unsigned DEFAULT '0', - `attributesEx3` int(4) unsigned DEFAULT '0', - `attributesEx4` int(4) unsigned DEFAULT '0', - `stances` int(4) unsigned DEFAULT '0' COMMENT 'SpellShapeshiftForm.dbc', - `stancesNot` int(4) unsigned DEFAULT '0' COMMENT 'SpellShapeshiftForm.dbc', - `targets` int(4) unsigned DEFAULT '0', - `targetCreatureType` int(4) unsigned DEFAULT '0' COMMENT 'CreatureType.dbc', - `requiresSpellFocus` int(4) unsigned DEFAULT '0' COMMENT 'SpellFocusObject.dbc', - `casterAuraState` int(4) unsigned DEFAULT '0', - `targetAuraState` int(4) unsigned DEFAULT '0', - `castingTimeIndex` int(4) unsigned DEFAULT '0' COMMENT 'SpellCastTimes.dbc', - `recoveryTime` int(4) unsigned DEFAULT '0', - `categoryRecoveryTime` int(4) unsigned DEFAULT '0', - `interruptFlags` int(4) unsigned DEFAULT '0', - `auraInterruptFlags` int(4) unsigned DEFAULT '0', - `channelInterruptFlags` int(4) unsigned DEFAULT '0', - `procFlags` int(4) unsigned DEFAULT '0', - `procChance` int(4) unsigned DEFAULT '0', - `procCharges` int(4) unsigned DEFAULT '0', - `maxLevel` int(4) unsigned DEFAULT '0', - `baseLevel` int(4) unsigned DEFAULT '0', - `spellLevel` int(4) unsigned DEFAULT '0', - `durationIndex` int(4) unsigned DEFAULT '0' COMMENT 'SpellDuration.dbc', - `powerType` int(4) unsigned DEFAULT '0', - `manaCost` int(4) unsigned DEFAULT '0', - `manCostPerLevel` int(4) unsigned DEFAULT '0', - `manaPerSecond` int(4) unsigned DEFAULT '0', - `manaPerSecondPerLevel` int(4) unsigned DEFAULT '0', - `rangeIndex` int(4) unsigned DEFAULT '0' COMMENT 'SpellRange.dbc', - `speed` float DEFAULT '0', - `modelNextSpell` int(4) unsigned DEFAULT '0', - `stackAmount` int(4) unsigned DEFAULT '0', - `totem1` int(4) unsigned DEFAULT '0', - `totem2` int(4) unsigned DEFAULT '0', - `reagent1` int(4) DEFAULT '0', - `reagent2` int(4) DEFAULT '0', - `reagent3` int(4) DEFAULT '0', - `reagent4` int(4) DEFAULT '0', - `reagent5` int(4) DEFAULT '0', - `reagent6` int(4) DEFAULT '0', - `reagent7` int(4) DEFAULT '0', - `reagent8` int(4) DEFAULT '0', - `reagentCount1` int(4) unsigned DEFAULT '0', - `reagentCount2` int(4) unsigned DEFAULT '0', - `reagentCount3` int(4) unsigned DEFAULT '0', - `reagentCount4` int(4) unsigned DEFAULT '0', - `reagentCount5` int(4) unsigned DEFAULT '0', - `reagentCount6` int(4) unsigned DEFAULT '0', - `reagentCount7` int(4) unsigned DEFAULT '0', - `reagentCount8` int(4) unsigned DEFAULT '0', - `equippedItemClass` int(4) DEFAULT '0' COMMENT 'ItemClass.dbc', - `equippedItemSubClassMask` int(4) DEFAULT '0' COMMENT 'ItemSubClass.dbc', - `equippedItemInventoryTypeMask` int(4) DEFAULT '0', - `effect1` int(4) unsigned DEFAULT '0', - `effect2` int(4) unsigned DEFAULT '0', - `effect3` int(4) unsigned DEFAULT '0', - `effectDieSides1` int(4) DEFAULT '0', - `effectDieSides2` int(4) DEFAULT '0', - `effectDieSides3` int(4) DEFAULT '0', - `effectBaseDice1` int(4) unsigned DEFAULT '0', - `effectBaseDice2` int(4) unsigned DEFAULT '0', - `effectBaseDice3` int(4) unsigned DEFAULT '0', - `effectDicePerLevel1` float DEFAULT '0', - `effectDicePerLevel2` float DEFAULT '0', - `effectDicePerLevel3` float DEFAULT '0', - `effectRealPointsPerLevel1` float DEFAULT '0', - `effectRealPointsPerLevel2` float DEFAULT '0', - `effectRealPointsPerLevel3` float DEFAULT '0', - `effectBasePoints1` int(4) DEFAULT '0', - `effectBasePoints2` int(4) DEFAULT '0', - `effectBasePoints3` int(4) DEFAULT '0', - `effectMechanic1` int(4) unsigned DEFAULT '0', - `effectMechanic2` int(4) unsigned DEFAULT '0', - `effectMechanic3` int(4) unsigned DEFAULT '0', - `effectImplicitTargetA1` int(4) unsigned DEFAULT '0', - `effectImplicitTargetA2` int(4) unsigned DEFAULT '0', - `effectImplicitTargetA3` int(4) unsigned DEFAULT '0', - `effectImplicitTargetB1` int(4) unsigned DEFAULT '0', - `effectImplicitTargetB2` int(4) unsigned DEFAULT '0', - `effectImplicitTargetB3` int(4) unsigned DEFAULT '0', - `effectRadiusIndex1` int(4) unsigned DEFAULT '0' COMMENT 'SpellRadius.dbc', - `effectRadiusIndex2` int(4) unsigned DEFAULT '0' COMMENT 'SpellRadius.dbc', - `effectRadiusIndex3` int(4) unsigned DEFAULT '0' COMMENT 'SpellRadius.dbc', - `effectApplyAuraName1` int(4) unsigned DEFAULT '0', - `effectApplyAuraName2` int(4) unsigned DEFAULT '0', - `effectApplyAuraName3` int(4) unsigned DEFAULT '0', - `effectAmplitude1` int(4) unsigned DEFAULT '0', - `effectAmplitude2` int(4) unsigned DEFAULT '0', - `effectAmplitude3` int(4) unsigned DEFAULT '0', - `effectMultipleValue1` float DEFAULT '0', - `effectMultipleValue2` float DEFAULT '0', - `effectMultipleValue3` float DEFAULT '0', - `effectChainTarget1` int(4) unsigned DEFAULT '0', - `effectChainTarget2` int(4) unsigned DEFAULT '0', - `effectChainTarget3` int(4) unsigned DEFAULT '0', - `effectItemType1` int(4) unsigned DEFAULT '0', - `effectItemType2` int(4) unsigned DEFAULT '0', - `effectItemType3` int(4) unsigned DEFAULT '0', - `effectMiscValue1` int(4) DEFAULT '0', - `effectMiscValue2` int(4) DEFAULT '0', - `effectMiscValue3` int(4) DEFAULT '0', - `effectTriggerSpell1` int(4) unsigned DEFAULT '0', - `effectTriggerSpell2` int(4) unsigned DEFAULT '0', - `effectTriggerSpell3` int(4) unsigned DEFAULT '0', - `effectPointsPerComboPoint1` float DEFAULT '0', - `effectPointsPerComboPoint2` float DEFAULT '0', - `effectPointsPerComboPoint3` float DEFAULT '0', - `spellVisual1` int(4) unsigned DEFAULT '0' COMMENT 'SpellVisual.dbc', - `spellVisual2` int(4) unsigned DEFAULT '0' COMMENT 'SpellVisual.dbc', - `spellIconId` int(4) unsigned DEFAULT '0' COMMENT 'SpellIcon.dbc', - `activeIconId` int(4) unsigned DEFAULT '0' COMMENT 'SpellIcon.dbc', - `spellPriority` int(4) unsigned DEFAULT '0', - `name1` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `name2` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `name3` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `name4` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `name5` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `name6` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `name7` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `name8` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `nameFlags` int(4) unsigned DEFAULT '0', - `nameSubtext1` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `nameSubtext2` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `nameSubtext3` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `nameSubtext4` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `nameSubtext5` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `nameSubtext6` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `nameSubtext7` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `nameSubtext8` varchar(256) COLLATE utf8_unicode_ci DEFAULT '', - `nameSubtextFlags` int(4) unsigned DEFAULT '0', - `description1` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '', - `description2` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '', - `description3` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '', - `description4` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '', - `description5` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '', - `description6` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '', - `description7` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '', - `description8` varchar(1024) COLLATE utf8_unicode_ci DEFAULT '', - `descriptionFlags` int(4) unsigned DEFAULT '0', - `auraDescription1` varchar(512) COLLATE utf8_unicode_ci DEFAULT '', - `auraDescription2` varchar(512) COLLATE utf8_unicode_ci DEFAULT '', - `auraDescription3` varchar(512) COLLATE utf8_unicode_ci DEFAULT '', - `auraDescription4` varchar(512) COLLATE utf8_unicode_ci DEFAULT '', - `auraDescription5` varchar(512) COLLATE utf8_unicode_ci DEFAULT '', - `auraDescription6` varchar(512) COLLATE utf8_unicode_ci DEFAULT '', - `auraDescription7` varchar(512) COLLATE utf8_unicode_ci DEFAULT '', - `auraDescription8` varchar(512) COLLATE utf8_unicode_ci DEFAULT '', - `auraDescriptionFlags` int(4) unsigned DEFAULT '0', - `manaCostPercentage` int(4) unsigned DEFAULT '0', - `startRecoveryCategory` int(4) unsigned DEFAULT '0', - `startRecoveryTime` int(4) unsigned DEFAULT '0', - `maxTargetLevel` int(4) unsigned DEFAULT '0', - `spellFamilyName` int(4) unsigned DEFAULT '0' COMMENT 'ChrClasses.dbc', - `spellFamilyFlags` bigint(20) unsigned DEFAULT '0', - `maxAffectedTargets` int(4) unsigned DEFAULT '0', - `dmgClass` int(4) unsigned DEFAULT '0', - `preventionType` int(4) unsigned DEFAULT '0', - `stanceBarOrder` int(4) DEFAULT '0', - `dmgMultiplier1` float DEFAULT '0', - `dmgMultiplier2` float DEFAULT '0', - `dmgMultiplier3` float DEFAULT '0', - `minFactionId` int(4) unsigned DEFAULT '0', - `minReputation` int(4) unsigned DEFAULT '0', - `requiredAuraVision` int(4) unsigned DEFAULT '0', - PRIMARY KEY (`ID`), - UNIQUE KEY `ID` (`ID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.spell_threat -DROP TABLE IF EXISTS `spell_threat`; -CREATE TABLE IF NOT EXISTS `spell_threat` ( - `entry` mediumint(8) unsigned NOT NULL, - `Threat` smallint(6) NOT NULL, - `multiplier` float NOT NULL DEFAULT '1' COMMENT 'threat multiplier for damage/healing', - `ap_bonus` float NOT NULL DEFAULT '0' COMMENT 'additional threat bonus from attack power', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.transports -DROP TABLE IF EXISTS `transports`; -CREATE TABLE IF NOT EXISTS `transports` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0', - `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', - `name` text, - `period` mediumint(8) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Transports'; - --- Data exporting was unselected. - - --- Dumping structure for table mangos.variables -DROP TABLE IF EXISTS `variables`; -CREATE TABLE IF NOT EXISTS `variables` ( - `index` int(10) unsigned NOT NULL DEFAULT '0', - `value` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`index`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- Data exporting was unselected. -/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; -/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/src/game/AI/AggressorAI.cpp b/src/game/AI/AggressorAI.cpp index 087bb2d65..9b0d82f50 100644 --- a/src/game/AI/AggressorAI.cpp +++ b/src/game/AI/AggressorAI.cpp @@ -92,6 +92,7 @@ AggressorAI::AttackStart(Unit *u) m_creature->SetInCombatWith(u); u->SetInCombatWith(m_creature); - m_creature->GetMotionMaster()->MoveChase(u); + if (m_CombatMovementEnabled) + m_creature->GetMotionMaster()->MoveChase(u); } } diff --git a/src/game/AI/CreatureAI.cpp b/src/game/AI/CreatureAI.cpp index ec19b8867..ede6f1fdd 100644 --- a/src/game/AI/CreatureAI.cpp +++ b/src/game/AI/CreatureAI.cpp @@ -82,6 +82,9 @@ CanCastResult CreatureAI::CanCastSpell(Unit* pTarget, const SpellEntry *pSpell, if (pSpell->rangeIndex == SPELL_RANGE_IDX_SELF_ONLY) return CAST_OK; + if (!(pSpell->AttributesEx2 & SPELL_ATTR_EX2_IGNORE_LOS) && !m_creature->IsWithinLOSInMap(pTarget)) + return CAST_FAIL_NOT_IN_LOS; + if (const SpellRangeEntry *pSpellRange = sSpellRangeStore.LookupEntry(pSpell->rangeIndex)) { if (pTarget != m_creature) @@ -111,35 +114,38 @@ CanCastResult CreatureAI::DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32 Unit* pCaster = m_creature; - if (uiCastFlags & CAST_FORCE_TARGET_SELF) + if (uiCastFlags & CF_TARGET_CASTS_ON_SELF) pCaster = pTarget; // Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered - if (!pCaster->IsNonMeleeSpellCasted(false) || uiCastFlags & (CAST_TRIGGERED | CAST_INTERRUPT_PREVIOUS)) + if (!pCaster->IsNonMeleeSpellCasted(false) || uiCastFlags & (CF_TRIGGERED | CF_INTERRUPT_PREVIOUS)) { if (const SpellEntry* pSpell = sSpellMgr.GetSpellEntry(uiSpell)) { - // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them - if (uiCastFlags & CAST_AURA_NOT_PRESENT) + // If cast flag CF_AURA_NOT_PRESENT is active, check if target already has aura on them + if (uiCastFlags & CF_AURA_NOT_PRESENT) { if (pTarget->HasAura(uiSpell)) return CAST_FAIL_TARGET_AURA; } // Check if cannot cast spell - if (!(uiCastFlags & (CAST_FORCE_TARGET_SELF | CAST_FORCE_CAST))) + if (!(uiCastFlags & (CF_TARGET_CASTS_ON_SELF | CF_FORCE_CAST))) { - CanCastResult castResult = CanCastSpell(pTarget, pSpell, uiCastFlags & CAST_TRIGGERED); + CanCastResult castResult = CanCastSpell(pTarget, pSpell, uiCastFlags & CF_TRIGGERED); if (castResult != CAST_OK) return castResult; } // Interrupt any previous spell - if ((uiCastFlags & CAST_INTERRUPT_PREVIOUS) && pCaster->IsNonMeleeSpellCasted(false)) + if ((uiCastFlags & CF_INTERRUPT_PREVIOUS) && pCaster->IsNonMeleeSpellCasted(false)) pCaster->InterruptNonMeleeSpells(false); - pCaster->CastSpell(pTarget, pSpell, uiCastFlags & CAST_TRIGGERED, nullptr, nullptr, uiOriginalCasterGUID); + if ((uiCastFlags & CF_MAIN_RANGED_SPELL) && pCaster->IsMoving()) + pCaster->StopMoving(); + + pCaster->CastSpell(pTarget, pSpell, uiCastFlags & CF_TRIGGERED, nullptr, nullptr, uiOriginalCasterGUID); return CAST_OK; } @@ -150,55 +156,6 @@ CanCastResult CreatureAI::DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32 return CAST_FAIL_IS_CASTING; } - -Unit* CreatureAI::DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff, bool bPercent) const -{ - Unit* pUnit = nullptr; - - MaNGOS::MostHPMissingInRangeCheck u_check(m_creature, fRange, uiMinHPDiff, bPercent); - MaNGOS::UnitLastSearcher searcher(pUnit, u_check); - - Cell::VisitGridObjects(m_creature, searcher, fRange); - - return pUnit; -} - -inline Unit* CreatureAI::GetTargetByType(uint32 CastTarget, uint16 SpellId) const -{ - switch (CastTarget) - { - case TARGET_T_SELF: - return m_creature; - case TARGET_T_HOSTILE: - return m_creature->getVictim(); - case TARGET_T_HOSTILE_SECOND_AGGRO: - return m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1); - case TARGET_T_HOSTILE_LAST_AGGRO: - return m_creature->SelectAttackingTarget(ATTACKING_TARGET_BOTTOMAGGRO, 0); - case TARGET_T_HOSTILE_RANDOM: - return m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); - case TARGET_T_HOSTILE_RANDOM_NOT_TOP: - return m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); - case TARGET_T_FRIENDLY: - case TARGET_T_FRIENDLY_NOT_SELF: - case TARGET_T_FRIENDLY_INJURED: - { - const SpellEntry* pSpell = sSpellMgr.GetSpellEntry(SpellId); - const SpellRangeEntry *pSpellRange = sSpellRangeStore.LookupEntry(pSpell->rangeIndex); - switch (CastTarget) - { - case TARGET_T_FRIENDLY: - return m_creature->SelectRandomFriendlyTarget(nullptr, pSpellRange->maxRange); - case TARGET_T_FRIENDLY_NOT_SELF: - return m_creature->SelectRandomFriendlyTarget(m_creature, pSpellRange->maxRange); - case TARGET_T_FRIENDLY_INJURED: - return DoSelectLowestHpFriendly(pSpellRange->maxRange, 50, true); - } - } - } - return nullptr; -} - void CreatureAI::SetSpellsTemplate(uint32 entry) { if (entry == 0) @@ -232,20 +189,32 @@ void CreatureAI::DoSpellTemplateCasts(const uint32 uiDiff) continue; } - Unit* spellTarget = GetTargetByType(spell.castTarget, spell.spellId); + Unit* spellTarget = ToUnit(GetTargetByType(m_creature, m_creature, spell.castTarget, spell.spellId)); - // no valid target - if (!spellTarget) - continue; - - if (DoCastSpellIfCan(spellTarget, spell.spellId, spell.castFlags) == CAST_OK) + CanCastResult result = DoCastSpellIfCan(spellTarget, spell.spellId, spell.castFlags); + + if (result == CAST_OK) { spell.cooldown = urand(spell.delayRepeatMin, spell.delayRepeatMax); + if (spell.castFlags & CF_MAIN_RANGED_SPELL) + { + SetCombatMovement(false); + SetMeleeAttack(false); + } + // If there is a script for this spell, run it. if (spell.scriptId) m_creature->GetMap()->ScriptsStart(sCreatureSpellScripts, spell.scriptId, m_creature, spellTarget); } + else if (result != CAST_FAIL_IS_CASTING) + { + if (spell.castFlags & CF_MAIN_RANGED_SPELL) + { + SetCombatMovement(true); + SetMeleeAttack(true); + } + } } else spell.cooldown -= uiDiff; @@ -349,7 +318,7 @@ void CreatureAI::DoCastAOE(uint32 spellId, bool triggered) bool CreatureAI::DoMeleeAttackIfReady() { - return m_creature->UpdateMeleeAttackingState(); + return m_MeleeEnabled ? m_creature->UpdateMeleeAttackingState() : false; } struct EnterEvadeModeHelper @@ -371,6 +340,35 @@ struct EnterEvadeModeHelper Unit* source; }; +void CreatureAI::SetMeleeAttack(bool enabled) +{ + if (m_MeleeEnabled == enabled) + return; + + m_MeleeEnabled = enabled; + + if (enabled) + m_creature->SendMeleeAttackStart(m_creature->getVictim()); + else + m_creature->SendMeleeAttackStop(m_creature->getVictim()); +} + +void CreatureAI::SetCombatMovement(bool enabled) +{ + if (m_CombatMovementEnabled == enabled) + return; + + m_CombatMovementEnabled = enabled; + + if (Unit* pVictim = m_creature->getVictim()) + { + if (!enabled && (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)) + m_creature->GetMotionMaster()->MoveIdle(); + else if (enabled && (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)) + m_creature->GetMotionMaster()->MoveChase(pVictim); + } +} + void CreatureAI::EnterEvadeMode() { // Reset back to default spells template. This also resets timers. diff --git a/src/game/AI/CreatureAI.h b/src/game/AI/CreatureAI.h index 590124c44..229caf420 100644 --- a/src/game/AI/CreatureAI.h +++ b/src/game/AI/CreatureAI.h @@ -53,40 +53,8 @@ enum CanCastResult CAST_FAIL_TOO_CLOSE = 4, CAST_FAIL_POWER = 5, CAST_FAIL_STATE = 6, - CAST_FAIL_TARGET_AURA = 7 -}; - -enum CastFlags -{ - CAST_INTERRUPT_PREVIOUS = 0x01, //Interrupt any spell casting - CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time) - CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range - CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range - CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself - CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell -}; - -enum Target -{ - //Self (m_creature) - TARGET_T_SELF = 0, //Self cast - - //Hostile targets (if pet then returns pet owner) - TARGET_T_HOSTILE, //Our current target (ie: highest aggro) - TARGET_T_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks) - TARGET_T_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for) - TARGET_T_HOSTILE_RANDOM, //Just any random target on our threat list - TARGET_T_HOSTILE_RANDOM_NOT_TOP, //Any random target except top threat - - //Invoker targets (if pet then returns pet owner) - TARGET_T_ACTION_INVOKER, //Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF) - - //Friendly targets - TARGET_T_FRIENDLY, //Random friendly unit. - TARGET_T_FRIENDLY_NOT_SELF, //Random friendly unit but not self. - TARGET_T_FRIENDLY_INJURED, //Friendly unit missing the most health. - - TARGET_T_END + CAST_FAIL_TARGET_AURA = 7, + CAST_FAIL_NOT_IN_LOS = 8 }; struct CreatureAISpellsEntry : CreatureSpellsEntry @@ -98,7 +66,7 @@ struct CreatureAISpellsEntry : CreatureSpellsEntry class MANGOS_DLL_SPEC CreatureAI { public: - explicit CreatureAI(Creature* creature) : m_creature(creature), m_bUseAiAtControl(false), m_uLastAlertTime(0) + explicit CreatureAI(Creature* creature) : m_creature(creature), m_bUseAiAtControl(false), m_uLastAlertTime(0), m_MeleeEnabled(true), m_CombatMovementEnabled(true) { SetSpellsTemplate(creature->GetCreatureInfo()->spells_template); } @@ -214,6 +182,9 @@ class MANGOS_DLL_SPEC CreatureAI // Called when filling loot table virtual bool FillLoot(Loot* loot, Player* looter) const { return false; } + // Does creature chase its target ? + bool IsCombatMovement() const { return m_CombatMovementEnabled; } + /** * Check if unit is visible for MoveInLineOfSight * Note: This check is by default only the state-depending (visibility, range), NOT LineOfSight @@ -247,9 +218,6 @@ class MANGOS_DLL_SPEC CreatureAI // Clears any group/raid icons this creature may have void ClearTargetIcon(); - // Returns a target based on the type specified. - inline Unit* GetTargetByType(uint32 CastTarget, uint16 Spellid) const; - // Assigns a creature_spells template to the AI. void SetSpellsTemplate(uint32 entry); void SetSpellsTemplate(const CreatureSpellsTemplate *SpellsTemplate); @@ -257,17 +225,21 @@ class MANGOS_DLL_SPEC CreatureAI // Goes through the creature_spells template to update timers and cast spells. void DoSpellTemplateCasts(const uint32 uiDiff); - // Returns friendly unit with the most amount of hp missing from max hp - Unit* DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff = 1, bool bPercent = false) const; - - ///== Fields ======================================= + // Enables or disables melee attacks. + void SetMeleeAttack(bool enabled); + // Enables or disabled combat movement. + void SetCombatMovement(bool enabled); + // Pointer to controlled by AI creature Creature* const m_creature; bool SwitchAiAtControl() const { return !m_bUseAiAtControl; } void SetUseAiAtControl(bool v) { m_bUseAiAtControl = v; } protected: - bool m_bUseAiAtControl; + ///== Fields ======================================= + bool m_bUseAiAtControl; + bool m_MeleeEnabled; // If we allow melee auto attack + bool m_CombatMovementEnabled; // If we allow targeted movement gen (chasing target) uint32 m_uLastAlertTime; std::vector m_CreatureSpells; }; diff --git a/src/game/AI/CreatureEventAI.cpp b/src/game/AI/CreatureEventAI.cpp index 38b8f1364..425fd213c 100644 --- a/src/game/AI/CreatureEventAI.cpp +++ b/src/game/AI/CreatureEventAI.cpp @@ -106,8 +106,6 @@ CreatureEventAI::CreatureEventAI(Creature *c) : CreatureAI(c) m_bEmptyList = m_CreatureEventAIList.empty(); m_Phase = 0; - m_CombatMovementEnabled = true; - m_MeleeEnabled = true; m_AttackDistance = 0.0f; m_AttackAngle = 0.0f; @@ -117,7 +115,7 @@ CreatureEventAI::CreatureEventAI(Creature *c) : CreatureAI(c) if (!m_bEmptyList) { for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - if (SpawnedEventConditionsCheck((*i).Event)) + if (i->Event.event_type == EVENT_T_SPAWNED) ProcessEvent(*i); } Reset(); @@ -383,7 +381,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (!(pHolder.Event.event_flags & EFLAG_RANDOM_ACTION)) { for (uint32 j = 0; j < MAX_ACTIONS; ++j) - ProcessAction(pHolder.Event.action[j], rnd, pHolder.Event.event_id, pActionInvoker); + ProcessAction(pHolder.Event.action[j], pHolder.Event.event_id, pActionInvoker); } //Process actions, random case else @@ -391,7 +389,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction // amount of real actions uint32 count = 0; for (uint32 j = 0; j < MAX_ACTIONS; j++) - if (pHolder.Event.action[j].type != ACTION_T_NONE) + if (pHolder.Event.action[j]) ++count; if (count) @@ -403,7 +401,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction uint32 j = 0; for (; ; ++j) { - if (pHolder.Event.action[j].type != ACTION_T_NONE) + if (pHolder.Event.action[j]) { if (!idx) break; @@ -411,506 +409,23 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction } } - ProcessAction(pHolder.Event.action[j], rnd, pHolder.Event.event_id, pActionInvoker); + ProcessAction(pHolder.Event.action[j], pHolder.Event.event_id, pActionInvoker); } } return true; } -void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 rnd, uint32 EventId, Unit* pActionInvoker) +void CreatureEventAI::ProcessAction(ScriptMap* action, uint32 EventId, Unit* pActionInvoker) { - switch (action.type) + if (!action) + return; + + WorldObject* target = pActionInvoker ? pActionInvoker : m_creature->getVictim(); + Map* map = m_creature->GetMap(); + + for (const auto& x : *action) { - case ACTION_T_TEXT: - { - if (!action.text.TextId[0]) - return; - - int32 temp = 0; - - if (action.text.TextId[1] && action.text.TextId[2]) - temp = action.text.TextId[rand() % 3]; - else if (action.text.TextId[1] && urand(0, 1)) - temp = action.text.TextId[1]; - else - temp = action.text.TextId[0]; - - if (temp) - { - Unit* target = nullptr; - - if (pActionInvoker) - { - if (pActionInvoker->GetTypeId() == TYPEID_PLAYER) - target = pActionInvoker; - else if (Unit* owner = pActionInvoker->GetOwner()) - { - if (owner->GetTypeId() == TYPEID_PLAYER) - target = owner; - } - } - else if ((target = m_creature->getVictim())) - { - if (target->GetTypeId() != TYPEID_PLAYER) - if (Unit* owner = target->GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER) - target = owner; - } - - DoScriptText(temp, m_creature, target); - } - break; - } - case ACTION_T_SET_FACTION: - { - if (action.set_faction.factionId) - m_creature->SetFactionTemporary(action.set_faction.factionId, action.set_faction.factionFlags); - else // no id provided, assume reset and then use default - m_creature->ClearTemporaryFaction(); - - break; - } - case ACTION_T_MORPH_TO_ENTRY_OR_MODEL: - { - if (action.morph.creatureId || action.morph.modelId) - { - //set model based on entry from creature_template - if (action.morph.creatureId) - { - if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(action.morph.creatureId)) - { - uint32 display_id = Creature::ChooseDisplayId(ci); - m_creature->SetDisplayId(display_id); - } - } - //if no param1, then use value from param2 (modelId) - else - m_creature->SetDisplayId(action.morph.modelId); - } - else - m_creature->DeMorph(); - break; - } - case ACTION_T_SOUND: - m_creature->PlayDirectSound(action.sound.soundId); - break; - case ACTION_T_EMOTE: - m_creature->HandleEmote(action.emote.emoteId); - break; - case ACTION_T_RANDOM_SOUND: - { - int32 temp = GetRandActionParam(rnd, action.random_sound.soundId1, action.random_sound.soundId2, action.random_sound.soundId3); - if (temp >= 0) - m_creature->PlayDirectSound(temp); - break; - } - case ACTION_T_RANDOM_EMOTE: - { - int32 temp = GetRandActionParam(rnd, action.random_emote.emoteId1, action.random_emote.emoteId2, action.random_emote.emoteId3); - if (temp >= 0) - m_creature->HandleEmote(temp); - break; - } - case ACTION_T_CAST: - { - Unit* target = GetTargetByType(action.cast.target, pActionInvoker); - - if (!target) - { - sLog.outDebug("CreatureEventAI: NULL target for ACTION_T_CAST creature entry %u casting spell id %u", m_creature->GetEntry(), action.cast.spellId); - return; - } - - CanCastResult castResult = DoCastSpellIfCan(target, action.cast.spellId, action.cast.castFlags); - - SpellEntry const* pSpell = sSpellMgr.GetSpellEntry(action.cast.spellId); - if (!pSpell) - { - sLog.outError("CreatureEventAI: creature entry %u uses non-existent spell %u", m_creature->GetEntry(), action.cast.spellId); - return; - } - - bool bGoMelee = false; - if (!(action.cast.castFlags & CAST_NO_MELEE_IF_OOM)) // Add specific flag if silenced? - { - if (castResult == CAST_FAIL_POWER || castResult == CAST_FAIL_TOO_FAR) - bGoMelee = true; - if (castResult == CAST_FAIL_STATE && pSpell->PreventionType == SPELL_PREVENTION_TYPE_SILENCE) - bGoMelee = true; - } - if (bGoMelee) - { - switch (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType()) - { - case CHASE_MOTION_TYPE: - case FOLLOW_MOTION_TYPE: - m_AttackDistance = 0.0f; - m_AttackAngle = 0.0f; - - m_creature->GetMotionMaster()->Clear(false); - m_creature->SetCasterChaseDistance(0.0f); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), m_AttackDistance, m_AttackAngle); - break; - default: - break; - } - } - - break; - } - case ACTION_T_SUMMON: - { - Unit* target = GetTargetByType(action.summon.target, pActionInvoker); - - Creature* pCreature = nullptr; - - if (action.summon.duration) - pCreature = m_creature->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, action.summon.duration); - else - pCreature = m_creature->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0); - - if (!pCreature) - sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, EventId, m_creature->GetEntry()); - else if (action.summon.target != TARGET_T_SELF && target) - pCreature->AI()->AttackStart(target); - break; - } - case ACTION_T_THREAT_SINGLE_PCT: - if (Unit* target = GetTargetByType(action.threat_single_pct.target, pActionInvoker)) - m_creature->getThreatManager().modifyThreatPercent(target, action.threat_single_pct.percent); - break; - case ACTION_T_THREAT_ALL_PCT: - { - ThreatList const& threatList = m_creature->getThreatManager().getThreatList(); - for (ThreatList::const_iterator i = threatList.begin(); i != threatList.end(); ++i) - if (Unit* Temp = m_creature->GetMap()->GetUnit((*i)->getUnitGuid())) - m_creature->getThreatManager().modifyThreatPercent(Temp, action.threat_all_pct.percent); - break; - } - case ACTION_T_QUEST_EVENT: - if (Unit* target = GetTargetByType(action.quest_event.target, pActionInvoker)) - if (target->GetTypeId() == TYPEID_PLAYER) - ((Player*)target)->AreaExploredOrEventHappens(action.quest_event.questId); - break; - case ACTION_T_CAST_EVENT: - if (Unit* target = GetTargetByType(action.cast_event.target, pActionInvoker)) - if (target->GetTypeId() == TYPEID_PLAYER) - ((Player*)target)->CastedCreatureOrGO(action.cast_event.creatureId, m_creature->GetObjectGuid(), action.cast_event.spellId); - break; - case ACTION_T_SET_UNIT_FIELD: - { - Unit* target = GetTargetByType(action.set_unit_field.target, pActionInvoker); - - // not allow modify important for integrity object fields - if (action.set_unit_field.field < OBJECT_END || action.set_unit_field.field >= UNIT_END) - return; - - if (target) - target->SetUInt32Value(action.set_unit_field.field, action.set_unit_field.value); - - break; - } - case ACTION_T_SET_UNIT_FLAG: - { - // not allow modify important for integrity object fields - if (action.unit_flag.field < OBJECT_END || action.unit_flag.field >= UNIT_END) - return; - - if (Unit* target = GetTargetByType(action.unit_flag.target, pActionInvoker)) - target->SetFlag(action.unit_flag.field, action.unit_flag.value); - break; - } - case ACTION_T_REMOVE_UNIT_FLAG: - { - // not allow modify important for integrity object fields - if (action.set_unit_field.field < OBJECT_END || action.set_unit_field.field >= UNIT_END) - return; - - if (Unit* target = GetTargetByType(action.unit_flag.target, pActionInvoker)) - target->RemoveFlag(action.unit_flag.field, action.unit_flag.value); - break; - } - case ACTION_T_AUTO_ATTACK: - m_MeleeEnabled = action.auto_attack.state != 0; - break; - case ACTION_T_COMBAT_MOVEMENT: - // ignore no affect case - if (m_CombatMovementEnabled == (action.combat_movement.state != 0) || m_creature->IsNonMeleeSpellCasted(false)) - return; - - m_CombatMovementEnabled = action.combat_movement.state != 0; - - //Allow movement (create new targeted movement gen only if idle) - if (m_CombatMovementEnabled) - { - if (action.combat_movement.melee && m_creature->isInCombat()) - if (Unit* victim = m_creature->getVictim()) - m_creature->SendMeleeAttackStart(victim); - m_creature->SetCasterChaseDistance(0.0f); - // Ustaag : le mob pourra de nouveau poursuivre le joueur s'il reste bloqué - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE || - (!m_creature->IsMoving() && (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE))) - { - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), m_AttackDistance, m_AttackAngle); - } - } - else - { - if (action.combat_movement.melee && m_creature->isInCombat()) - if (Unit* victim = m_creature->getVictim()) - m_creature->SendMeleeAttackStop(victim); - m_creature->SetCasterChaseDistance(25.0f); - } - break; - case ACTION_T_SET_PHASE: - m_Phase = action.set_phase.phase; - break; - case ACTION_T_INC_PHASE: - { - int32 new_phase = int32(m_Phase) + action.set_inc_phase.step; - if (new_phase < 0) - { - sLog.outErrorDb("CreatureEventAI: Event %d decrease Phase under 0. CreatureEntry = %d", EventId, m_creature->GetEntry()); - m_Phase = 0; - } - else if (new_phase >= MAX_PHASE) - { - sLog.outErrorDb("CreatureEventAI: Event %d incremented Phase above %u. Phase mask cannot be used with phases past %u. CreatureEntry = %d", EventId, MAX_PHASE - 1, MAX_PHASE - 1, m_creature->GetEntry()); - m_Phase = MAX_PHASE - 1; - } - else - m_Phase = new_phase; - - break; - } - case ACTION_T_EVADE: - EnterEvadeMode(); - break; - case ACTION_T_FLEE: - m_creature->DoFlee(); - break; - case ACTION_T_QUEST_EVENT_ALL: - if (pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER) - ((Player*)pActionInvoker)->GroupEventHappens(action.quest_event_all.questId, m_creature); - break; - case ACTION_T_CAST_EVENT_ALL: - { - ThreatList const& threatList = m_creature->getThreatManager().getThreatList(); - for (ThreatList::const_iterator i = threatList.begin(); i != threatList.end(); ++i) - if (Player* temp = m_creature->GetMap()->GetPlayer((*i)->getUnitGuid())) - temp->CastedCreatureOrGO(action.cast_event_all.creatureId, m_creature->GetObjectGuid(), action.cast_event_all.spellId); - break; - } - case ACTION_T_REMOVEAURASFROMSPELL: - if (Unit* target = GetTargetByType(action.remove_aura.target, pActionInvoker)) - target->RemoveAurasDueToSpell(action.remove_aura.spellId); - break; - case ACTION_T_RANGED_MOVEMENT: - m_AttackDistance = (float)action.ranged_movement.distance; - m_AttackAngle = action.ranged_movement.angle / 180.0f * M_PI_F; - - if (m_CombatMovementEnabled) - { - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) - { - //Drop current movement gen - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), m_AttackDistance, m_AttackAngle); - } - } - break; - case ACTION_T_RANDOM_PHASE: - m_Phase = GetRandActionParam(rnd, action.random_phase.phase1, action.random_phase.phase2, action.random_phase.phase3); - break; - case ACTION_T_RANDOM_PHASE_RANGE: - if (action.random_phase_range.phaseMax > action.random_phase_range.phaseMin) - m_Phase = action.random_phase_range.phaseMin + (rnd % (action.random_phase_range.phaseMax - action.random_phase_range.phaseMin)); - else - sLog.outErrorDb("CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 <= Param1. Divide by Zero. Event = %d. CreatureEntry = %d", EventId, m_creature->GetEntry()); - break; - case ACTION_T_SUMMON_ID: - { - Unit* target = GetTargetByType(action.summon_id.target, pActionInvoker); - - CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr.GetCreatureEventAISummonMap().find(action.summon_id.spawnId); - if (i == sEventAIMgr.GetCreatureEventAISummonMap().end()) - { - sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, EventId, m_creature->GetEntry()); - return; - } - - Creature* pCreature = nullptr; - if ((*i).second.SpawnTimeSecs) - pCreature = m_creature->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, (*i).second.SpawnTimeSecs); - else - pCreature = m_creature->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0); - - if (!pCreature) - sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", action.summon_id.creatureId, EventId, m_creature->GetEntry()); - else if (action.summon_id.target != TARGET_T_SELF && target) - pCreature->AI()->AttackStart(target); - - break; - } - case ACTION_T_KILLED_MONSTER: - //first attempt player/group who tapped creature - if (Player* pPlayer = m_creature->GetLootRecipient()) - pPlayer->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature); - else - { - //if not available, use pActionInvoker - if (Unit* pTarget = GetTargetByType(action.killed_monster.target, pActionInvoker)) - if (Player* pPlayer2 = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself()) - pPlayer2->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature); - } - break; - case ACTION_T_SET_INST_DATA: - { - InstanceData* pInst = m_creature->GetInstanceData(); - if (!pInst) - { - sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", EventId, m_creature->GetEntry()); - return; - } - - pInst->SetData(action.set_inst_data.field, action.set_inst_data.value); - break; - } - case ACTION_T_SET_INST_DATA64: - { - Unit* target = GetTargetByType(action.set_inst_data64.target, pActionInvoker); - if (!target) - { - sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, m_creature->GetEntry()); - return; - } - - InstanceData* pInst = m_creature->GetInstanceData(); - if (!pInst) - { - sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, m_creature->GetEntry()); - return; - } - - pInst->SetData64(action.set_inst_data64.field, target->GetObjectGuid().GetRawValue()); - break; - } - case ACTION_T_UPDATE_TEMPLATE: - if (m_creature->GetEntry() == action.update_template.creatureId) - { - - sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", EventId, m_creature->GetEntry()); - return; - } - - m_creature->UpdateEntry(action.update_template.creatureId, action.update_template.team ? HORDE : ALLIANCE); - break; - case ACTION_T_DIE: - if (m_creature->isDead()) - { - - sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, m_creature->GetEntry()); - return; - } - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); - break; - case ACTION_T_ZONE_COMBAT_PULSE: - { - m_creature->SetInCombatWithZone(); - break; - } - case ACTION_T_CALL_FOR_HELP: - { - m_creature->CallForHelp((float)action.call_for_help.radius); - break; - } - case ACTION_T_SET_SHEATH: - { - m_creature->SetSheath(SheathState(action.set_sheath.sheath)); - break; - } - case ACTION_T_FORCE_DESPAWN: - { - m_creature->ForcedDespawn(action.forced_despawn.msDelay); - break; - } - case ACTION_T_SET_INVINCIBILITY_HP_LEVEL: - { - if (action.invincibility_hp_level.is_percent) - m_InvinceabilityHpLevel = m_creature->GetMaxHealth() * action.invincibility_hp_level.hp_level / 100; - else - m_InvinceabilityHpLevel = action.invincibility_hp_level.hp_level; - break; - } - case ACTION_T_MOUNT_TO_ENTRY_OR_MODEL: - { - if (action.mount.creatureId || action.mount.modelId) - { - // set model based on entry from creature_template - if (action.mount.creatureId) - { - if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(action.mount.creatureId)) - { - uint32 display_id = Creature::ChooseDisplayId(cInfo); - m_creature->Mount(display_id); - } - } - //if no param1, then use value from param2 (modelId) - else - m_creature->Mount(action.mount.modelId); - } - else - m_creature->Unmount(); - - break; - } - case ACTION_T_SET_GAME_EVENT: - { - uint32 event_id = action.set_game_event.eventId; - bool overwrite = (action.set_game_event.eventOverwrite > 0); - if (action.set_game_event.eventStart > 0) - sGameEventMgr.StartEvent(event_id, overwrite); - else - sGameEventMgr.StopEvent(event_id, overwrite); - break; - } - case ACTION_T_SET_STAND_STATE: - { - m_creature->SetStandState(action.setStandState.standState); - break; - } - case ACTION_T_CHANGE_MOVEMENT: - { - switch (action.changeMovement.movementType) - { - case IDLE_MOTION_TYPE: - m_creature->GetMotionMaster()->MoveIdle(); - break; - case RANDOM_MOTION_TYPE: - m_creature->GetMotionMaster()->MoveRandom(); - break; - case WAYPOINT_MOTION_TYPE: - m_creature->GetMotionMaster()->MoveWaypoint(); - break; - } - break; - } - case ACTION_T_SET_VARIABLE: - { - sObjectMgr.SetSavedVariable(action.setVariable.variableEntry, action.setVariable.value, true); - break; - } - case ACTION_T_EVENT_SCRIPT: - { - m_creature->GetMap()->ScriptsStart(sEventScripts, action.eventScript.eventScriptId, m_creature, pActionInvoker ? pActionInvoker : m_creature); - break; - } - case ACTION_T_SET_SPELLS_TEMPLATE: - { - SetSpellsTemplate(action.setSpellsTemplate.spellsTemplateId); - break; - } + map->ScriptCommandStartDirect(x.second, m_creature, target); } } @@ -923,7 +438,7 @@ void CreatureEventAI::JustRespawned() //Handle Spawned Events for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - if (SpawnedEventConditionsCheck((*i).Event)) + if (i->Event.event_type == EVENT_T_SPAWNED) ProcessEvent(*i); } @@ -1271,7 +786,7 @@ void CreatureEventAI::UpdateAI(const uint32 diff) DoSpellTemplateCasts(diff); //Melee Auto-Attack - if (Combat && m_MeleeEnabled && m_creature->CanReachWithMeleeAttack(m_creature->getVictim())) + if (Combat) DoMeleeAttackIfReady(); } @@ -1303,26 +818,9 @@ inline int32 CreatureEventAI::GetRandActionParam(uint32 rnd, int32 param1, int32 return 0; } -inline Unit* CreatureEventAI::GetTargetByType(uint32 Target, Unit* pActionInvoker) const +void CreatureEventAI::SetInvincibilityHealthLevel(uint32 hp_level, bool is_percent) { - switch (Target) - { - case TARGET_T_SELF: - return m_creature; - case TARGET_T_HOSTILE: - return m_creature->getVictim(); - case TARGET_T_HOSTILE_SECOND_AGGRO: - return m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1); - case TARGET_T_HOSTILE_LAST_AGGRO: - return m_creature->SelectAttackingTarget(ATTACKING_TARGET_BOTTOMAGGRO, 0); - case TARGET_T_HOSTILE_RANDOM: - return m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); - case TARGET_T_HOSTILE_RANDOM_NOT_TOP: - return m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); - case TARGET_T_ACTION_INVOKER: - return pActionInvoker; - } - return nullptr; + m_InvinceabilityHpLevel = is_percent ? m_creature->GetMaxHealth() * hp_level / 100 : hp_level; } Unit* CreatureEventAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff) @@ -1384,30 +882,3 @@ void CreatureEventAI::DamageTaken(Unit* /*done_by*/, uint32& damage) damage = m_creature->GetHealth() - m_InvinceabilityHpLevel; } } - -bool CreatureEventAI::SpawnedEventConditionsCheck(CreatureEventAI_Event const& event) -{ - if (event.event_type != EVENT_T_SPAWNED) - return false; - - switch (event.spawned.condition) - { - case SPAWNED_EVENT_ALWAY: - // always - return true; - case SPAWNED_EVENT_MAP: - // map ID check - return m_creature->GetMapId() == event.spawned.conditionValue1; - case SPAWNED_EVENT_ZONE: - { - // zone ID check - uint32 zone, area; - m_creature->GetZoneAndAreaId(zone, area); - return zone == event.spawned.conditionValue1 || area == event.spawned.conditionValue1; - } - default: - break; - } - - return false; -} diff --git a/src/game/AI/CreatureEventAI.h b/src/game/AI/CreatureEventAI.h index 48036d470..3d23db428 100644 --- a/src/game/AI/CreatureEventAI.h +++ b/src/game/AI/CreatureEventAI.h @@ -48,7 +48,7 @@ enum EventAI_Type EVENT_T_SPELLHIT = 8, // SpellID, School, RepeatMin, RepeatMax EVENT_T_RANGE = 9, // MinDist, MaxDist, RepeatMin, RepeatMax EVENT_T_OOC_LOS = 10, // NoHostile, MaxRnage, RepeatMin, RepeatMax - EVENT_T_SPAWNED = 11, // Condition, CondValue1 + EVENT_T_SPAWNED = 11, // NONE EVENT_T_TARGET_HP = 12, // HPMax%, HPMin%, RepeatMin, RepeatMax EVENT_T_TARGET_CASTING = 13, // RepeatMin, RepeatMax EVENT_T_FRIENDLY_HP = 14, // HPDeficit, Radius, RepeatMin, RepeatMax @@ -71,72 +71,12 @@ enum EventAI_Type EVENT_T_END, }; -enum EventAI_ActionType -{ - ACTION_T_NONE = 0, // No action - ACTION_T_TEXT = 1, // TextId1, optionally -TextId2, optionally -TextId3(if -TextId2 exist). If more than just -TextId1 is defined, randomize. Negative values. - ACTION_T_SET_FACTION = 2, // FactionId (or 0 for default) - ACTION_T_MORPH_TO_ENTRY_OR_MODEL = 3, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to demorph) - ACTION_T_SOUND = 4, // SoundId - ACTION_T_EMOTE = 5, // EmoteId - ACTION_T_RANDOM_SAY = 6, // UNUSED - ACTION_T_RANDOM_YELL = 7, // UNUSED - ACTION_T_RANDOM_TEXTEMOTE = 8, // UNUSED - ACTION_T_RANDOM_SOUND = 9, // SoundId1, SoundId2, SoundId3 (-1 in any field means no output if randomed that field) - ACTION_T_RANDOM_EMOTE = 10, // EmoteId1, EmoteId2, EmoteId3 (-1 in any field means no output if randomed that field) - ACTION_T_CAST = 11, // SpellId, Target, CastFlags - ACTION_T_SUMMON = 12, // CreatureID, Target, Duration in ms - ACTION_T_THREAT_SINGLE_PCT = 13, // Threat%, Target - ACTION_T_THREAT_ALL_PCT = 14, // Threat% - ACTION_T_QUEST_EVENT = 15, // QuestID, Target - ACTION_T_CAST_EVENT = 16, // QuestID, SpellId, Target - must be removed as hack? - ACTION_T_SET_UNIT_FIELD = 17, // Field_Number, Value, Target - ACTION_T_SET_UNIT_FLAG = 18, // Flags (may be more than one field OR'd together), Target - ACTION_T_REMOVE_UNIT_FLAG = 19, // Flags (may be more than one field OR'd together), Target - ACTION_T_AUTO_ATTACK = 20, // AllowAttackState (0 = stop attack, anything else means continue attacking) - ACTION_T_COMBAT_MOVEMENT = 21, // AllowCombatMovement (0 = stop combat based movement, anything else continue attacking) - ACTION_T_SET_PHASE = 22, // Phase - ACTION_T_INC_PHASE = 23, // Value (may be negative to decrement phase, should not be 0) - ACTION_T_EVADE = 24, // No Params - ACTION_T_FLEE = 25, // No Params - ACTION_T_QUEST_EVENT_ALL = 26, // QuestID - ACTION_T_CAST_EVENT_ALL = 27, // CreatureId, SpellId - ACTION_T_REMOVEAURASFROMSPELL = 28, // Target, Spellid - ACTION_T_RANGED_MOVEMENT = 29, // Distance, Angle - ACTION_T_RANDOM_PHASE = 30, // PhaseId1, PhaseId2, PhaseId3 - ACTION_T_RANDOM_PHASE_RANGE = 31, // PhaseMin, PhaseMax - ACTION_T_SUMMON_ID = 32, // CreatureId, Target, SpawnId - ACTION_T_KILLED_MONSTER = 33, // CreatureId, Target - ACTION_T_SET_INST_DATA = 34, // Field, Data - ACTION_T_SET_INST_DATA64 = 35, // Field, Target - ACTION_T_UPDATE_TEMPLATE = 36, // Entry, Team - ACTION_T_DIE = 37, // No Params - ACTION_T_ZONE_COMBAT_PULSE = 38, // No Params - ACTION_T_CALL_FOR_HELP = 39, // Radius - ACTION_T_SET_SHEATH = 40, // Sheath (0-passive,1-melee,2-ranged) - ACTION_T_FORCE_DESPAWN = 41, // Delay (0-instant despawn) - ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue, format(0-flat,1-percent from max health) - ACTION_T_MOUNT_TO_ENTRY_OR_MODEL = 43, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to unmount) - ACTION_T_SET_GAME_EVENT = 44, // EventID, Start/stop [NOSTALRIUS] - ACTION_T_SET_STAND_STATE = 47, // StandState, unused, unused - ACTION_T_CHANGE_MOVEMENT = 48, // MovementType, WanderDistance, unused - ACTION_T_SET_VARIABLE = 49, // VariableEntry, Value, unused - ACTION_T_EVENT_SCRIPT = 50, // EventScriptId - ACTION_T_SET_SPELLS_TEMPLATE = 51, // Entry from creature_spells table. - ACTION_T_END, -}; - enum EventFlags { EFLAG_REPEATABLE = 0x01, //Event repeats - EFLAG_RESERVED_1 = 0x02, - EFLAG_RESERVED_2 = 0x04, - EFLAG_RESERVED_3 = 0x08, - EFLAG_RESERVED_4 = 0x10, - EFLAG_RANDOM_ACTION = 0x20, //Event only execute one from existed actions instead each action. - EFLAG_RESERVED_6 = 0x40, - EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build - // no free bits, uint8 field + EFLAG_RANDOM_ACTION = 0x02, //Event only execute one from existed actions instead each action. + EFLAG_DEBUG_ONLY = 0x04, //Event only occurs in debug build + // uint8 field }; enum SpawnedEventMode @@ -146,268 +86,6 @@ enum SpawnedEventMode SPAWNED_EVENT_ZONE = 2 }; -struct CreatureEventAI_Action -{ - EventAI_ActionType type: 16; - union - { - // ACTION_T_TEXT = 1 - struct - { - int32 TextId[3]; - } text; - // ACTION_T_SET_FACTION = 2 - struct - { - uint32 factionId; // faction id or 0 to restore default faction - uint32 factionFlags; // flags will restore default faction at evade and/or respawn - } set_faction; - // ACTION_T_MORPH_TO_ENTRY_OR_MODEL = 3 - struct - { - uint32 creatureId; // set one from fields (or 0 for both to demorph) - uint32 modelId; - } morph; - // ACTION_T_SOUND = 4 - struct - { - uint32 soundId; - } sound; - // ACTION_T_EMOTE = 5 - struct - { - uint32 emoteId; - } emote; - // ACTION_T_RANDOM_SOUND = 9 - struct - { - int32 soundId1; // (-1 in any field means no output if randomed that field) - int32 soundId2; - int32 soundId3; - } random_sound; - // ACTION_T_RANDOM_EMOTE = 10 - struct - { - int32 emoteId1; // (-1 in any field means no output if randomed that field) - int32 emoteId2; - int32 emoteId3; - } random_emote; - // ACTION_T_CAST = 11 - struct - { - uint32 spellId; - uint32 target; - uint32 castFlags; - } cast; - // ACTION_T_SUMMON = 12 - struct - { - uint32 creatureId; - uint32 target; - uint32 duration; - } summon; - // ACTION_T_THREAT_SINGLE_PCT = 13 - struct - { - int32 percent; - uint32 target; - } threat_single_pct; - // ACTION_T_THREAT_ALL_PCT = 14 - struct - { - int32 percent; - } threat_all_pct; - // ACTION_T_QUEST_EVENT = 15 - struct - { - uint32 questId; - uint32 target; - } quest_event; - // ACTION_T_CAST_EVENT = 16 - struct - { - uint32 creatureId; - uint32 spellId; - uint32 target; - } cast_event; - // ACTION_T_SET_UNIT_FIELD = 17 - struct - { - uint32 field; - uint32 value; - uint32 target; - } set_unit_field; - // ACTION_T_SET_UNIT_FLAG = 18, // value provided mask bits that will be set - // ACTION_T_REMOVE_UNIT_FLAG = 19, // value provided mask bits that will be clear - struct - { - uint32 value; - uint32 target; - uint32 field; - } unit_flag; - // ACTION_T_AUTO_ATTACK = 20 - struct - { - uint32 state; // 0 = stop attack, anything else means continue attacking - } auto_attack; - // ACTION_T_COMBAT_MOVEMENT = 21 - struct - { - uint32 state; // 0 = stop combat based movement, anything else continue attacking - uint32 melee; // if set: at stop send melee combat stop if in combat, use for terminate melee fighting state for switch to ranged - } combat_movement; - // ACTION_T_SET_PHASE = 22 - struct - { - uint32 phase; - } set_phase; - // ACTION_T_INC_PHASE = 23 - struct - { - int32 step; - } set_inc_phase; - // ACTION_T_QUEST_EVENT_ALL = 26 - struct - { - uint32 questId; - } quest_event_all; - // ACTION_T_CAST_EVENT_ALL = 27 - struct - { - uint32 creatureId; - uint32 spellId; - } cast_event_all; - // ACTION_T_REMOVEAURASFROMSPELL = 28 - struct - { - uint32 target; - uint32 spellId; - } remove_aura; - // ACTION_T_RANGED_MOVEMENT = 29 - struct - { - uint32 distance; - int32 angle; - } ranged_movement; - // ACTION_T_RANDOM_PHASE = 30 - struct - { - uint32 phase1; - uint32 phase2; - uint32 phase3; - } random_phase; - // ACTION_T_RANDOM_PHASE_RANGE = 31 - struct - { - uint32 phaseMin; - uint32 phaseMax; - } random_phase_range; - // ACTION_T_SUMMON_ID = 32 - struct - { - uint32 creatureId; - uint32 target; - uint32 spawnId; - } summon_id; - // ACTION_T_KILLED_MONSTER = 33 - struct - { - uint32 creatureId; - uint32 target; - } killed_monster; - // ACTION_T_SET_INST_DATA = 34 - struct - { - uint32 field; - uint32 value; - } set_inst_data; - // ACTION_T_SET_INST_DATA64 = 35 - struct - { - uint32 field; - uint32 target; - } set_inst_data64; - // ACTION_T_UPDATE_TEMPLATE = 36 - struct - { - uint32 creatureId; - uint32 team; - } update_template; - // ACTION_T_CALL_FOR_HELP = 39 - struct - { - uint32 radius; - } call_for_help; - // ACTION_T_SET_SHEATH = 40 - struct - { - uint32 sheath; - } set_sheath; - // ACTION_T_FORCE_DESPAWN = 41 - struct - { - uint32 msDelay; - } forced_despawn; - // ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42 - struct - { - uint32 hp_level; - uint32 is_percent; - } invincibility_hp_level; - // ACTION_T_MOUNT_TO_ENTRY_OR_MODEL = 43 - struct - { - uint32 creatureId; // set one from fields (or 0 for both to dismount) - uint32 modelId; - } mount; - // ACTION_T_SET_GAME_EVENT = 44 - struct - { - uint32 eventId; - uint32 eventStart; // 0 = false, 1 = true - uint32 eventOverwrite; // 0 = false, 1 = true - } set_game_event; - // ACTION_T_SET_STAND_STATE = 47 - struct - { - uint32 standState; - uint32 unused1; - uint32 unused2; - } setStandState; - // ACTION_T_CHANGE_MOVEMENT = 48 - struct - { - uint32 movementType; - uint32 wanderDistance; - uint32 unused1; - } changeMovement; - // ACTION_T_SET_VARIABLE = 49 - struct - { - uint32 variableEntry; - uint32 value; - uint32 unused1; - } setVariable; - // ACTION_T_EVENT_SCRIPT = 50 - struct - { - uint32 eventScriptId; - } eventScript; - // ACTION_T_SET_SPELLS_TEMPLATE = 51 - struct - { - uint32 spellsTemplateId; - } setSpellsTemplate; - // RAW - struct - { - uint32 param1; - uint32 param2; - uint32 param3; - } raw; - }; -}; - struct CreatureEventAI_Event { uint32 event_id; @@ -474,12 +152,6 @@ struct CreatureEventAI_Event uint32 repeatMin; uint32 repeatMax; } ooc_los; - // EVENT_T_SPAWNED = 11 - struct - { - uint32 condition; - uint32 conditionValue1; - } spawned; // EVENT_T_TARGET_CASTING = 13 struct { @@ -559,25 +231,12 @@ struct CreatureEventAI_Event } raw; }; - CreatureEventAI_Action action[MAX_ACTIONS]; + ScriptMap* action[MAX_ACTIONS]; }; + //Event_Map typedef std::vector CreatureEventAI_Event_Vec; -typedef UNORDERED_MAP CreatureEventAI_Event_Map; - -struct CreatureEventAI_Summon -{ - uint32 id; - - float position_x; - float position_y; - float position_z; - float orientation; - uint32 SpawnTimeSecs; -}; - -//EventSummon_Map -typedef UNORDERED_MAP CreatureEventAI_Summon_Map; +typedef std::unordered_map CreatureEventAI_Event_Map; struct CreatureEventAIHolder { @@ -623,17 +282,18 @@ class MANGOS_DLL_SPEC CreatureEventAI : public CreatureAI static int Permissible(const Creature *); bool ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pActionInvoker = nullptr); - void ProcessAction(CreatureEventAI_Action const& action, uint32 rnd, uint32 EventId, Unit* pActionInvoker); + void ProcessAction(ScriptMap* action, uint32 EventId, Unit* pActionInvoker); inline uint32 GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3); inline int32 GetRandActionParam(uint32 rnd, int32 param1, int32 param2, int32 param3); - inline Unit* GetTargetByType(uint32 Target, Unit* pActionInvoker) const; - - bool SpawnedEventConditionsCheck(CreatureEventAI_Event const& event); Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff); void DoFindFriendlyMissingBuff(std::list& _list, float range, uint32 spellid); void DoFindFriendlyCC(std::list& _list, float range); + void SetInvincibilityHealthLevel(uint32 hp_level, bool is_percent); + + uint8 m_Phase; // Current phase, max 32 phases + protected: uint32 m_EventUpdateTime; //Time between event updates uint32 m_EventDiff; //Time between the last event call @@ -642,10 +302,6 @@ class MANGOS_DLL_SPEC CreatureEventAI : public CreatureAI //Variables used by Events themselves typedef std::vector CreatureEventAIList; CreatureEventAIList m_CreatureEventAIList; //Holder for events (stores enabled, time, and eventid) - - uint8 m_Phase; // Current phase, max 32 phases - bool m_CombatMovementEnabled; // If we allow targeted movment gen (movement twoards top threat) - bool m_MeleeEnabled; // If we allow melee auto attack float m_AttackDistance; // Distance to attack from float m_AttackAngle; // Angle of attack uint32 m_InvinceabilityHpLevel; // Minimal health level allowed at damage apply diff --git a/src/game/AI/CreatureEventAIMgr.cpp b/src/game/AI/CreatureEventAIMgr.cpp index 166968cd3..613178169 100644 --- a/src/game/AI/CreatureEventAIMgr.cpp +++ b/src/game/AI/CreatureEventAIMgr.cpp @@ -34,95 +34,8 @@ INSTANTIATE_SINGLETON_1(CreatureEventAIMgr); -void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use) -{ - - //Drop Existing EventSummon Map - m_CreatureEventAI_Summon_Map.clear(); - - // Gather additional data for EventAI - QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM creature_ai_summons"); - if (result) - { - BarGoLink bar(result->GetRowCount()); - uint32 Count = 0; - - do - { - bar.step(); - Field *fields = result->Fetch(); - - CreatureEventAI_Summon temp; - - uint32 i = fields[0].GetUInt32(); - temp.position_x = fields[1].GetFloat(); - temp.position_y = fields[2].GetFloat(); - temp.position_z = fields[3].GetFloat(); - temp.orientation = fields[4].GetFloat(); - temp.SpawnTimeSecs = fields[5].GetUInt32(); - temp.id = i; - - if (!MaNGOS::IsValidMapCoord(temp.position_x, temp.position_y, temp.position_z, temp.orientation)) - { - sLog.outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f,%f,%f,%f), skipping.", i, temp.position_x, temp.position_y, temp.position_z, temp.orientation); - continue; - } - - //Add to map - m_CreatureEventAI_Summon_Map[i] = temp; - ++Count; - } - while (result->NextRow()); - - delete result; - - if (check_entry_use) - CheckUnusedAISummons(); - - sLog.outString(); - sLog.outString(">> Loaded %u CreatureEventAI summon definitions", Count); - } - else - { - BarGoLink bar(1); - bar.step(); - sLog.outString(); - sLog.outString(">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty."); - } -} - -void CreatureEventAIMgr::CheckUnusedAISummons() -{ - std::set idx_set; - // check not used strings this is negative range - for (CreatureEventAI_Summon_Map::const_iterator itr = m_CreatureEventAI_Summon_Map.begin(); itr != m_CreatureEventAI_Summon_Map.end(); ++itr) - idx_set.insert(itr->first); - - for (uint8 i = 1; i <= MAX_ACTIONS; i++) - { - Field* fields; - QueryResult* result = WorldDatabase.PQuery("SELECT action%u_param3 FROM creature_ai_scripts WHERE action%u_type=32", i, i); - - if (result) - { - do - { - fields = result->Fetch(); - int id = fields[0].GetInt32(); - if (id) - idx_set.erase(id); - } while (result->NextRow()); - delete result; - } - } - - - for (std::set::const_iterator itr = idx_set.begin(); itr != idx_set.end(); ++itr) - sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_summons` but not used in EventAI scripts.", *itr); -} - // ------------------- -void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() +void CreatureEventAIMgr::LoadCreatureEventAI_Events() { //Drop Existing EventAI List m_CreatureEventAI_Event_Map.clear(); @@ -130,10 +43,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() // Gather event data QueryResult *result = WorldDatabase.Query("SELECT id, creature_id, condition_id, event_type, event_inverse_phase_mask, event_chance, event_flags, " "event_param1, event_param2, event_param3, event_param4, " - "action1_type, action1_param1, action1_param2, action1_param3, " - "action2_type, action2_param1, action2_param2, action2_param3, " - "action3_type, action3_param1, action3_param2, action3_param3 " - "FROM creature_ai_scripts"); + "action1_script, action2_script, action3_script " + "FROM creature_ai_events"); if (result) { BarGoLink bar(result->GetRowCount()); @@ -157,7 +68,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() //Report any errors in event if (e_type >= EVENT_T_END) { - sLog.outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type); + sLog.outErrorDb("CreatureEventAI: Event %u with wrong type (%u), skipping.", i, e_type); continue; } temp.event_type = EventAI_Type(e_type); @@ -196,7 +107,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() sLog.outErrorDb("CreatureEventAI: Creature %u has condition_id %u that does not exist in `conditions`, ignoring", temp.creature_id, temp.condition_id); temp.condition_id = 0; } - } + } //Individual event checks switch (temp.event_type) @@ -255,22 +166,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); break; case EVENT_T_SPAWNED: - switch (temp.spawned.condition) - { - case SPAWNED_EVENT_ALWAY: - break; - case SPAWNED_EVENT_MAP: - if (!sMapStorage.LookupEntry(temp.spawned.conditionValue1)) - sLog.outErrorDb("CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'map specific' but map (param2: %u) does not exist. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1); - break; - case SPAWNED_EVENT_ZONE: - if (!AreaEntry::GetById(temp.spawned.conditionValue1)) - sLog.outErrorDb("CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'area specific' but area (param2: %u) does not exist. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1); - break; - default: - sLog.outErrorDb("CreatureEventAI: Creature %u are using invalid spawned event %u mode (%u) in param1", temp.creature_id, i, temp.spawned.condition); - break; - } break; case EVENT_T_FRIENDLY_HP: if (temp.friendly_hp.repeatMax < temp.friendly_hp.repeatMin) @@ -386,369 +281,22 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() for (uint32 j = 0; j < MAX_ACTIONS; j++) { - uint16 action_type = fields[11 + (j * 4)].GetUInt16(); - if (action_type >= ACTION_T_END) + uint32 action_script = fields[11 + j].GetUInt32(); + temp.action[j] = nullptr; + + if (action_script) { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j + 1, action_type); - temp.action[j].type = ACTION_T_NONE; - continue; - } + const auto& scriptIter = sCreatureAIScripts.find(action_script); - CreatureEventAI_Action& action = temp.action[j]; - - action.type = EventAI_ActionType(action_type); - action.raw.param1 = fields[12 + (j * 4)].GetUInt32(); - action.raw.param2 = fields[13 + (j * 4)].GetUInt32(); - action.raw.param3 = fields[14 + (j * 4)].GetUInt32(); - - //Report any errors in actions - switch (action.type) - { - case ACTION_T_NONE: - break; - case ACTION_T_TEXT: + if (scriptIter != sCreatureAIScripts.end()) { - bool not_set = false; - for (int k = 0; k < 3; ++k) - { - if (action.text.TextId[k]) - { - if (k > 0 && not_set) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u has param%d, but it follow after not set param. Required for randomized text.", i, j + 1, k + 1); - - if (!action.text.TextId[k]) - not_set = true; - else if (action.text.TextId[k] > 0) - { - if (!sObjectMgr.GetBroadcastTextLocale(action.text.TextId[k])) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u param%d references non-existent broadcast text (%u).", i, j + 1, k + 1, action.text.TextId[k]); - action.text.TextId[k] = 0; - } - } - else if (!sScriptMgr.GetTextData(action.text.TextId[k])) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u param%d references non-existing entry (%i) in texts table.", i, j + 1, k + 1, action.text.TextId[k]); - action.text.TextId[k] = 0; - } - } - } - break; + temp.action[j] = &scriptIter->second; } - case ACTION_T_SET_FACTION: - if (action.set_faction.factionId != 0 && !sObjectMgr.GetFactionEntry(action.set_faction.factionId)) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent FactionId %u.", i, j + 1, action.set_faction.factionId); - action.set_faction.factionId = 0; - } - break; - case ACTION_T_MORPH_TO_ENTRY_OR_MODEL: - if (action.morph.creatureId != 0 || action.morph.modelId != 0) - { - if (action.morph.creatureId && !sCreatureStorage.LookupEntry(action.morph.creatureId)) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j + 1, action.morph.creatureId); - action.morph.creatureId = 0; - } - - if (action.morph.modelId) - { - if (action.morph.creatureId) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j + 1, action.morph.modelId, action.morph.creatureId); - action.morph.modelId = 0; - } - else if (!sCreatureDisplayInfoStore.LookupEntry(action.morph.modelId)) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j + 1, action.morph.modelId); - action.morph.modelId = 0; - } - } - } - break; - case ACTION_T_SOUND: - if (!sObjectMgr.GetSoundEntry(action.sound.soundId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SoundID %u.", i, j + 1, action.sound.soundId); - break; - case ACTION_T_EMOTE: - if (!sEmotesStore.LookupEntry(action.emote.emoteId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j + 1, action.emote.emoteId); - break; - case ACTION_T_RANDOM_SOUND: - if (!sObjectMgr.GetSoundEntry(action.random_sound.soundId1)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 uses nonexistent SoundID %u.", i, j + 1, action.random_sound.soundId1); - if (action.random_sound.soundId2 >= 0 && !sObjectMgr.GetSoundEntry(action.random_sound.soundId2)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u param2 uses nonexistent SoundID %u.", i, j + 1, action.random_sound.soundId2); - if (action.random_sound.soundId3 >= 0 && !sObjectMgr.GetSoundEntry(action.random_sound.soundId3)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u param3 uses nonexistent SoundID %u.", i, j + 1, action.random_sound.soundId3); - break; - case ACTION_T_RANDOM_EMOTE: - if (!sEmotesStore.LookupEntry(action.random_emote.emoteId1)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j + 1, action.random_emote.emoteId1); - if (action.random_emote.emoteId2 >= 0 && !sEmotesStore.LookupEntry(action.random_emote.emoteId2)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u param2 (EmoteId: %u) are not valid.", i, j + 1, action.random_emote.emoteId2); - if (action.random_emote.emoteId3 >= 0 && !sEmotesStore.LookupEntry(action.random_emote.emoteId3)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u param3 (EmoteId: %u) are not valid.", i, j + 1, action.random_emote.emoteId3); - break; - case ACTION_T_CAST: + else { - const SpellEntry *spell = sSpellMgr.GetSpellEntry(action.cast.spellId); - if (!spell) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j + 1, action.cast.spellId); - continue; - } - - else if (spell->SpellFamilyName == SPELLFAMILY_GENERIC) - { - // Don't modify player spells, or spells that have category cooldown already (stealth for example) - uint32 cooldown = 0; - switch (temp.event_type) - { - case EVENT_T_RANGE: - cooldown = temp.range.repeatMin; - break; - case EVENT_T_TIMER: - cooldown = temp.timer.repeatMin; - break; - } - if (cooldown && (!spell->RecoveryTime && !spell->CategoryRecoveryTime) || spell->RecoveryTime > cooldown) - const_cast(spell)->RecoveryTime = cooldown; - } - - //Cast is always triggered if target is forced to cast on self - if (action.cast.castFlags & CAST_FORCE_TARGET_SELF) - action.cast.castFlags |= CAST_TRIGGERED; - - if (action.cast.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - break; + sLog.outErrorDb("CreatureEventAI: Event %u has a non-existent script = %u in action%u_script.", i, action_script, j+1); + continue; } - case ACTION_T_SUMMON: - if (!sCreatureStorage.LookupEntry(action.summon.creatureId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.summon.creatureId); - - if (action.summon.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - break; - case ACTION_T_THREAT_SINGLE_PCT: - if (std::abs(action.threat_single_pct.percent) > 100) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j + 1, action.threat_single_pct.percent); - if (action.threat_single_pct.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - break; - case ACTION_T_THREAT_ALL_PCT: - if (std::abs(action.threat_all_pct.percent) > 100) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j + 1, action.threat_all_pct.percent); - break; - case ACTION_T_QUEST_EVENT: - if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event.questId)) - { - if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j + 1, action.quest_event.questId); - } - else if (!sObjectMgr.IsExistingQuestId(action.quest_event.questId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Quest entry %u.", i, j + 1, action.quest_event.questId); - - if (action.quest_event.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - - break; - case ACTION_T_CAST_EVENT: - if (!sCreatureStorage.LookupEntry(action.cast_event.creatureId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.cast_event.creatureId); - if (!sSpellMgr.GetSpellEntry(action.cast_event.spellId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j + 1, action.cast_event.spellId); - if (action.cast_event.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - break; - case ACTION_T_SET_UNIT_FIELD: - if (action.set_unit_field.field < OBJECT_END || action.set_unit_field.field >= UNIT_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j + 1); - if (action.set_unit_field.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - break; - case ACTION_T_SET_UNIT_FLAG: - case ACTION_T_REMOVE_UNIT_FLAG: - if (action.unit_flag.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - break; - case ACTION_T_SET_PHASE: - if (action.set_phase.phase >= MAX_PHASE) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); - break; - case ACTION_T_INC_PHASE: - if (action.set_inc_phase.step == 0) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j + 1); - else if (std::abs(action.set_inc_phase.step) > MAX_PHASE - 1) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j + 1, action.set_inc_phase.step); - break; - case ACTION_T_QUEST_EVENT_ALL: - if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event_all.questId)) - { - if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j + 1, action.quest_event_all.questId); - } - else - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Quest entry %u.", i, j + 1, action.quest_event_all.questId); - break; - case ACTION_T_CAST_EVENT_ALL: - if (!sCreatureStorage.LookupEntry(action.cast_event_all.creatureId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.cast_event_all.creatureId); - if (!sSpellMgr.GetSpellEntry(action.cast_event_all.spellId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j + 1, action.cast_event_all.spellId); - break; - case ACTION_T_REMOVEAURASFROMSPELL: - if (!sSpellMgr.GetSpellEntry(action.remove_aura.spellId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j + 1, action.remove_aura.spellId); - if (action.remove_aura.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - break; - case ACTION_T_RANDOM_PHASE: //PhaseId1, PhaseId2, PhaseId3 - if (action.random_phase.phase1 >= MAX_PHASE) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); - if (action.random_phase.phase2 >= MAX_PHASE) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase2 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); - if (action.random_phase.phase3 >= MAX_PHASE) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); - break; - case ACTION_T_RANDOM_PHASE_RANGE: //PhaseMin, PhaseMax - if (action.random_phase_range.phaseMin >= MAX_PHASE) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); - if (action.random_phase_range.phaseMin >= MAX_PHASE) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); - if (action.random_phase_range.phaseMin >= action.random_phase_range.phaseMax) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax <= phaseMin.", i, j + 1); - std::swap(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax); - // equal case processed at call - } - break; - case ACTION_T_SUMMON_ID: - if (!sCreatureStorage.LookupEntry(action.summon_id.creatureId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.summon_id.creatureId); - if (action.summon_id.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - if (m_CreatureEventAI_Summon_Map.find(action.summon_id.spawnId) == m_CreatureEventAI_Summon_Map.end()) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j + 1, action.summon_id.spawnId); - break; - case ACTION_T_KILLED_MONSTER: - if (!sCreatureStorage.LookupEntry(action.killed_monster.creatureId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.killed_monster.creatureId); - if (action.killed_monster.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - break; - case ACTION_T_SET_INST_DATA: - //if (!(temp.event_flags & EFLAG_NORMAL) && !(temp.event_flags & EFLAG_HEROIC)) - // sLog.outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without event flags (normal/heroic).", i, j+1); - if (action.set_inst_data.value > 4/*SPECIAL*/) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j + 1); - break; - case ACTION_T_SET_INST_DATA64: - //if (!(temp.event_flags & EFLAG_NORMAL) && !(temp.event_flags & EFLAG_HEROIC)) - // sLog.outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without event flags (normal/heroic).", i, j+1); - if (action.set_inst_data64.target >= TARGET_T_END) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); - break; - case ACTION_T_UPDATE_TEMPLATE: - if (!sCreatureStorage.LookupEntry(action.update_template.creatureId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.update_template.creatureId); - break; - case ACTION_T_SET_SHEATH: - if (action.set_sheath.sheath >= MAX_SHEATH_STATE) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses wrong sheath state %u.", i, j + 1, action.set_sheath.sheath); - action.set_sheath.sheath = SHEATH_STATE_UNARMED; - } - break; - case ACTION_T_SET_INVINCIBILITY_HP_LEVEL: - if (action.invincibility_hp_level.is_percent) - { - if (action.invincibility_hp_level.hp_level > 100) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j + 1, action.invincibility_hp_level.hp_level); - action.invincibility_hp_level.hp_level = 100; - } - } - break; - case ACTION_T_MOUNT_TO_ENTRY_OR_MODEL: - if (action.mount.creatureId != 0 || action.mount.modelId != 0) - { - if (action.mount.creatureId && !sCreatureStorage.LookupEntry(action.mount.creatureId)) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j + 1, action.mount.creatureId); - action.morph.creatureId = 0; - } - - if (action.mount.modelId) - { - if (action.mount.creatureId) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j + 1, action.mount.modelId, action.mount.creatureId); - action.mount.modelId = 0; - } - else if (!sCreatureDisplayInfoStore.LookupEntry(action.mount.modelId)) - { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j + 1, action.mount.modelId); - action.mount.modelId = 0; - } - } - } - break; - case ACTION_T_EVADE: //No Params - case ACTION_T_FLEE: //No Params - case ACTION_T_DIE: //No Params - case ACTION_T_ZONE_COMBAT_PULSE: //No Params - case ACTION_T_FORCE_DESPAWN: //Delay - case ACTION_T_AUTO_ATTACK: //AllowAttackState (0 = stop attack, anything else means continue attacking) - case ACTION_T_COMBAT_MOVEMENT: //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking) - case ACTION_T_RANGED_MOVEMENT: //Distance, Angle - case ACTION_T_CALL_FOR_HELP: //Distance - case ACTION_T_SET_VARIABLE: // VariableEntry, Value - break; - - case ACTION_T_RANDOM_SAY: - case ACTION_T_RANDOM_YELL: - case ACTION_T_RANDOM_TEXTEMOTE: - sLog.outErrorDb("CreatureEventAI: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j + 1); - break; - - case ACTION_T_SET_STAND_STATE: - if (action.setStandState.standState >= MAX_UNIT_STAND_STATE) - { - sLog.outErrorDb("Event %u uses invalid unit stand state %u (must be smaller than %u)", i, action.setStandState.standState, MAX_UNIT_STAND_STATE); - continue; - } - break; - case ACTION_T_CHANGE_MOVEMENT: - if (action.changeMovement.movementType >= MAX_DB_MOTION_TYPE) - { - sLog.outErrorDb("Event %u uses invalid movement type %u (must be smaller than %u)", i, action.changeMovement.movementType, MAX_DB_MOTION_TYPE); - continue; - } - break; - case ACTION_T_EVENT_SCRIPT: - { - if (sEventScripts.find(action.eventScript.eventScriptId) == sEventScripts.end()) - { - sLog.outErrorDb("Event %u uses invalid event script id %u.", i, action.eventScript.eventScriptId); - continue; - } - break; - } - case ACTION_T_SET_SPELLS_TEMPLATE: - { - if (action.setSpellsTemplate.spellsTemplateId) - if (!sObjectMgr.GetCreatureSpellsTemplate(action.setSpellsTemplate.spellsTemplateId)) - { - sLog.outErrorDb("Event %u uses invalid creature_spells id %u.", i, action.setSpellsTemplate.spellsTemplateId); - continue; - } - break; - } - default: - sLog.outErrorDb("CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j + 1, temp.action[j].type); - break; } } @@ -760,16 +308,14 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() delete result; - CheckUnusedAISummons(); - sLog.outString(); - sLog.outString(">> Loaded %u CreatureEventAI scripts", Count); + sLog.outString(">> Loaded %u CreatureEventAI events.", Count); } else { BarGoLink bar(1); bar.step(); sLog.outString(); - sLog.outString(">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty."); + sLog.outString(">> Loaded 0 CreatureEventAI events. DB table `creature_ai_events` is empty."); } } diff --git a/src/game/AI/CreatureEventAIMgr.h b/src/game/AI/CreatureEventAIMgr.h index 100475bc1..cc3c13e02 100644 --- a/src/game/AI/CreatureEventAIMgr.h +++ b/src/game/AI/CreatureEventAIMgr.h @@ -31,17 +31,13 @@ class CreatureEventAIMgr CreatureEventAIMgr(){}; ~CreatureEventAIMgr(){}; - void LoadCreatureEventAI_Summons(bool check_entry_use); - void LoadCreatureEventAI_Scripts(); + void LoadCreatureEventAI_Events(); + void ClearEventData() { m_CreatureEventAI_Event_Map.clear(); } CreatureEventAI_Event_Map const& GetCreatureEventAIMap() const { return m_CreatureEventAI_Event_Map; } - CreatureEventAI_Summon_Map const& GetCreatureEventAISummonMap() const { return m_CreatureEventAI_Summon_Map; } private: - void CheckUnusedAISummons(); - CreatureEventAI_Event_Map m_CreatureEventAI_Event_Map; - CreatureEventAI_Summon_Map m_CreatureEventAI_Summon_Map; }; #define sEventAIMgr MaNGOS::Singleton::Instance() diff --git a/src/game/AI/GenericSpellAI.cpp b/src/game/AI/GenericSpellAI.cpp index bc0426b10..edb85c00c 100644 --- a/src/game/AI/GenericSpellAI.cpp +++ b/src/game/AI/GenericSpellAI.cpp @@ -219,7 +219,7 @@ struct MANGOS_DLL_DECL GenericSpellMob : public ScriptedAI } case GENERIC_TARGET_FRIEND_NEED_HEAL: { - target = DoSelectLowestHpFriendly(it->maxRange, it->healValue / 4); + target = m_creature->DoSelectLowestHpFriendly(it->maxRange, it->healValue / 4); break; } case GENERIC_TARGET_FRIEND_DISPELL_CC: diff --git a/src/game/AI/ReactorAI.cpp b/src/game/AI/ReactorAI.cpp index 983fb970f..504dad802 100644 --- a/src/game/AI/ReactorAI.cpp +++ b/src/game/AI/ReactorAI.cpp @@ -57,7 +57,8 @@ ReactorAI::AttackStart(Unit *p) m_creature->SetInCombatWith(p); p->SetInCombatWith(m_creature); - m_creature->GetMotionMaster()->MoveChase(p); + if (m_CombatMovementEnabled) + m_creature->GetMotionMaster()->MoveChase(p); } } diff --git a/src/game/AI/ScriptedAI.cpp b/src/game/AI/ScriptedAI.cpp index dc1e3fab5..ae4b085ac 100644 --- a/src/game/AI/ScriptedAI.cpp +++ b/src/game/AI/ScriptedAI.cpp @@ -12,7 +12,6 @@ ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature), me(pCreature), - m_bCombatMovement(true), m_uiEvadeCheckCooldown(2500), m_uiHomeArea(m_creature->GetAreaId()) { @@ -56,7 +55,7 @@ void ScriptedAI::AttackStart(Unit* pWho) m_creature->SetInCombatWith(pWho); pWho->SetInCombatWith(m_creature); - if (IsCombatMovement()) + if (m_CombatMovementEnabled) m_creature->GetMotionMaster()->MoveChase(pWho); } else @@ -359,11 +358,6 @@ void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 ui m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 2, uint32(uiRanged)); } -void ScriptedAI::SetCombatMovement(bool bCombatMove) -{ - m_bCombatMovement = bCombatMove; -} - // Hacklike storage used for misc creatures that are expected to evade of outside of a certain area. // It is assumed the information is found elswehere and can be handled by mangos. So far no luck finding such information/way to extract it. enum diff --git a/src/game/AI/ScriptedAI.h b/src/game/AI/ScriptedAI.h index f0e370f5c..55be31bfa 100644 --- a/src/game/AI/ScriptedAI.h +++ b/src/game/AI/ScriptedAI.h @@ -146,10 +146,6 @@ struct MANGOS_DLL_DECL ScriptedAI : CreatureAI void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE); - //Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims - void SetCombatMovement(bool bCombatMove); - bool IsCombatMovement() const { return m_bCombatMovement; } - bool EnterEvadeIfOutOfCombatArea(const uint32 uiDiff); void EnterEvadeIfOutOfHomeArea(); @@ -163,7 +159,6 @@ struct MANGOS_DLL_DECL ScriptedAI : CreatureAI Creature* me; private: - bool m_bCombatMovement; uint32 m_uiEvadeCheckCooldown; bool m_bEvadeOutOfHomeArea; diff --git a/src/game/Chat/Chat.cpp b/src/game/Chat/Chat.cpp index a42195e82..2d27c929f 100644 --- a/src/game/Chat/Chat.cpp +++ b/src/game/Chat/Chat.cpp @@ -583,7 +583,6 @@ ChatCommand * ChatHandler::getCommandTable() { { MSTR, "all", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllCommand, "", nullptr }, { MSTR, "all_area", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllAreaCommand, "", nullptr }, - { MSTR, "all_eventai", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllEventAICommand, "", nullptr }, { MSTR, "all_gossips", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllGossipsCommand, "", nullptr }, { MSTR, "all_item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllItemCommand, "", nullptr }, { MSTR, "all_locales", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllLocalesCommand, "", nullptr }, @@ -603,8 +602,7 @@ ChatCommand * ChatHandler::getCommandTable() { MSTR, "command", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCommandCommand, "", nullptr }, { MSTR, "conditions", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadConditionsCommand, "", nullptr }, { MSTR, "creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureCommand, "", nullptr }, - { MSTR, "creature_ai_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAIScriptsCommand, "", nullptr }, - { MSTR, "creature_ai_summons", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAISummonsCommand, "", nullptr }, + { MSTR, "creature_ai_events", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAIEventsCommand, "", nullptr }, { MSTR, "creature_battleground", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadBattleEventCommand, "", nullptr }, { MSTR, "creature_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestInvRelationsCommand, "", nullptr }, { MSTR, "creature_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesCreatureCommand, "", nullptr }, diff --git a/src/game/Chat/Chat.h b/src/game/Chat/Chat.h index 856f4c9df..cffe754ba 100644 --- a/src/game/Chat/Chat.h +++ b/src/game/Chat/Chat.h @@ -642,7 +642,6 @@ class MANGOS_DLL_SPEC ChatHandler bool HandleReloadAllNpcCommand(char* args); bool HandleReloadAllQuestCommand(char* args); bool HandleReloadAllScriptsCommand(char* args); - bool HandleReloadAllEventAICommand(char* args); bool HandleReloadAllSpellCommand(char* args); bool HandleReloadAllLocalesCommand(char* args); @@ -651,8 +650,7 @@ class MANGOS_DLL_SPEC ChatHandler bool HandleReloadAreaTriggerTavernCommand(char* args); bool HandleReloadAreaTriggerTeleportCommand(char* args); bool HandleReloadEventScriptsCommand(char* args); - bool HandleReloadEventAISummonsCommand(char* args); - bool HandleReloadEventAIScriptsCommand(char* args); + bool HandleReloadEventAIEventsCommand(char* args); bool HandleReloadCommandCommand(char* args); bool HandleReloadBattleEventCommand(char* args); bool HandleReloadConditionsCommand(char* args); diff --git a/src/game/Commands/Level3.cpp b/src/game/Commands/Level3.cpp index 4ba9ef525..4d912d10d 100644 --- a/src/game/Commands/Level3.cpp +++ b/src/game/Commands/Level3.cpp @@ -67,7 +67,7 @@ bool ChatHandler::HandleReloadAllCommand(char* /*args*/) HandleReloadSkillFishingBaseLevelCommand((char*)""); HandleReloadAllAreaCommand((char*)""); - HandleReloadAllEventAICommand((char*)""); + HandleReloadEventAIEventsCommand((char*)""); HandleReloadAllLootCommand((char*)""); HandleReloadAllNpcCommand((char*)""); HandleReloadAllQuestCommand((char*)""); @@ -144,13 +144,6 @@ bool ChatHandler::HandleReloadAllScriptsCommand(char* /*args*/) return true; } -bool ChatHandler::HandleReloadAllEventAICommand(char* /*args*/) -{ - HandleReloadEventAISummonsCommand((char*)"a"); - HandleReloadEventAIScriptsCommand((char*)"a"); - return true; -} - bool ChatHandler::HandleReloadAllSpellCommand(char* /*args*/) { HandleReloadSkillDiscoveryTemplateCommand((char*)"a"); @@ -698,19 +691,23 @@ bool ChatHandler::HandleReloadEventScriptsCommand(char* args) return true; } -bool ChatHandler::HandleReloadEventAISummonsCommand(char* /*args*/) +// Do not add separate reload command for scripts! +// EventAI events must be loaded right after. +bool ChatHandler::HandleReloadEventAIEventsCommand(char* args) { - sLog.outString("Re-Loading Summons from `creature_ai_summons`..."); - sEventAIMgr.LoadCreatureEventAI_Summons(true); - SendSysMessage("DB table `creature_ai_summons` reloaded."); - return true; -} + sEventAIMgr.ClearEventData(); -bool ChatHandler::HandleReloadEventAIScriptsCommand(char* /*args*/) -{ - sLog.outString("Re-Loading Scripts from `creature_ai_scripts`..."); - sEventAIMgr.LoadCreatureEventAI_Scripts(); - SendSysMessage("DB table `creature_ai_scripts` reloaded."); + if (*args != 'a') + sLog.outString("Re-Loading Scripts from `creature_ai_scripts`..."); + + sScriptMgr.LoadCreatureEventAIScripts(); + + if (*args != 'a') + SendSysMessage("DB table `creature_ai_scripts` reloaded."); + + sLog.outString("Re-Loading Events from `creature_ai_events`..."); + sEventAIMgr.LoadCreatureEventAI_Events(); + SendSysMessage("DB table `creature_ai_events` reloaded."); return true; } diff --git a/src/game/Conditions.cpp b/src/game/Conditions.cpp index 8b4e671e2..fe2d89168 100644 --- a/src/game/Conditions.cpp +++ b/src/game/Conditions.cpp @@ -78,7 +78,8 @@ uint8 const ConditionTargetsInternal[] = CONDITION_REQ_TARGET_PLAYER, // 29 CONDITION_REQ_TARGET_PLAYER, // 30 CONDITION_REQ_SOURCE_WORLDOBJECT, // 31 - CONDITION_REQ_SOURCE_CREATURE, // 32 + CONDITION_REQ_SOURCE_CREATURE, // 32 + CONDITION_REQ_MAP_OR_WORLDOBJECT, // 33 }; // Starts from 4th element so that -3 will return first element. @@ -437,6 +438,15 @@ bool inline ConditionEntry::Evaluate(WorldObject const* target, Map const* map, } return false; } + case CONDITION_MAP_ID: + { + uint32 mapId = map ? map->GetId() : (source ? source->GetMapId() : target->GetMapId()); + + if (mapId == m_value1) + return true; + + return false; + } } return false; } @@ -926,6 +936,15 @@ bool ConditionEntry::IsValid() } break; } + case CONDITION_MAP_ID: + { + if (!sMapStorage.LookupEntry(m_value1)) + { + sLog.outErrorDb("Current map condition (entry %u, type %u) has invalid Map ID %u", m_entry, m_condition, m_value1); + return false; + } + break; + } case CONDITION_NONE: break; default: diff --git a/src/game/Conditions.h b/src/game/Conditions.h index 09fb6a2f4..4243dbf36 100644 --- a/src/game/Conditions.h +++ b/src/game/Conditions.h @@ -68,7 +68,8 @@ enum ConditionType // If skill_value == 1, then true if player has not skill skill_id CONDITION_REPUTATION_RANK_MAX = 30, // faction_id max_rank CONDITION_HAS_FLAG = 31, // field_id flag - CONDITION_LAST_WAYPOINT = 32, // waypointId 0 = exact, 1: wp <= waypointId, 2: wp > waypointId Use to check what waypoint was last reached + CONDITION_LAST_WAYPOINT = 32, // waypointId 0 = exact, 1: wp <= waypointId, 2: wp > waypointId Use to check what waypoint was last reached + CONDITION_MAP_ID = 33, // map_id }; enum ConditionFlags diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index a9e28dd74..c9bb503e5 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -2182,7 +2182,7 @@ void BattleGroundMap::UnloadAll(bool pForce) } /// Put scripts in the execution queue -void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, Object* target) +void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, WorldObject* source, WorldObject* target) { ///- Find the script map ScriptMapMap::const_iterator s = scripts.find(id); @@ -2192,7 +2192,6 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O // prepare static data ObjectGuid sourceGuid = source->GetObjectGuid(); ObjectGuid targetGuid = target ? target->GetObjectGuid() : ObjectGuid(); - ObjectGuid ownerGuid = source->isType(TYPEMASK_ITEM) ? ((Item*)source)->GetOwnerGuid() : ObjectGuid(); ///- Schedule script execution for all scripts in the script map ScriptMap const *s2 = &(s->second); @@ -2203,7 +2202,6 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O ScriptAction sa; sa.sourceGuid = sourceGuid; sa.targetGuid = targetGuid; - sa.ownerGuid = ownerGuid; sa.script = &iter->second; m_scriptSchedule.insert(ScriptScheduleMap::value_type(time_t(sWorld.GetGameTime() + iter->first), sa)); @@ -2215,19 +2213,17 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O m_scriptSchedule_lock.release(); } -void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target) +void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, WorldObject* source, WorldObject* target) { // NOTE: script record _must_ exist until command executed // prepare static data ObjectGuid sourceGuid = source->GetObjectGuid(); ObjectGuid targetGuid = target ? target->GetObjectGuid() : ObjectGuid(); - ObjectGuid ownerGuid = source->isType(TYPEMASK_ITEM) ? ((Item*)source)->GetOwnerGuid() : ObjectGuid(); ScriptAction sa; sa.sourceGuid = sourceGuid; sa.targetGuid = targetGuid; - sa.ownerGuid = ownerGuid; sa.script = &script; m_scriptSchedule_lock.acquire(); @@ -2236,19 +2232,20 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou m_scriptSchedule_lock.release(); } -bool Map::FindScriptTargets(Object*& source, Object*& target, const ScriptAction& step) +void Map::ScriptCommandStartDirect(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + if ((script.command != SCRIPT_COMMAND_DISABLED) && + FindScriptFinalTargets(source, target, script) && + (!script.condition || sObjectMgr.IsConditionSatisfied(script.condition, target, this, source, CONDITION_FROM_DBSCRIPTS))) + (this->*(m_ScriptCommands[script.command]))(script, source, target); +} + +bool Map::FindScriptInitialTargets(WorldObject*& source, WorldObject*& target, const ScriptAction& step) { if (step.sourceGuid) { switch (step.sourceGuid.GetHigh()) { - case HIGHGUID_ITEM: - { - // case HIGHGUID_CONTAINER: ==HIGHGUID_ITEM - if (Player* player = HashMapHolder::Find(step.ownerGuid)) - source = player->GetItemByGuid(step.sourceGuid); - break; - } case HIGHGUID_UNIT: source = GetCreature(step.sourceGuid); break; @@ -2301,131 +2298,161 @@ bool Map::FindScriptTargets(Object*& source, Object*& target, const ScriptAction if (target && !target->IsInWorld()) target = nullptr; + return true; +} + +bool Map::FindScriptFinalTargets(WorldObject*& source, WorldObject*& target, const ScriptInfo& script) +{ // we swap target and source if data_flags & 0x1 - if (step.script->raw.data[4] & SF_GENERAL_SWAP_INITIAL_TARGETS) + if (script.raw.data[4] & SF_GENERAL_SWAP_INITIAL_TARGETS) std::swap(source, target); // If we have a buddy lets find it. - if (step.script->buddy_id) + if (script.target_type) { - Object* pBuddy = nullptr; - switch (step.script->buddy_type) + switch (script.target_type) { - case BUDDY_TYPE_CREATURE_ENTRY: - { - if (source && source->isType(TYPEMASK_WORLDOBJECT)) + case TARGET_T_CREATURE_WITH_ENTRY: { - WorldObject* pSource = (WorldObject*)source; + if (!source) + { + sLog.outError("FindScriptTargets: Attempt to search for nearby creature in script with id %u but source is a NULL object.", script.id); + return false; + } + Creature* pCreatureBuddy = nullptr; - MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*pSource, step.script->buddy_id, true, step.script->buddy_radius); + MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*source, script.target_param1, true, script.target_param2); MaNGOS::CreatureLastSearcher searcher(pCreatureBuddy, u_check); - Cell::VisitGridObjects(pSource, searcher, step.script->buddy_radius); + Cell::VisitGridObjects(source, searcher, script.target_param2); if (pCreatureBuddy) - pBuddy = pCreatureBuddy; + target = pCreatureBuddy; + else + { + sLog.outError("FindScriptTargets: Failed to find buddy for script with id %u (target_param1: %u), (target_param2: %u), (target_type: %u).", script.id, script.target_param1, script.target_param2, script.target_type); + return false; + } + break; } - else - sLog.outError("FindScriptTargets: Attempt to search for nearby creature in script with id %u but source is not a world object.", step.script->id); - break; - } - case BUDDY_TYPE_CREATURE_GUID: - { - const CreatureData* pCreatureData = sObjectMgr.GetCreatureData(step.script->buddy_id); - if (pCreatureData) + case TARGET_T_CREATURE_WITH_GUID: { - Creature* pCreatureBuddy = this->GetCreature(ObjectGuid(HIGHGUID_UNIT, pCreatureData->id, step.script->buddy_id)); + const CreatureData* pCreatureData = sObjectMgr.GetCreatureData(script.target_param1); + if (pCreatureData) + { + Creature* pCreatureBuddy = this->GetCreature(ObjectGuid(HIGHGUID_UNIT, pCreatureData->id, script.target_param1)); - if (pCreatureBuddy) - pBuddy = pCreatureBuddy; + if (pCreatureBuddy) + target = pCreatureBuddy; + else + { + sLog.outError("FindScriptTargets: Failed to find buddy for script with id %u (target_param1: %u), (target_param2: %u), (target_type: %u).", script.id, script.target_param1, script.target_param2, script.target_type); + return false; + } + } + break; } - break; - } - case BUDDY_TYPE_CREATURE_INSTANCE_DATA: - { - InstanceData* pInstanceData = this->GetInstanceData(); - if (pInstanceData) + case TARGET_T_CREATURE_FROM_INSTANCE_DATA: { - Creature* pCreatureBuddy = pInstanceData->GetCreature(pInstanceData->GetData64(step.script->buddy_id)); + InstanceData* pInstanceData = this->GetInstanceData(); + if (pInstanceData) + { + Creature* pCreatureBuddy = pInstanceData->GetCreature(pInstanceData->GetData64(script.target_param1)); - if (pCreatureBuddy) - pBuddy = pCreatureBuddy; + if (pCreatureBuddy) + target = pCreatureBuddy; + else + { + sLog.outError("FindScriptTargets: Failed to find buddy for script with id %u (target_param1: %u), (target_param2: %u), (target_type: %u).", script.id, script.target_param1, script.target_param2, script.target_type); + return false; + } + } + break; } - break; - } - case BUDDY_TYPE_GAMEOBJECT_ENTRY: - { - if (source && source->isType(TYPEMASK_WORLDOBJECT)) + case TARGET_T_GAMEOBJECT_WITH_ENTRY: { - WorldObject* pSource = (WorldObject*)source; + if (!source) + { + sLog.outError("FindScriptTargets: Attempt to search for nearby gameobject in script with id %u but source is a NULL object.", script.id); + return false; + } + GameObject* pGameObjectBuddy = nullptr; - MaNGOS::NearestGameObjectEntryInObjectRangeCheck u_check(*pSource, step.script->buddy_id, step.script->buddy_radius); + MaNGOS::NearestGameObjectEntryInObjectRangeCheck u_check(*source, script.target_param1, script.target_param2); MaNGOS::GameObjectLastSearcher searcher(pGameObjectBuddy, u_check); - Cell::VisitGridObjects(pSource, searcher, step.script->buddy_radius); + Cell::VisitGridObjects(source, searcher, script.target_param2); if (pGameObjectBuddy) - pBuddy = pGameObjectBuddy; + target = pGameObjectBuddy; + else + { + sLog.outError("FindScriptTargets: Failed to find buddy for script with id %u (target_param1: %u), (target_param2: %u), (target_type: %u).", script.id, script.target_param1, script.target_param2, script.target_type); + return false; + } + break; } - else - sLog.outError("FindScriptTargets: Attempt to search for nearby gameobject in script with id %u but source is not a world object.", step.script->id); - break; - } - case BUDDY_TYPE_GAMEOBJECT_GUID: - { - GameObjectData const* pGameObjectData = sObjectMgr.GetGOData(step.script->buddy_id); - if (pGameObjectData) + case TARGET_T_GAMEOBJECT_WITH_GUID: { - GameObject* pGameObjectBuddy = this->GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, pGameObjectData->id, step.script->buddy_id)); + GameObjectData const* pGameObjectData = sObjectMgr.GetGOData(script.target_param1); + if (pGameObjectData) + { + GameObject* pGameObjectBuddy = this->GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, pGameObjectData->id, script.target_param1)); - if (pGameObjectBuddy) - pBuddy = pGameObjectBuddy; + if (pGameObjectBuddy) + target = pGameObjectBuddy; + else + { + sLog.outError("FindScriptTargets: Failed to find buddy for script with id %u (target_param1: %u), (target_param2: %u), (target_type: %u).", script.id, script.target_param1, script.target_param2, script.target_type); + return false; + } + } + break; } - break; - } - case BUDDY_TYPE_GAMEOBJECT_INSTANCE_DATA: - { - InstanceData* pInstanceData = this->GetInstanceData(); - if (pInstanceData) + case TARGET_T_GAMEOBJECT_FROM_INSTANCE_DATA: { - GameObject* pGameObjectBuddy = pInstanceData->GetGameObject(pInstanceData->GetData64(step.script->buddy_id)); + InstanceData* pInstanceData = this->GetInstanceData(); + if (pInstanceData) + { + GameObject* pGameObjectBuddy = pInstanceData->GetGameObject(pInstanceData->GetData64(script.target_param1)); - if (pGameObjectBuddy) - pBuddy = pGameObjectBuddy; + if (pGameObjectBuddy) + target = pGameObjectBuddy; + else + { + sLog.outError("FindScriptTargets: Failed to find buddy for script with id %u (target_param1: %u), (target_param2: %u), (target_type: %u).", script.id, script.target_param1, script.target_param2, script.target_type); + return false; + } + } + break; + } + default: + { + target = GetTargetByType(source, target, script.target_type, script.target_param1, script.target_param2); + break; } - break; - } - } - - if (pBuddy) - source = pBuddy; - else - { - sLog.outError("FindScriptTargets: Failed to find buddy for script with id %u (buddy_id: %u), (buddy_radius: %u), (buddy_type: %u).", step.script->id, step.script->buddy_id, step.script->buddy_radius, step.script->buddy_type); - return false; } } // we swap target and source again if data_flags & 0x2 // this way we have all possible combinations with 3 targets - if (step.script->raw.data[4] & SF_GENERAL_SWAP_FINAL_TARGETS) + if (script.raw.data[4] & SF_GENERAL_SWAP_FINAL_TARGETS) std::swap(source, target); // we replace the target with the source if data_flags & 0x4 - if (step.script->raw.data[4] & SF_GENERAL_TARGET_SELF) + if (script.raw.data[4] & SF_GENERAL_TARGET_SELF) target = source; return true; } -// Removes all parts of script from the queue. -void Map::TerminateScript(ScriptAction& step) +void Map::TerminateScript(const ScriptAction& step) { for (auto rmItr = m_scriptSchedule.begin(); rmItr != m_scriptSchedule.end();) { - if (rmItr->second.IsSameScript(step.script->id, step.sourceGuid, step.targetGuid, step.ownerGuid)) + if (rmItr->second.IsSameScript(step.script->id, step.sourceGuid, step.targetGuid)) { m_scriptSchedule.erase(rmItr++); sScriptMgr.DecreaseScheduledScriptCount(); @@ -2450,20 +2477,19 @@ void Map::ScriptsProcess() // ok as multimap is a *sorted* associative container while (!m_scriptSchedule.empty() && (iter->first <= sWorld.GetGameTime())) { - ScriptAction step = iter->second; + const ScriptAction step = iter->second; m_scriptSchedule_lock.release(); - Object* source = nullptr; - Object* target = nullptr; + WorldObject* source = nullptr; + WorldObject* target = nullptr; - bool scriptResultOk = FindScriptTargets(source, target, step) && (step.script->command != SCRIPT_COMMAND_DISABLED); - - if (step.script->condition) - if (!sObjectMgr.IsConditionSatisfied(step.script->condition, ToWorldObject(target), this, ToWorldObject(source), CONDITION_FROM_DBSCRIPTS)) - scriptResultOk = false; + bool scriptResultOk = (step.script->command != SCRIPT_COMMAND_DISABLED) && + FindScriptInitialTargets(source, target, step) && + FindScriptFinalTargets(source, target, *step.script) && + (!step.script->condition || sObjectMgr.IsConditionSatisfied(step.script->condition, target, this, source, CONDITION_FROM_DBSCRIPTS)); if (scriptResultOk) - scriptResultOk = (this->*(m_ScriptCommands[step.script->command]))(step, source, target); + scriptResultOk = (this->*(m_ScriptCommands[step.script->command]))(*step.script, source, target); // Command returns true if we should abort script. if (scriptResultOk) diff --git a/src/game/Maps/Map.h b/src/game/Maps/Map.h index b5f2591df..75f33064b 100644 --- a/src/game/Maps/Map.h +++ b/src/game/Maps/Map.h @@ -191,7 +191,7 @@ typedef ACE_Thread_Mutex MapMutexType; // Use ACE_Null_Mutex to disable locks // Instance IDs reserved for internal use (instanced continent parts, ...) #define RESERVED_INSTANCES_LAST 100 -typedef bool(Map::*ScriptCommandFunction) (ScriptAction& step, Object* source, Object* target); +typedef bool(Map::*ScriptCommandFunction) (const ScriptInfo& script, WorldObject* source, WorldObject* target); class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::ObjectLevelLockable { @@ -325,10 +325,14 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj typedef MapRefManager PlayerList; PlayerList const& GetPlayers() const { return m_mapRefManager; } - //per-map script storage - void ScriptsStart(std::map > const& scripts, uint32 id, Object* source, Object* target); - void ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target); - void TerminateScript(ScriptAction& step); + // Adds all commands that are part of the provided script id to the queue. + void ScriptsStart(std::map > const& scripts, uint32 id, WorldObject* source, WorldObject* target); + // Adds the provided command to the queue. Will be handled by ScriptsProcess. + void ScriptCommandStart(ScriptInfo const& script, uint32 delay, WorldObject* source, WorldObject* target); + // Immediately executes the provided command. + void ScriptCommandStartDirect(const ScriptInfo& script, WorldObject* source, WorldObject* target); + // Removes all parts of script from the queue. + void TerminateScript(const ScriptAction& step); // must called with AddToWorld void AddToActive(WorldObject* obj); @@ -534,7 +538,8 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj void setNGrid(NGridType* grid, uint32 x, uint32 y); void ScriptsProcess(); - bool FindScriptTargets(Object*& source, Object*& target, const ScriptAction& step); + bool FindScriptInitialTargets(WorldObject*& source, WorldObject*& target, const ScriptAction& step); + bool FindScriptFinalTargets(WorldObject*& source, WorldObject*& target, const ScriptInfo& step); void SendObjectUpdates(); void UpdateVisibilityForRelocations(); @@ -643,48 +648,61 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj CreatureLinkingHolder m_creatureLinkingHolder; // Functions to handle all db script commands. - bool ScriptCommand_Talk(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_Emote(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_FieldSet(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_MoveTo(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_ModifyFlags(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_InterruptCasts(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_TeleportTo(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_QuestExplored(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_KillCredit(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_RespawnGameObject(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SummonCreature(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_OpenDoor(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_CloseDoor(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_ActivateGameObject(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_RemoveAura(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_CastSpell(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_PlaySound(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_CreateItem(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_DespawnCreature(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SetEquipment(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SetMovementType(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SetActiveObject(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SetFaction(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_Morph(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_Mount(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SetRun(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_AttackStart(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_UpdateEntry(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SetStandState(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_ModifyThreat(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SendTaxiPath(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_TerminateScript(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_TerminateCondition(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_Evade(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SetHomePosition(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_TurnTo(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_MeetingStone(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SetData(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_SetData64(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_StartScript(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_RemoveItem(ScriptAction& step, Object* source, Object* target); - bool ScriptCommand_RemoveGameObject(ScriptAction& step, Object* source, Object* target); + bool ScriptCommand_Talk(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_Emote(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_FieldSet(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_MoveTo(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_ModifyFlags(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_InterruptCasts(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_TeleportTo(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_QuestExplored(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_KillCredit(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_RespawnGameObject(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SummonCreature(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_OpenDoor(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_CloseDoor(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_ActivateGameObject(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_RemoveAura(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_CastSpell(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_PlaySound(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_CreateItem(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_DespawnCreature(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetEquipment(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetMovementType(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetActiveObject(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetFaction(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_Morph(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_Mount(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetRun(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_AttackStart(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_UpdateEntry(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetStandState(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_ModifyThreat(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SendTaxiPath(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_TerminateScript(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_TerminateCondition(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_Evade(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetHomePosition(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_TurnTo(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_MeetingStone(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetData(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetData64(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_StartScript(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_RemoveItem(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_RemoveGameObject(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetMeleeAttack(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetCombatMovement(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetPhase(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetPhaseRandom(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetPhaseRange(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_Flee(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_DealDamage(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_ZoneCombatPulse(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_CallForHelp(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_SetSheath(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_Invincibility(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_GameEvent(const ScriptInfo& script, WorldObject* source, WorldObject* target); + bool ScriptCommand_ServerVariable(const ScriptInfo& script, WorldObject* source, WorldObject* target); // Add any new script command functions to the array. const ScriptCommandFunction m_ScriptCommands[SCRIPT_COMMAND_MAX] = @@ -731,6 +749,19 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj &Map::ScriptCommand_StartScript, // 39 &Map::ScriptCommand_RemoveItem, // 40 &Map::ScriptCommand_RemoveGameObject, // 41 + &Map::ScriptCommand_SetMeleeAttack, // 42 + &Map::ScriptCommand_SetCombatMovement, // 43 + &Map::ScriptCommand_SetPhase, // 44 + &Map::ScriptCommand_SetPhaseRandom, // 45 + &Map::ScriptCommand_SetPhaseRange, // 46 + &Map::ScriptCommand_Flee, // 47 + &Map::ScriptCommand_DealDamage, // 48 + &Map::ScriptCommand_ZoneCombatPulse, // 49 + &Map::ScriptCommand_CallForHelp, // 50 + &Map::ScriptCommand_SetSheath, // 51 + &Map::ScriptCommand_Invincibility, // 52 + &Map::ScriptCommand_GameEvent, // 53 + &Map::ScriptCommand_ServerVariable, // 54 }; public: diff --git a/src/game/Maps/MapManager.cpp b/src/game/Maps/MapManager.cpp index 20a036152..a6afca136 100644 --- a/src/game/Maps/MapManager.cpp +++ b/src/game/Maps/MapManager.cpp @@ -621,17 +621,17 @@ BattleGroundMap* MapManager::CreateBattleGroundMap(uint32 id, uint32 InstanceId, bool IsNorthTo(float x, float y, float const* limits, int count /* last case is limits[2*count - 1] */) { - int insideCount = 0; + bool isNorth = false; for (int i = 0; i < count - 1; ++i) { if ((limits[2*i + 1] < y && y < limits[2*i + 3]) || (limits[2*i + 1] > y && y > limits[2*i + 3])) { float threshold = limits[2*i] + (limits[2*i + 2] - limits[2*i]) * (y - limits[2*i + 1]) / (limits[2*i + 3] - limits[2*i + 1]); if (x > threshold) - ++insideCount; + isNorth = !isNorth; } } - return insideCount % 2 == 1; + return isNorth; } uint32 MapManager::GetContinentInstanceId(uint32 mapId, float x, float y, bool* transitionArea) @@ -775,8 +775,8 @@ uint32 MapManager::GetContinentInstanceId(uint32 mapId, float x, float y, bool* 1184.00f, -3915.00f, 737.00f, -3782.00f, -75.00f, -3742.00f, - -263.00f, -3836.00f, - -173.00f, -4064.00f, + -288.30f, -3863.80f, // Northwest path for shaman quest "Call of Fire" + -282.30f, -4050.90f, -81.00f, -4091.00f, -49.00f, -4089.00f, -16.00f, -4187.00f, @@ -807,9 +807,10 @@ uint32 MapManager::GetContinentInstanceId(uint32 mapId, float x, float y, bool* -3472.819580f, 182.522476f, // Feralas -4365.006836f, -1602.575439f, // the Barrens -4515.219727f, -1681.356079f, - -4543.093750f, -1882.869385f, // Thousand Needles - -4824.16f, -2310.11f, - -5102.913574f, -2647.062744f, + -4703.36035f , -2166.91016f, // Thousand Needles + -4849.61377f , -2176.16284f, // Razorfen Downs outsides + -4863.11377f , -2185.06274f, + -5043.4502f , -2431.94971f, -5248.286621f, -3034.536377f, -5246.920898f, -3339.139893f, -5459.449707f, -4920.155273f, // Tanaris @@ -951,6 +952,7 @@ void MapManager::ScheduleInstanceSwitch(Player* player, uint16 newInstance) ASSERT(mapId < LAST_CONTINENT_ID); m_scheduledInstanceSwitches_lock[mapId].acquire(); m_scheduledInstanceSwitches[mapId][player] = newInstance; + player->SetPendingInstanceSwitch(true); m_scheduledInstanceSwitches_lock[mapId].release(); } @@ -964,6 +966,7 @@ void MapManager::SwitchPlayersInstances() Player* player = it->first; if (player->IsInWorld() && player->GetMapId() == continent) player->SwitchInstance(it->second); + player->SetPendingInstanceSwitch(false); } m_scheduledInstanceSwitches[continent].clear(); } diff --git a/src/game/Maps/ScriptCommands.cpp b/src/game/Maps/ScriptCommands.cpp index f77d7942f..fcc7214fd 100644 --- a/src/game/Maps/ScriptCommands.cpp +++ b/src/game/Maps/ScriptCommands.cpp @@ -20,67 +20,70 @@ #include "ScriptMgr.h" #include "GridSearchers.h" #include "InstanceData.h" +#include "CreatureEventAI.h" +#include "CreatureAIImpl.h" +#include "GameEventMgr.h" // Script commands should return false by default. // If they return true the rest of the script is aborted. -inline bool ShouldAbortScript(ScriptAction& step) +inline bool ShouldAbortScript(const ScriptInfo& script) { - return (step.script->raw.data[4] & SF_GENERAL_ABORT_ON_FAILURE); + return (script.raw.data[4] & SF_GENERAL_ABORT_ON_FAILURE); } // SCRIPT_COMMAND_TALK (0) -bool Map::ScriptCommand_Talk(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_Talk(const ScriptInfo& script, WorldObject* source, WorldObject* target) { - WorldObject* pSource = ToWorldObject(source); + WorldObject* pSource = source; if (!pSource) { - sLog.outError("SCRIPT_COMMAND_TALK (script id %u) call for a NULL or non-worldobject source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_TALK (script id %u) call for a NULL or non-worldobject source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } Unit* unitTarget = ToUnit(target); - int32 textId = step.script->talk.textId[0]; + int32 textId = script.talk.textId[0]; // May have text for random - if (step.script->talk.textId[1]) + if (script.talk.textId[1]) { int i = 2; for (; i < MAX_TEXT_ID; ++i) { - if (!step.script->talk.textId[i]) + if (!script.talk.textId[i]) break; } // Use one random - textId = step.script->talk.textId[rand() % i]; + textId = script.talk.textId[rand() % i]; } - DoScriptText(textId, pSource, unitTarget, step.script->talk.chatType); + DoScriptText(textId, pSource, unitTarget, script.talk.chatType); return false; } // SCRIPT_COMMAND_EMOTE (1) -bool Map::ScriptCommand_Emote(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_Emote(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Unit* pSource = ToUnit(source); if (!pSource) { - sLog.outError("SCRIPT_COMMAND_EMOTE (script id %u) call for a NULL or non-worldobject source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_EMOTE (script id %u) call for a NULL or non-worldobject source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } // find the emote std::vector emotes; - emotes.push_back(step.script->emote.emoteId); + emotes.push_back(script.emote.emoteId); for (int i = 0; i < MAX_EMOTE_ID; ++i) { - if (!step.script->emote.randomEmotes[i]) + if (!script.emote.randomEmotes[i]) continue; - emotes.push_back(uint32(step.script->emote.randomEmotes[i])); + emotes.push_back(uint32(script.emote.randomEmotes[i])); } pSource->HandleEmote(emotes[urand(0, emotes.size() - 1)]); @@ -89,46 +92,46 @@ bool Map::ScriptCommand_Emote(ScriptAction& step, Object* source, Object* target } // SCRIPT_COMMAND_FIELD_SET(2) -bool Map::ScriptCommand_FieldSet(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_FieldSet(const ScriptInfo& script, WorldObject* source, WorldObject* target) { if (!source) { - sLog.outError("SCRIPT_COMMAND_FIELD_SET (script id %u) call for a NULL object, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_FIELD_SET (script id %u) call for a NULL object, skipping.", script.id); + return ShouldAbortScript(script); } - if (step.script->setField.fieldId <= OBJECT_FIELD_ENTRY || step.script->setField.fieldId >= source->GetValuesCount()) + if (script.setField.fieldId <= OBJECT_FIELD_ENTRY || script.setField.fieldId >= source->GetValuesCount()) { sLog.outError("SCRIPT_COMMAND_FIELD_SET (script id %u) call for wrong field %u (max count: %u) in object (TypeId: %u).", - step.script->id, step.script->setField.fieldId, source->GetValuesCount(), source->GetTypeId()); - return ShouldAbortScript(step); + script.id, script.setField.fieldId, source->GetValuesCount(), source->GetTypeId()); + return ShouldAbortScript(script); } - source->SetUInt32Value(step.script->setField.fieldId, step.script->setField.fieldValue); + source->SetUInt32Value(script.setField.fieldId, script.setField.fieldValue); return false; } // SCRIPT_COMMAND_MOVE_TO (3) -bool Map::ScriptCommand_MoveTo(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_MoveTo(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource = ToCreature(source); if (!pSource) { - sLog.outError("SCRIPT_COMMAND_MOVE_TO (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_MOVE_TO (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - float x = step.script->x; - float y = step.script->y; - float z = step.script->z; + float x = script.x; + float y = script.y; + float z = script.z; - if (step.script->moveTo.coordinatesType) + if (script.moveTo.coordinatesType) { - if (WorldObject* pTarget = ToWorldObject(target)) + if (WorldObject* pTarget = target) { - switch (step.script->moveTo.coordinatesType) + switch (script.moveTo.coordinatesType) { case SO_MOVETO_COORDINATES_RELATIVE_TO_TARGET: { @@ -149,141 +152,141 @@ bool Map::ScriptCommand_MoveTo(ScriptAction& step, Object* source, Object* targe } else { - sLog.outError("SCRIPT_COMMAND_MOVE_TO (script id %u) call with datalong = %u for a NULL or non-worldobject target, skipping.", step.script->id, step.script->moveTo.coordinatesType); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_MOVE_TO (script id %u) call with datalong = %u for a NULL or non-worldobject target, skipping.", script.id, script.moveTo.coordinatesType); + return ShouldAbortScript(script); } } // Only move if we can move. - if (pSource->hasUnitState(UNIT_STAT_NOT_MOVE) && !(step.script->moveTo.flags & SF_MOVETO_FORCED)) - return ShouldAbortScript(step); + if (pSource->hasUnitState(UNIT_STAT_NOT_MOVE) && !(script.moveTo.flags & SF_MOVETO_FORCED)) + return ShouldAbortScript(script); - float speed = step.script->moveTo.travelTime != 0 ? pSource->GetDistance(x, y, z) / ((float)step.script->moveTo.travelTime * 0.001f) : 0.0f; - float orientation = step.script->o ? step.script->o : -10.0f; + float speed = script.moveTo.travelTime != 0 ? pSource->GetDistance(x, y, z) / ((float)script.moveTo.travelTime * 0.001f) : 0.0f; + float orientation = script.o ? script.o : -10.0f; - if (step.script->moveTo.flags & SF_MOVETO_POINT_MOVEGEN) - pSource->GetMotionMaster()->MovePoint(0, x, y, z, step.script->moveTo.movementOptions, speed, orientation); + if (script.moveTo.flags & SF_MOVETO_POINT_MOVEGEN) + pSource->GetMotionMaster()->MovePoint(0, x, y, z, script.moveTo.movementOptions, speed, orientation); else - pSource->MonsterMoveWithSpeed(x, y, z, orientation, speed, step.script->moveTo.movementOptions); + pSource->MonsterMoveWithSpeed(x, y, z, orientation, speed, script.moveTo.movementOptions); return false; } // SCRIPT_COMMAND_MODIFY_FLAGS (4) -bool Map::ScriptCommand_ModifyFlags(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_ModifyFlags(const ScriptInfo& script, WorldObject* source, WorldObject* target) { if (!source) { - sLog.outError("SCRIPT_COMMAND_MODIFY_FLAGS (script id %u) call for a NULL object, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_MODIFY_FLAGS (script id %u) call for a NULL object, skipping.", script.id); + return ShouldAbortScript(script); } - if (step.script->modFlags.fieldId <= OBJECT_FIELD_ENTRY || step.script->modFlags.fieldId >= source->GetValuesCount()) + if (script.modFlags.fieldId <= OBJECT_FIELD_ENTRY || script.modFlags.fieldId >= source->GetValuesCount()) { sLog.outError("SCRIPT_COMMAND_MODIFY_FLAGS (script id %u) call for wrong field %u (max count: %u) in object (TypeId: %u).", - step.script->id, step.script->modFlags.fieldId, source->GetValuesCount(), source->GetTypeId()); - return ShouldAbortScript(step); + script.id, script.modFlags.fieldId, source->GetValuesCount(), source->GetTypeId()); + return ShouldAbortScript(script); } // Add Flags - if (step.script->modFlags.mode == SO_MODIFYFLAGS_SET) - source->SetFlag(step.script->modFlags.fieldId, step.script->modFlags.fieldValue); + if (script.modFlags.mode == SO_MODIFYFLAGS_SET) + source->SetFlag(script.modFlags.fieldId, script.modFlags.fieldValue); // Remove Flags - else if (step.script->modFlags.mode == SO_MODIFYFLAGS_REMOVE) - source->RemoveFlag(step.script->modFlags.fieldId, step.script->modFlags.fieldValue); + else if (script.modFlags.mode == SO_MODIFYFLAGS_REMOVE) + source->RemoveFlag(script.modFlags.fieldId, script.modFlags.fieldValue); // Toggle Flags else { - if (source->HasFlag(step.script->modFlags.fieldId, step.script->modFlags.fieldValue)) - source->RemoveFlag(step.script->modFlags.fieldId, step.script->modFlags.fieldValue); + if (source->HasFlag(script.modFlags.fieldId, script.modFlags.fieldValue)) + source->RemoveFlag(script.modFlags.fieldId, script.modFlags.fieldValue); else - source->SetFlag(step.script->modFlags.fieldId, step.script->modFlags.fieldValue); + source->SetFlag(script.modFlags.fieldId, script.modFlags.fieldValue); } return false; } // SCRIPT_COMMAND_INTERRUPT_CASTS (5) -bool Map::ScriptCommand_InterruptCasts(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_InterruptCasts(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Unit* pSource = ToUnit(source); if (!pSource) { - sLog.outError("SCRIPT_COMMAND_INTERRUPT_CAST (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_INTERRUPT_CAST (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - pSource->InterruptNonMeleeSpells(step.script->interruptCasts.withDelayed, step.script->interruptCasts.spellId); + pSource->InterruptNonMeleeSpells(script.interruptCasts.withDelayed, script.interruptCasts.spellId); return false; } // SCRIPT_COMMAND_TELEPORT_TO (6) -bool Map::ScriptCommand_TeleportTo(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_TeleportTo(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Unit* pSource = ToUnit(source); if (!pSource) { - sLog.outError("SCRIPT_COMMAND_TELEPORT_TO (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_TELEPORT_TO (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } if (pSource->GetTypeId() == TYPEID_PLAYER) - (static_cast(pSource))->TeleportTo(step.script->teleportTo.mapId, step.script->x, step.script->y, step.script->z, step.script->o, step.script->teleportTo.teleportOptions); + (static_cast(pSource))->TeleportTo(script.teleportTo.mapId, script.x, script.y, script.z, script.o, script.teleportTo.teleportOptions); else - pSource->NearTeleportTo(step.script->x, step.script->y, step.script->z, step.script->o, step.script->teleportTo.teleportOptions); + pSource->NearTeleportTo(script.x, script.y, script.z, script.o, script.teleportTo.teleportOptions); return false; } // SCRIPT_COMMAND_QUEST_EXPLORED (7) -bool Map::ScriptCommand_QuestExplored(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_QuestExplored(const ScriptInfo& script, WorldObject* source, WorldObject* target) { // when script called for item spell casting then target == (unit or GO) and source is player Player* pPlayer; WorldObject* pWorldObject; - if (!(((pPlayer = ToPlayer(target)) && (pWorldObject = ToWorldObject(source))) || ((pPlayer = ToPlayer(source)) && (pWorldObject = ToWorldObject(target))))) + if (!(((pPlayer = ToPlayer(target)) && (pWorldObject = source)) || ((pPlayer = ToPlayer(source)) && (pWorldObject = target)))) { - sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) call for a NULL player, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) call for a NULL player, skipping.", script.id); + return ShouldAbortScript(script); } if (pWorldObject->GetTypeId() != TYPEID_UNIT && pWorldObject->GetTypeId() != TYPEID_GAMEOBJECT && pWorldObject->GetTypeId() != TYPEID_PLAYER) { - sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) call for a non-creature, non-gameobject or non-player (TypeId: %u), skipping.", step.script->id, pWorldObject->GetTypeId()); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) call for a non-creature, non-gameobject or non-player (TypeId: %u), skipping.", script.id, pWorldObject->GetTypeId()); + return ShouldAbortScript(script); } // quest id and flags checked at script loading if ((pWorldObject->GetTypeId() != TYPEID_UNIT || (static_cast(pWorldObject))->isAlive()) && - (step.script->questExplored.distance == 0 || pWorldObject->IsWithinDistInMap(pPlayer, float(step.script->questExplored.distance)))) - pPlayer->AreaExploredOrEventHappens(step.script->questExplored.questId); + (script.questExplored.distance == 0 || pWorldObject->IsWithinDistInMap(pPlayer, float(script.questExplored.distance)))) + pPlayer->AreaExploredOrEventHappens(script.questExplored.questId); else - pPlayer->FailQuest(step.script->questExplored.questId); + pPlayer->FailQuest(script.questExplored.questId); return false; } // SCRIPT_COMMAND_KILL_CREDIT (8) -bool Map::ScriptCommand_KillCredit(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_KillCredit(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Player* pSource; // accept player in any one from target/source arg if ((pSource = ToPlayer(target)) || (pSource = ToPlayer(source))) { - if (step.script->killCredit.isGroupCredit) - pSource->RewardPlayerAndGroupAtEvent(step.script->killCredit.creatureEntry, pSource); + if (script.killCredit.isGroupCredit) + pSource->RewardPlayerAndGroupAtEvent(script.killCredit.creatureEntry, pSource); else - pSource->KilledMonsterCredit(step.script->killCredit.creatureEntry); + pSource->KilledMonsterCredit(script.killCredit.creatureEntry); } else { - sLog.outError("SCRIPT_COMMAND_KILL_CREDIT (script id %u) call for a NULL object, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_KILL_CREDIT (script id %u) call for a NULL object, skipping.", script.id); + return ShouldAbortScript(script); } @@ -291,16 +294,16 @@ bool Map::ScriptCommand_KillCredit(ScriptAction& step, Object* source, Object* t } // SCRIPT_COMMAND_RESPAWN_GAMEOBJECT (9) -bool Map::ScriptCommand_RespawnGameObject(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_RespawnGameObject(const ScriptInfo& script, WorldObject* source, WorldObject* target) { GameObject *pGo = nullptr; - uint32 guidlow = step.script->respawnGo.goGuid; + uint32 guidlow = script.respawnGo.goGuid; if (guidlow) { GameObjectData const* goData = sObjectMgr.GetGOData(guidlow); if (!goData) - return ShouldAbortScript(step); // checked at load + return ShouldAbortScript(script); // checked at load pGo = GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, goData->id, guidlow)); } @@ -311,23 +314,23 @@ bool Map::ScriptCommand_RespawnGameObject(ScriptAction& step, Object* source, Ob if (!pGo) { - sLog.outError("SCRIPT_COMMAND_RESPAWN_GAMEOBJECT (script id %u) failed for gameobject(guid: %u).", step.script->id, guidlow); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_RESPAWN_GAMEOBJECT (script id %u) failed for gameobject(guid: %u).", script.id, guidlow); + return ShouldAbortScript(script); } - int32 time_to_despawn = step.script->respawnGo.despawnDelay < 5 ? 5 : step.script->respawnGo.despawnDelay; + int32 time_to_despawn = script.respawnGo.despawnDelay < 5 ? 5 : script.respawnGo.despawnDelay; if (pGo->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || pGo->GetGoType() == GAMEOBJECT_TYPE_DOOR || pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON || pGo->GetGoType() == GAMEOBJECT_TYPE_TRAP) { - sLog.outError("SCRIPT_COMMAND_RESPAWN_GAMEOBJECT (script id %u) can not be used with gameobject of type %u (guid: %u).", step.script->id, uint32(pGo->GetGoType()), step.script->respawnGo.goGuid); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_RESPAWN_GAMEOBJECT (script id %u) can not be used with gameobject of type %u (guid: %u).", script.id, uint32(pGo->GetGoType()), script.respawnGo.goGuid); + return ShouldAbortScript(script); } if (pGo->isSpawned()) - return ShouldAbortScript(step); //gameobject already spawned + return ShouldAbortScript(script); //gameobject already spawned pGo->SetLootState(GO_READY); pGo->SetRespawnTime(time_to_despawn); //despawn object in ? seconds @@ -338,54 +341,54 @@ bool Map::ScriptCommand_RespawnGameObject(ScriptAction& step, Object* source, Ob } // SCRIPT_COMMAND_TEMP_SUMMON_CREATURE (10) -bool Map::ScriptCommand_SummonCreature(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SummonCreature(const ScriptInfo& script, WorldObject* source, WorldObject* target) { - if (!step.script->summonCreature.creatureEntry) + if (!script.summonCreature.creatureEntry) { - sLog.outError("SCRIPT_COMMAND_TEMP_SUMMON_CREATURE (script id %u) call for a NULL creature, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_TEMP_SUMMON_CREATURE (script id %u) call for a NULL creature, skipping.", script.id); + return ShouldAbortScript(script); } - WorldObject* pSummoner = ToWorldObject(source); + WorldObject* pSummoner = source; if (!pSummoner) { - sLog.outError("SCRIPT_COMMAND_TEMP_SUMMON_CREATURE (script id %u) call for a NULL or non-worldobject source (TypeId: %u, skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_TEMP_SUMMON_CREATURE (script id %u) call for a NULL or non-worldobject source (TypeId: %u, skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - float x = step.script->x; - float y = step.script->y; - float z = step.script->z; - float o = step.script->o; + float x = script.x; + float y = script.y; + float z = script.z; + float o = script.o; - if (step.script->summonCreature.flags & SF_SUMMONCREATURE_UNIQUE || step.script->summonCreature.flags & SF_SUMMONCREATURE_UNIQUE_TEMP) + if (script.summonCreature.flags & SF_SUMMONCREATURE_UNIQUE || script.summonCreature.flags & SF_SUMMONCREATURE_UNIQUE_TEMP) { - float dist = step.script->summonCreature.uniqueDistance ? step.script->summonCreature.uniqueDistance : (pSummoner->GetDistance(x, y, z) + 50.0f) * 2; + float dist = script.summonCreature.uniqueDistance ? script.summonCreature.uniqueDistance : (pSummoner->GetDistance(x, y, z) + 50.0f) * 2; std::list foundCreatures; - GetCreatureListWithEntryInGrid(foundCreatures, pSummoner, step.script->summonCreature.creatureEntry, dist); + GetCreatureListWithEntryInGrid(foundCreatures, pSummoner, script.summonCreature.creatureEntry, dist); if (!foundCreatures.empty()) { uint32 exAmount = 0; - uint32 reqAmount = step.script->summonCreature.uniqueLimit ? step.script->summonCreature.uniqueLimit : 1; + uint32 reqAmount = script.summonCreature.uniqueLimit ? script.summonCreature.uniqueLimit : 1; - if (step.script->summonCreature.flags & SF_SUMMONCREATURE_UNIQUE) + if (script.summonCreature.flags & SF_SUMMONCREATURE_UNIQUE) exAmount = foundCreatures.size(); else exAmount = count_if(foundCreatures.begin(), foundCreatures.end(), [&](Creature* c) { return c->IsTemporarySummon(); }); if (exAmount >= reqAmount) - return ShouldAbortScript(step); + return ShouldAbortScript(script); } } float orientation = o; - if ((step.script->summonCreature.facingLogic == SO_SUMMONCREATURE_FACE_SUMMONER) || (step.script->summonCreature.facingLogic == SO_SUMMONCREATURE_FACE_TARGET)) + if ((script.summonCreature.facingLogic == SO_SUMMONCREATURE_FACE_SUMMONER) || (script.summonCreature.facingLogic == SO_SUMMONCREATURE_FACE_TARGET)) { - WorldObject* facingTarget = ((step.script->summonCreature.facingLogic == SO_SUMMONCREATURE_FACE_TARGET) && target && target->isType(TYPEMASK_WORLDOBJECT)) ? static_cast(target) : pSummoner; + WorldObject* facingTarget = ((script.summonCreature.facingLogic == SO_SUMMONCREATURE_FACE_TARGET) && target && target->isType(TYPEMASK_WORLDOBJECT)) ? static_cast(target) : pSummoner; float dx = facingTarget->GetPositionX() - x; float dy = facingTarget->GetPositionY() - y; @@ -394,32 +397,54 @@ bool Map::ScriptCommand_SummonCreature(ScriptAction& step, Object* source, Objec orientation = (orientation >= 0) ? orientation : 2 * M_PI_F + orientation; } - Creature* pCreature = pSummoner->SummonCreature(step.script->summonCreature.creatureEntry, x, y, z, orientation, - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, step.script->summonCreature.despawnDelay, step.script->summonCreature.flags & SF_SUMMONCREATURE_ACTIVE); + Creature* pCreature = pSummoner->SummonCreature(script.summonCreature.creatureEntry, x, y, z, orientation, + TempSummonType(script.summonCreature.despawnType), script.summonCreature.despawnDelay, script.summonCreature.flags & SF_SUMMONCREATURE_ACTIVE); if (!pCreature) { - sLog.outError("SCRIPT_COMMAND_TEMP_SUMMON (script id %u) failed for creature (entry: %u).", step.script->id, step.script->summonCreature.creatureEntry); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_TEMP_SUMMON (script id %u) failed for creature (entry: %u).", script.id, script.summonCreature.creatureEntry); + return ShouldAbortScript(script); } - if (step.script->summonCreature.setRun == 1) + if (script.summonCreature.flags & SF_SUMMONCREATURE_SET_RUN) pCreature->SetWalk(false); + switch (script.summonCreature.attackTarget) + { + case TARGET_T_OWNER_OR_SELF: + break; + case TARGET_T_PROVIDED_TARGET: + { + if (Unit* pAttackTarget = ToUnit(target)) + if (pCreature->AI()) + pCreature->AI()->AttackStart(pAttackTarget); + break; + } + default: + { + if (Creature* pCreatureSummoner = pSummoner->ToCreature()) + { + if (Unit* pAttackTarget = ToUnit(GetTargetByType(pCreatureSummoner, nullptr, script.summonCreature.attackTarget))) + if (pCreature->AI()) + pCreature->AI()->AttackStart(pAttackTarget); + } + } + } + return false; } // SCRIPT_COMMAND_OPEN_DOOR (11) -bool Map::ScriptCommand_OpenDoor(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_OpenDoor(const ScriptInfo& script, WorldObject* source, WorldObject* target) { GameObject *pDoor = nullptr; - uint32 guidlow = step.script->openDoor.goGuid; + uint32 guidlow = script.openDoor.goGuid; if (guidlow) { GameObjectData const* goData = sObjectMgr.GetGOData(guidlow); if (!goData) // checked at load - return ShouldAbortScript(step); + return ShouldAbortScript(script); pDoor = GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, goData->id, guidlow)); } @@ -430,20 +455,20 @@ bool Map::ScriptCommand_OpenDoor(ScriptAction& step, Object* source, Object* tar if (!pDoor) { - sLog.outError("SCRIPT_COMMAND_OPEN_DOOR (script id %u) failed for gameobject(guid: %u).", step.script->id, guidlow); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_OPEN_DOOR (script id %u) failed for gameobject(guid: %u).", script.id, guidlow); + return ShouldAbortScript(script); } if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR) { - sLog.outError("SCRIPT_COMMAND_OPEN_DOOR (script id %u) failed for non-door(GoType: %u).", step.script->id, pDoor->GetGoType()); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_OPEN_DOOR (script id %u) failed for non-door(GoType: %u).", script.id, pDoor->GetGoType()); + return ShouldAbortScript(script); } if (pDoor->GetGoState() != GO_STATE_READY) - return ShouldAbortScript(step); //door already open + return ShouldAbortScript(script); //door already open - int32 time_to_close = step.script->openDoor.resetDelay < 3 ? 3 : step.script->openDoor.resetDelay; // Ustaag : duree minimale de reset fixee a 3 sec au lieu de 15 + int32 time_to_close = script.openDoor.resetDelay < 3 ? 3 : script.openDoor.resetDelay; // Ustaag : duree minimale de reset fixee a 3 sec au lieu de 15 pDoor->UseDoorOrButton(time_to_close); @@ -454,16 +479,16 @@ bool Map::ScriptCommand_OpenDoor(ScriptAction& step, Object* source, Object* tar } // SCRIPT_COMMAND_CLOSE_DOOR (12) -bool Map::ScriptCommand_CloseDoor(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_CloseDoor(const ScriptInfo& script, WorldObject* source, WorldObject* target) { GameObject *pDoor = nullptr; - uint32 guidlow = step.script->closeDoor.goGuid; + uint32 guidlow = script.closeDoor.goGuid; if (guidlow) { GameObjectData const* goData = sObjectMgr.GetGOData(guidlow); if (!goData) // checked at load - return ShouldAbortScript(step); + return ShouldAbortScript(script); pDoor = GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, goData->id, guidlow)); } @@ -474,19 +499,19 @@ bool Map::ScriptCommand_CloseDoor(ScriptAction& step, Object* source, Object* ta if (!pDoor) { - sLog.outError("SCRIPT_COMMAND_CLOSE_DOOR (script id %u) failed for gameobject(guid: %u).", step.script->id, guidlow); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_CLOSE_DOOR (script id %u) failed for gameobject(guid: %u).", script.id, guidlow); + return ShouldAbortScript(script); } if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR) { - sLog.outError("SCRIPT_COMMAND_CLOSE_DOOR (script id %u) failed for non-door(GoType: %u).", step.script->id, pDoor->GetGoType()); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_CLOSE_DOOR (script id %u) failed for non-door(GoType: %u).", script.id, pDoor->GetGoType()); + return ShouldAbortScript(script); } if (pDoor->GetGoState() == GO_STATE_READY) - return ShouldAbortScript(step); //door already closed + return ShouldAbortScript(script); //door already closed - int32 time_to_open = step.script->closeDoor.resetDelay < 3 ? 3 : step.script->closeDoor.resetDelay; // Ustaag : duree minimale de reset fixee a 3 sec au lieu de 15 + int32 time_to_open = script.closeDoor.resetDelay < 3 ? 3 : script.closeDoor.resetDelay; // Ustaag : duree minimale de reset fixee a 3 sec au lieu de 15 pDoor->UseDoorOrButton(time_to_open); @@ -497,21 +522,21 @@ bool Map::ScriptCommand_CloseDoor(ScriptAction& step, Object* source, Object* ta } // SCRIPT_COMMAND_ACTIVATE_OBJECT (13) -bool Map::ScriptCommand_ActivateGameObject(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_ActivateGameObject(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Unit* pUser = nullptr; GameObject *pGo = nullptr; if (!((pUser = ToUnit(source)) || (pUser = ToUnit(target)))) { - sLog.outError("SCRIPT_COMMAND_ACTIVATE_OBJECT (script id %u) call for a NULL user, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_ACTIVATE_OBJECT (script id %u) call for a NULL user, skipping.", script.id); + return ShouldAbortScript(script); } if (!((pGo = ToGameObject(target)) || (pGo = ToGameObject(source)))) { - sLog.outError("SCRIPT_COMMAND_ACTIVATE_OBJECT (script id %u) call for a NULL gameobject, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_ACTIVATE_OBJECT (script id %u) call for a NULL gameobject, skipping.", script.id); + return ShouldAbortScript(script); } pGo->Use(pUser); @@ -519,135 +544,142 @@ bool Map::ScriptCommand_ActivateGameObject(ScriptAction& step, Object* source, O } // SCRIPT_COMMAND_REMOVE_AURA (14) -bool Map::ScriptCommand_RemoveAura(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_RemoveAura(const ScriptInfo& script, WorldObject* source, WorldObject* target) { - Unit* pUnitTarget = ToUnit(source); + Unit* pSource = ToUnit(source); - if (!pUnitTarget) + if (!pSource) { - sLog.outError("SCRIPT_COMMAND_REMOVE_AURA (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_REMOVE_AURA (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - pUnitTarget->RemoveAurasDueToSpell(step.script->removeAura.spellId); + pSource->RemoveAurasDueToSpell(script.removeAura.spellId); return false; } // SCRIPT_COMMAND_CAST_SPELL (15) -bool Map::ScriptCommand_CastSpell(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_CastSpell(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Unit* pUnitSource = ToUnit(source); Unit* pUnitTarget = ToUnit(target); - - if (!pUnitSource || !pUnitTarget) + + if (!pUnitSource) { - sLog.outError("SCRIPT_COMMAND_CAST_SPELL (script id %u) call for a NULL source or target, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_CAST_SPELL (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - if ((step.script->castSpell.flags & SF_CASTSPELL_INTERRUPT_PREVIOUS) && pUnitSource->IsNonMeleeSpellCasted(false)) + if (!pUnitTarget) + return ShouldAbortScript(script); + + if ((script.castSpell.flags & CF_INTERRUPT_PREVIOUS) && pUnitSource->IsNonMeleeSpellCasted(false)) pUnitSource->InterruptNonMeleeSpells(false); - //TODO: when GO cast implemented, code below must be updated accordingly to also allow GO spell cast - pUnitSource->CastSpell(pUnitTarget, step.script->castSpell.spellId, (step.script->castSpell.flags & SF_CASTSPELL_TRIGGERED) != 0); + Creature* pCreatureSource = pUnitSource->ToCreature(); + + if (pCreatureSource && pCreatureSource->AI()) + pCreatureSource->AI()->DoCastSpellIfCan(pUnitTarget, script.castSpell.spellId, script.castSpell.flags); + else + pUnitSource->CastSpell(pUnitTarget, script.castSpell.spellId, (script.castSpell.flags & CF_TRIGGERED) != 0); return false; } // SCRIPT_COMMAND_PLAY_SOUND (16) -bool Map::ScriptCommand_PlaySound(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_PlaySound(const ScriptInfo& script, WorldObject* source, WorldObject* target) { - WorldObject* pSource = ToWorldObject(source); + WorldObject* pSource = source; if (!pSource) { - sLog.outError("SCRIPT_COMMAND_PLAY_SOUND (script id %u) call for a NULL or non-worldobject source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_PLAY_SOUND (script id %u) call for a NULL or non-worldobject source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } Player* pTarget = nullptr; - if ((step.script->playSound.flags & SF_PLAYSOUND_ONLY_TO_TARGET) && !(pTarget = ToPlayer(target))) + if ((script.playSound.flags & SF_PLAYSOUND_ONLY_TO_TARGET) && !(pTarget = ToPlayer(target))) { - sLog.outError("SCRIPT_COMMAND_PLAY_SOUND (script id %u) in targeted mode call for a NULL or non-player target (TypeId: %u), skipping.", step.script->id, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_PLAY_SOUND (script id %u) in targeted mode call for a NULL or non-player target (TypeId: %u), skipping.", script.id, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } - if (step.script->playSound.flags & SF_PLAYSOUND_DISTANCE_DEPENDENT) - pSource->PlayDistanceSound(step.script->playSound.soundId, pTarget); + if (script.playSound.flags & SF_PLAYSOUND_DISTANCE_DEPENDENT) + pSource->PlayDistanceSound(script.playSound.soundId, pTarget); else - pSource->PlayDirectSound(step.script->playSound.soundId, pTarget); + pSource->PlayDirectSound(script.playSound.soundId, pTarget); return false; } // SCRIPT_COMMAND_CREATE_ITEM (17) -bool Map::ScriptCommand_CreateItem(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_CreateItem(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Player* pReceiver; if (!((pReceiver = ToPlayer(target)) || (pReceiver = ToPlayer(source)))) { - sLog.outError("SCRIPT_COMMAND_CREATE_ITEM (script id %u) call for a NULL or non-player object (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_CREATE_ITEM (script id %u) call for a NULL or non-player object (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } - if (Item* pItem = pReceiver->StoreNewItemInInventorySlot(step.script->createItem.itemEntry, step.script->createItem.amount)) - pReceiver->SendNewItem(pItem, step.script->createItem.amount, true, false); + if (Item* pItem = pReceiver->StoreNewItemInInventorySlot(script.createItem.itemEntry, script.createItem.amount)) + pReceiver->SendNewItem(pItem, script.createItem.amount, true, false); return false; } // SCRIPT_COMMAND_DESPAWN_CREATURE (18) -bool Map::ScriptCommand_DespawnCreature(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_DespawnCreature(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource = ToCreature(source); if (!pSource) { - sLog.outError("SCRIPT_COMMAND_DESPAWN_CREATURE (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_DESPAWN_CREATURE (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - pSource->DespawnOrUnsummon(step.script->despawn.despawnDelay); + pSource->DespawnOrUnsummon(script.despawn.despawnDelay); return false; } // SCRIPT_COMMAND_SET_EQUIPMENT (19) -bool Map::ScriptCommand_SetEquipment(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SetEquipment(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource = ToCreature(source); if (!pSource) { - sLog.outError("SCRIPT_COMMAND_DESPAWN_CREATURE (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_DESPAWN_CREATURE (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - if (step.script->setEquipment.resetDefault) + if (script.setEquipment.resetDefault) { pSource->LoadEquipment(pSource->GetCreatureInfo()->equipmentId, true); return false; } // main hand - if (step.script->setEquipment.slot[0] >= 0) - pSource->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, step.script->setEquipment.slot[0]); + if (script.setEquipment.slot[0] >= 0) + pSource->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, script.setEquipment.slot[0]); // off hand - if (step.script->setEquipment.slot[1] >= 0) - pSource->SetVirtualItem(VIRTUAL_ITEM_SLOT_1, step.script->setEquipment.slot[1]); + if (script.setEquipment.slot[1] >= 0) + pSource->SetVirtualItem(VIRTUAL_ITEM_SLOT_1, script.setEquipment.slot[1]); // ranged - if (step.script->setEquipment.slot[2] >= 0) - pSource->SetVirtualItem(VIRTUAL_ITEM_SLOT_2, step.script->setEquipment.slot[2]); + if (script.setEquipment.slot[2] >= 0) + pSource->SetVirtualItem(VIRTUAL_ITEM_SLOT_2, script.setEquipment.slot[2]); return false; } // SCRIPT_COMMAND_MOVEMENT (20) -bool Map::ScriptCommand_SetMovementType(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SetMovementType(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource; Unit* pTarget; @@ -658,14 +690,14 @@ bool Map::ScriptCommand_SetMovementType(ScriptAction& step, Object* source, Obje pTarget = ToUnit(source); else { - sLog.outError("SCRIPT_COMMAND_MOVEMENT (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_MOVEMENT (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } // Consider add additional checks for cases where creature should not change movementType // (pet? in combat? already using same MMgen as script try to apply?) - switch (step.script->movement.movementType) + switch (script.movement.movementType) { case IDLE_MOTION_TYPE: pSource->GetMotionMaster()->MoveIdle(); @@ -674,82 +706,82 @@ bool Map::ScriptCommand_SetMovementType(ScriptAction& step, Object* source, Obje pSource->GetMotionMaster()->MoveRandom(); break; case WAYPOINT_MOTION_TYPE: - pSource->GetMotionMaster()->MoveWaypoint(step.script->movement.boolParam); + pSource->GetMotionMaster()->MoveWaypoint(script.movement.boolParam); break; case CONFUSED_MOTION_TYPE: pSource->GetMotionMaster()->MoveConfused(); break; case CHASE_MOTION_TYPE: - if (step.script->movement.boolParam) // chase victim + if (script.movement.boolParam) // chase victim { if (Unit* pVictim = pSource->getVictim()) - pSource->GetMotionMaster()->MoveChase(pVictim, step.script->x, step.script->o); + pSource->GetMotionMaster()->MoveChase(pVictim, script.x, script.o); break; } else if (pTarget) - pSource->GetMotionMaster()->MoveChase(pTarget, step.script->x, step.script->o); + pSource->GetMotionMaster()->MoveChase(pTarget, script.x, script.o); break; case HOME_MOTION_TYPE: pSource->GetMotionMaster()->MoveTargetedHome(); break; case FLEEING_MOTION_TYPE: - if (step.script->movement.boolParam) // flee from victim + if (script.movement.boolParam) // flee from victim { if (Unit* pVictim = pSource->getVictim()) - pSource->GetMotionMaster()->MoveFleeing(pVictim, step.script->movement.intParam); + pSource->GetMotionMaster()->MoveFleeing(pVictim, script.movement.intParam); break; } else if (pTarget) - pSource->GetMotionMaster()->MoveFleeing(pTarget, step.script->movement.intParam); + pSource->GetMotionMaster()->MoveFleeing(pTarget, script.movement.intParam); break; case DISTRACT_MOTION_TYPE: - pSource->GetMotionMaster()->MoveDistract(step.script->movement.intParam); + pSource->GetMotionMaster()->MoveDistract(script.movement.intParam); break; case FOLLOW_MOTION_TYPE: if (pTarget) - pSource->GetMotionMaster()->MoveFollow(pTarget, step.script->x, step.script->o); + pSource->GetMotionMaster()->MoveFollow(pTarget, script.x, script.o); break; case CHARGE_MOTION_TYPE: if (pTarget) - pSource->GetMotionMaster()->MoveCharge(pTarget, step.script->movement.intParam, step.script->movement.boolParam); + pSource->GetMotionMaster()->MoveCharge(pTarget, script.movement.intParam, script.movement.boolParam); break; default: - sLog.outError("SCRIPT_COMMAND_MOVEMENT (script id %u) call for an invalid motion type (MotionType: %u), skipping.", step.script->id, step.script->movement.movementType); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_MOVEMENT (script id %u) call for an invalid motion type (MotionType: %u), skipping.", script.id, script.movement.movementType); + return ShouldAbortScript(script); } return false; } // SCRIPT_COMMAND_SET_ACTIVEOBJECT (21) -bool Map::ScriptCommand_SetActiveObject(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SetActiveObject(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource; if (!((pSource = ToCreature(source)) || (pSource = ToCreature(target)))) { - sLog.outError("SCRIPT_COMMAND_SET_ACTIVEOBJECT (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_SET_ACTIVEOBJECT (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } - pSource->SetActiveObjectState(step.script->activeObject.activate); + pSource->SetActiveObjectState(script.activeObject.activate); return false; } // SCRIPT_COMMAND_SET_FACTION (22) -bool Map::ScriptCommand_SetFaction(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SetFaction(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource; if (!((pSource = ToCreature(source)) || (pSource = ToCreature(target)))) { - sLog.outError("SCRIPT_COMMAND_SET_FACTION (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_SET_FACTION (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } - if (step.script->faction.factionId) - pSource->SetFactionTemporary(step.script->faction.factionId, step.script->faction.flags); + if (script.faction.factionId) + pSource->SetFactionTemporary(script.faction.factionId, script.faction.flags); else pSource->ClearTemporaryFaction(); @@ -757,23 +789,23 @@ bool Map::ScriptCommand_SetFaction(ScriptAction& step, Object* source, Object* t } // SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL (23) -bool Map::ScriptCommand_Morph(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_Morph(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource; if (!((pSource = ToCreature(source)) || (pSource = ToCreature(target)))) { - sLog.outError("SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } - if (!step.script->morph.creatureOrModelEntry) + if (!script.morph.creatureOrModelEntry) pSource->DeMorph(); - else if (step.script->morph.isDisplayId) - pSource->SetDisplayId(step.script->morph.creatureOrModelEntry); + else if (script.morph.isDisplayId) + pSource->SetDisplayId(script.morph.creatureOrModelEntry); else { - CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(step.script->morph.creatureOrModelEntry); + CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(script.morph.creatureOrModelEntry); uint32 display_id = Creature::ChooseDisplayId(ci); pSource->SetDisplayId(display_id); @@ -783,23 +815,23 @@ bool Map::ScriptCommand_Morph(ScriptAction& step, Object* source, Object* target } // SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL (24) -bool Map::ScriptCommand_Mount(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_Mount(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource; if (!((pSource = ToCreature(source)) || (pSource = ToCreature(target)))) { - sLog.outError("SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } - if (!step.script->mount.creatureOrModelEntry) + if (!script.mount.creatureOrModelEntry) pSource->Unmount(); - else if (step.script->mount.isDisplayId) - pSource->Mount(step.script->mount.creatureOrModelEntry); + else if (script.mount.isDisplayId) + pSource->Mount(script.mount.creatureOrModelEntry); else { - CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(step.script->mount.creatureOrModelEntry); + CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(script.mount.creatureOrModelEntry); uint32 display_id = Creature::ChooseDisplayId(ci); pSource->Mount(display_id); @@ -809,150 +841,140 @@ bool Map::ScriptCommand_Mount(ScriptAction& step, Object* source, Object* target } // SCRIPT_COMMAND_SET_RUN (25) -bool Map::ScriptCommand_SetRun(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SetRun(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource; if (!((pSource = ToCreature(source)) || (pSource = ToCreature(target)))) { - sLog.outError("SCRIPT_COMMAND_SET_RUN (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_SET_RUN (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } - pSource->SetWalk(!step.script->run.run); + pSource->SetWalk(!script.run.run); return false; } // SCRIPT_COMMAND_ATTACK_START (26) -bool Map::ScriptCommand_AttackStart(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_AttackStart(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Unit* pTarget = ToUnit(target); Creature* pAttacker = ToCreature(source); if (!pAttacker || !pTarget) { - sLog.outError("SCRIPT_COMMAND_ATTACK_START (script id %u) call for a NULL source or target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_ATTACK_START (script id %u) call for a NULL source or target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } if (pAttacker->IsFriendlyTo(pTarget)) { - sLog.outError("SCRIPT_COMMAND_ATTACK_START (script id %u) attacker is friendly to target, can not attack.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_ATTACK_START (script id %u) attacker is friendly to target, can not attack.", script.id); + return ShouldAbortScript(script); } - pAttacker->AI()->AttackStart(pTarget); + if (pAttacker->AI()) + pAttacker->AI()->AttackStart(pTarget); return false; } // SCRIPT_COMMAND_UPDATE_ENTRY (27) -bool Map::ScriptCommand_UpdateEntry(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_UpdateEntry(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource = ToCreature(source); if (!pSource) { - sLog.outError("SCRIPT_COMMAND_UPDATE_ENTRY (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_UPDATE_ENTRY (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - if (pSource->GetEntry() != step.script->updateEntry.creatureEntry) - pSource->UpdateEntry(step.script->updateEntry.creatureEntry, step.script->updateEntry.team ? HORDE : ALLIANCE); + if (pSource->GetEntry() != script.updateEntry.creatureEntry) + pSource->UpdateEntry(script.updateEntry.creatureEntry, script.updateEntry.team ? HORDE : ALLIANCE); return false; } // SCRIPT_COMMAND_STAND_STATE (28) -bool Map::ScriptCommand_SetStandState(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SetStandState(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Unit* pSource = ToUnit(source); if (!pSource) { - sLog.outError("SCRIPT_COMMAND_STAND_STATE (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_STAND_STATE (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - pSource->SetStandState(step.script->standState.stand_state); + pSource->SetStandState(script.standState.stand_state); return false; } // SCRIPT_COMMAND_MODIFY_THREAT (29) -bool Map::ScriptCommand_ModifyThreat(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_ModifyThreat(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource = ToCreature(source); if (!pSource) { - sLog.outError("SCRIPT_COMMAND_MODIFY_THREAT (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_MODIFY_THREAT (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - switch (step.script->modThreat.target) + if (script.modThreat.target == SO_MODIFYTHREAT_ALL_ATTACKERS) { - case SO_MODIFYTHREAT_PROVIDED_TARGET: - { - if (target && target->isType(TYPEMASK_UNIT)) - pSource->getThreatManager().modifyThreatPercent(static_cast(target), step.script->x); - break; - } - case SO_MODIFYTHREAT_CURRENT_VICTIM: - { - if (Unit* pVictim = pSource->getVictim()) - pSource->getThreatManager().modifyThreatPercent(pVictim, step.script->x); - break; - } - case SO_MODIFYTHREAT_ALL_ATTACKERS: - { - ThreatList const& threatList = pSource->getThreatManager().getThreatList(); - for (ThreatList::const_iterator i = threatList.begin(); i != threatList.end(); ++i) - if (Unit* Temp = pSource->GetMap()->GetUnit((*i)->getUnitGuid())) - pSource->getThreatManager().modifyThreatPercent(Temp, step.script->x); - break; - } + ThreatList const& threatList = pSource->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = threatList.begin(); i != threatList.end(); ++i) + if (Unit* Temp = pSource->GetMap()->GetUnit((*i)->getUnitGuid())) + pSource->getThreatManager().modifyThreatPercent(Temp, script.x); + } + else + { + if (Unit* pTarget = ToUnit(GetTargetByType(pSource, target, script.modThreat.target))) + pSource->getThreatManager().modifyThreatPercent(pTarget, script.x); } return false; } // SCRIPT_COMMAND_SEND_TAXI_PATH (30) -bool Map::ScriptCommand_SendTaxiPath(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SendTaxiPath(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Player* pPlayer; if (!((pPlayer = ToPlayer(target)) || (pPlayer = ToPlayer(source)))) { - sLog.outError("SCRIPT_COMMAND_SEND_TAXI_PATH (script id %u) call for a non-player source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_SEND_TAXI_PATH (script id %u) call for a non-player source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } - pPlayer->ActivateTaxiPathTo(step.script->sendTaxiPath.taxiPathId, 0, true); + pPlayer->ActivateTaxiPathTo(script.sendTaxiPath.taxiPathId, 0, true); return false; } // SCRIPT_COMMAND_TERMINATE_SCRIPT (31) -bool Map::ScriptCommand_TerminateScript(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_TerminateScript(const ScriptInfo& script, WorldObject* source, WorldObject* target) { - if (step.script->terminateScript.creatureEntry) + if (script.terminateScript.creatureEntry) { WorldObject* pSearcher; - if (!((pSearcher = ToWorldObject(source)) || (pSearcher = ToWorldObject(target)))) + if (!((pSearcher = source) || (pSearcher = target))) { - sLog.outError("SCRIPT_COMMAND_TERMINATE_SCRIPT (script id %u) call for a NULL object, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_TERMINATE_SCRIPT (script id %u) call for a NULL object, skipping.", script.id); + return ShouldAbortScript(script); } Creature* pCreatureBuddy = nullptr; - MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*pSearcher, step.script->terminateScript.creatureEntry, true, step.script->terminateScript.searchRadius); + MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*pSearcher, script.terminateScript.creatureEntry, true, script.terminateScript.searchRadius); MaNGOS::CreatureLastSearcher searcher(pCreatureBuddy, u_check); - Cell::VisitGridObjects(pSearcher, searcher, step.script->terminateScript.searchRadius); + Cell::VisitGridObjects(pSearcher, searcher, script.terminateScript.searchRadius); - if ((step.script->terminateScript.flags == SO_TERMINATESCRIPT_IF_NOT_FOUND) && !pCreatureBuddy) + if ((script.terminateScript.flags == SO_TERMINATESCRIPT_IF_NOT_FOUND) && !pCreatureBuddy) return true; // when npc was not found alive - else if ((step.script->terminateScript.flags == SO_TERMINATESCRIPT_IF_FOUND) && pCreatureBuddy) + else if ((script.terminateScript.flags == SO_TERMINATESCRIPT_IF_FOUND) && pCreatureBuddy) return true; // when npc was found alive } else @@ -962,36 +984,36 @@ bool Map::ScriptCommand_TerminateScript(ScriptAction& step, Object* source, Obje } // SCRIPT_COMMAND_TERMINATE_CONDITION (32) -bool Map::ScriptCommand_TerminateCondition(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_TerminateCondition(const ScriptInfo& script, WorldObject* source, WorldObject* target) { - WorldObject* pSource = ToWorldObject(source); - WorldObject* pTarget = ToWorldObject(target); + WorldObject* pSource = source; + WorldObject* pTarget = target; - bool terminateResult = sObjectMgr.IsConditionSatisfied(step.script->terminateCond.conditionId, pTarget, this, pSource, CONDITION_FROM_DBSCRIPTS); + bool terminateResult = sObjectMgr.IsConditionSatisfied(script.terminateCond.conditionId, pTarget, this, pSource, CONDITION_FROM_DBSCRIPTS); - if (step.script->terminateCond.flags & SF_TERMINATECONDITION_WHEN_FALSE) + if (script.terminateCond.flags & SF_TERMINATECONDITION_WHEN_FALSE) terminateResult = !terminateResult; - if (terminateResult && step.script->terminateCond.failQuest) + if (terminateResult && script.terminateCond.failQuest) { Player* pPlayer; if ((pPlayer = ToPlayer(pSource)) || (pPlayer = ToPlayer(pTarget))) - pPlayer->GroupEventFailHappens(step.script->terminateCond.failQuest); + pPlayer->GroupEventFailHappens(script.terminateCond.failQuest); } return terminateResult; // Terminate further steps of this script } // SCRIPT_COMMAND_ENTER_EVADE_MODE (33) -bool Map::ScriptCommand_Evade(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_Evade(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource; if (!((pSource = ToCreature(source)) || (pSource = ToCreature(target)))) { - sLog.outError("SCRIPT_COMMAND_ENTER_EVADE_MODE (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_ENTER_EVADE_MODE (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } if (pSource->AI()) @@ -1001,51 +1023,51 @@ bool Map::ScriptCommand_Evade(ScriptAction& step, Object* source, Object* target } // SCRIPT_COMMAND_SET_HOME_POSITION (34) -bool Map::ScriptCommand_SetHomePosition(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SetHomePosition(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Creature* pSource; if (!((pSource = ToCreature(source)) || (pSource = ToCreature(target)))) { - sLog.outError("SCRIPT_COMMAND_SET_HOME_POSITION (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_SET_HOME_POSITION (script id %u) call for a NULL or non-creature source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } - if (step.script->setHome.useCurrent) + if (script.setHome.useCurrent) pSource->SaveHomePosition(); else - pSource->SetHomePosition(step.script->x, step.script->y, step.script->z, step.script->o); + pSource->SetHomePosition(script.x, script.y, script.z, script.o); return false; } // SCRIPT_COMMAND_TURN_TO (35) -bool Map::ScriptCommand_TurnTo(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_TurnTo(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Unit* pSource = ToUnit(source); if (!pSource) { - sLog.outError("SCRIPT_COMMAND_TURN_TO (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_TURN_TO (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); } - switch (step.script->turnTo.facingLogic) + switch (script.turnTo.facingLogic) { case SO_TURNTO_FACE_TARGET: { - if (WorldObject* pTarget = ToWorldObject(target)) + if (WorldObject* pTarget = target) pSource->SetFacingToObject(pTarget); else { - sLog.outError("SCRIPT_COMMAND_TURN_TO (script id %u) call with datalong=0 for a non-worldobject target (TypeId: %u), skipping", step.script->id, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_TURN_TO (script id %u) call with datalong=0 for a non-worldobject target (TypeId: %u), skipping", script.id, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } break; } case SO_TURNTO_PROVIDED_ORIENTATION: { - pSource->SetFacingTo(step.script->o); + pSource->SetFacingTo(script.o); break; } } @@ -1054,103 +1076,89 @@ bool Map::ScriptCommand_TurnTo(ScriptAction& step, Object* source, Object* targe } // SCRIPT_COMMAND_MEETINGSTONE (36) -bool Map::ScriptCommand_MeetingStone(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_MeetingStone(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Player* pPlayer; if (!((pPlayer = ToPlayer(target)) || (pPlayer = ToPlayer(source)))) { - sLog.outError("SCRIPT_COMMAND_MEETINGSTONE (script id %u) call for a NULL or non-player source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_MEETINGSTONE (script id %u) call for a NULL or non-player source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } if (!sLFGMgr.IsPlayerInQueue(pPlayer->GetObjectGuid())) - sLFGMgr.AddToQueue(pPlayer, step.script->meetingstone.areaId); + sLFGMgr.AddToQueue(pPlayer, script.meetingstone.areaId); return false; } // SCRIPT_COMMAND_SET_INST_DATA (37) -bool Map::ScriptCommand_SetData(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SetData(const ScriptInfo& script, WorldObject* source, WorldObject* target) { InstanceData* pInst = GetInstanceData(); if (!pInst) { - sLog.outError("SCRIPT_COMMAND_SET_INST_DATA (script id %u) call for map without an instance script, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_SET_INST_DATA (script id %u) call for map without an instance script, skipping.", script.id); + return ShouldAbortScript(script); } - uint32 uiData = step.script->setData.data; - switch (step.script->setData.type) + uint32 uiData = script.setData.data; + switch (script.setData.type) { - case SO_INSTDATA_RAW: - { - break; - } case SO_INSTDATA_INCREMENT: { - uiData+= pInst->GetData(step.script->setData.field); + uiData+= pInst->GetData(script.setData.field); break; } case SO_INSTDATA_DECREMENT: { - uint32 uiOldData = pInst->GetData(step.script->setData.field); + uint32 uiOldData = pInst->GetData(script.setData.field); uiData = (uiData < uiOldData) ? (uiOldData - uiData) : 0; break; } - default: - { - sLog.outError("SCRIPT_COMMAND_SET_INST_DATA (script id %u) call for an invalid type (datalong3=%u), skipping.", step.script->id, step.script->setData.type); - return ShouldAbortScript(step); - } } - pInst->SetData(step.script->setData.field, uiData); + pInst->SetData(script.setData.field, uiData); return false; } // SCRIPT_COMMAND_SET_INST_DATA64 (38) -bool Map::ScriptCommand_SetData64(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_SetData64(const ScriptInfo& script, WorldObject* source, WorldObject* target) { InstanceData* pInst = GetInstanceData(); if (!pInst) { - sLog.outError("SCRIPT_COMMAND_SET_INST_DATA64 (script id %u) call for map without an instance script, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_SET_INST_DATA64 (script id %u) call for map without an instance script, skipping.", script.id); + return ShouldAbortScript(script); } - switch (step.script->setData64.type) + switch (script.setData64.type) { case SO_INSTDATA64_RAW: { - pInst->SetData64(step.script->setData64.field, step.script->setData64.data); + pInst->SetData64(script.setData64.field, script.setData64.data); break; } case SO_INSTDATA64_SOURCE_GUID: { if (source) - pInst->SetData64(step.script->setData64.field, source->GetGUID()); + pInst->SetData64(script.setData64.field, source->GetGUID()); else { - sLog.outError("SCRIPT_COMMAND_SET_INST_DATA64 (script id %u) call for a NULL source, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_SET_INST_DATA64 (script id %u) call for a NULL source, skipping.", script.id); + return ShouldAbortScript(script); } break; } - default: - { - sLog.outError("SCRIPT_COMMAND_SET_INST_DATA64 (script id %u) call for an invalid type (datalong3=%u), skipping.", step.script->id, step.script->setData64.type); - return ShouldAbortScript(step); - } } return false; } // SCRIPT_COMMAND_START_SCRIPT (39) -bool Map::ScriptCommand_StartScript(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_StartScript(const ScriptInfo& script, WorldObject* source, WorldObject* target) { const uint32 roll = urand(1, 100); uint32 sum = 0; @@ -1158,12 +1166,12 @@ bool Map::ScriptCommand_StartScript(ScriptAction& step, Object* source, Object* for (int i = 0; i < 4; i++) { - const uint32 currentId = step.script->startScript.scriptId[i]; + const uint32 currentId = script.startScript.scriptId[i]; if (!currentId) continue; - const uint32 currentChance = step.script->startScript.chance[i]; + const uint32 currentChance = script.startScript.chance[i]; if ((roll > sum) && (roll <= (sum + currentChance))) { @@ -1177,39 +1185,301 @@ bool Map::ScriptCommand_StartScript(ScriptAction& step, Object* source, Object* if (chosenId) ScriptsStart(sEventScripts, chosenId, source, target); else - return ShouldAbortScript(step); + return ShouldAbortScript(script); return false; } // SCRIPT_COMMAND_REMOVE_ITEM (40) -bool Map::ScriptCommand_RemoveItem(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_RemoveItem(const ScriptInfo& script, WorldObject* source, WorldObject* target) { Player* pPlayer; if (!((pPlayer = ToPlayer(target)) || (pPlayer = ToPlayer(source)))) { - sLog.outError("SCRIPT_COMMAND_REMOVE_ITEM (script id %u) call for a NULL or non-player source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_REMOVE_ITEM (script id %u) call for a NULL or non-player source and target (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", script.id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); } - pPlayer->DestroyItemCount(step.script->createItem.itemEntry, step.script->createItem.amount, true); + pPlayer->DestroyItemCount(script.createItem.itemEntry, script.createItem.amount, true); return false; } // SCRIPT_COMMAND_REMOVE_OBJECT (41) -bool Map::ScriptCommand_RemoveGameObject(ScriptAction& step, Object* source, Object* target) +bool Map::ScriptCommand_RemoveGameObject(const ScriptInfo& script, WorldObject* source, WorldObject* target) { GameObject *pGo = nullptr; if (!((pGo = ToGameObject(target)) || (pGo = ToGameObject(source)))) { - sLog.outError("SCRIPT_COMMAND_REMOVE_OBJECT (script id %u) call for a NULL gameobject, skipping.", step.script->id); - return ShouldAbortScript(step); + sLog.outError("SCRIPT_COMMAND_REMOVE_OBJECT (script id %u) call for a NULL gameobject, skipping.", script.id); + return ShouldAbortScript(script); } pGo->SetLootState(GO_JUST_DEACTIVATED); pGo->AddObjectToRemoveList(); + return false; +} + +// SCRIPT_COMMAND_SET_MELEE_ATTACK (42) +bool Map::ScriptCommand_SetMeleeAttack(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Creature* pSource = ToCreature(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_SET_MELEE_ATTACK (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + if (pSource->AI()) + pSource->AI()->SetMeleeAttack(script.enableMelee.enabled); + + return false; +} + +// SCRIPT_COMMAND_SET_COMBAT_MOVEMENT (43) +bool Map::ScriptCommand_SetCombatMovement(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Creature* pSource = ToCreature(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_SET_COMBAT_MOVEMENT (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + if (pSource->AI()) + pSource->AI()->SetCombatMovement(script.combatMovement.enabled); + + return false; +} + +// SCRIPT_COMMAND_SET_PHASE (44) +bool Map::ScriptCommand_SetPhase(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Creature* pSource = ToCreature(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_SET_PHASE (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + auto* pAI = dynamic_cast(pSource->AI()); + + if (!pAI) + return ShouldAbortScript(script); + + uint32 uiPhase = script.setPhase.phase; + + switch (script.setPhase.mode) + { + case SO_SETPHASE_INCREMENT: + { + uiPhase+= pAI->m_Phase; + break; + } + case SO_SETPHASE_DECREMENT: + { + uint32 uiOldPhase = pAI->m_Phase; + uiPhase = (uiPhase < uiOldPhase) ? (uiOldPhase - uiPhase) : 0; + break; + } + } + + if (uiPhase >= MAX_PHASE) + { + sLog.outErrorDb("SCRIPT_COMMAND_SET_PHASE (script id %u) attempt to increment Phase above %u. Phase mask cannot be used with phases past %u. CreatureEntry = %d", script.id, MAX_PHASE - 1, MAX_PHASE - 1, pSource->GetEntry()); + return ShouldAbortScript(script); + } + + pAI->m_Phase = uiPhase; + + return false; +} + +// SCRIPT_COMMAND_SET_PHASE_RANDOM (45) +bool Map::ScriptCommand_SetPhaseRandom(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Creature* pSource = ToCreature(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_SET_PHASE_RANDOM (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + auto* pAI = dynamic_cast(pSource->AI()); + + if (!pAI) + return ShouldAbortScript(script); + + uint32 phase1 = script.setPhaseRandom.phase[0]; + uint32 phase2 = script.setPhaseRandom.phase[1]; + uint32 phase3 = script.setPhaseRandom.phase[2]; + uint32 phase4 = script.setPhaseRandom.phase[3]; + + if (phase4) + pAI->m_Phase = RAND(phase1, phase2, phase3, phase4); + else if (phase3) + pAI->m_Phase = RAND(phase1, phase2, phase3); + else + pAI->m_Phase = RAND(phase1, phase2); + + return false; +} + +// SCRIPT_COMMAND_SET_PHASE_RANGE (46) +bool Map::ScriptCommand_SetPhaseRange(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Creature* pSource = ToCreature(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_SET_PHASE_RANGE (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + auto* pAI = dynamic_cast(pSource->AI()); + + if (!pAI) + return ShouldAbortScript(script); + + pAI->m_Phase = urand(script.setPhaseRange.phaseMin, script.setPhaseRange.phaseMax); + + return false; +} + +// SCRIPT_COMMAND_FLEE (47) +bool Map::ScriptCommand_Flee(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Creature* pSource = ToCreature(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_FLEE (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + if (script.flee.seekAssistance) + pSource->DoFleeToGetAssistance(); + else + pSource->DoFlee(); + + return false; +} + +// SCRIPT_COMMAND_DEAL_DAMAGE (48) +bool Map::ScriptCommand_DealDamage(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Unit* pSource = ToUnit(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_DEAL_DAMAGE (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + Unit* pTarget = ToUnit(source); + + if (!pTarget) + { + sLog.outError("SCRIPT_COMMAND_DEAL_DAMAGE (script id %u) call for a NULL or non-unit target (TypeId: %u), skipping.", script.id, target ? target->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + uint32 damage = script.dealDamage.isPercent ? pTarget->GetMaxHealth()*(script.dealDamage.damage / 100.0f) : script.dealDamage.damage; + pSource->DealDamage(pTarget, damage, nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false); + + return false; +} + +// SCRIPT_COMMAND_ZONE_COMBAT_PULSE (49) +bool Map::ScriptCommand_ZoneCombatPulse(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Creature* pSource = ToCreature(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_ZONE_COMBAT_PULSE (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + pSource->SetInCombatWithZone(script.combatPulse.initialPulse); + + return false; +} + +// SCRIPT_COMMAND_CALL_FOR_HELP (50) +bool Map::ScriptCommand_CallForHelp(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Creature* pSource = ToCreature(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_CALL_FOR_HELP (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + pSource->CallForHelp(script.x); + + return false; +} + +// SCRIPT_COMMAND_SET_SHEATH (51) +bool Map::ScriptCommand_SetSheath(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Unit* pSource = ToUnit(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_SET_SHEATH (script id %u) call for a NULL or non-unit source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + pSource->SetSheath(SheathState(script.setSheath.sheathState)); + + return false; +} + +// SCRIPT_COMMAND_INVINCIBILITY (52) +bool Map::ScriptCommand_Invincibility(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + Creature* pSource = ToCreature(source); + + if (!pSource) + { + sLog.outError("SCRIPT_COMMAND_INVINCIBILITY (script id %u) call for a NULL or non-creature source (TypeId: %u), skipping.", script.id, source ? source->GetTypeId() : 0); + return ShouldAbortScript(script); + } + + auto* pAI = dynamic_cast(pSource->AI()); + + if (!pAI) + return ShouldAbortScript(script); + + pAI->SetInvincibilityHealthLevel(script.invincibility.health, script.invincibility.isPercent); + + return false; +} + +// SCRIPT_COMMAND_GAME_EVENT (53) +bool Map::ScriptCommand_GameEvent(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + if (script.gameEvent.start) + sGameEventMgr.StartEvent(script.gameEvent.eventId, script.gameEvent.overwrite); + else + sGameEventMgr.StopEvent(script.gameEvent.eventId, script.gameEvent.overwrite); + + return false; +} + +// SCRIPT_COMMAND_SET_SERVER_VARIABLE (54) +bool Map::ScriptCommand_ServerVariable(const ScriptInfo& script, WorldObject* source, WorldObject* target) +{ + sObjectMgr.SetSavedVariable(script.serverVariable.index, script.serverVariable.value, true); + return false; } \ No newline at end of file diff --git a/src/game/Objects/Creature.cpp b/src/game/Objects/Creature.cpp index 88d7b40a5..f8f362f33 100644 --- a/src/game/Objects/Creature.cpp +++ b/src/game/Objects/Creature.cpp @@ -3118,6 +3118,13 @@ void Creature::OnLeaveCombat() UpdateCombatState(false); UpdateCombatWithZoneState(false); + // a delayed spell event could set the creature in combat again + auto itEvent = m_Events.GetEvents().begin(); + for (; itEvent != m_Events.GetEvents().end(); ++itEvent) + if (SpellEvent* event = dynamic_cast(itEvent->second)) + if (event->GetSpell()->getState() != SPELL_STATE_FINISHED) + event->GetSpell()->cancel(); + if (_creatureGroup) _creatureGroup->OnLeaveCombat(this); @@ -3394,6 +3401,19 @@ Unit* Creature::SelectNearestHostileUnitInAggroRange(bool useLOS) const return target; } +// Returns friendly unit with the most amount of hp missing from max hp +Unit* Creature::DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff, bool bPercent) const +{ + Unit* pUnit = nullptr; + + MaNGOS::MostHPMissingInRangeCheck u_check(this, fRange, uiMinHPDiff, bPercent); + MaNGOS::UnitLastSearcher searcher(pUnit, u_check); + + Cell::VisitGridObjects(this, searcher, fRange); + + return pUnit; +} + // use this function to avoid having hostile creatures attack // friendlies and other mobs they shouldn't attack bool Creature::_IsTargetAcceptable(Unit const *target) const diff --git a/src/game/Objects/Creature.h b/src/game/Objects/Creature.h index a943b6a53..221383d09 100644 --- a/src/game/Objects/Creature.h +++ b/src/game/Objects/Creature.h @@ -728,13 +728,15 @@ class MANGOS_DLL_SPEC Creature : public Unit // AI helpers Unit* SelectNearestHostileUnitInAggroRange(bool useLOS) const; Unit* SelectNearestTargetInAttackDistance(float dist) const; - // - Selection de victime (dans la liste d'aggro) + Unit* DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff = 1, bool bPercent = false) const; + // - Victim selection (from aggro list) Unit* GetNearestVictimInRange(float min, float max); Unit* GetFarthestVictimInRange(float min, float max); Unit* GetVictimInRange(float min, float max); Unit* GetHostileCasterInRange(float min, float max); Unit* GetHostileCaster(); - // - Selection generique + + // - Generic Selection void ProcessThreatList(ThreatListProcesser* f); // Spell Launch : diff --git a/src/game/Objects/Object.cpp b/src/game/Objects/Object.cpp index fc86163b8..594fa64e0 100644 --- a/src/game/Objects/Object.cpp +++ b/src/game/Objects/Object.cpp @@ -867,23 +867,8 @@ void Object::SetUInt64Value(uint16 index, const uint64 &value) MANGOS_ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, true)); if (*((uint64*) & (m_uint32Values[ index ])) != value) { - uint32 first = m_uint32Values[ index ] = *((uint32*)&value); - uint32 second = m_uint32Values[ index + 1 ] = *(((uint32*)&value) + 1); - - // Force an update at both mirrored values, even if only one index was changed - // If we don't update the second index, it may become perpetually stuck and - // lead to weird client behaviour such as not displaying a target (only the - // first part is networked). This is typically only an issue for units which - // have these values set at create time, as the client will ignore unpacked - // 64bit values that arent fully networked in the create stage, yet accept - // them in the update stage (presumably it defaults to 0 for both bytes if - // not present, making it "OK" if we only send one in the future). - // Note that this behaviour is inconsistent as well, sometimes it works - // with only one part whereas other times it does not. It appears to be - // related to the number of (player) units in the vicinity. - // The first update will correct any malformed 64bit data. - m_uint32Values_mirror[ index ] = first + 1; - m_uint32Values_mirror[ index + 1] = second + 1; + m_uint32Values[ index ] = *((uint32*)&value); + m_uint32Values[ index + 1 ] = *(((uint32*)&value) + 1); MarkForClientUpdate(); } } diff --git a/src/game/Objects/Object.h b/src/game/Objects/Object.h index 188d12bf7..671af52b1 100644 --- a/src/game/Objects/Object.h +++ b/src/game/Objects/Object.h @@ -553,6 +553,10 @@ class MANGOS_DLL_SPEC Object bool IsDeleted() const { return _deleted; } // Convertions + inline bool IsWorldObject() const { return isType(TYPEMASK_WORLDOBJECT); } + WorldObject* ToWorldObject() { if (IsWorldObject()) return reinterpret_cast(this); else return nullptr; } + WorldObject const* ToWorldObject() const { if (IsWorldObject()) return reinterpret_cast(this); else return nullptr; } + inline bool IsPlayer() const { return GetTypeId() == TYPEID_PLAYER; } Player* ToPlayer() { if (IsPlayer()) return reinterpret_cast(this); else return nullptr; } Player const* ToPlayer() const { if (IsPlayer()) return reinterpret_cast(this); else return nullptr; } diff --git a/src/game/Objects/Player.cpp b/src/game/Objects/Player.cpp index 6e6274a4e..1c26b64e1 100644 --- a/src/game/Objects/Player.cpp +++ b/src/game/Objects/Player.cpp @@ -409,7 +409,8 @@ UpdateMask Player::updateVisualBits; Player::Player(WorldSession *session) : Unit(), m_mover(this), m_camera(this), m_reputationMgr(this), m_enableInstanceSwitch(true), m_currentTicketCounter(0), - m_honorMgr(this), m_bNextRelocationsIgnored(0) + m_honorMgr(this), m_bNextRelocationsIgnored(0), + m_pendingInstanceSwitch(false) { m_objectType |= TYPEMASK_PLAYER; m_objectTypeId = TYPEID_PLAYER; @@ -1151,6 +1152,20 @@ void Player::SetDrunkValue(uint16 newDrunkenValue, uint32 itemId) m_detectInvisibilityMask &= ~(1 << 6); } +// Used to update attacker creatures (including pets' attackers) combat status when a player switches map +struct UpdateAttackersCombatHelper +{ + explicit UpdateAttackersCombatHelper(Player* _player) : player(_player) {} + void operator()(Unit* unit) const + { + for (Unit* attacker : unit->getAttackers()) + if (Creature* creature = attacker->ToCreature()) + if (attacker->getVictim() == unit) + creature->SelectHostileTarget(); + } + Player* player; +}; + void Player::Update(uint32 update_diff, uint32 p_time) { if (!IsInWorld()) @@ -1359,7 +1374,14 @@ void Player::Update(uint32 update_diff, uint32 p_time) uint16 newInstanceId = sMapMgr.GetContinentInstanceId(GetMap()->GetId(), GetPositionX(), GetPositionY(), &transition); if (newInstanceId != GetInstanceId()) if (!transition || !isInCombat()) + { sMapMgr.ScheduleInstanceSwitch(this, newInstanceId); + + // Update attacker creatures combat status if needed + UpdateAttackersCombatHelper helper(this); + helper(this); + CallForAllControlledUnits(helper, CONTROLLED_PET | CONTROLLED_TOTEMS | CONTROLLED_GUARDIANS | CONTROLLED_CHARM); + } } if (IsInWorld()) { @@ -1778,18 +1800,20 @@ bool Player::SwitchInstance(uint32 newInstanceId) Map* oldmap = GetMap(); - // Leave transport - if (m_transport) + // Leave transport if absent from new instance + // normally it should have switched before the player + if (m_transport && m_transport->GetInstanceId() != newInstanceId) { m_transport->RemovePassenger(this); m_movementInfo.ClearTransportData(); + m_movementInfo.RemoveMovementFlag(MOVEFLAG_ONTRANSPORT); } // Stop duel if (duel) if (GameObject* obj = GetMap()->GetGameObject(GetGuidValue(PLAYER_DUEL_ARBITER))) DuelComplete(DUEL_FLED); // Fix movement flags - m_movementInfo.RemoveMovementFlag(MOVEFLAG_MASK_MOVING_OR_TURN | MOVEFLAG_ONTRANSPORT); + m_movementInfo.RemoveMovementFlag(MOVEFLAG_MASK_MOVING_OR_TURN); SetSelectionGuid(ObjectGuid()); CombatStop(); @@ -1970,6 +1994,11 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati ScheduledTeleportData *data = new ScheduledTeleportData(mapid, x, y, z, orientation, options, recover); sMapMgr.ScheduleFarTeleport(this, data); + + // Update attacker creatures combat status if needed + UpdateAttackersCombatHelper helper(this); + helper(this); + CallForAllControlledUnits(helper, CONTROLLED_PET | CONTROLLED_TOTEMS | CONTROLLED_GUARDIANS | CONTROLLED_CHARM); } return true; } @@ -12701,7 +12730,8 @@ void Player::AddQuest(Quest const *pQuest, Object *questGiver) // starting initial DB quest script if (pQuest->GetQuestStartScript() != 0) - GetMap()->ScriptsStart(sQuestStartScripts, pQuest->GetQuestStartScript(), questGiver, this); + if (WorldObject* pQuestGiver = questGiver->ToWorldObject()) + GetMap()->ScriptsStart(sQuestStartScripts, pQuest->GetQuestStartScript(), pQuestGiver, this); } diff --git a/src/game/Objects/Player.h b/src/game/Objects/Player.h index c1c436f3d..40906904e 100644 --- a/src/game/Objects/Player.h +++ b/src/game/Objects/Player.h @@ -1697,6 +1697,7 @@ class MANGOS_DLL_SPEC Player final: public Unit bool IsBeingTeleported() const { return mSemaphoreTeleport_Near || mSemaphoreTeleport_Far || mPendingFarTeleport; } bool IsBeingTeleportedNear() const { return mSemaphoreTeleport_Near; } bool IsBeingTeleportedFar() const { return mSemaphoreTeleport_Far; } + bool IsPendingFarTeleport() const { return mPendingFarTeleport; } void SetSemaphoreTeleportNear(bool semphsetting); void SetSemaphoreTeleportFar(bool semphsetting); void SetPendingFarTeleport(bool pending) { mPendingFarTeleport = pending; } @@ -2177,8 +2178,11 @@ class MANGOS_DLL_SPEC Player final: public Unit inline bool HasScheduledEvent() const { return m_Events.HasScheduledEvent(); } void SetAutoInstanceSwitch(bool v) { m_enableInstanceSwitch = v; } + void SetPendingInstanceSwitch(bool v) { m_pendingInstanceSwitch = v; } + bool IsPendingInstanceSwitch() const { return m_pendingInstanceSwitch; } protected: bool m_enableInstanceSwitch; + bool m_pendingInstanceSwitch; uint32 m_skippedUpdateTime; uint32 m_DetectInvTimer; diff --git a/src/game/Objects/TemporarySummon.cpp b/src/game/Objects/TemporarySummon.cpp index 8678733ef..7143e0e9d 100644 --- a/src/game/Objects/TemporarySummon.cpp +++ b/src/game/Objects/TemporarySummon.cpp @@ -200,19 +200,20 @@ void TemporarySummon::Update(uint32 update_diff, uint32 diff) break; } - /* Potential hack to force updates at target index if it is not networked normally - if (isAlive() && isInCombat() && m_forceTargetUpdateTimer) + if (isAlive() && isInCombat()) { if (m_forceTargetUpdateTimer <= diff) { - m_forceTargetUpdateTimer = 0; - // 64bit value, so it fills two indexes in the 32bit value mapping + m_forceTargetUpdateTimer = 3000; ForceValuesUpdateAtIndex(UNIT_FIELD_TARGET); - ForceValuesUpdateAtIndex(UNIT_FIELD_TARGET+1) } else m_forceTargetUpdateTimer -= diff; - }*/ + } + else { + m_forceTargetUpdateTimer = 1000; + } + Creature::Update(update_diff, diff); } diff --git a/src/game/Objects/Unit.cpp b/src/game/Objects/Unit.cpp index 389772454..a3d615094 100644 --- a/src/game/Objects/Unit.cpp +++ b/src/game/Objects/Unit.cpp @@ -4319,10 +4319,10 @@ bool Unit::RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder *holder) if (is_spellSpecPerTarget || (is_spellSpecPerTargetPerCaster && holder->GetCasterGuid() == (*i).second->GetCasterGuid())) { - // cannot remove stronger snare / haste debuff - if (spellId_spec == SPELL_SNARE || spellId_spec == SPELL_NEGATIVE_HASTE) - if (!CompareSpellSpecificAuras(spellProto, i_spellProto)) - return false; + // cannot remove stronger snare / haste debuff + if (spellId_spec == SPELL_SNARE || spellId_spec == SPELL_NEGATIVE_HASTE) + if (!CompareSpellSpecificAuras(spellProto, i_spellProto)) + return false; // cannot remove higher rank if (sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId)) @@ -7405,8 +7405,20 @@ bool Unit::isTargetableForAttack(bool inverseAlive /*=false*/) const if (!CanBeDetected()) return false; - if (GetTypeId() == TYPEID_PLAYER && (((Player *)this)->isGameMaster() || ((Player*)this)->watching_cinematic_entry != 0)) - return false; + if (const Player* player = GetCharmerOrOwnerPlayerOrPlayerItself()) + { + if (player->isGameMaster()) + return false; + + // in such case, unlike a creature, a charmed Player can be targeted even if his charmer can't + if (const Player* charmedPlayer = ToPlayer()) + player = charmedPlayer; + + if (player->watching_cinematic_entry != 0 || + player->IsPendingFarTeleport() || + player->IsPendingInstanceSwitch()) + return false; + } if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE)) return false; diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp index c6607aad8..b99b6f74d 100644 --- a/src/game/ScriptMgr.cpp +++ b/src/game/ScriptMgr.cpp @@ -28,6 +28,7 @@ #include "SpellAuras.h" #include "ScriptLoader.h" #include "Conditions.h" +#include "GameEventMgr.h" typedef std::vector ScriptVector; int num_sc_scripts; @@ -41,6 +42,7 @@ ScriptMapMap sGameObjectScripts; ScriptMapMap sEventScripts; ScriptMapMap sGossipScripts; ScriptMapMap sCreatureMovementScripts; +ScriptMapMap sCreatureAIScripts; INSTANTIATE_SINGLETON_1(ScriptMgr); @@ -64,7 +66,8 @@ ScriptMgr::~ScriptMgr() void ScriptMgr::DisableScriptAction(ScriptInfo& script) { script.command = SCRIPT_COMMAND_DISABLED; - script.buddy_id = 0; + script.target_param1 = 0; + script.condition = 0; } void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) @@ -77,7 +80,7 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) scripts.clear(); // need for reload support // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - QueryResult *result = WorldDatabase.PQuery("SELECT id, delay, command, datalong, datalong2, datalong3, datalong4, buddy_id, buddy_radius, buddy_type, data_flags, dataint, dataint2, dataint3, dataint4, x, y, z, o, condition_id FROM %s", tablename); + QueryResult *result = WorldDatabase.PQuery("SELECT id, delay, command, datalong, datalong2, datalong3, datalong4, target_param1, target_param2, target_type, data_flags, dataint, dataint2, dataint3, dataint4, x, y, z, o, condition_id FROM %s", tablename); uint32 count = 0; @@ -107,9 +110,9 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) tmp.raw.data[2] = fields[5].GetUInt32(); tmp.raw.data[3] = fields[6].GetUInt32(); - tmp.buddy_id = fields[7].GetUInt32(); - tmp.buddy_radius = fields[8].GetUInt32(); - tmp.buddy_type = fields[9].GetUInt8(); + tmp.target_param1 = fields[7].GetUInt32(); + tmp.target_param2 = fields[8].GetUInt32(); + tmp.target_type = fields[9].GetUInt8(); tmp.raw.data[4] = fields[10].GetUInt32(); tmp.raw.data[5] = fields[11].GetInt32(); @@ -128,95 +131,90 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) continue; } - if (tmp.buddy_id) + switch (tmp.target_type) { - switch (tmp.buddy_type) + case TARGET_T_CREATURE_WITH_ENTRY: { - case BUDDY_TYPE_CREATURE_ENTRY: + if (!ObjectMgr::GetCreatureTemplate(tmp.target_param1)) { - if (!ObjectMgr::GetCreatureTemplate(tmp.buddy_id)) + if (!sObjectMgr.IsExistingCreatureId(tmp.target_param1)) { - if (!sObjectMgr.IsExistingCreatureId(tmp.buddy_id)) - { - sLog.outErrorDb("Table `%s` has buddy_id = %u for script id %u, but this creature_template does not exist.", tablename, tmp.buddy_id, tmp.id); - continue; - } - else - DisableScriptAction(tmp); - } - if (!tmp.buddy_radius) - { - sLog.outErrorDb("Table `%s` has buddy_id = %u for script id %u, but search radius is too small (buddy_radius = %u).", tablename, tmp.buddy_id, tmp.id, tmp.buddy_radius); + sLog.outErrorDb("Table `%s` has target_param1 = %u for script id %u, but this creature_template does not exist.", tablename, tmp.target_param1, tmp.id); continue; } - break; + else + DisableScriptAction(tmp); } - case BUDDY_TYPE_CREATURE_GUID: + if (!tmp.target_param2) { - if (!sObjectMgr.GetCreatureData(tmp.buddy_id)) + sLog.outErrorDb("Table `%s` has target_param1 = %u for script id %u, but search radius is too small (target_param2 = %u).", tablename, tmp.target_param1, tmp.id, tmp.target_param2); + continue; + } + break; + } + case TARGET_T_CREATURE_WITH_GUID: + { + if (!sObjectMgr.GetCreatureData(tmp.target_param1)) + { + if (!sObjectMgr.IsExistingCreatureGuid(tmp.target_param1)) { - if (!sObjectMgr.IsExistingCreatureGuid(tmp.buddy_id)) - { - sLog.outErrorDb("Table `%s` has buddy_id = %u for script id %u, but this creature guid does not exist.", tablename, tmp.buddy_id, tmp.id); - continue; - } - else - DisableScriptAction(tmp); + sLog.outErrorDb("Table `%s` has target_param1 = %u for script id %u, but this creature guid does not exist.", tablename, tmp.target_param1, tmp.id); + continue; } - break; + else + DisableScriptAction(tmp); } - case BUDDY_TYPE_GAMEOBJECT_ENTRY: + break; + } + case TARGET_T_GAMEOBJECT_WITH_ENTRY: + { + if (!ObjectMgr::GetGameObjectInfo(tmp.target_param1)) { - if (!ObjectMgr::GetGameObjectInfo(tmp.buddy_id)) + if (!sObjectMgr.IsExistingGameObjectId(tmp.target_param1)) { - if (!sObjectMgr.IsExistingGameObjectId(tmp.buddy_id)) - { - sLog.outErrorDb("Table `%s` has buddy_id = %u for script id %u, but this gameobject_template does not exist.", tablename, tmp.buddy_id, tmp.id); - continue; - } - else - DisableScriptAction(tmp); + sLog.outErrorDb("Table `%s` has target_param1 = %u for script id %u, but this gameobject_template does not exist.", tablename, tmp.target_param1, tmp.id); + continue; } - break; + else + DisableScriptAction(tmp); } - case BUDDY_TYPE_GAMEOBJECT_GUID: + break; + } + case TARGET_T_GAMEOBJECT_WITH_GUID: + { + GameObjectData const* data = sObjectMgr.GetGOData(tmp.target_param1); + if (!data) { - GameObjectData const* data = sObjectMgr.GetGOData(tmp.buddy_id); - if (!data) + if (!sObjectMgr.IsExistingGameObjectGuid(tmp.target_param1)) { - if (!sObjectMgr.IsExistingGameObjectGuid(tmp.buddy_id)) - { - sLog.outErrorDb("Table `%s` has buddy_id = %u for script id %u, but this gameobject guid does not exist.", tablename, tmp.buddy_id, tmp.id); - continue; - } - else - { - DisableScriptAction(tmp); - break; - } - + sLog.outErrorDb("Table `%s` has target_param1 = %u for script id %u, but this gameobject guid does not exist.", tablename, tmp.target_param1, tmp.id); + continue; + } + else + { + DisableScriptAction(tmp); + break; } - GameObjectInfo const* info = ObjectMgr::GetGameObjectInfo(data->id); - if (!info) - { - sLog.outErrorDb("Table `%s` has buddy_id = %u for script id %u, but this guid is for a non-existent gameobject entry %u.", tablename, tmp.buddy_id, tmp.id, data->id); - continue; - } - break; } - case BUDDY_TYPE_CREATURE_INSTANCE_DATA: - case BUDDY_TYPE_GAMEOBJECT_INSTANCE_DATA: - break; - default: + + GameObjectInfo const* info = ObjectMgr::GetGameObjectInfo(data->id); + if (!info) { - sLog.outError("Table `%s` has an unknown buddy_type = %u used for script id %u.", tablename, tmp.buddy_type, tmp.id); - break; + sLog.outErrorDb("Table `%s` has target_param1 = %u for script id %u, but this guid is for a non-existent gameobject entry %u.", tablename, tmp.target_param1, tmp.id, data->id); + continue; } + break; + } + default: + { + if (tmp.target_type >= TARGET_T_END) + sLog.outError("Table `%s` has an unknown target_type = %u used for script id %u.", tablename, tmp.target_type, tmp.id); + break; } } - if (!tmp.buddy_id && (tmp.raw.data[4] & SF_GENERAL_SWAP_INITIAL_TARGETS) && (tmp.raw.data[4] & SF_GENERAL_SWAP_FINAL_TARGETS)) + if (!tmp.target_type && (tmp.raw.data[4] & SF_GENERAL_SWAP_INITIAL_TARGETS) && (tmp.raw.data[4] & SF_GENERAL_SWAP_FINAL_TARGETS)) { sLog.outErrorDb("Table `%s` has nonsensical flag combination (data_flags = %u) without a buddy for script id %u", tablename, tmp.moveTo.flags, tmp.id); continue; @@ -477,12 +475,15 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) tablename, tmp.castSpell.spellId, tmp.id); continue; } - if (tmp.castSpell.flags & ~0x3) + if (tmp.castSpell.flags & ~ALL_CAST_FLAGS) { - sLog.outErrorDb("Table `%s` using unknown flags in datalong2 (%u)i n SCRIPT_COMMAND_CAST_SPELL for script id %u", + sLog.outErrorDb("Table `%s` using unknown flags in datalong2 (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", tablename, tmp.castSpell.flags, tmp.id); continue; } + // Cast is always triggered if target is forced to cast on self + if (tmp.castSpell.flags & CF_TARGET_CASTS_ON_SELF) + tmp.castSpell.flags |= CF_TRIGGERED; break; } case SCRIPT_COMMAND_REMOVE_ITEM: @@ -674,7 +675,7 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) } case SCRIPT_COMMAND_MODIFY_THREAT: { - if (tmp.modThreat.target >= SO_MODIFYTHREAT_MAX_TARGETS) + if (tmp.modThreat.target > SO_MODIFYTHREAT_ALL_ATTACKERS) { sLog.outErrorDb("Table `%s` has invalid target type (datalong = %u) in SCRIPT_COMMAND_MODIFY_THREAT for script id %u", tablename, tmp.modThreat.target, tmp.id); continue; @@ -802,6 +803,98 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) break; } + case SCRIPT_COMMAND_SET_PHASE: + { + if (tmp.setPhase.phase >= 32) // Max EventAI phase. + { + sLog.outErrorDb("Table `%s` has datalong = %u above maximum allowed phase in SCRIPT_COMMAND_SET_PHASE for script id %u.", tablename, tmp.setPhase.phase, tmp.id); + continue; + } + if (tmp.setPhase.mode >= SO_SETPHASE_MAX) + { + sLog.outErrorDb("Table `%s` has invalid option datalong2 = %u in SCRIPT_COMMAND_SET_PHASE for script id %u.", tablename, tmp.setPhase.mode, tmp.id); + continue; + } + break; + } + case SCRIPT_COMMAND_SET_PHASE_RANDOM: + { + bool error = false; + for (uint8 i = 0; i < 4; i++) + { + if (tmp.setPhaseRandom.phase[i] >= 32) // Max EventAI phase. + { + sLog.outErrorDb("Table `%s` has datalong%u = %u above maximum allowed phase in SCRIPT_COMMAND_SET_PHASE_RANDOM for script id %u.", tablename, i, tmp.setPhaseRandom.phase[i], tmp.id); + error = true; + break; + } + } + + if (error) + continue; + + break; + } + case SCRIPT_COMMAND_SET_PHASE_RANGE: + { + if (tmp.setPhaseRange.phaseMax >= 32) // Max EventAI phase. + { + sLog.outErrorDb("Table `%s` has datalong2 = %u above maximum allowed phase in SCRIPT_COMMAND_SET_PHASE_RANGE for script id %u.", tablename, tmp.setPhaseRange.phaseMax, tmp.id); + continue; + } + if (tmp.setPhaseRange.phaseMin >= tmp.setPhaseRange.phaseMax) + { + sLog.outErrorDb("Table `%s` has phase_min (datalong=%u) >= phase_max (datalong2=%u) in SCRIPT_COMMAND_SET_PHASE_RANGE for script id %u.", tablename, tmp.setPhaseRange.phaseMin, tmp.setPhaseRange.phaseMax, tmp.id); + continue; + } + break; + } + case SCRIPT_COMMAND_DEAL_DAMAGE: + { + if (tmp.dealDamage.damage == 0) + { + sLog.outErrorDb("Table `%s` has datalong = %u in SCRIPT_COMMAND_DEAL_DAMAGE for script id %u.", tablename, tmp.dealDamage.damage, tmp.id); + continue; + } + if (tmp.dealDamage.isPercent) + { + if (tmp.dealDamage.damage > 100) + { + sLog.outErrorDb("Table `%s` has datalong = %u above 100% with datalong2 = %u in SCRIPT_COMMAND_DEAL_DAMAGE for script id %u.", tablename, tmp.dealDamage.damage, tmp.dealDamage.isPercent, tmp.id); + continue; + } + } + break; + } + case SCRIPT_COMMAND_SET_SHEATH: + { + if (tmp.setSheath.sheathState >= MAX_SHEATH_STATE) + { + sLog.outErrorDb("Table `%s` has datalong = %u above maximum sheath state in SCRIPT_COMMAND_SET_SHEATH for script id %u.", tablename, tmp.setSheath.sheathState, tmp.id); + continue; + } + break; + } + case SCRIPT_COMMAND_INVINCIBILITY: + { + if (tmp.invincibility.isPercent) + { + if (tmp.invincibility.health > 100) + { + sLog.outErrorDb("Table `%s` has datalong = %u above 100% with datalong2 = %u in SCRIPT_COMMAND_INVINCIBILITY for script id %u.", tablename, tmp.invincibility.health, tmp.invincibility.isPercent, tmp.id); + continue; + } + } + break; + } + case SCRIPT_COMMAND_GAME_EVENT: + { + if (!sGameEventMgr.IsValidEvent(tmp.gameEvent.eventId)) + { + sLog.outErrorDb("Table `%s` has datalong = %u for a non-existing game event in SCRIPT_COMMAND_GAME_EVENT for script id %u.", tablename, tmp.gameEvent.eventId, tmp.id); + continue; + } + } } if (scripts.find(tmp.id) == scripts.end()) @@ -932,6 +1025,59 @@ void ScriptMgr::LoadCreatureMovementScripts() // checks are done in WaypointManager::Load } +void ScriptMgr::LoadCreatureEventAIScripts() +{ + LoadScripts(sCreatureAIScripts, "creature_ai_scripts"); + + + QueryResult* result; + Field* fields; + + // Check for scripts with delay, which is not supported for this table. + for (uint8 i = 1; i <= 3; i++) + { + result = WorldDatabase.Query("SELECT DISTINCT id FROM creature_ai_scripts WHERE delay != 0"); + + if (result) + { + do + { + fields = result->Fetch(); + uint32 scriptId = fields[0].GetUInt32(); + sLog.outErrorDb("Table `creature_ai_scripts` has script (Id: %u) with delay!=0 but this is not supported for creature AI events.", scriptId); + } while (result->NextRow()); + delete result; + } + } + + // Get all script Ids referenced in creature_ai_events table. + std::set actionIds; + for (uint8 i = 1; i <= 3; i++) + { + result = WorldDatabase.PQuery("SELECT action%u_script FROM creature_ai_events", i); + + if (result) + { + do + { + fields = result->Fetch(); + uint32 scriptId = fields[0].GetUInt32(); + if (scriptId) + actionIds.insert(scriptId); + } while (result->NextRow()); + delete result; + } + } + + // Then check if all scripts are in above list of used script Ids. + for (ScriptMapMap::const_iterator itr = sCreatureAIScripts.begin(); itr != sCreatureAIScripts.end(); ++itr) + { + std::set::const_iterator itr2 = actionIds.find(itr->first); + if (itr2 == actionIds.end()) + sLog.outErrorDb("Table `creature_ai_scripts` has script (Id: %u) not used by any creature AI events.", itr->first); + } +} + void ScriptMgr::CheckAllScriptTexts() { CheckScriptTexts(sQuestEndScripts); @@ -942,6 +1088,7 @@ void ScriptMgr::CheckAllScriptTexts() CheckScriptTexts(sEventScripts); CheckScriptTexts(sGossipScripts); CheckScriptTexts(sCreatureMovementScripts); + CheckScriptTexts(sCreatureAIScripts); sWaypointMgr.CheckTextsExistance(); } @@ -1779,31 +1926,11 @@ void ScriptMgr::CollectPossibleEventIds(std::set& eventIds) } } } - - // Load all possible script entries from EventAI. - // Has to be done with a query because it's loaded later. - QueryResult* result; - Field* fields; - for (uint8 i = 1; i <= 3; i++) - { - result = WorldDatabase.PQuery("SELECT action%u_param1 FROM creature_ai_scripts WHERE action%u_type=50", i, i); - - if (result) - { - do - { - fields = result->Fetch(); - uint32 eventId = fields[0].GetUInt32(); - if (eventId) - eventIds.insert(eventId); - } while (result->NextRow()); - delete result; - } - } // Load all possible script entries from SCRIPT_COMMAND_START_SCRIPT. - const char* script_tables[8] = + const char* script_tables[9] = { + "creature_ai_scripts", "creature_movement_scripts", "creature_spells_scripts", "event_scripts", @@ -1814,7 +1941,10 @@ void ScriptMgr::CollectPossibleEventIds(std::set& eventIds) "quest_start_scripts" }; - for (uint8 i = 0; i < 8; i++) + QueryResult* result; + Field* fields; + + for (uint8 i = 0; i < 9; i++) { result = WorldDatabase.PQuery("SELECT datalong, datalong2, datalong3, datalong4 FROM %s WHERE command=39", script_tables[i]); diff --git a/src/game/ScriptMgr.h b/src/game/ScriptMgr.h index 6883e1210..84c499037 100644 --- a/src/game/ScriptMgr.h +++ b/src/game/ScriptMgr.h @@ -25,22 +25,19 @@ #include "ObjectGuid.h" #include "DBCEnums.h" #include "ace/Atomic_Op.h" +#include "SpellMgr.h" +#include "Creature.h" struct AreaTriggerEntry; class Aura; -class Creature; class CreatureAI; class GameObject; class GameObjectAI; class InstanceData; class Item; class Map; -class Object; -class Player; class Quest; class SpellCastTargets; -class Unit; -class WorldObject; // Legend: // source - the type of object which executes the command @@ -99,9 +96,10 @@ enum eScriptCommand // datalong2 = despawn_delay // datalong3 = unique_limit // datalong4 = unique_distance - // data_flags = eSummonCreatureFlags - // dataint = (bool) setRun; 0 = off (default), 1 = on + // dataint = eSummonCreatureFlags // dataint2 = eSummonCreatureFacingOptions + // dataint3 = attack_target (see enum Target) + // dataint4 = despawn_type (see enum TempSummonType) // x/y/z/o = coordinates SCRIPT_COMMAND_OPEN_DOOR = 11, // source = GameObject (from datalong, provided source or target) // If provided target is BUTTON GameObject, command is run on it too. @@ -198,6 +196,40 @@ enum eScriptCommand // datalong2 = amount SCRIPT_COMMAND_REMOVE_OBJECT = 41, // source = GameObject // target = Unit + SCRIPT_COMMAND_SET_MELEE_ATTACK = 42, // source = Creature + // datalong = (bool) 0 = off, 1 = on + SCRIPT_COMMAND_SET_COMBAT_MOVEMENT = 43, // source = Creature + // datalong = (bool) 0 = off, 1 = on + SCRIPT_COMMAND_SET_PHASE = 44, // source = Creature + // datalong = phase + // datalong2 = eSetPhaseOptions + SCRIPT_COMMAND_SET_PHASE_RANDOM = 45, // source = Creature + // datalong1-4 = phase + SCRIPT_COMMAND_SET_PHASE_RANGE = 46, // source = Creature + // datalong = phase_min + // datalong2 = phase_max + SCRIPT_COMMAND_FLEE = 47, // source = Creature + // datalong = seek_assistance (bool) 0 = off, 1 = on + SCRIPT_COMMAND_DEAL_DAMAGE = 48, // source = Unit + // target = Unit + // datalong = damage + // datalong2 = (bool) is_percent + SCRIPT_COMMAND_ZONE_COMBAT_PULSE = 49, // source = Creature + // datalong = (bool) initialPulse + SCRIPT_COMMAND_CALL_FOR_HELP = 50, // source = Creature + // x = radius + SCRIPT_COMMAND_SET_SHEATH = 51, // source = Unit + // datalong = see enum SheathState + SCRIPT_COMMAND_INVINCIBILITY = 52, // source = Creature + // datalong = health + // datalong2 = (bool) is_percent + SCRIPT_COMMAND_GAME_EVENT = 53, // source = None + // datalong = event_id + // datalong2 = (bool) start + // datalong3 = (bool) overwrite + SCRIPT_COMMAND_SET_SERVER_VARIABLE = 54, // source = None + // datalong = index + // datalong2 = value SCRIPT_COMMAND_MAX, SCRIPT_COMMAND_DISABLED = 9999 // Script action was disabled during loading. @@ -235,9 +267,10 @@ enum eModifyFlagsOptions // Must start from 0x8 because of target selection flags. enum eSummonCreatureFlags { - SF_SUMMONCREATURE_ACTIVE = 0x10, // active creatures are always updated - SF_SUMMONCREATURE_UNIQUE = 0x20, // not actually unique, just checks for same entry in certain range - SF_SUMMONCREATURE_UNIQUE_TEMP = 0x40 // same as 0x10 but check for TempSummon only creatures + SF_SUMMONCREATURE_SET_RUN = 0x1, // makes creature move at run speed + SF_SUMMONCREATURE_ACTIVE = 0x2, // active creatures are always updated + SF_SUMMONCREATURE_UNIQUE = 0x4, // not actually unique, just checks for same entry in certain range + SF_SUMMONCREATURE_UNIQUE_TEMP = 0x8 // same as 0x10 but check for TempSummon only creatures }; // Possible dataint2 values for SCRIPT_COMMAND_TEMP_SUMMON_CREATURE @@ -247,13 +280,6 @@ enum eSummonCreatureFacingOptions SO_SUMMONCREATURE_FACE_TARGET = 2 // Creature will face the provided target object. }; -// Flags used by SCRIPT_COMMAND_CAST_SPELL -enum eCastSpellFlags -{ - SF_CASTSPELL_TRIGGERED = 0x1, // Triggered spells skip checks. - SF_CASTSPELL_INTERRUPT_PREVIOUS = 0x2 // Will interrupt the current spell cast. -}; - // Flags used by SCRIPT_COMMAND_PLAY_SOUND enum ePlaySoundFlags { @@ -264,11 +290,8 @@ enum ePlaySoundFlags // Possible datalong values for SCRIPT_COMMAND_MODIFY_THREAT enum eModifyThreatTargets { - SO_MODIFYTHREAT_PROVIDED_TARGET = 0, - SO_MODIFYTHREAT_CURRENT_VICTIM = 1, - SO_MODIFYTHREAT_ALL_ATTACKERS = 2, - - SO_MODIFYTHREAT_MAX_TARGETS + // 0 to 5 from Target enum. + SO_MODIFYTHREAT_ALL_ATTACKERS = 6 }; // Possible datalong3 values for SCRIPT_COMMAND_TERMINATE_SCRIPT @@ -310,15 +333,14 @@ enum eSetInstData64Options SO_INSTDATA64_MAX }; -// Values used in buddy_type column -enum eBuddyType +// Possible datalong values for SCRIPT_COMMAND_SET_PHASE +enum eSetPhaseOptions { - BUDDY_TYPE_CREATURE_ENTRY = 0, - BUDDY_TYPE_CREATURE_GUID = 1, - BUDDY_TYPE_CREATURE_INSTANCE_DATA = 2, - BUDDY_TYPE_GAMEOBJECT_ENTRY = 3, - BUDDY_TYPE_GAMEOBJECT_GUID = 4, - BUDDY_TYPE_GAMEOBJECT_INSTANCE_DATA = 5, + SO_SETPHASE_RAW = 0, + SO_SETPHASE_INCREMENT = 1, + SO_SETPHASE_DECREMENT = 2, + + SO_SETPHASE_MAX }; enum eDataFlags @@ -415,9 +437,11 @@ struct ScriptInfo uint32 despawnDelay; // datalong2 uint32 uniqueLimit; // datalong3 uint32 uniqueDistance; // datalong4 - uint32 flags; // data_flags - int32 setRun; // dataint + uint32 unused; // data_flags + int32 flags; // dataint int32 facingLogic; // dataint2 + int32 attackTarget; // dataint3 + int32 despawnType; // dataint4 } summonCreature; struct // SCRIPT_COMMAND_OPEN_DOOR (11) @@ -590,22 +614,91 @@ struct ScriptInfo // SCRIPT_COMMAND_REMOVE_OBJECT (41) + struct // SCRIPT_COMMAND_SET_MELEE_ATTACK (42) + { + uint32 enabled; // datalong + } enableMelee; + + struct // SCRIPT_COMMAND_SET_COMBAT_MOVEMENT (43) + { + uint32 enabled; // datalong + } combatMovement; + + struct // SCRIPT_COMMAND_SET_PHASE (44) + { + uint32 phase; // datalong + uint32 mode; // datalong2 + } setPhase; + + struct // SCRIPT_COMMAND_SET_PHASE_RANDOM (45) + { + uint32 phase[MAX_TEXT_ID]; // datalong + } setPhaseRandom; + + struct // SCRIPT_COMMAND_SET_PHASE_RANGE (46) + { + uint32 phaseMin; // datalong + uint32 phaseMax; // datalong2 + } setPhaseRange; + + struct // SCRIPT_COMMAND_FLEE (47) + { + uint32 seekAssistance; // datalong + } flee; + + struct // SCRIPT_COMMAND_DEAL_DAMAGE (48) + { + uint32 damage; // datalong + uint32 isPercent; // datalong2 + } dealDamage; + + struct // SCRIPT_COMMAND_ZONE_COMBAT_PULSE (49) + { + uint32 initialPulse; // datalong + } combatPulse; + + // SCRIPT_COMMAND_CALL_FOR_HELP (50) + + struct // SCRIPT_COMMAND_SET_SHEATH (51) + { + uint32 sheathState; // datalong + } setSheath; + + struct // SCRIPT_COMMAND_INVINCIBILITY (52) + { + uint32 health; // datalong + uint32 isPercent; // datalong2 + } invincibility; + + struct // SCRIPT_COMMAND_GAME_EVENT (53) + { + uint32 eventId; // datalong + uint32 start; // datalong2 + uint32 overwrite; // datalong3 + } gameEvent; + + struct // SCRIPT_COMMAND_SET_SERVER_VARIABLE (54) + { + uint32 index; // datalong + uint32 value; // datalong2 + } serverVariable; + struct { uint32 data[9]; } raw; }; - uint32 buddy_id; - uint32 buddy_radius; - uint8 buddy_type; + uint32 target_param1; + uint32 target_param2; + uint8 target_type; float x; float y; float z; float o; - ScriptInfo() : id(0), delay(0), command(0), condition(0), buddy_id(0), buddy_radius(0), buddy_type(0), x(0), y(0), z(0), o(0) + ScriptInfo() : id(0), delay(0), command(0), condition(0), target_param1(0), target_param2(0), target_type(0), x(0), y(0), z(0), o(0) { memset(raw.data, 0, sizeof(raw.data)); } @@ -627,15 +720,13 @@ struct ScriptAction { ObjectGuid sourceGuid; ObjectGuid targetGuid; - ObjectGuid ownerGuid; // owner of source if source is item ScriptInfo const* script; // pointer to static script data - bool IsSameScript(uint32 id, ObjectGuid sourceGuid, ObjectGuid targetGuid, ObjectGuid ownerGuid) const + bool IsSameScript(uint32 id, ObjectGuid sourceGuid, ObjectGuid targetGuid) const { return id == script->id && (sourceGuid == this->sourceGuid || !sourceGuid) && - (targetGuid == this->targetGuid || !targetGuid) && - (ownerGuid == this->ownerGuid || !ownerGuid); + (targetGuid == this->targetGuid || !targetGuid); } }; @@ -650,6 +741,7 @@ extern ScriptMapMap sGameObjectScripts; extern ScriptMapMap sEventScripts; extern ScriptMapMap sGossipScripts; extern ScriptMapMap sCreatureMovementScripts; +extern ScriptMapMap sCreatureAIScripts; #define MAX_SCRIPTS 5000 //72 bytes each (approx 351kb) #define VISIBLE_RANGE (166.0f) //MAX visible range (size of grid) @@ -663,6 +755,112 @@ extern ScriptMapMap sCreatureMovementScripts; #define TEXT_SOURCE_CUSTOM_START TEXT_SOURCE_RANGE*2 #define TEXT_SOURCE_CUSTOM_END TEXT_SOURCE_RANGE*3 + 1 +enum CastFlags +{ + CF_INTERRUPT_PREVIOUS = 0x01, //Interrupt any spell casting + CF_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time) + CF_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range + CF_MAIN_RANGED_SPELL = 0x08, //To be used by ranged mobs only. Creature will not chase target until cast fails. + CF_TARGET_CASTS_ON_SELF = 0x10, //Forces the target to cast this spell on itself + CF_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell +}; + +#define ALL_CAST_FLAGS (CF_INTERRUPT_PREVIOUS | CF_TRIGGERED | CF_FORCE_CAST | CF_MAIN_RANGED_SPELL | CF_TARGET_CASTS_ON_SELF | CF_AURA_NOT_PRESENT) + +// Values used in target_type column +enum ScriptTarget +{ + TARGET_T_PROVIDED_TARGET = 0, //Object that was provided to the command + + TARGET_T_HOSTILE = 1, //Our current target (ie: highest aggro) + TARGET_T_HOSTILE_SECOND_AGGRO = 2, //Second highest aggro (generaly used for cleaves and some special attacks) + TARGET_T_HOSTILE_LAST_AGGRO = 3, //Dead last on aggro (no idea what this could be used for) + TARGET_T_HOSTILE_RANDOM = 4, //Just any random target on our threat list + TARGET_T_HOSTILE_RANDOM_NOT_TOP = 5, //Any random target except top threat + + TARGET_T_OWNER_OR_SELF = 6, //Either self or owner if pet or controlled + TARGET_T_OWNER = 7, //The owner of the source + + + TARGET_T_CREATURE_WITH_ENTRY = 8, //Searches for nearby creature with the given entry + //Param1 = creature_entry + //Param2 = search_radius + + TARGET_T_CREATURE_WITH_GUID = 9, //The creature with this database guid + //Param1 = db_guid + + TARGET_T_CREATURE_FROM_INSTANCE_DATA = 10, //Find creature by guid stored in instance data + //Param1 = instance_data_field + + TARGET_T_GAMEOBJECT_WITH_ENTRY = 11, //Searches for nearby gameobject with the given entry + //Param1 = gameobject_entry + //Param2 = search_radius + + TARGET_T_GAMEOBJECT_WITH_GUID = 12, //The gameobject with this database guid + //Param1 = db_guid + + TARGET_T_GAMEOBJECT_FROM_INSTANCE_DATA = 13, //Find gameobject by guid stored in instance data + //Param1 = instance_data_field + + TARGET_T_FRIENDLY = 14, //Random friendly unit. + //Param1 = spell_id (for range check) + //Param2 = (bool) exclude_self + + TARGET_T_FRIENDLY_INJURED = 15, //Friendly unit missing the most health. + //Param1 = spell_id (for range check) + //Param2 = hp_percent + TARGET_T_END +}; + +//Generic scripting functions +void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = nullptr, uint32 chatTypeOverride = 0); +void DoOrSimulateScriptTextForMap(int32 iTextEntry, uint32 uiCreatureEntry, Map* pMap, Creature* pCreatureSource = nullptr, Unit* pTarget = nullptr); + +// Returns a target based on the type specified. +inline WorldObject* GetTargetByType(WorldObject* pSource, WorldObject* pTarget, uint8 TargetType, uint32 Param1 = 0u, uint32 Param2 = 0u) +{ + switch (TargetType) + { + case TARGET_T_PROVIDED_TARGET: + return pTarget; + case TARGET_T_HOSTILE: + if (Unit* pUnitSource = ToUnit(pSource)) + return pUnitSource->getVictim(); + break; + case TARGET_T_HOSTILE_SECOND_AGGRO: + if (Creature* pCreatureSource = ToCreature(pSource)) + return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1); + break; + case TARGET_T_HOSTILE_LAST_AGGRO: + if (Creature* pCreatureSource = ToCreature(pSource)) + return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_BOTTOMAGGRO, 0); + break; + case TARGET_T_HOSTILE_RANDOM: + if (Creature* pCreatureSource = ToCreature(pSource)) + return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + break; + case TARGET_T_HOSTILE_RANDOM_NOT_TOP: + if (Creature* pCreatureSource = ToCreature(pSource)) + return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + break; + case TARGET_T_OWNER_OR_SELF: + if (Unit* pUnitSource = ToUnit(pSource)) + return pUnitSource->GetCharmerOrOwnerOrSelf(); + break; + case TARGET_T_OWNER: + if (Unit* pUnitSource = ToUnit(pSource)) + return pUnitSource->GetOwner(); + break; + case TARGET_T_FRIENDLY: + if (Unit* pUnitSource = ToUnit(pSource)) + return pUnitSource->SelectRandomFriendlyTarget(Param2 ? pUnitSource : nullptr, Param1 ? sSpellRangeStore.LookupEntry(sSpellMgr.GetSpellEntry(Param1)->rangeIndex)->maxRange : 30); + case TARGET_T_FRIENDLY_INJURED: + if (Creature* pCreatureSource = ToCreature(pSource)) + return pCreatureSource->DoSelectLowestHpFriendly(Param1 ? sSpellRangeStore.LookupEntry(sSpellMgr.GetSpellEntry(Param1)->rangeIndex)->maxRange : 30, Param2 ? Param2 : 50, true); + } + return nullptr; +} + //Spell targets used by SelectSpell enum SelectTarget { @@ -808,6 +1006,7 @@ class ScriptMgr void LoadCreatureSpellScripts(); void LoadGossipScripts(); void LoadCreatureMovementScripts(); + void LoadCreatureEventAIScripts(); void CheckAllScriptTexts(); @@ -926,10 +1125,6 @@ class ScriptMgr ACE_Atomic_Op m_scheduledScripts; }; -//Generic scripting text function -void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = nullptr, uint32 chatTypeOverride = 0); -void DoOrSimulateScriptTextForMap(int32 iTextEntry, uint32 uiCreatureEntry, Map* pMap, Creature* pCreatureSource = nullptr, Unit* pTarget = nullptr); - #define sScriptMgr MaNGOS::Singleton::Instance() MANGOS_DLL_SPEC uint32 GetAreaTriggerScriptId(uint32 triggerId); diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index 6a79498ed..94af2137b 100644 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -7258,7 +7258,7 @@ int Aura::CheckExclusiveWith(Aura const* other) const return 2; else if (other->GetModifier()->m_amount < GetModifier()->m_amount && GetModifier()->m_amount < 0) return 2; - + return 1; } diff --git a/src/game/Transports/Transport.cpp b/src/game/Transports/Transport.cpp index 56e2926c0..3a01a7045 100644 --- a/src/game/Transports/Transport.cpp +++ b/src/game/Transports/Transport.cpp @@ -280,7 +280,8 @@ bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z, fl { Map const* oldMap = GetMap(); - SetLocationInstanceId(sMapMgr.GetContinentInstanceId(newMapid, x, y)); + uint32 newInstanceId = sMapMgr.GetContinentInstanceId(newMapid, x, y); + SetLocationInstanceId(newInstanceId); Map* newMap = sMapMgr.CreateMap(newMapid, this); GetMap()->Remove(this, false); SetMap(newMap); @@ -328,8 +329,17 @@ bool Transport::TeleportTransport(uint32 newMapid, float x, float y, float z, fl player->RemoveSpellsCausingAura(SPELL_AURA_MOD_FEAR); player->CombatStopWithPets(true); - player->TeleportTo(newMapid, destX, destY, destZ, destO, - TELE_TO_NOT_LEAVE_TRANSPORT); + // No need for teleport packet if no map change + // The client still shows the correct loading screen when one is needed (Grom'Gol-Undercity) + if (newMapid == player->GetMapId()) + { + player->TeleportPositionRelocation(destX, destY, destZ, destO); + if (newInstanceId != player->GetInstanceId()) + sMapMgr.ScheduleInstanceSwitch(player, newInstanceId); + } + else + player->TeleportTo(newMapid, destX, destY, destZ, destO, + TELE_TO_NOT_LEAVE_TRANSPORT); break; } diff --git a/src/game/World.cpp b/src/game/World.cpp index 54a6e03f6..be846a135 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1562,17 +1562,15 @@ void World::SetInitialWorldSettings() sScriptMgr.LoadCreatureSpellScripts(); sScriptMgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) sScriptMgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) + sScriptMgr.LoadCreatureEventAIScripts(); sLog.outString(">>> Scripts loaded"); sLog.outString(); sLog.outString("Checking all script texts..."); // must be after Load*Scripts calls sScriptMgr.CheckAllScriptTexts(); - sLog.outString("Loading CreatureEventAI Summons..."); - sEventAIMgr.LoadCreatureEventAI_Summons(false); // false, will checked in LoadCreatureEventAI_Scripts - - sLog.outString("Loading CreatureEventAI Scripts..."); - sEventAIMgr.LoadCreatureEventAI_Scripts(); + sLog.outString("Loading CreatureEventAI Events..."); + sEventAIMgr.LoadCreatureEventAI_Events(); sLog.outString("Initializing Scripts..."); sScriptMgr.Initialize(); diff --git a/src/scripts/custom/npc_j_eevee.cpp b/src/scripts/custom/npc_j_eevee.cpp index 689e015df..24c37335b 100644 --- a/src/scripts/custom/npc_j_eevee.cpp +++ b/src/scripts/custom/npc_j_eevee.cpp @@ -70,7 +70,7 @@ void npc_j_eevee_dreadsteedAI::MovementInform(uint32 uiType, uint32 uiPointId) if (Player* player = m_creature->GetMap()->GetPlayer(guidPlayer)) DoScriptText(SAY_J_EEVEE_DREADSTEED_4, m_creature, player); - DoCastSpellIfCan(m_creature, SPELL_J_EEVEE_TELEPORT, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_J_EEVEE_TELEPORT, CF_TRIGGERED); break; } @@ -189,7 +189,7 @@ void npc_j_eevee_scholomanceAI::MovementInform(uint32 uiType, uint32 uiPointId) attackRepeatTimer = 1000; break; case 13: - DoCastSpellIfCan(m_creature, SPELL_J_EEVEE_TELEPORT, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_J_EEVEE_TELEPORT, CF_TRIGGERED); finished = true; break; } diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_depths/arena_challenge_ai.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_depths/arena_challenge_ai.cpp index f5c82b5a5..0bb24849f 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_depths/arena_challenge_ai.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_depths/arena_challenge_ai.cpp @@ -132,7 +132,7 @@ struct npc_va_jashniAI : public ScriptedAI { if (m_uiFlashHealTimer < diff) { - Unit *target = DoSelectLowestHpFriendly(40.0f, 1); + Unit *target = m_creature->DoSelectLowestHpFriendly(40.0f, 1); if (target && DoCastSpellIfCan(target, SPELL_VA_JASHNI_FLASH_HEAL) == CAST_OK) m_uiFlashHealTimer = urand(8000, 14000); @@ -142,7 +142,7 @@ struct npc_va_jashniAI : public ScriptedAI if (m_uiShieldTimer < diff) { - Unit *target = DoSelectLowestHpFriendly(40.0f, 1); + Unit *target = m_creature->DoSelectLowestHpFriendly(40.0f, 1); if (target && DoCastSpellIfCan(target, SPELL_VA_JASHNI_SHIELD) == CAST_OK) m_uiShieldTimer = urand(40000, 50000); @@ -152,7 +152,7 @@ struct npc_va_jashniAI : public ScriptedAI if (m_uiRenewTimer < diff) { - Unit *target = DoSelectLowestHpFriendly(40.0f, 1); + Unit *target = m_creature->DoSelectLowestHpFriendly(40.0f, 1); if (target && DoCastSpellIfCan(target, SPELL_VA_JASHNI_RENEW) == CAST_OK) m_uiRenewTimer = urand(55000, 65000); @@ -443,7 +443,7 @@ struct npc_malgen_longspearAI : public ScriptedAI // Feign death, lay trap, re-acquire target Unit *currentTarget = m_creature->getVictim(); - if (DoCastSpellIfCan(m_creature, SPELL_MALGEN_LONGSPEAR_FEIGN_DEATH, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_MALGEN_LONGSPEAR_FEIGN_DEATH, CF_TRIGGERED) == CAST_OK) { // Feign for 1 secs, then trap and repop m_bIsFeigned = true; @@ -460,7 +460,7 @@ struct npc_malgen_longspearAI : public ScriptedAI { m_creature->RemoveAurasDueToSpell(SPELL_MALGEN_LONGSPEAR_FEIGN_DEATH); - DoCastSpellIfCan(m_creature, SPELL_MALGEN_LONGSPEAR_FROST_TRAP, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_MALGEN_LONGSPEAR_FROST_TRAP, CF_TRIGGERED); m_uiFrostTrapTimer = 0; m_bIsFeigned = false; diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_mother_smolderweb.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_mother_smolderweb.cpp index 9d3675506..bfcfb7008 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_mother_smolderweb.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_mother_smolderweb.cpp @@ -49,7 +49,7 @@ struct boss_mothersmolderwebAI : public ScriptedAI void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) { if (m_creature->GetHealth() <= uiDamage) - DoCastSpellIfCan(m_creature, SPELL_SUMMON_SPIRE_SPIDERLING, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUMMON_SPIRE_SPIDERLING, CF_TRIGGERED); } void UpdateAI(const uint32 uiDiff) diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_chromaggus.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_chromaggus.cpp index 30064f267..8c99a2c30 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_chromaggus.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_chromaggus.cpp @@ -366,7 +366,7 @@ struct boss_chromaggusAI : public ScriptedAI if (Player* pPlayer = m_creature->GetMap()->GetPlayer(*it)) { // Cast affliction - if (DoCastSpellIfCan(pPlayer, m_uiSpellAfflict, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(pPlayer, m_uiSpellAfflict, CF_TRIGGERED) == CAST_OK) { if (m_uiSpellAfflict == SPELL_BROODAF_RED) m_lRedAfflictionPlayerGUID.push_back(pPlayer->GetObjectGuid()); diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_ebonroc.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_ebonroc.cpp index afc00f389..4a77268fc 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_ebonroc.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_ebonroc.cpp @@ -119,7 +119,7 @@ struct boss_ebonrocAI : public ScriptedAI // Shadow of Ebonroc Timer if (m_uiShadowOfEbonrocTimer < uiDiff) { - if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOW_OF_EBONROC, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOW_OF_EBONROC, CF_AURA_NOT_PRESENT) == CAST_OK) m_uiShadowOfEbonrocTimer = 8000; } else diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_vaelastrasz.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_vaelastrasz.cpp index 4b99b4371..1a04d5876 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_vaelastrasz.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_vaelastrasz.cpp @@ -551,7 +551,7 @@ struct npc_death_talon_CaptainAI : public ScriptedAI m_uiMarkFlamesTimer = 6000; m_uiCommandingShoutTimer = urand(12000, 25000); m_uiCleaveTimer = urand(4000, 8000); - DoCastSpellIfCan(m_creature, SPELL_AURA_FLAMES, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_AURA_FLAMES, CF_AURA_NOT_PRESENT); SetAuraFlames(false); } @@ -570,7 +570,7 @@ struct npc_death_talon_CaptainAI : public ScriptedAI if (!m_creature->HasAura(SPELL_AURA_FLAMES)) m_creature->AddAura(SPELL_AURA_FLAMES, ADD_AURA_PERMANENT); - DoCastSpellIfCan(m_creature, SPELL_COMMANDING_SHOUT, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_COMMANDING_SHOUT, CF_TRIGGERED); } void JustDied(Unit* /*pKiller*/) diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_victor_nefarius.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_victor_nefarius.cpp index cae11d58e..d23552427 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_victor_nefarius.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_victor_nefarius.cpp @@ -343,7 +343,7 @@ struct boss_victor_nefariusAI : ScriptedAI if (i->getSource() && i->getSource()->isAlive()) m_creature->AddThreat(i->getSource(), 10000.0f); - DoCastSpellIfCan(m_creature, SPELL_ROOT, CAST_TRIGGERED); // root + DoCastSpellIfCan(m_creature, SPELL_ROOT, CF_TRIGGERED); // root break; } } @@ -432,7 +432,7 @@ struct boss_victor_nefariusAI : ScriptedAI m_creature->InterruptNonMeleeSpells(false); //Root self - DoCastSpellIfCan(m_creature, SPELL_ROOT, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_ROOT, CF_TRIGGERED); //Make super invis if (m_creature->GetVisibility() != VISIBILITY_OFF) @@ -516,7 +516,7 @@ struct boss_victor_nefariusAI : ScriptedAI m_creature->SendSpellGo(m_creature, SPELL_VISUAL_EFFECT); AttackStart(pTarget); m_creature->SetInCombatWithZone(); - DoCastSpellIfCan(m_creature, SPELL_ROOT, CAST_TRIGGERED); // Root Self + DoCastSpellIfCan(m_creature, SPELL_ROOT, CF_TRIGGERED); // Root Self m_uiShadowBlinkTimer = urand(20000, 25000); m_uiShadowBoltTimer = urand(3000, 6000); Smoke = false; @@ -533,7 +533,7 @@ struct boss_victor_nefariusAI : ScriptedAI { m_creature->getThreatManager().modifyThreatPercent(pTarget, -100); m_creature->getThreatManager().addThreatDirectly(pTarget, m_uiMindControledPlayerAggro); - DoCastSpellIfCan(m_creature, SPELL_ROOT, CAST_TRIGGERED); // Root self + DoCastSpellIfCan(m_creature, SPELL_ROOT, CF_TRIGGERED); // Root self m_uiMindControledPlayerGuid.Clear(); m_uiMindControledPlayerAggro = 0; } @@ -552,7 +552,7 @@ struct boss_victor_nefariusAI : ScriptedAI { m_uiMindControledPlayerGuid = pTarget->GetObjectGuid(); m_uiMindControledPlayerAggro = m_creature->getThreatManager().getThreat(pTarget); - if (DoCastSpellIfCan(pTarget, SPELL_SHADOW_COMMAND, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(pTarget, SPELL_SHADOW_COMMAND, CF_AURA_NOT_PRESENT) == CAST_OK) m_uiMindControlTimer = urand(25000, 40000); } } diff --git a/src/scripts/eastern_kingdoms/burning_steppes/burning_steppes.cpp b/src/scripts/eastern_kingdoms/burning_steppes/burning_steppes.cpp index 659a3cead..78f6fbf76 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/burning_steppes.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/burning_steppes.cpp @@ -669,7 +669,7 @@ struct npc_klinfranAI : public ScriptedAI if (pSpell && pSpell->Id == 14277) // Scorpid Sting (Rank 4) { m_creature->RemoveAurasDueToSpell(SPELL_DEMONIC_FRENZY); - DoCastSpellIfCan(m_creature, SPELL_ENTROPIC_STING, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_ENTROPIC_STING, CF_TRIGGERED); } } diff --git a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_garr.cpp b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_garr.cpp index 2aa64c2bd..a4ca4eb42 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_garr.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_garr.cpp @@ -90,7 +90,7 @@ struct boss_garrAI : ScriptedAI std::ostringstream log; - CanCastResult result = DoCastSpellIfCan(m_creature, SPELL_ENRAGE, CAST_TRIGGERED); + CanCastResult result = DoCastSpellIfCan(m_creature, SPELL_ENRAGE, CF_TRIGGERED); if (result == CAST_OK) { @@ -192,8 +192,8 @@ struct mob_fireswornAI : ScriptedAI void Aggro(Unit* /*pWho*/) override { - DoCastSpellIfCan(m_creature, SPELL_THRASH, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); - DoCastSpellIfCan(m_creature, SPELL_IMMOLATE, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_THRASH, CF_TRIGGERED | CF_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_IMMOLATE, CF_TRIGGERED | CF_AURA_NOT_PRESENT); m_creature->SetInCombatWithZone(); } diff --git a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_gehennas.cpp b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_gehennas.cpp index 8e2e80117..94b64e48b 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_gehennas.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_gehennas.cpp @@ -95,7 +95,7 @@ struct boss_gehennasAI : public ScriptedAI //GehennasCurse_Timer if (GehennasCurse_Timer < diff) { - if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_GEHENNASCURSE, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_GEHENNASCURSE, CF_AURA_NOT_PRESENT) == CAST_OK) GehennasCurse_Timer = urand(22000, 30000); } else GehennasCurse_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_ragnaros.cpp b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_ragnaros.cpp index 64d7c996a..dd32ba168 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_ragnaros.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_ragnaros.cpp @@ -191,8 +191,8 @@ struct boss_ragnarosAI : ScriptedAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } m_creature->SetInCombatWithZone(); - DoCastSpellIfCan(m_creature, SPELL_MELT_WEAPON_AURA, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT | CAST_FORCE_TARGET_SELF); - DoCastSpellIfCan(m_creature, SPELL_ELEMENTAL_FIRE_AURA, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_MELT_WEAPON_AURA, CF_TRIGGERED | CF_AURA_NOT_PRESENT | CF_TARGET_CASTS_ON_SELF); + DoCastSpellIfCan(m_creature, SPELL_ELEMENTAL_FIRE_AURA, CF_TRIGGERED | CF_AURA_NOT_PRESENT); } void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) override @@ -448,7 +448,7 @@ struct boss_ragnarosAI : ScriptedAI m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (DoCastSpellIfCan(m_creature, SPELL_SUBMERGE_VISUAL, CAST_INTERRUPT_PREVIOUS) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_SUBMERGE_VISUAL, CF_INTERRUPT_PREVIOUS) == CAST_OK) { //Root self DoCastSpellIfCan(m_creature, 23973); diff --git a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_shazzrah.cpp b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_shazzrah.cpp index 36619cfa9..3eed77deb 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_shazzrah.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_shazzrah.cpp @@ -89,7 +89,7 @@ struct boss_shazzrahAI : public ScriptedAI //ShazzrahCurse_Timer if (ShazzrahCurse_Timer < diff) { - if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHAZZRAHCURSE, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHAZZRAHCURSE, CF_AURA_NOT_PRESENT) == CAST_OK) ShazzrahCurse_Timer = 20000; } else ShazzrahCurse_Timer -= diff; @@ -114,7 +114,7 @@ struct boss_shazzrahAI : public ScriptedAI if (Blink_Timer < diff) { // Teleporting him to a random gamer and casting Arcane Explosion after that. - if (DoCastSpellIfCan(m_creature, SPELL_GATE_DUMMY, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_GATE_DUMMY, CF_TRIGGERED) == CAST_OK) { // manual, until added effect of dummy properly if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, nullptr, SELECT_FLAG_PLAYER)) diff --git a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_sulfuron_harbinger.cpp b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_sulfuron_harbinger.cpp index e0855911a..5a7d1ac89 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_sulfuron_harbinger.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_sulfuron_harbinger.cpp @@ -184,7 +184,7 @@ struct mob_flamewaker_priestAI : public ScriptedAI //Casting Heal to Sulfuron or other Guards. if (Heal_Timer < diff) { - Unit* pUnit = DoSelectLowestHpFriendly(60.0f, 1); + Unit* pUnit = m_creature->DoSelectLowestHpFriendly(60.0f, 1); if (!pUnit) return; diff --git a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/molten_core.cpp b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/molten_core.cpp index efc465c8b..d099e332e 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/molten_core.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/molten_core.cpp @@ -366,7 +366,7 @@ struct mob_core_houndAI : public ScriptedAI if (m_bResurrectionOkay) { ResurrectSelf(); - DoCastSpellIfCan(m_creature, SPELL_FIRE_NOVA_VISUAL, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_FIRE_NOVA_VISUAL, CF_TRIGGERED); m_creature->MonsterTextEmote("Core Hound reignites from the heat of another Core Hound!"); } else @@ -430,7 +430,7 @@ struct mob_firelordAI : public ScriptedAI void Aggro(Unit* pWho) override { - DoCastSpellIfCan(m_creature, SPELL_INCINERATE_AURA, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_INCINERATE_AURA, CF_TRIGGERED | CF_AURA_NOT_PRESENT); } void JustSummoned(Creature* pSummoned) override @@ -457,7 +457,7 @@ struct mob_firelordAI : public ScriptedAI { if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, nullptr, SELECT_FLAG_PLAYER)) { - if (DoCastSpellIfCan(pTarget, SPELL_SOULBURN, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(pTarget, SPELL_SOULBURN, CF_TRIGGERED) == CAST_OK) m_uiSoulBurnTimer = urand(3000, 4000); } } diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_gluth.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_gluth.cpp index 9013588a8..0b143c6b2 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_gluth.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_gluth.cpp @@ -159,7 +159,7 @@ struct boss_gluthAI : public ScriptedAI Player* pPlayer = (*it).getSource(); if (!pPlayer) continue; if (pPlayer->isDead()) continue; - DoCastSpellIfCan(pPlayer, SPELL_DECIMATE_OTHER, CAST_TRIGGERED); + DoCastSpellIfCan(pPlayer, SPELL_DECIMATE_OTHER, CF_TRIGGERED); } } } @@ -338,7 +338,7 @@ struct mob_zombieChow : public ScriptedAI { if (ChaseGluth()) { - DoCastSpellIfCan(m_creature, SPELL_DECIMATE_OTHER, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_DECIMATE_OTHER, CF_TRIGGERED); isHitByDecimate = true; } } diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_heigan.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_heigan.cpp index 6cd73f1b1..316f19976 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_heigan.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_heigan.cpp @@ -295,7 +295,7 @@ struct boss_heiganAI : public ScriptedAI { portedPlayersThisPhase.clear(); - if (DoCastSpellIfCan(m_creature, SPELL_TELEPORT_SELF, CAST_TRIGGERED) != CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_TELEPORT_SELF, CF_TRIGGERED) != CAST_OK) { return; } diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_noth.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_noth.cpp index 327348a75..f7383790c 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_noth.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_noth.cpp @@ -186,9 +186,9 @@ struct boss_nothAI : public ScriptedAI { DoScriptText(SAY_SUMMON, m_creature); - DoCastSpellIfCan(m_creature, SPELL_SUM_WARR_SW, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_SUM_WARR_NW, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_SUM_WARR_NE, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUM_WARR_SW, CF_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUM_WARR_NW, CF_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUM_WARR_NE, CF_TRIGGERED); m_events.Repeat(Seconds(30)); } @@ -200,8 +200,8 @@ struct boss_nothAI : public ScriptedAI SPELL_BLINK_1, SPELL_BLINK_2, SPELL_BLINK_3, SPELL_BLINK_4 }; - DoCastSpellIfCan(m_creature, SPELL_CRIPPLE, CAST_TRIGGERED | CAST_FORCE_CAST); - DoCastSpellIfCan(m_creature, auiSpellBlink[urand(0, 3)], CAST_TRIGGERED|CAST_FORCE_CAST); + DoCastSpellIfCan(m_creature, SPELL_CRIPPLE, CF_TRIGGERED | CF_FORCE_CAST); + DoCastSpellIfCan(m_creature, auiSpellBlink[urand(0, 3)], CF_TRIGGERED|CF_FORCE_CAST); m_events.Repeat(Seconds(urand(30, 40))); DoResetThreat(); if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) @@ -225,7 +225,7 @@ struct boss_nothAI : public ScriptedAI void TeleportToBalc() { - if (DoCastSpellIfCan(m_creature, SPELL_TP_BALC, CAST_TRIGGERED|CAST_FORCE_CAST) != CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_TP_BALC, CF_TRIGGERED|CF_FORCE_CAST) != CAST_OK) { m_events.Repeat(100); // try again return; @@ -259,7 +259,7 @@ struct boss_nothAI : public ScriptedAI void TeleportFromBalc() { - if (DoCastSpellIfCan(m_creature, SPELL_TP_CENTER, CAST_TRIGGERED) != CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_TP_CENTER, CF_TRIGGERED) != CAST_OK) { m_events.Repeat(100); // try again return; @@ -286,20 +286,20 @@ struct boss_nothAI : public ScriptedAI std::remove(champs.begin(), champs.end(), champ3); // Summoning the selected 3 guardians - DoCastSpellIfCan(m_creature, champ1, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, champ2, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, champ3, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, champ1, CF_TRIGGERED); + DoCastSpellIfCan(m_creature, champ2, CF_TRIGGERED); + DoCastSpellIfCan(m_creature, champ3, CF_TRIGGERED); // Choosing the final champion at random between the remaining 7 locations uint32 champ4 = champs[urand(0, 6)]; - DoCastSpellIfCan(m_creature, champ4, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, champ4, CF_TRIGGERED); } void Summon2Guardians() { // Choose one of two locations south-west, and either the north-east or north-west location - DoCastSpellIfCan(m_creature, urand(0, 1) ? SPELL_SUM_GUARD_SW1 : SPELL_SUM_GUARD_SW1, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, urand(0, 1) ? SPELL_SUM_GUARD_NE : SPELL_SUM_GUARD_NW, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, urand(0, 1) ? SPELL_SUM_GUARD_SW1 : SPELL_SUM_GUARD_SW1, CF_TRIGGERED); + DoCastSpellIfCan(m_creature, urand(0, 1) ? SPELL_SUM_GUARD_NE : SPELL_SUM_GUARD_NW, CF_TRIGGERED); } void Summon3Constructs() diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_patchwerk.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_patchwerk.cpp index 41f93a4ed..b6ce1e9a0 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_patchwerk.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_patchwerk.cpp @@ -165,7 +165,7 @@ struct boss_patchwerkAI : public ScriptedAI m_creature->SetTargetGuid(pTarget->GetObjectGuid()); previousTarget = pTarget->GetObjectGuid(); } - DoCastSpellIfCan(pTarget, SPELL_HATEFULSTRIKE, CAST_TRIGGERED); + DoCastSpellIfCan(pTarget, SPELL_HATEFULSTRIKE, CF_TRIGGERED); } bool CustomGetTarget() diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_razuvious.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_razuvious.cpp index 00cc1c651..55d7a2d8d 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_razuvious.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_razuvious.cpp @@ -204,7 +204,7 @@ struct boss_razuviousAI : public ScriptedAI void JustDied(Unit* pKiller) { DoScriptText(SAY_DEATH, m_creature); - DoCastSpellIfCan(m_creature, SPELL_HOPELESS, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_HOPELESS, CF_TRIGGERED); if (m_pInstance) m_pInstance->SetData(TYPE_RAZUVIOUS, DONE); } diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_sapphiron.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_sapphiron.cpp index bde11acc2..5f9ac5e98 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_sapphiron.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_sapphiron.cpp @@ -371,7 +371,7 @@ struct boss_sapphironAI : public ScriptedAI iceboltTargets.push_back(target->GetObjectGuid()); m_creature->SetFacingToObject(target); - DoCastSpellIfCan(target, SPELL_ICEBOLT, CAST_TRIGGERED); + DoCastSpellIfCan(target, SPELL_ICEBOLT, CF_TRIGGERED); RescheduleIcebolt(); } @@ -592,7 +592,7 @@ struct boss_sapphironAI : public ScriptedAI { // Looks like the wing buffet dissapears as he starts casting frost breath UnSummonWingBuffet(); - if (DoCastSpellIfCan(m_creature, SPELL_FROST_BREATH_DUMMY, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_FROST_BREATH_DUMMY, CF_TRIGGERED) == CAST_OK) events.ScheduleEvent(EVENT_FROST_BREATH_CAST, 500); else events.Repeat(100); diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_thaddius.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_thaddius.cpp index 37d0a66fa..a4f8d2795 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_thaddius.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/boss_thaddius.cpp @@ -894,7 +894,7 @@ struct boss_thaddiusAI : public ScriptedAI switch (l_EventId) { case EVENT_SHIFT: - if (DoCastSpellIfCan(m_creature, SPELL_POLARITY_SHIFT, CAST_INTERRUPT_PREVIOUS) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_POLARITY_SHIFT, CF_INTERRUPT_PREVIOUS) == CAST_OK) { m_events.Repeat(30000); m_events.ScheduleEvent(EVENT_POLARITY_CHANGE, 3000); diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/instance_naxxramas.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/instance_naxxramas.cpp index 923aff2c2..54b7be1ba 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/instance_naxxramas.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/naxxramas/instance_naxxramas.cpp @@ -1613,7 +1613,7 @@ struct mob_naxxramasPlagueSlimeAI : public ScriptedAI m_creature->UpdateEntry(entry->EffectMiscValue[0]); if (prev_spell) m_creature->RemoveAurasDueToSpell(prev_spell); - DoCastSpellIfCan(m_creature, spell, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, spell, CF_TRIGGERED); m_creature->SetObjectScale(2.0f); // updateentry and the actual spells screws up the scale... prev_spell = spell; } diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/boss_baroness_anastari.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/boss_baroness_anastari.cpp index 0fc35e9dc..6a8add284 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/boss_baroness_anastari.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/boss_baroness_anastari.cpp @@ -246,7 +246,7 @@ struct boss_baroness_anastariAI : public ScriptedAI //BansheeCurse if (BansheeCurse_Timer < diff) { - if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_BANSHEECURSE, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_BANSHEECURSE, CF_AURA_NOT_PRESENT) == CAST_OK) BansheeCurse_Timer = 18000; } else BansheeCurse_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_hakkar.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_hakkar.cpp index 26222772c..b45dbeaa8 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_hakkar.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_hakkar.cpp @@ -213,7 +213,7 @@ struct boss_hakkarAI : public ScriptedAI // if ((Berserk_Timer < diff) || (m_creature->GetHealthPercent() < 5.0f)) if (Berserk_Timer < diff) { - if (DoCastSpellIfCan(m_creature, SPELL_BERSERK, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_BERSERK, CF_AURA_NOT_PRESENT) == CAST_OK) Berserk_Timer = 2000; } else diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_renataki.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_renataki.cpp index 55e7298a1..1260c58c2 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_renataki.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_renataki.cpp @@ -82,7 +82,7 @@ struct boss_renatakiAI : public ScriptedAI return; if (m_creature->GetHealthPercent() < 30) - DoCastSpellIfCan(m_creature, SPELL_ENRAGE, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_ENRAGE, CF_AURA_NOT_PRESENT); if (Invisible) { diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_thekal.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_thekal.cpp index 994c505b7..9ab00f864 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_thekal.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_thekal.cpp @@ -602,7 +602,7 @@ struct mob_zealot_lorkhanAI : public zg_rez_add if (DoCastSpellIfCan(m_creature, SPELL_GREATERHEAL) == CAST_OK) GreaterHeal_Timer = 12000; } - else if (Unit* pTarget = DoSelectLowestHpFriendly(100.0f, 9500)) + else if (Unit* pTarget = m_creature->DoSelectLowestHpFriendly(100.0f, 9500)) { if (DoCastSpellIfCan(pTarget, SPELL_GREATERHEAL) == CAST_OK) GreaterHeal_Timer = 12000; diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_venoxis.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_venoxis.cpp index 8a08f95b9..14c847c94 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_venoxis.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_venoxis.cpp @@ -273,7 +273,7 @@ struct boss_venoxisAI : public ScriptedAI // FRENZY if (!bFrenzy) if (m_creature->GetHealthPercent() < 20.0f) - if (DoCastSpellIfCan(m_creature, SPELL_FRENZY, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_FRENZY, CF_AURA_NOT_PRESENT) == CAST_OK) bFrenzy = true; DoMeleeAttackIfReady(); diff --git a/src/scripts/eastern_kingdoms/western_plaguelands/quest_in_dreams.cpp b/src/scripts/eastern_kingdoms/western_plaguelands/quest_in_dreams.cpp index fc2215910..fe853b277 100644 --- a/src/scripts/eastern_kingdoms/western_plaguelands/quest_in_dreams.cpp +++ b/src/scripts/eastern_kingdoms/western_plaguelands/quest_in_dreams.cpp @@ -90,7 +90,7 @@ void npc_tirion_fordring_in_dreamsAI::DoAttack(const uint32 uiDiff) { if (m_uiDevotionAuraTimer < uiDiff) { - DoCastSpellIfCan(m_creature, SPELL_DEVOTION_AURA, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_DEVOTION_AURA, CF_AURA_NOT_PRESENT); m_uiDevotionAuraTimer = 5000; } else @@ -651,7 +651,7 @@ void npc_isillienAI::Event4KillTaelan(const uint32 uiDiff) m_creature->getThreatManager().clearReferences(); m_creature->AttackStop(); - if (DoCastSpellIfCan(pTaelan, SPELL_TAELAN_DEATH, CAST_TRIGGERED | CAST_INTERRUPT_PREVIOUS | CAST_FORCE_CAST) == CAST_OK) + if (DoCastSpellIfCan(pTaelan, SPELL_TAELAN_DEATH, CF_TRIGGERED | CF_INTERRUPT_PREVIOUS | CF_FORCE_CAST) == CAST_OK) { GuardsDoAttack(nullptr, true, false); GuardsDoAttack(nullptr, false, false); @@ -1098,7 +1098,7 @@ void npc_taelanAI::Reset() m_uiHolyCleaveTimer = urand(5000, 10000); m_uiCrusaderStrikeTimer = urand(7000, 9000); - DoCastSpellIfCan(m_creature, SPELL_MURDER, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_MURDER, CF_AURA_NOT_PRESENT); } void npc_taelanAI::ResetCreature() @@ -1278,7 +1278,7 @@ void npc_taelanAI::Event2FightCavaliers(const uint32 uiDiff) DoScriptText(SAY_TAELAN_NOO, m_creature); m_creature->SetStandState(UNIT_STAND_STATE_STAND); - DoCastSpellIfCan(m_creature, SPELL_TAELAN_SUFFERING, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_TAELAN_SUFFERING, CF_TRIGGERED); m_creature->SetFactionTemporary(FACTION_ESCORT_N_FRIEND_PASSIVE, TEMPFACTION_RESTORE_RESPAWN); bool fight = false; @@ -1470,7 +1470,7 @@ void npc_taelanAI::TimerSayAndGo(const uint32 uiDiff, uint32 uiUpd, int32 textId void npc_taelanAI::DoAttack(const uint32 uiDiff) { - DoCastSpellIfCan(m_creature, SPELL_DEVOTION_AURA, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_DEVOTION_AURA, CF_AURA_NOT_PRESENT); DoHeal(uiDiff); @@ -1498,7 +1498,7 @@ void npc_taelanAI::DoAttack(const uint32 uiDiff) void npc_taelanAI::DoHeal(const uint32 uiDiff) { // heals himself or friendly creatures around - if (auto pHealMe = DoSelectLowestHpFriendly(40.0f, 40, true)) + if (auto pHealMe = m_creature->DoSelectLowestHpFriendly(40.0f, 40, true)) { if (pHealMe->GetHealthPercent() < 20.0f) { @@ -1595,7 +1595,7 @@ void npc_crimson_eliteAI::DoAttack(const uint32 uiDiff) { if (m_uiRetributionAuraCheckTimer < uiDiff) { - DoCastSpellIfCan(m_creature, SPELL_RETRIBUTION_AURA, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_RETRIBUTION_AURA, CF_TRIGGERED | CF_AURA_NOT_PRESENT); m_uiRetributionAuraCheckTimer = 5000; } else diff --git a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_jandice_barov.cpp b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_jandice_barov.cpp index 7318ab62c..efafa6beb 100644 --- a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_jandice_barov.cpp +++ b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_jandice_barov.cpp @@ -94,7 +94,7 @@ struct boss_jandicebarovAI : public ScriptedAI if (sWorld.GetWowPatch() > WOW_PATCH_108) { - DoCastSpellIfCan(m_creature, SPELL_DROP_JOURNAL, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_DROP_JOURNAL, CF_TRIGGERED); } } diff --git a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_lorekeeper_polkelt.cpp b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_lorekeeper_polkelt.cpp index 4515809a0..1150d4648 100644 --- a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_lorekeeper_polkelt.cpp +++ b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_lorekeeper_polkelt.cpp @@ -50,7 +50,7 @@ struct boss_lorekeeperpolkeltAI : public ScriptedAI void Aggro(Unit* /*pWho*/) { - DoCastSpellIfCan(m_creature, SPELL_DARKPLAGUE_AURA, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_DARKPLAGUE_AURA, CF_TRIGGERED | CF_AURA_NOT_PRESENT); } void JustDied(Unit *killer) diff --git a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/scholo_trash.cpp b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/scholo_trash.cpp index 1076b0b41..26acd71b5 100644 --- a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/scholo_trash.cpp +++ b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/scholo_trash.cpp @@ -27,7 +27,7 @@ struct npc_unstable_corpseAI : public ScriptedAI void Aggro(Unit* /*pWho*/) { - DoCastSpellIfCan(m_creature, SPELL_DARK_PLAGUE_AURA, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_DARK_PLAGUE_AURA, CF_TRIGGERED | CF_AURA_NOT_PRESENT); } void JustDied(Unit* pKiller) @@ -72,7 +72,7 @@ struct npc_reanimated_corpseAI : public ScriptedAI void Aggro(Unit* /*pWho*/) { - DoCastSpellIfCan(m_creature, SPELL_DARK_PLAGUE_AURA, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_DARK_PLAGUE_AURA, CF_TRIGGERED | CF_AURA_NOT_PRESENT); } void Resurrect() @@ -209,9 +209,9 @@ struct npc_spectral_tutorAI : public ScriptedAI // Image Projection if (m_uiImageTimer < uiDiff) { - if (DoCastSpellIfCan(m_creature, SPELL_SUMMON_PROJECTION, CAST_INTERRUPT_PREVIOUS) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_SUMMON_PROJECTION, CF_INTERRUPT_PREVIOUS) == CAST_OK) { - DoCastSpellIfCan(m_creature, SPELL_IMAGE_PROJECTION, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_IMAGE_PROJECTION, CF_TRIGGERED); m_uiImageTimer = urand(17700, 25300); m_uiHideTimer = 5800; m_isProjection = true; @@ -227,7 +227,7 @@ struct npc_spectral_tutorAI : public ScriptedAI { if (!m_creature->HasAura(SPELL_IMAGE_PROJECTION)) { - if (DoCastSpellIfCan(m_creature, SPELL_PROJECTION_LEECH, CAST_TRIGGERED | CAST_INTERRUPT_PREVIOUS) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_PROJECTION_LEECH, CF_TRIGGERED | CF_INTERRUPT_PREVIOUS) == CAST_OK) { m_isProjection = false; return; diff --git a/src/scripts/eastern_kingdoms/westfall/deadmines/boss_mr_smite.cpp b/src/scripts/eastern_kingdoms/westfall/deadmines/boss_mr_smite.cpp index 06d70f4be..698933295 100644 --- a/src/scripts/eastern_kingdoms/westfall/deadmines/boss_mr_smite.cpp +++ b/src/scripts/eastern_kingdoms/westfall/deadmines/boss_mr_smite.cpp @@ -75,7 +75,7 @@ struct boss_mr_smiteAI : public ScriptedAI m_uiSlamTimer = 9000; m_uiThrashTimer = 4000; - //DoCastSpellIfCan(m_creature, SPELL_NIBLE_REFLEXES, CAST_TRIGGERED);//in creature_addon now + //DoCastSpellIfCan(m_creature, SPELL_NIBLE_REFLEXES, CF_TRIGGERED);//in creature_addon now m_creature->LoadEquipment(31000, 0); diff --git a/src/scripts/eastern_kingdoms/wetlands/wetlands.cpp b/src/scripts/eastern_kingdoms/wetlands/wetlands.cpp index 3be2bc801..179b0d931 100644 --- a/src/scripts/eastern_kingdoms/wetlands/wetlands.cpp +++ b/src/scripts/eastern_kingdoms/wetlands/wetlands.cpp @@ -102,7 +102,7 @@ public: // slowing poison timer if (m_slowingPoisonTimer < uiDiff) { - CanCastResult castResult = DoCastSpellIfCan(m_creature->getVictim(), SPELL_SLOWING_POISON, CAST_AURA_NOT_PRESENT); + CanCastResult castResult = DoCastSpellIfCan(m_creature->getVictim(), SPELL_SLOWING_POISON, CF_AURA_NOT_PRESENT); if (castResult == CAST_OK) m_slowingPoisonTimer = urand(8400, 15300); } diff --git a/src/scripts/kalimdor/feralas/dire_maul/boss_gordok_king.cpp b/src/scripts/kalimdor/feralas/dire_maul/boss_gordok_king.cpp index 4e38e9682..8d17b0b87 100644 --- a/src/scripts/kalimdor/feralas/dire_maul/boss_gordok_king.cpp +++ b/src/scripts/kalimdor/feralas/dire_maul/boss_gordok_king.cpp @@ -363,7 +363,7 @@ void boss_chorushAI::UpdateAIShaman(const uint32 uiDiff) if (m_uiSpellTimers[3] < uiDiff) { Unit* pTarget = NULL; - if (pTarget = DoSelectLowestHpFriendly(40.0f, 15000)); + if (pTarget = m_creature->DoSelectLowestHpFriendly(40.0f, 15000)); else if (m_creature->GetHealthPercent() < 50.0f) pTarget = m_creature; @@ -423,7 +423,7 @@ void boss_chorushAI::UpdateAIPrist(const uint32 uiDiff) if (m_uiSpellTimers[3] < uiDiff) { Unit* pTarget = NULL; - if (pTarget = DoSelectLowestHpFriendly(40.0f, 15000)); + if (pTarget = m_creature->DoSelectLowestHpFriendly(40.0f, 15000)); else if (m_creature->GetHealthPercent() < 50.0f) pTarget = m_creature; @@ -446,7 +446,7 @@ void boss_chorushAI::UpdateAIPrist(const uint32 uiDiff) // Power Word Shield if (m_uiSpellTimers[1] < uiDiff) { - if (Unit* pTarget = DoSelectLowestHpFriendly(40.0f)) + if (Unit* pTarget = m_creature->DoSelectLowestHpFriendly(40.0f)) { if (DoCastSpellIfCan(pTarget, SPELL_POWER_WORD_SHIELD) == CAST_OK) m_uiSpellTimers[1] = urand(17000, 22000); diff --git a/src/scripts/kalimdor/feralas/dire_maul/instance_dire_maul.cpp b/src/scripts/kalimdor/feralas/dire_maul/instance_dire_maul.cpp index 4f694abf6..cf6b24f02 100644 --- a/src/scripts/kalimdor/feralas/dire_maul/instance_dire_maul.cpp +++ b/src/scripts/kalimdor/feralas/dire_maul/instance_dire_maul.cpp @@ -1707,7 +1707,7 @@ struct boss_prince_tortheldrinAI:public ScriptedAI whirlwindTimer = urand(14000, 22000); // Thrash - DoCastSpellIfCan(m_creature, SPELL_THRASH, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_THRASH, CF_TRIGGERED | CF_AURA_NOT_PRESENT); } void UpdateAI(const uint32 uiDiff) @@ -2090,7 +2090,7 @@ struct boss_alzzin_the_wildshaperAI : ScriptedAI // Wither if (m_uiWitherTimer < uiDiff) { - if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_WITHER, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_WITHER, CF_AURA_NOT_PRESENT) == CAST_OK) m_uiWitherTimer = urand(8000, 10000); } else @@ -2111,7 +2111,7 @@ struct boss_alzzin_the_wildshaperAI : ScriptedAI // Mangle if (m_uiMangleTimer < uiDiff) { - if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_MANGLE, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_MANGLE, CF_AURA_NOT_PRESENT) == CAST_OK) m_uiMangleTimer = urand(8000, 10000); } else @@ -2152,7 +2152,7 @@ struct boss_alzzin_the_wildshaperAI : ScriptedAI { if (m_creature->GetHealthPercent() < 50.0f) { - if (DoCastSpellIfCan(m_creature, SPELL_WILD_REGENERATION, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_WILD_REGENERATION, CF_AURA_NOT_PRESENT) == CAST_OK) m_uiWildRegenerationTimer = urand(10000, 15000); } } @@ -2334,7 +2334,7 @@ struct boss_magister_kalendrisAI:public ScriptedAI // Shadow Word Pain if (m_uiShadowWordPainTimer < uiDiff) { - if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOW_WORD_PAIN, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOW_WORD_PAIN, CF_AURA_NOT_PRESENT) == CAST_OK) m_uiShadowWordPainTimer = urand(9000, 11000); } else diff --git a/src/scripts/kalimdor/moonglade/moonglade.cpp b/src/scripts/kalimdor/moonglade/moonglade.cpp index 5a5286c43..3c59ab838 100644 --- a/src/scripts/kalimdor/moonglade/moonglade.cpp +++ b/src/scripts/kalimdor/moonglade/moonglade.cpp @@ -735,7 +735,7 @@ struct npc_keeper_remulosAI : public npc_escortAI if (m_uiHealTimer < uiDiff) { - if (Unit* pTarget = DoSelectLowestHpFriendly(DEFAULT_VISIBILITY_DISTANCE)) + if (Unit* pTarget = m_creature->DoSelectLowestHpFriendly(DEFAULT_VISIBILITY_DISTANCE)) { switch (urand(0, 2)) { diff --git a/src/scripts/kalimdor/silithus/ruins_of_ahnqiraj/ruins_of_ahnqiraj.cpp b/src/scripts/kalimdor/silithus/ruins_of_ahnqiraj/ruins_of_ahnqiraj.cpp index 05a2b3cbb..6d9bbed12 100644 --- a/src/scripts/kalimdor/silithus/ruins_of_ahnqiraj/ruins_of_ahnqiraj.cpp +++ b/src/scripts/kalimdor/silithus/ruins_of_ahnqiraj/ruins_of_ahnqiraj.cpp @@ -1324,28 +1324,6 @@ struct SwarmguardNeedlerAI : public ScriptedAI } }; -struct OssirianAgroTriggerAI : public ScriptedAI -{ - OssirianAgroTriggerAI(Creature* pCreature) : ScriptedAI(pCreature) - { - Reset(); - } - - void Reset() - { - } - - void MoveInLineOfSight(Unit* who) - { - if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 9.0f)) - { - if (Creature* Crea = m_creature->FindNearestCreature(NPC_OSSIRIAN, 200.0f)) - if (!Crea->isInCombat()) - Crea->AI()->AttackStart(who); - } - } -}; - /*******************/ CreatureAI* GetAI_AntiIntrusion(Creature* pCreature) @@ -1353,6 +1331,7 @@ CreatureAI* GetAI_AntiIntrusion(Creature* pCreature) return new npc_antiIntrusionAI(pCreature); } + CreatureAI* GetAI_Zerran(Creature* pCreature) { return new ZerranAI(pCreature); @@ -1439,11 +1418,6 @@ CreatureAI* GetAI_QirajiSwarmguard(Creature* pCreature) return new QirajiSwarmguardAI(pCreature); } -CreatureAI* GetAI_OssirianAgroTrigger(Creature* pCreature) -{ - return new OssirianAgroTriggerAI(pCreature); -} - void AddSC_ruins_of_ahnqiraj() { Script *newscript; @@ -1536,9 +1510,4 @@ void AddSC_ruins_of_ahnqiraj() newscript->Name = "boss_zerran"; newscript->GetAI = &GetAI_Zerran; newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_ossirian_agro_trigger"; - newscript->GetAI = &GetAI_OssirianAgroTrigger; - newscript->RegisterSelf(); } diff --git a/src/scripts/kalimdor/silithus/silithus.cpp b/src/scripts/kalimdor/silithus/silithus.cpp index 1c641e4a4..9115de14f 100644 --- a/src/scripts/kalimdor/silithus/silithus.cpp +++ b/src/scripts/kalimdor/silithus/silithus.cpp @@ -586,7 +586,7 @@ struct npc_solenorAI : public ScriptedAI if (pSpell && pSpell->Id == 14268) // Wing Clip (Rank 3) { - if (DoCastSpellIfCan(m_creature, SPELL_CRIPPLING_CLIP, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_CRIPPLING_CLIP, CF_TRIGGERED) == CAST_OK) DoScriptText(EMOTE_IMMOBILIZED, m_creature); } } @@ -3184,7 +3184,7 @@ struct npc_MerokAI : public ScriptedAI // HEALING WAVE if (m_uiHealingWave <= uiDiff) { - Unit* pUnit = DoSelectLowestHpFriendly(60.0f, 1); + Unit* pUnit = m_creature->DoSelectLowestHpFriendly(60.0f, 1); if (!pUnit) return; @@ -3230,7 +3230,7 @@ struct npc_ShaiAI : public ScriptedAI // FLASH HEAL if (m_uiFlashHeal <= uiDiff) { - Unit* pUnit = DoSelectLowestHpFriendly(60.0f, 1); + Unit* pUnit = m_creature->DoSelectLowestHpFriendly(60.0f, 1); if (!pUnit) return; @@ -3368,7 +3368,7 @@ struct boss_vamAI : public ScriptedAI if (!Enraged && Enrage_Timer < diff) Enraged = true; else if (Enraged) - DoCastSpellIfCan(m_creature, SPELL_ENRAGE, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_ENRAGE, CF_AURA_NOT_PRESENT); else Enrage_Timer -= diff; diff --git a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_bug_trio.cpp index ec90add9a..1cf96e83d 100644 --- a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_bug_trio.cpp +++ b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_bug_trio.cpp @@ -208,7 +208,7 @@ struct boss_kriAI : public boss_bug_trioAI void JustDied(Unit* pKiller) override { // Spawn Poison Cloud on death - DoCastSpellIfCan(m_creature, SPELL_SUMMON_CLOUD, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUMMON_CLOUD, CF_TRIGGERED); boss_bug_trioAI::JustDied(pKiller); } @@ -320,7 +320,7 @@ struct boss_yaujAI : public boss_bug_trioAI if (DoCastSpellIfCan(m_creature, SPELL_HEAL) == CAST_OK) m_uiHealTimer = 12000; } - else if (Unit* pTarget = DoSelectLowestHpFriendly(100.0f)) + else if (Unit* pTarget = m_creature->DoSelectLowestHpFriendly(100.0f)) { if (DoCastSpellIfCan(pTarget, SPELL_HEAL) == CAST_OK) m_uiHealTimer = 12000; @@ -364,7 +364,7 @@ struct boss_vemAI : public boss_bug_trioAI void JustDied(Unit* pKiller) override { // Enrage the other bugs on death - DoCastSpellIfCan(m_creature, SPELL_VENGEANCE, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_VENGEANCE, CF_TRIGGERED); boss_bug_trioAI::JustDied(pKiller); } diff --git a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_cthun.cpp b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_cthun.cpp index 74d2d6cd4..d3d3b174f 100644 --- a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_cthun.cpp +++ b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_cthun.cpp @@ -150,7 +150,7 @@ public: Unit* target = targetSelectFunc(m_creature); bool didCast = false; if (target) { - if(m_creature->AI()->DoCastSpellIfCan(target, spellID, triggered ? CAST_TRIGGERED : 0) == CAST_OK) { + if(m_creature->AI()->DoCastSpellIfCan(target, spellID, triggered ? CF_TRIGGERED : 0) == CAST_OK) { didCast = true; } } @@ -565,7 +565,7 @@ public: if (birthTimer > diff) { // Only want to cast it once, and it cant be done in ctor because groundRupture interrupts the animation. if (birthTimer == TENTACLE_BIRTH_DURATION) { - DoCastSpellIfCan(m_creature, SPELL_TENTACLE_BIRTH, CAST_FORCE_TARGET_SELF); + DoCastSpellIfCan(m_creature, SPELL_TENTACLE_BIRTH, CF_TARGET_CASTS_ON_SELF); } birthTimer -= diff; } diff --git a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_fankriss.cpp b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_fankriss.cpp index 11fd6fb7a..20d09560a 100644 --- a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_fankriss.cpp +++ b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_fankriss.cpp @@ -104,7 +104,7 @@ struct creature_spawn_fankrissAI : public ScriptedAI if (enrageTimer < diff) { - DoCastSpellIfCan(m_creature, SPELL_SPAWN_ENRAGE, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SPAWN_ENRAGE, CF_TRIGGERED); enrageTimer = std::numeric_limits::max(); } else diff --git a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_huhuran.cpp b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_huhuran.cpp index 68f3d4827..6111c6f73 100644 --- a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_huhuran.cpp +++ b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_huhuran.cpp @@ -134,7 +134,7 @@ struct boss_huhuranAI : public ScriptedAI m_uiNoxiousPoisonTimer -= uiDiff; if (m_bBerserk) - DoCastSpellIfCan(m_creature, SPELL_BERSERK, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_BERSERK, CF_AURA_NOT_PRESENT); else if (m_creature->GetHealthPercent() < 31.0f || m_uiBerserkTimer < uiDiff) { DoScriptText(EMOTE_GENERIC_BERSERK, m_creature); diff --git a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_ouro.cpp b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_ouro.cpp index dd4d13ce2..6b04d5f6c 100644 --- a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_ouro.cpp +++ b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_ouro.cpp @@ -1,461 +1,461 @@ -/* - * Copyright (C) 2006-2011 ScriptDev2 - * Copyright (C) 2010-2011 ScriptDev0 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Ouro -SD%Complete: 90 -SDComment: Some minor adjustments may be required -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "scriptPCH.h" -#include "temple_of_ahnqiraj.h" - -enum -{ - // ground spells - SPELL_SWEEP = 26103, - SPELL_SANDBLAST = 26102, - SPELL_BOULDER = 26616, - SPELL_BERSERK = 26615, - - // emerge spells - SPELL_BIRTH = 26262, // The Birth Animation - SPELL_GROUND_RUPTURE = 26100, // spell not confirmed - SPELL_SUMMON_BASE = 26133, // summons gameobject 180795 - SPELL_DESPAWN_BASE = 26594, - - // submerge spells - SPELL_SUBMERGE_VISUAL = 26063, - SPELL_SUMMON_OURO_MOUNDS = 26058, // summons 5 dirt mounds - SPELL_SUMMON_TRIGGER = 26284, - - // SPELL_SUMMON_OURO_TRIGG = 26642, - SPELL_SUMMON_OURO = 26061, // used by the script to summon the boss directly - //SPELL_QUAKE = 26093, - - // other spells - not used - SPELL_SUMMON_SCARABS = 26060, // triggered after 30 secs - cast by the Dirt Mounds - SPELL_DIRTMOUND_PASSIVE = 26092, // casts 26093 every 1 sec - // SPELL_SET_OURO_HEALTH = 26075, // removed from DBC - // SPELL_SAVE_OURO_HEALTH = 26076, // removed from DBC - // SPELL_TELEPORT_TRIGGER = 26285, // removed from DBC - // SPELL_SUBMERGE_TRIGGER = 26104, // removed from DBC - SPELL_SUMMON_OURO_MOUND = 26617, - // SPELL_SCARABS_PERIODIC = 26619, // cast by the Dirt Mounds in order to spawn the scarabs - removed from DBC - - // summoned npcs - // NPC_OURO_SCARAB = 15718, // summoned by Dirt Mounds - NPC_OURO_TRIGGER = 15717, - NPC_DIRT_MOUND = 15712, -}; - -/* - * Sand Blast timers are based on June 2006 values (15-20s) as shown in - * https://www.youtube.com/watch?v=REmX3uRTFkQ and further reduced to account - * for April 2006 nerfs (http://blue.cardplace.com/cache/wow-dungeons/481724.htm & - * http://blue.cardplace.com/cache/wow-general/7950998.htm - * Sweep timers based on the same video. No known nerfs. - */ -const uint32_t SANDBLAST_TIMER_INITIAL_MIN = 30000; -const uint32_t SANDBLAST_TIMER_INITIAL_MAX = 45000; -const uint32_t SANDBLAST_TIMER_MIN = 12000; -const uint32_t SANDBLAST_TIMER_MAX = 17000; -const uint32_t SUBMERGE_TIMER = 60000; -const uint32_t SUBMERGE_ANIMATION_INVIS = 2000; -const uint32_t SWEEP_TIMER = 15000; - -struct boss_ouroAI : public Scripted_NoMovementAI -{ - boss_ouroAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) - { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - uint32 m_uiSweepTimer; - uint32 m_uiSandBlastTimer; - uint32 m_uiSubmergeTimer; - bool m_SummonBase; - uint32 m_uiNoMeleeTimer; - uint32 m_uiSubmergeInvisTimer; - uint32 m_justEmergedGraceTimer; - uint32 m_uiSummonMoundTimer; - - bool m_bEnraged; - bool m_bSubmerged; - - ObjectGuid m_ouroTriggerGuid; - - WorldLocation m_StartingLoc; - - void Reset() - { - m_uiSweepTimer = urand(30000, 40000); - m_uiSandBlastTimer = urand(SANDBLAST_TIMER_INITIAL_MIN, SANDBLAST_TIMER_INITIAL_MAX); - m_uiSubmergeTimer = SUBMERGE_TIMER; - m_SummonBase = true; - m_uiSubmergeInvisTimer = SUBMERGE_ANIMATION_INVIS; - - m_uiNoMeleeTimer = 3000; - // Source : http://wowwiki.wikia.com/wiki/Ouro - // "Ouro seems to give you about 10 seconds to get a MT in there when he pops up" - m_justEmergedGraceTimer = 10000; - - m_uiSummonMoundTimer = 10000; - m_bEnraged = false; - m_bSubmerged = false; - - - m_ouroTriggerGuid.Clear(); - } - - void Aggro(Unit* /*pWho*/) - { - if (m_pInstance) - m_pInstance->SetData(TYPE_OURO, IN_PROGRESS); - - m_creature->GetPosition(m_StartingLoc); - } - - void DespawnCreatures(bool ShouldDespawnScarabs) - { - std::list lCreature; - m_creature->GetCreatureListWithEntryInGrid(lCreature, NPC_DIRT_MOUND, 250.0f); - if (ShouldDespawnScarabs) - m_creature->GetCreatureListWithEntryInGrid(lCreature, NPC_OURO_SCARAB, 250.0f); - for (std::list::iterator itr = lCreature.begin(); itr != lCreature.end(); ++itr) - (*itr)->ForcedDespawn(); - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_OURO, FAIL); - - DespawnCreatures(true); - m_creature->CastSpell(m_creature, SPELL_DESPAWN_BASE, true); - - Submerge(true); - m_creature->ForcedDespawn(2000); - } - - void JustDied(Unit* /*pKiller*/) - { - if (m_pInstance) - m_pInstance->SetData(TYPE_OURO, DONE); - - m_creature->CastSpell(m_creature, SPELL_DESPAWN_BASE, true); - } - - void JustSummoned(Creature* pSummoned) - { - switch (pSummoned->GetEntry()) - { - case NPC_OURO_TRIGGER: - m_ouroTriggerGuid = pSummoned->GetGUID(); - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - pSummoned->GetMotionMaster()->MoveFollow(pTarget, 0.0f, 0.0f); - break; - } - } - - void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) override - { - if (pSpell->Id == SPELL_SANDBLAST && pTarget) - { - if (m_creature->getThreatManager().getThreat(pTarget)) - m_creature->getThreatManager().modifyThreatPercent(pTarget, -100); - } - } - - void Submerge(bool isReset = false) - { - // Source : http://wowwiki.wikia.com/wiki/Ouro - // "Ouro has a chance to submerge every 1.5minutes. - // He will not submerge if he is busy casting a Sand Blast or Sweep, else he will submerge - // (ie. the chance of submerging is totally random)" - m_uiSubmergeTimer = SUBMERGE_TIMER; - - if (DoCastSpellIfCan(m_creature, SPELL_SUBMERGE_VISUAL, false) == CAST_OK) - { - if (!isReset) - { - DoCastSpellIfCan(m_creature, SPELL_SUMMON_OURO_MOUNDS, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_SUMMON_TRIGGER, CAST_TRIGGERED); - } - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - ClearTargetIcon(); - - m_bSubmerged = true; - m_uiSubmergeTimer = 30000; - - m_justEmergedGraceTimer = 10000; - m_uiNoMeleeTimer = 3000; - m_uiSubmergeInvisTimer = SUBMERGE_ANIMATION_INVIS; - DoResetThreat(); - } - else - { - m_uiSubmergeTimer = 2000; // try again in a moment - } - } - - void SetNewTarget(Unit &pNewTarget) - { - const uint32 uiMaxThreat = m_creature->getThreatManager().getThreat(m_creature->getVictim()); - - // erase current target's threat as soon as we switch the target now - m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(), -100); - - // give the new target aggro - m_creature->getThreatManager().addThreat(&pNewTarget, uiMaxThreat); - } - - - bool CheckForMelee() - { - // at first we check for the current player-type target - Unit* pMainTarget = m_creature->getVictim(); - if (pMainTarget->GetTypeId() == TYPEID_PLAYER && !pMainTarget->ToPlayer()->isGameMaster() && - m_creature->IsWithinMeleeRange(pMainTarget) && m_creature->IsWithinLOSInMap(pMainTarget)) - { - return true; - } - - // at second we look for any melee player-type target (if current target is not reachable) - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0, nullptr, - SELECT_FLAG_PLAYER_NOT_GM | SELECT_FLAG_IN_LOS | SELECT_FLAG_IN_MELEE_RANGE)) - { - SetNewTarget(*pTarget); - return true; - } - - // reaching this point means there are no more reachable player-type targets in melee range - - // at third we take any melee pet target just to punch in the face - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0, nullptr, - SELECT_FLAG_PET | SELECT_FLAG_IN_LOS | SELECT_FLAG_IN_MELEE_RANGE)) - { - SetNewTarget(*pTarget); - return false; - } - - // at fourth we take anything to wipe it out and log (whatever, just in case) - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0, nullptr, - SELECT_FLAG_NOT_PLAYER | SELECT_FLAG_IN_LOS | SELECT_FLAG_IN_MELEE_RANGE)) - { - SetNewTarget(*pTarget); - } - return false; - } - - void UpdateAI(const uint32 uiDiff) - { - // Return since we have no pTarget - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - if (!m_bSubmerged) - { - // Summon sandworm base - if (m_SummonBase) - { - // Note: server side spells should be cast directly - m_creature->CastSpell(m_creature, SPELL_SUMMON_BASE, true); - // Cast Despawn base to trigger spawn anim - m_creature->CastSpell(m_creature, SPELL_DESPAWN_BASE, true); - m_SummonBase = false; - } - - // Sweep - if (m_uiSweepTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_SWEEP) == CAST_OK) - m_uiSweepTimer = SWEEP_TIMER; - } - else - m_uiSweepTimer -= uiDiff; - - // Sand Blast - if (m_uiSandBlastTimer < uiDiff) - { - auto target = m_creature->getThreatManager().getHostileTarget(); +/* + * Copyright (C) 2006-2011 ScriptDev2 + * Copyright (C) 2010-2011 ScriptDev0 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ouro +SD%Complete: 90 +SDComment: Some minor adjustments may be required +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "scriptPCH.h" +#include "temple_of_ahnqiraj.h" + +enum +{ + // ground spells + SPELL_SWEEP = 26103, + SPELL_SANDBLAST = 26102, + SPELL_BOULDER = 26616, + SPELL_BERSERK = 26615, + + // emerge spells + SPELL_BIRTH = 26262, // The Birth Animation + SPELL_GROUND_RUPTURE = 26100, // spell not confirmed + SPELL_SUMMON_BASE = 26133, // summons gameobject 180795 + SPELL_DESPAWN_BASE = 26594, + + // submerge spells + SPELL_SUBMERGE_VISUAL = 26063, + SPELL_SUMMON_OURO_MOUNDS = 26058, // summons 5 dirt mounds + SPELL_SUMMON_TRIGGER = 26284, + + // SPELL_SUMMON_OURO_TRIGG = 26642, + SPELL_SUMMON_OURO = 26061, // used by the script to summon the boss directly + //SPELL_QUAKE = 26093, + + // other spells - not used + SPELL_SUMMON_SCARABS = 26060, // triggered after 30 secs - cast by the Dirt Mounds + SPELL_DIRTMOUND_PASSIVE = 26092, // casts 26093 every 1 sec + // SPELL_SET_OURO_HEALTH = 26075, // removed from DBC + // SPELL_SAVE_OURO_HEALTH = 26076, // removed from DBC + // SPELL_TELEPORT_TRIGGER = 26285, // removed from DBC + // SPELL_SUBMERGE_TRIGGER = 26104, // removed from DBC + SPELL_SUMMON_OURO_MOUND = 26617, + // SPELL_SCARABS_PERIODIC = 26619, // cast by the Dirt Mounds in order to spawn the scarabs - removed from DBC + + // summoned npcs + // NPC_OURO_SCARAB = 15718, // summoned by Dirt Mounds + NPC_OURO_TRIGGER = 15717, + NPC_DIRT_MOUND = 15712, +}; + +/* + * Sand Blast timers are based on June 2006 values (15-20s) as shown in + * https://www.youtube.com/watch?v=REmX3uRTFkQ and further reduced to account + * for April 2006 nerfs (http://blue.cardplace.com/cache/wow-dungeons/481724.htm & + * http://blue.cardplace.com/cache/wow-general/7950998.htm + * Sweep timers based on the same video. No known nerfs. + */ +const uint32_t SANDBLAST_TIMER_INITIAL_MIN = 30000; +const uint32_t SANDBLAST_TIMER_INITIAL_MAX = 45000; +const uint32_t SANDBLAST_TIMER_MIN = 12000; +const uint32_t SANDBLAST_TIMER_MAX = 17000; +const uint32_t SUBMERGE_TIMER = 60000; +const uint32_t SUBMERGE_ANIMATION_INVIS = 2000; +const uint32_t SWEEP_TIMER = 15000; + +struct boss_ouroAI : public Scripted_NoMovementAI +{ + boss_ouroAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiSweepTimer; + uint32 m_uiSandBlastTimer; + uint32 m_uiSubmergeTimer; + bool m_SummonBase; + uint32 m_uiNoMeleeTimer; + uint32 m_uiSubmergeInvisTimer; + uint32 m_justEmergedGraceTimer; + uint32 m_uiSummonMoundTimer; + + bool m_bEnraged; + bool m_bSubmerged; + + ObjectGuid m_ouroTriggerGuid; + + WorldLocation m_StartingLoc; + + void Reset() + { + m_uiSweepTimer = urand(30000, 40000); + m_uiSandBlastTimer = urand(SANDBLAST_TIMER_INITIAL_MIN, SANDBLAST_TIMER_INITIAL_MAX); + m_uiSubmergeTimer = SUBMERGE_TIMER; + m_SummonBase = true; + m_uiSubmergeInvisTimer = SUBMERGE_ANIMATION_INVIS; + + m_uiNoMeleeTimer = 3000; + // Source : http://wowwiki.wikia.com/wiki/Ouro + // "Ouro seems to give you about 10 seconds to get a MT in there when he pops up" + m_justEmergedGraceTimer = 10000; + + m_uiSummonMoundTimer = 10000; + m_bEnraged = false; + m_bSubmerged = false; + + + m_ouroTriggerGuid.Clear(); + } + + void Aggro(Unit* /*pWho*/) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_OURO, IN_PROGRESS); + + m_creature->GetPosition(m_StartingLoc); + } + + void DespawnCreatures(bool ShouldDespawnScarabs) + { + std::list lCreature; + m_creature->GetCreatureListWithEntryInGrid(lCreature, NPC_DIRT_MOUND, 250.0f); + if (ShouldDespawnScarabs) + m_creature->GetCreatureListWithEntryInGrid(lCreature, NPC_OURO_SCARAB, 250.0f); + for (std::list::iterator itr = lCreature.begin(); itr != lCreature.end(); ++itr) + (*itr)->ForcedDespawn(); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_OURO, FAIL); + + DespawnCreatures(true); + m_creature->CastSpell(m_creature, SPELL_DESPAWN_BASE, true); + + Submerge(true); + m_creature->ForcedDespawn(2000); + } + + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_OURO, DONE); + + m_creature->CastSpell(m_creature, SPELL_DESPAWN_BASE, true); + } + + void JustSummoned(Creature* pSummoned) + { + switch (pSummoned->GetEntry()) + { + case NPC_OURO_TRIGGER: + m_ouroTriggerGuid = pSummoned->GetGUID(); + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->GetMotionMaster()->MoveFollow(pTarget, 0.0f, 0.0f); + break; + } + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) override + { + if (pSpell->Id == SPELL_SANDBLAST && pTarget) + { + if (m_creature->getThreatManager().getThreat(pTarget)) + m_creature->getThreatManager().modifyThreatPercent(pTarget, -100); + } + } + + void Submerge(bool isReset = false) + { + // Source : http://wowwiki.wikia.com/wiki/Ouro + // "Ouro has a chance to submerge every 1.5minutes. + // He will not submerge if he is busy casting a Sand Blast or Sweep, else he will submerge + // (ie. the chance of submerging is totally random)" + m_uiSubmergeTimer = SUBMERGE_TIMER; + + if (DoCastSpellIfCan(m_creature, SPELL_SUBMERGE_VISUAL, false) == CAST_OK) + { + if (!isReset) + { + DoCastSpellIfCan(m_creature, SPELL_SUMMON_OURO_MOUNDS, CF_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUMMON_TRIGGER, CF_TRIGGERED); + } + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + ClearTargetIcon(); + + m_bSubmerged = true; + m_uiSubmergeTimer = 30000; + + m_justEmergedGraceTimer = 10000; + m_uiNoMeleeTimer = 3000; + m_uiSubmergeInvisTimer = SUBMERGE_ANIMATION_INVIS; + DoResetThreat(); + } + else + { + m_uiSubmergeTimer = 2000; // try again in a moment + } + } + + void SetNewTarget(Unit &pNewTarget) + { + const uint32 uiMaxThreat = m_creature->getThreatManager().getThreat(m_creature->getVictim()); + + // erase current target's threat as soon as we switch the target now + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(), -100); + + // give the new target aggro + m_creature->getThreatManager().addThreat(&pNewTarget, uiMaxThreat); + } + + + bool CheckForMelee() + { + // at first we check for the current player-type target + Unit* pMainTarget = m_creature->getVictim(); + if (pMainTarget->GetTypeId() == TYPEID_PLAYER && !pMainTarget->ToPlayer()->isGameMaster() && + m_creature->IsWithinMeleeRange(pMainTarget) && m_creature->IsWithinLOSInMap(pMainTarget)) + { + return true; + } + + // at second we look for any melee player-type target (if current target is not reachable) + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0, nullptr, + SELECT_FLAG_PLAYER_NOT_GM | SELECT_FLAG_IN_LOS | SELECT_FLAG_IN_MELEE_RANGE)) + { + SetNewTarget(*pTarget); + return true; + } + + // reaching this point means there are no more reachable player-type targets in melee range + + // at third we take any melee pet target just to punch in the face + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0, nullptr, + SELECT_FLAG_PET | SELECT_FLAG_IN_LOS | SELECT_FLAG_IN_MELEE_RANGE)) + { + SetNewTarget(*pTarget); + return false; + } + + // at fourth we take anything to wipe it out and log (whatever, just in case) + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0, nullptr, + SELECT_FLAG_NOT_PLAYER | SELECT_FLAG_IN_LOS | SELECT_FLAG_IN_MELEE_RANGE)) + { + SetNewTarget(*pTarget); + } + return false; + } + + void UpdateAI(const uint32 uiDiff) + { + // Return since we have no pTarget + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bSubmerged) + { + // Summon sandworm base + if (m_SummonBase) + { + // Note: server side spells should be cast directly + m_creature->CastSpell(m_creature, SPELL_SUMMON_BASE, true); + // Cast Despawn base to trigger spawn anim + m_creature->CastSpell(m_creature, SPELL_DESPAWN_BASE, true); + m_SummonBase = false; + } + + // Sweep + if (m_uiSweepTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_SWEEP) == CAST_OK) + m_uiSweepTimer = SWEEP_TIMER; + } + else + m_uiSweepTimer -= uiDiff; + + // Sand Blast + if (m_uiSandBlastTimer < uiDiff) + { + auto target = m_creature->getThreatManager().getHostileTarget(); + + if (target && DoCastSpellIfCan(target, SPELL_SANDBLAST) == CAST_OK) + { + m_uiSandBlastTimer = urand(SANDBLAST_TIMER_MIN, SANDBLAST_TIMER_MAX); + } + } + else + m_uiSandBlastTimer -= uiDiff; + + if (!m_bEnraged) + { + // Enrage at 20% HP + if (m_creature->GetHealthPercent() < 20.0f) + { + if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK) + { + m_bEnraged = true; + return; + } + } + + // Submerge + if (m_uiSubmergeTimer < uiDiff) + { + Submerge(); + } + else + m_uiSubmergeTimer -= uiDiff; + } + else + { + // Summon 1 mound every 10 secs when enraged + if (m_uiSummonMoundTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_SUMMON_OURO_MOUND) == CAST_OK) + m_uiSummonMoundTimer = 10000; + } + else + m_uiSummonMoundTimer -= uiDiff; + } + + // every tick we check for melee targets to attack + if (CheckForMelee()) + { + m_uiNoMeleeTimer = std::max((uint32)3000, m_justEmergedGraceTimer); + } + + // If we are within range melee the target + if (m_creature->CanReachWithMeleeAttack(m_creature->getVictim())) + { + DoMeleeAttackIfReady(); + } + // Spam Boulder spell when enraged and not tanked + else if (m_bEnraged) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_BOULDER); + } + } + // Submerge if no melee and not enraged + else if (m_uiNoMeleeTimer < uiDiff) + { + Submerge(); + } + else + m_uiNoMeleeTimer -= uiDiff; + + m_justEmergedGraceTimer -= std::min(uiDiff, m_justEmergedGraceTimer); + } + else + { + // Resume combat + if (m_uiSubmergeTimer < uiDiff) + { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + // Teleport to the trigger in order to get a new location + if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_ouroTriggerGuid)) + m_creature->NearTeleportTo(pTrigger->GetPositionX(), pTrigger->GetPositionY(), pTrigger->GetPositionZ(), 0); + + if (DoCastSpellIfCan(m_creature, SPELL_BIRTH) == CAST_OK) + { + //DoCastSpellIfCan(m_creature, SPELL_SUMMON_SCARABS, CF_TRIGGERED); + + m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE_VISUAL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + std::list lGroundRuptureTargets; + ThreatList const& lThreat = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = lThreat.begin(); i != lThreat.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + if (pUnit && pUnit->GetDistance2d(m_creature) < 20.0f) + lGroundRuptureTargets.push_back(pUnit); + } + for (auto &target : lGroundRuptureTargets) + m_creature->CastSpell(target, SPELL_GROUND_RUPTURE, true); + + m_bSubmerged = false; + m_SummonBase = true; + m_uiSubmergeTimer = SUBMERGE_TIMER; + m_uiSubmergeInvisTimer = SUBMERGE_ANIMATION_INVIS; + m_uiSweepTimer = SWEEP_TIMER; + m_uiSandBlastTimer = urand(SANDBLAST_TIMER_MIN, SANDBLAST_TIMER_MAX); + + DespawnCreatures(false); + + // Ouro should despawn instant on reset, not after going to his spawn point + m_creature->SetHomePosition( + m_creature->GetPositionX(), + m_creature->GetPositionY(), + m_creature->GetPositionZ(), + m_creature->GetOrientation()); + } + } + else + { + if (m_creature->GetVisibility() == VISIBILITY_ON) + { + if (m_uiSubmergeInvisTimer < uiDiff) + { + m_creature->SetVisibility(VISIBILITY_OFF); + } + else + { + m_uiSubmergeInvisTimer -= uiDiff; + } + } + + m_uiSubmergeTimer -= uiDiff; + } + } + } +}; + +CreatureAI* GetAI_boss_ouro(Creature* pCreature) +{ + return new boss_ouroAI(pCreature); +} + +struct npc_ouro_spawnerAI : public Scripted_NoMovementAI +{ + npc_ouro_spawnerAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) {Reset();} + + bool m_bHasSummoned; + + void Reset() + { + m_bHasSummoned = false; + + DoCastSpellIfCan(m_creature, SPELL_DIRTMOUND_PASSIVE); + } - if (target && DoCastSpellIfCan(target, SPELL_SANDBLAST) == CAST_OK) - { - m_uiSandBlastTimer = urand(SANDBLAST_TIMER_MIN, SANDBLAST_TIMER_MAX); - } - } - else - m_uiSandBlastTimer -= uiDiff; - - if (!m_bEnraged) - { - // Enrage at 20% HP - if (m_creature->GetHealthPercent() < 20.0f) - { - if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK) - { - m_bEnraged = true; - return; - } - } - - // Submerge - if (m_uiSubmergeTimer < uiDiff) - { - Submerge(); - } - else - m_uiSubmergeTimer -= uiDiff; - } - else - { - // Summon 1 mound every 10 secs when enraged - if (m_uiSummonMoundTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_SUMMON_OURO_MOUND) == CAST_OK) - m_uiSummonMoundTimer = 10000; - } - else - m_uiSummonMoundTimer -= uiDiff; - } - - // every tick we check for melee targets to attack - if (CheckForMelee()) - { - m_uiNoMeleeTimer = std::max((uint32)3000, m_justEmergedGraceTimer); - } - - // If we are within range melee the target - if (m_creature->CanReachWithMeleeAttack(m_creature->getVictim())) - { - DoMeleeAttackIfReady(); - } - // Spam Boulder spell when enraged and not tanked - else if (m_bEnraged) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - DoCastSpellIfCan(pTarget, SPELL_BOULDER); - } - } - // Submerge if no melee and not enraged - else if (m_uiNoMeleeTimer < uiDiff) - { - Submerge(); - } - else - m_uiNoMeleeTimer -= uiDiff; - - m_justEmergedGraceTimer -= std::min(uiDiff, m_justEmergedGraceTimer); - } - else - { - // Resume combat - if (m_uiSubmergeTimer < uiDiff) - { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - // Teleport to the trigger in order to get a new location - if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_ouroTriggerGuid)) - m_creature->NearTeleportTo(pTrigger->GetPositionX(), pTrigger->GetPositionY(), pTrigger->GetPositionZ(), 0); - - if (DoCastSpellIfCan(m_creature, SPELL_BIRTH) == CAST_OK) - { - //DoCastSpellIfCan(m_creature, SPELL_SUMMON_SCARABS, CAST_TRIGGERED); - - m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE_VISUAL); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - std::list lGroundRuptureTargets; - ThreatList const& lThreat = m_creature->getThreatManager().getThreatList(); - for (ThreatList::const_iterator i = lThreat.begin(); i != lThreat.end(); ++i) - { - Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); - if (pUnit && pUnit->GetDistance2d(m_creature) < 20.0f) - lGroundRuptureTargets.push_back(pUnit); - } - for (auto &target : lGroundRuptureTargets) - m_creature->CastSpell(target, SPELL_GROUND_RUPTURE, true); - - m_bSubmerged = false; - m_SummonBase = true; - m_uiSubmergeTimer = SUBMERGE_TIMER; - m_uiSubmergeInvisTimer = SUBMERGE_ANIMATION_INVIS; - m_uiSweepTimer = SWEEP_TIMER; - m_uiSandBlastTimer = urand(SANDBLAST_TIMER_MIN, SANDBLAST_TIMER_MAX); - - DespawnCreatures(false); - - // Ouro should despawn instant on reset, not after going to his spawn point - m_creature->SetHomePosition( - m_creature->GetPositionX(), - m_creature->GetPositionY(), - m_creature->GetPositionZ(), - m_creature->GetOrientation()); - } - } - else - { - if (m_creature->GetVisibility() == VISIBILITY_ON) - { - if (m_uiSubmergeInvisTimer < uiDiff) - { - m_creature->SetVisibility(VISIBILITY_OFF); - } - else - { - m_uiSubmergeInvisTimer -= uiDiff; - } - } - - m_uiSubmergeTimer -= uiDiff; - } - } - } -}; - -CreatureAI* GetAI_boss_ouro(Creature* pCreature) -{ - return new boss_ouroAI(pCreature); -} - -struct npc_ouro_spawnerAI : public Scripted_NoMovementAI -{ - npc_ouro_spawnerAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) {Reset();} - - bool m_bHasSummoned; - - void Reset() - { - m_bHasSummoned = false; - - DoCastSpellIfCan(m_creature, SPELL_DIRTMOUND_PASSIVE); - } - void MoveInLineOfSight(Unit* pWho) override { // Spawn Ouro on LoS check @@ -468,194 +468,194 @@ struct npc_ouro_spawnerAI : public Scripted_NoMovementAI } ScriptedAI::MoveInLineOfSight(pWho); - } - - void JustSummoned(Creature* pSummoned) - { - // Despawn when Ouro is spawned - if (pSummoned->GetEntry() == NPC_OURO) - { - pSummoned->CastSpell(pSummoned, SPELL_BIRTH, false); - pSummoned->SetInCombatWithZone(); - m_creature->ForcedDespawn(); - } - } - - void UpdateAI(const uint32 /*uiDiff*/) { } -}; - -CreatureAI* GetAI_npc_ouro_spawner(Creature* pCreature) -{ - return new npc_ouro_spawnerAI(pCreature); -} - -struct npc_dirt_moundAI : public ScriptedAI -{ - npc_dirt_moundAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} - - uint32 m_uiChangeTargetTimer; - uint32 m_uiDespawnTimer; - ObjectGuid m_TargetGUID; - ObjectGuid m_CurrentTargetGUID; - - void JustRespawned() override - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - ScriptedAI::JustRespawned(); - } - - void Reset() - { - m_uiDespawnTimer = 30000; - m_TargetGUID.Clear(); - m_CurrentTargetGUID.Clear(); - - DoCastSpellIfCan(m_creature, SPELL_DIRTMOUND_PASSIVE); - } - - void MoveInLineOfSight(Unit *who) - { - if (!m_TargetGUID && who->GetTypeId() == TYPEID_PLAYER) - { - m_TargetGUID = who->GetGUID(); - } - } - - void UpdateAI(const uint32 uiDiff) - { - Unit *pTarget = m_creature->GetMap()->GetUnit(m_CurrentTargetGUID); - const bool bForceChangeTarget = !pTarget || pTarget->isDead() - || pTarget->IsImmuneToDamage(SPELL_SCHOOL_MASK_NATURE); - - if (bForceChangeTarget || m_uiChangeTargetTimer < uiDiff) - { - m_CurrentTargetGUID.Clear(); - - if (Unit* pTarget = m_creature->GetMap()->GetUnit(m_TargetGUID)) - { - m_creature->GetMotionMaster()->MoveFollow(pTarget, 0.0f, 0.0f); - m_CurrentTargetGUID = m_TargetGUID; - m_TargetGUID.Clear(); - } - else - { - m_creature->GetMotionMaster()->MoveRandom(); - } - m_uiChangeTargetTimer = urand(0, 10000); - } - else - m_uiChangeTargetTimer -= uiDiff; - - if (m_uiDespawnTimer < uiDiff) - { - m_creature->CastSpell(m_creature, SPELL_SUMMON_SCARABS, true); - m_creature->ForcedDespawn(); - } - else - { - m_uiDespawnTimer -= uiDiff; - } - } -}; - -CreatureAI* GetAI_npc_dirt_mound(Creature* pCreature) -{ - return new npc_dirt_moundAI(pCreature); -} - -struct npc_ouro_scarabAI : public ScriptedAI -{ - npc_ouro_scarabAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } - - uint32 m_uiDespawnTimer; - - void Reset() - { - m_uiDespawnTimer = 45000; - } - - void MoveInLineOfSight(Unit *who) - { - if (who->GetTypeId() == TYPEID_PLAYER && !m_creature->getVictim() && !urand(0, 5)) - { - AttackStart(who); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (m_creature->getVictim()) - DoMeleeAttackIfReady(); - - if (m_uiDespawnTimer < uiDiff) - m_creature->ForcedDespawn(); - else - m_uiDespawnTimer -= uiDiff; - } -}; - -CreatureAI* GetAI_npc_ouro_scarab(Creature* pCreature) -{ - return new npc_ouro_scarabAI(pCreature); -} - -struct go_sandworm_baseAI: public GameObjectAI -{ - go_sandworm_baseAI(GameObject* pGo) : GameObjectAI(pGo), m_bActive(true) {} - - bool m_bActive; - - bool OnUse(Unit* pUser) - { - WorldLocation loc; - pUser->GetObjectScale(); - pUser->GetPosition(loc); - - if (m_bActive) - { - m_bActive = false; - me->SendGameObjectCustomAnim(); - } - else - { - me->SetRespawnTime(0); - me->Delete(); - } - return false; - } -}; - -GameObjectAI* GetAIgo_sandworm_base(GameObject *pGo) -{ - return new go_sandworm_baseAI(pGo); -} - -void AddSC_boss_ouro() -{ - Script* pNewScript; - - pNewScript = new Script; - pNewScript->Name = "boss_ouro"; - pNewScript->GetAI = &GetAI_boss_ouro; - pNewScript->RegisterSelf(); - - pNewScript = new Script; - pNewScript->Name = "npc_ouro_spawner"; - pNewScript->GetAI = &GetAI_npc_ouro_spawner; - pNewScript->RegisterSelf(); - - pNewScript = new Script; - pNewScript->Name = "npc_dirt_mound"; - pNewScript->GetAI = &GetAI_npc_dirt_mound; - pNewScript->RegisterSelf(); - - pNewScript = new Script; - pNewScript->Name = "npc_ouro_scarab"; - pNewScript->GetAI = &GetAI_npc_ouro_scarab; - pNewScript->RegisterSelf(); - - pNewScript = new Script; - pNewScript->Name = "go_sandworm_base"; - pNewScript->GOGetAI = &GetAIgo_sandworm_base; - pNewScript->RegisterSelf(); -} + } + + void JustSummoned(Creature* pSummoned) + { + // Despawn when Ouro is spawned + if (pSummoned->GetEntry() == NPC_OURO) + { + pSummoned->CastSpell(pSummoned, SPELL_BIRTH, false); + pSummoned->SetInCombatWithZone(); + m_creature->ForcedDespawn(); + } + } + + void UpdateAI(const uint32 /*uiDiff*/) { } +}; + +CreatureAI* GetAI_npc_ouro_spawner(Creature* pCreature) +{ + return new npc_ouro_spawnerAI(pCreature); +} + +struct npc_dirt_moundAI : public ScriptedAI +{ + npc_dirt_moundAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiChangeTargetTimer; + uint32 m_uiDespawnTimer; + ObjectGuid m_TargetGUID; + ObjectGuid m_CurrentTargetGUID; + + void JustRespawned() override + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + ScriptedAI::JustRespawned(); + } + + void Reset() + { + m_uiDespawnTimer = 30000; + m_TargetGUID.Clear(); + m_CurrentTargetGUID.Clear(); + + DoCastSpellIfCan(m_creature, SPELL_DIRTMOUND_PASSIVE); + } + + void MoveInLineOfSight(Unit *who) + { + if (!m_TargetGUID && who->GetTypeId() == TYPEID_PLAYER) + { + m_TargetGUID = who->GetGUID(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + Unit *pTarget = m_creature->GetMap()->GetUnit(m_CurrentTargetGUID); + const bool bForceChangeTarget = !pTarget || pTarget->isDead() + || pTarget->IsImmuneToDamage(SPELL_SCHOOL_MASK_NATURE); + + if (bForceChangeTarget || m_uiChangeTargetTimer < uiDiff) + { + m_CurrentTargetGUID.Clear(); + + if (Unit* pTarget = m_creature->GetMap()->GetUnit(m_TargetGUID)) + { + m_creature->GetMotionMaster()->MoveFollow(pTarget, 0.0f, 0.0f); + m_CurrentTargetGUID = m_TargetGUID; + m_TargetGUID.Clear(); + } + else + { + m_creature->GetMotionMaster()->MoveRandom(); + } + m_uiChangeTargetTimer = urand(0, 10000); + } + else + m_uiChangeTargetTimer -= uiDiff; + + if (m_uiDespawnTimer < uiDiff) + { + m_creature->CastSpell(m_creature, SPELL_SUMMON_SCARABS, true); + m_creature->ForcedDespawn(); + } + else + { + m_uiDespawnTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_dirt_mound(Creature* pCreature) +{ + return new npc_dirt_moundAI(pCreature); +} + +struct npc_ouro_scarabAI : public ScriptedAI +{ + npc_ouro_scarabAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 m_uiDespawnTimer; + + void Reset() + { + m_uiDespawnTimer = 45000; + } + + void MoveInLineOfSight(Unit *who) + { + if (who->GetTypeId() == TYPEID_PLAYER && !m_creature->getVictim() && !urand(0, 5)) + { + AttackStart(who); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_creature->getVictim()) + DoMeleeAttackIfReady(); + + if (m_uiDespawnTimer < uiDiff) + m_creature->ForcedDespawn(); + else + m_uiDespawnTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_ouro_scarab(Creature* pCreature) +{ + return new npc_ouro_scarabAI(pCreature); +} + +struct go_sandworm_baseAI: public GameObjectAI +{ + go_sandworm_baseAI(GameObject* pGo) : GameObjectAI(pGo), m_bActive(true) {} + + bool m_bActive; + + bool OnUse(Unit* pUser) + { + WorldLocation loc; + pUser->GetObjectScale(); + pUser->GetPosition(loc); + + if (m_bActive) + { + m_bActive = false; + me->SendGameObjectCustomAnim(); + } + else + { + me->SetRespawnTime(0); + me->Delete(); + } + return false; + } +}; + +GameObjectAI* GetAIgo_sandworm_base(GameObject *pGo) +{ + return new go_sandworm_baseAI(pGo); +} + +void AddSC_boss_ouro() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_ouro"; + pNewScript->GetAI = &GetAI_boss_ouro; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_ouro_spawner"; + pNewScript->GetAI = &GetAI_npc_ouro_spawner; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_dirt_mound"; + pNewScript->GetAI = &GetAI_npc_dirt_mound; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_ouro_scarab"; + pNewScript->GetAI = &GetAI_npc_ouro_scarab; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_sandworm_base"; + pNewScript->GOGetAI = &GetAIgo_sandworm_base; + pNewScript->RegisterSelf(); +} diff --git a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_sartura.cpp b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_sartura.cpp index 22a0c86ab..bdd3ad3db 100644 --- a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_sartura.cpp +++ b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_sartura.cpp @@ -231,7 +231,7 @@ struct boss_sarturaAI : public ScriptedAI // If she is <25% enrage if (!m_bIsEnraged && m_creature->GetHealthPercent() <= 20.0f) { - if (DoCastSpellIfCan(m_creature, SPELL_ENRAGE, m_uiWhirlWindEndTimer ? CAST_TRIGGERED : 0) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_ENRAGE, m_uiWhirlWindEndTimer ? CF_TRIGGERED : 0) == CAST_OK) { DoScriptText(EMOTE_ENRAGE, m_creature); m_bIsEnraged = true; @@ -243,7 +243,7 @@ struct boss_sarturaAI : public ScriptedAI { if (m_uiEnrageHardTimer <= uiDiff) { - if (DoCastSpellIfCan(m_creature, SPELL_ENRAGEHARD, m_uiWhirlWindEndTimer ? CAST_TRIGGERED : 0) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_ENRAGEHARD, m_uiWhirlWindEndTimer ? CF_TRIGGERED : 0) == CAST_OK) { DoScriptText(EMOTE_ENRAGEHARD, m_creature); m_uiEnrageHardTimer = 0; diff --git a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_skeram.cpp b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_skeram.cpp index 5422fb3d3..deee4e967 100644 --- a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_skeram.cpp +++ b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_skeram.cpp @@ -228,7 +228,7 @@ struct boss_skeramAI : public ScriptedAI // Get closest target if (Player* target = GetNearestPlayer(40.0f)) { - if (DoCastSpellIfCan(target, SPELL_TRUE_FULFILLMENT, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(target, SPELL_TRUE_FULFILLMENT, CF_AURA_NOT_PRESENT) == CAST_OK) { // Cancel buffs on previous victim CancelFulfillment(); diff --git a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_viscidus.cpp b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_viscidus.cpp index 7c1a56205..13428f56f 100644 --- a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_viscidus.cpp +++ b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/boss_viscidus.cpp @@ -230,8 +230,8 @@ struct boss_viscidusAI : public ScriptedAI m_creature->SetObjectScale(m_initialScale); track.reset(); - DoCastSpellIfCan(m_creature, SPELL_MEMBRANE_VISCIDUS, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_WEAKNESS, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_MEMBRANE_VISCIDUS, CF_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_WEAKNESS, CF_TRIGGERED); ResetViscidusState(); } @@ -257,7 +257,7 @@ struct boss_viscidusAI : public ScriptedAI if (m_pInstance) m_pInstance->SetData(TYPE_VISCIDUS, FAIL); - DoCastSpellIfCan(m_creature, SPELL_DESPAWN_GLOBS, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_DESPAWN_GLOBS, CF_TRIGGERED); } void JustDied(Unit* /*pKiller*/) @@ -316,7 +316,7 @@ struct boss_viscidusAI : public ScriptedAI if (pSummoned->GetEntry() == NPC_GLOB_OF_VISCIDUS) { // should be a spell script! - if (DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_SHRINKS_HP, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_SHRINKS_HP, CF_TRIGGERED) == CAST_OK) { auto health = m_creature->GetHealth() - static_cast((m_creature->GetMaxHealth() * 0.05f)); @@ -364,7 +364,7 @@ struct boss_viscidusAI : public ScriptedAI { m_creature->SetVisibility(VISIBILITY_ON); - if (DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_SUICIDE, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_SUICIDE, CF_TRIGGERED) == CAST_OK) m_creature->DealDamage(m_creature, m_creature->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, nullptr, false); return; @@ -375,7 +375,7 @@ struct boss_viscidusAI : public ScriptedAI uint32 uiGlobeCount = m_creature->GetHealthPercent() / 5.0f; for (uint8 i = 0; i < uiGlobeCount; ++i) - DoCastSpellIfCan(m_creature, auiGlobSummonSpells[i], CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, auiGlobSummonSpells[i], CF_TRIGGERED); m_uiExplodeDelayTimer = 2500; // 2500(instead of 1000) makes glob summon effect more visible return; @@ -417,7 +417,7 @@ struct boss_viscidusAI : public ScriptedAI DoScriptText(EMOTE_FROZEN, m_creature); m_creature->RemoveAurasDueToSpell(SPELL_VISCIDUS_SLOWED_MORE); - DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_FREEZE, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_FREEZE, CF_TRIGGERED); } else if (m_uiHitCount >= HITCOUNT_SLOW_MORE) { @@ -426,7 +426,7 @@ struct boss_viscidusAI : public ScriptedAI DoScriptText(EMOTE_FREEZE, m_creature); m_creature->RemoveAurasDueToSpell(SPELL_VISCIDUS_SLOWED); } - DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_SLOWED_MORE, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_SLOWED_MORE, CF_TRIGGERED); } else if (m_uiHitCount >= HITCOUNT_SLOW) { @@ -434,7 +434,7 @@ struct boss_viscidusAI : public ScriptedAI { DoScriptText(EMOTE_SLOW, m_creature); } - DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_SLOWED, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_SLOWED, CF_TRIGGERED); } } } @@ -472,7 +472,7 @@ struct boss_viscidusAI : public ScriptedAI { if (m_uiGrowCount) { - DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_GROWS, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_GROWS, CF_TRIGGERED); m_creature->SetObjectScale(m_creature->GetObjectScale() + 0.04f); --m_uiGrowCount; } diff --git a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp index 80f103cd8..75077a3b4 100644 --- a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp @@ -809,7 +809,7 @@ struct AI_QirajiMindslayer : public ScriptedAI { } } if (closestPlayer) { - DoCastSpellIfCan(closestPlayer, 26049, CAST_TRIGGERED | CAST_INTERRUPT_PREVIOUS); + DoCastSpellIfCan(closestPlayer, 26049, CF_TRIGGERED | CF_INTERRUPT_PREVIOUS); } } diff --git a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp index 3e793f636..f71bc858b 100644 --- a/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp +++ b/src/scripts/kalimdor/silithus/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp @@ -310,7 +310,7 @@ struct aqsentinelAI : public ScriptedAI if (sent->isDead()) continue; m_bAlone = false; - DoCastSpellIfCan(sent, SPELL_TRANSFER, CAST_TRIGGERED); + DoCastSpellIfCan(sent, SPELL_TRANSFER, CF_TRIGGERED); uint32 h = sent->GetHealth() + (sent->GetMaxHealth() / 2); if (h > sent->GetMaxHealth()) h = sent->GetMaxHealth(); diff --git a/src/scripts/kalimdor/the_barrens/razorfen_downs/boss_amnennar_the_coldbringer.cpp b/src/scripts/kalimdor/the_barrens/razorfen_downs/boss_amnennar_the_coldbringer.cpp index 7122aef03..ae10044bf 100644 --- a/src/scripts/kalimdor/the_barrens/razorfen_downs/boss_amnennar_the_coldbringer.cpp +++ b/src/scripts/kalimdor/the_barrens/razorfen_downs/boss_amnennar_the_coldbringer.cpp @@ -64,7 +64,7 @@ struct boss_amnennar_the_coldbringerAI : public ScriptedAI Spectrals60 = false; Hp = false; aggro = false; - DoCastSpellIfCan(m_creature, SPELL_IMMUNE_FROST, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_IMMUNE_FROST, CF_AURA_NOT_PRESENT); } void Aggro(Unit *who) diff --git a/src/scripts/kalimdor/the_barrens/wailing_caverns/wailing_caverns.cpp b/src/scripts/kalimdor/the_barrens/wailing_caverns/wailing_caverns.cpp index 334e9c95a..b68bb05ad 100644 --- a/src/scripts/kalimdor/the_barrens/wailing_caverns/wailing_caverns.cpp +++ b/src/scripts/kalimdor/the_barrens/wailing_caverns/wailing_caverns.cpp @@ -667,28 +667,28 @@ struct EvolvingEctoplasmAI : public ScriptedAI if (pSpell->School == SPELL_SCHOOL_FROST) { // m_creature->SetDisplayId(1751); - DoCastSpellIfCan(m_creature, SPELL_IMMUNE_FROST, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_IMMUNE_FROST, CF_AURA_NOT_PRESENT); m_uiImmuneTimer = 10000; isImmune = true; } else if (pSpell->School == SPELL_SCHOOL_FIRE) { // m_creature->SetDisplayId(11138); - DoCastSpellIfCan(m_creature, SPELL_IMMUNE_FIRE, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_IMMUNE_FIRE, CF_AURA_NOT_PRESENT); m_uiImmuneTimer = 10000; isImmune = true; } else if (pSpell->School == SPELL_SCHOOL_NATURE) { // m_creature->SetDisplayId(4266); - DoCastSpellIfCan(m_creature, SPELL_IMMUNE_NATURE, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_IMMUNE_NATURE, CF_AURA_NOT_PRESENT); m_uiImmuneTimer = 10000; isImmune = true; } else if (pSpell->School == SPELL_SCHOOL_SHADOW) { // m_creature->SetDisplayId(767); - DoCastSpellIfCan(m_creature, SPELL_IMMUNE_SHADOW, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_IMMUNE_SHADOW, CF_AURA_NOT_PRESENT); m_uiImmuneTimer = 10000; isImmune = true; } diff --git a/src/scripts/kalimdor/ungoro_crater/ungoro_crater.cpp b/src/scripts/kalimdor/ungoro_crater/ungoro_crater.cpp index c008d88ab..067b6a44b 100644 --- a/src/scripts/kalimdor/ungoro_crater/ungoro_crater.cpp +++ b/src/scripts/kalimdor/ungoro_crater/ungoro_crater.cpp @@ -745,7 +745,7 @@ struct npc_simone_seductressAI : public ScriptedAI { if (pSpell && pSpell->Id == 14280) // Viper Sting (Rank 3) { - if (DoCastSpellIfCan(m_creature, SPELL_SILENCE, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_SILENCE, CF_TRIGGERED) == CAST_OK) DoScriptText(EMOTE_SILENCE, m_creature); } } diff --git a/src/scripts/kalimdor/winterspring/winterspring.cpp b/src/scripts/kalimdor/winterspring/winterspring.cpp index e9f401c11..06c49fe9f 100644 --- a/src/scripts/kalimdor/winterspring/winterspring.cpp +++ b/src/scripts/kalimdor/winterspring/winterspring.cpp @@ -292,7 +292,7 @@ struct npc_artoriusAI : public ScriptedAI { if (pSpell->Id == 13555 || pSpell->Id == 25295) // Serpent Sting (Rank 8 or Rank 9) { - if (DoCastSpellIfCan(m_creature, SPELL_STINGING_TRAUMA, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_STINGING_TRAUMA, CF_TRIGGERED) == CAST_OK) DoScriptText(EMOTE_POISON, m_creature); } } diff --git a/src/scripts/world/dragons_of_nightmare/boss_dragon_of_nightmare.cpp b/src/scripts/world/dragons_of_nightmare/boss_dragon_of_nightmare.cpp index 5a2b33d91..386ac46bc 100644 --- a/src/scripts/world/dragons_of_nightmare/boss_dragon_of_nightmare.cpp +++ b/src/scripts/world/dragons_of_nightmare/boss_dragon_of_nightmare.cpp @@ -40,7 +40,7 @@ void boss_dragon_of_nightmareAI::Reset() void boss_dragon_of_nightmareAI::Aggro(Unit* /*pWho*/) { - DoCastSpellIfCan(m_creature, SPELL_MARK_OF_NATURE, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_MARK_OF_NATURE, CF_TRIGGERED | CF_AURA_NOT_PRESENT); } void boss_dragon_of_nightmareAI::EnterEvadeMode() @@ -85,7 +85,7 @@ void boss_dragon_of_nightmareAI::UpdateAI(const uint32 uiDiff) if (m_uiSummonPlayerTimer > 6000) { - if (DoCastSpellIfCan(pTarget, SPELL_SUMMON_PLAYER, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(pTarget, SPELL_SUMMON_PLAYER, CF_TRIGGERED) == CAST_OK) m_uiSummonPlayerTimer = 0; } } @@ -94,8 +94,8 @@ void boss_dragon_of_nightmareAI::UpdateAI(const uint32 uiDiff) if (m_uiSeepingFogTimer <= uiDiff) { - DoCastSpellIfCan(m_creature, SPELL_SEEPING_FOG_RIGHT, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_SEEPING_FOG_LEFT, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SEEPING_FOG_RIGHT, CF_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SEEPING_FOG_LEFT, CF_TRIGGERED); m_uiSeepingFogTimer = 2 * MINUTE*IN_MILLISECONDS + 300; } @@ -145,7 +145,7 @@ struct npc_dream_fogAI : ScriptedPetAI void ResetCreature() override { - DoCastSpellIfCan(m_creature, SPELL_DREAM_FOG_AURA, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_DREAM_FOG_AURA, CF_TRIGGERED | CF_AURA_NOT_PRESENT); } void AttackedBy(Unit*) override {} diff --git a/src/scripts/world/dragons_of_nightmare/boss_emeriss.cpp b/src/scripts/world/dragons_of_nightmare/boss_emeriss.cpp index 2238b5fad..103a7c2cb 100644 --- a/src/scripts/world/dragons_of_nightmare/boss_emeriss.cpp +++ b/src/scripts/world/dragons_of_nightmare/boss_emeriss.cpp @@ -67,7 +67,7 @@ bool boss_emerissAI::UpdateDragonAI(const uint32 uiDiff) if (m_uiVolatileInfectionTimer <= uiDiff) { Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, nullptr, SELECT_FLAG_PLAYER_NOT_GM); - if (pTarget && DoCastSpellIfCan(pTarget, SPELL_VOLATILE_INFECTION, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (pTarget && DoCastSpellIfCan(pTarget, SPELL_VOLATILE_INFECTION, CF_AURA_NOT_PRESENT) == CAST_OK) m_uiVolatileInfectionTimer = urand(10000, 16000); } else diff --git a/src/scripts/world/dragons_of_nightmare/boss_lethon.cpp b/src/scripts/world/dragons_of_nightmare/boss_lethon.cpp index eaa4e802e..a0aad6824 100644 --- a/src/scripts/world/dragons_of_nightmare/boss_lethon.cpp +++ b/src/scripts/world/dragons_of_nightmare/boss_lethon.cpp @@ -35,7 +35,7 @@ void boss_lethonAI::Aggro(Unit* pWho) { boss_dragon_of_nightmareAI::Aggro(pWho); - DoCastSpellIfCan(m_creature, SPELL_SHADOW_BOLT_WHIRL, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_SHADOW_BOLT_WHIRL, CF_TRIGGERED | CF_AURA_NOT_PRESENT); DoScriptText(SAY_LETHON_AGGRO, m_creature); } diff --git a/src/scripts/world/dragons_of_nightmare/boss_taerar.cpp b/src/scripts/world/dragons_of_nightmare/boss_taerar.cpp index c382381b8..333f3ffb9 100644 --- a/src/scripts/world/dragons_of_nightmare/boss_taerar.cpp +++ b/src/scripts/world/dragons_of_nightmare/boss_taerar.cpp @@ -63,9 +63,9 @@ bool boss_taerarAI::DoSpecialAbility() { if (DoCastSpellIfCan(m_creature, SPELL_SELF_STUN) == CAST_OK) { - DoCastSpellIfCan(m_creature, SPELL_SHADE_OF_TAERAR_LEFT, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_SHADE_OF_TAERAR_RIGHT, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_SHADE_OF_TAERAR_FRONT, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SHADE_OF_TAERAR_LEFT, CF_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SHADE_OF_TAERAR_RIGHT, CF_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SHADE_OF_TAERAR_FRONT, CF_TRIGGERED); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/scripts/world/dragons_of_nightmare/boss_ysondre.cpp b/src/scripts/world/dragons_of_nightmare/boss_ysondre.cpp index 873f2d81c..6738c2b00 100644 --- a/src/scripts/world/dragons_of_nightmare/boss_ysondre.cpp +++ b/src/scripts/world/dragons_of_nightmare/boss_ysondre.cpp @@ -123,7 +123,7 @@ void npc_demented_druidAI::UpdateAI(const uint32 uiDiff) if (target && !target->HasAura(SPELL_CURSE_OF_THORNS)) { - if (DoCastSpellIfCan(target, SPELL_CURSE_OF_THORNS, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(target, SPELL_CURSE_OF_THORNS, CF_AURA_NOT_PRESENT) == CAST_OK) m_uiCurseOfThornsTimer = urand(13000, 16000); } } @@ -144,7 +144,7 @@ void npc_demented_druidAI::UpdateAI(const uint32 uiDiff) { Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, nullptr, SELECT_FLAG_PLAYER_NOT_GM | SELECT_FLAG_POWER_MANA); - if (target && DoCastSpellIfCan(target, SPELL_SILENCE, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (target && DoCastSpellIfCan(target, SPELL_SILENCE, CF_AURA_NOT_PRESENT) == CAST_OK) m_uiSilenceTimer = urand(10000, 14000); } else diff --git a/src/scripts/world/elemental_invasions.cpp b/src/scripts/world/elemental_invasions.cpp index 41dc0e6ec..8a5550a7b 100644 --- a/src/scripts/world/elemental_invasions.cpp +++ b/src/scripts/world/elemental_invasions.cpp @@ -214,7 +214,7 @@ struct npc_invaderAI : ScriptedAI case EVENT_IND_FIRE: if (m_uiShieldTimer < uiDiff) { - DoCastSpellIfCan(m_creature, SPELL_FIRE_SHIELD, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_FIRE_SHIELD, CF_AURA_NOT_PRESENT); m_uiShieldTimer = urand(6000, 8000); } else @@ -235,7 +235,7 @@ struct npc_invaderAI : ScriptedAI case EVENT_IND_AIR: if (m_uiShieldTimer < uiDiff) { - DoCastSpellIfCan(m_creature, SPELL_LIGHTN_SHIELD, CAST_AURA_NOT_PRESENT); + DoCastSpellIfCan(m_creature, SPELL_LIGHTN_SHIELD, CF_AURA_NOT_PRESENT); m_uiShieldTimer = urand(10000, 12000); } else diff --git a/src/scripts/world/npcs_special.cpp b/src/scripts/world/npcs_special.cpp index 5e6f67a66..e2c6bb107 100644 --- a/src/scripts/world/npcs_special.cpp +++ b/src/scripts/world/npcs_special.cpp @@ -1427,7 +1427,7 @@ struct npc_gnomish_battle_chickenAI : ScriptedPetAI { if (pDoneBy && m_bFuryReady) { - if (DoCastSpellIfCan(m_creature, SPELL_CHICKEN_FURY, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_CHICKEN_FURY, CF_TRIGGERED) == CAST_OK) { m_uiChickenFuryTimer = 25000; m_bFuryReady = false; @@ -1443,7 +1443,7 @@ struct npc_gnomish_battle_chickenAI : ScriptedPetAI { if (m_uiBattleSquawkTimer < uiDiff) { - if (DoCastSpellIfCan(m_creature, SPELL_BATTLE_SQUAWK, CAST_TRIGGERED) == CAST_OK) + if (DoCastSpellIfCan(m_creature, SPELL_BATTLE_SQUAWK, CF_TRIGGERED) == CAST_OK) m_bSquawkDone = true; } else @@ -1702,7 +1702,7 @@ struct npc_the_cleanerAI : public ScriptedAI void Reset() { - DoCastSpellIfCan(m_creature, SPELL_IMMUNITY, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_IMMUNITY, CF_TRIGGERED); m_uiDespawnTimer = 3000; } @@ -2378,7 +2378,7 @@ struct npc_shahramAI : ScriptedPetAI } } - if (shahramSpell && DoCastSpellIfCan(m_creature, shahramSpell, CAST_TRIGGERED) == CAST_OK) + if (shahramSpell && DoCastSpellIfCan(m_creature, shahramSpell, CF_TRIGGERED) == CAST_OK) { if (!hasCastDebuff) hasCastDebuff = true; diff --git a/src/scripts/world/world_event_naxxramas.cpp b/src/scripts/world/world_event_naxxramas.cpp index d079864f6..9d7598ef3 100644 --- a/src/scripts/world/world_event_naxxramas.cpp +++ b/src/scripts/world/world_event_naxxramas.cpp @@ -310,10 +310,10 @@ struct npc_necrotic_shard : public ScriptedAI if (GameObject* necropolis = m_creature->GetMap()->GetGameObject(_necropolisGuid)) necropolis->SendGameObjectCustomAnim(); // buff players around - DoCastSpellIfCan(m_creature, SPELL_DMG_BOOST_AT_PYLON_DEATH, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_DMG_BOOST_AT_PYLON_DEATH, CF_TRIGGERED); // send death to relay - DoCastSpellIfCan(m_creature, SPELL_COMMUNICATION_CAMP_RELAY, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_COMMUNICATION_CAMP_RELAY, CF_TRIGGERED); DespawnAdds(); } @@ -620,7 +620,7 @@ struct GhoulBerserker : public ScriptedAI void JustDied(Unit*) { if (Unit* shard = m_creature->FindNearestCreature(NPC_NECROTIC_SHARD, 100.0f)) - DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CAST_TRIGGERED); + DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CF_TRIGGERED); } void UpdateAI(const uint32 uiDiff) @@ -684,7 +684,7 @@ struct SpectralSoldierAI : public ScriptedAI void JustDied(Unit*) { if (Unit* shard = m_creature->FindNearestCreature(NPC_NECROTIC_SHARD, 100.0f)) - DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CAST_TRIGGERED); + DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CF_TRIGGERED); } void UpdateAI(const uint32 uiDiff) @@ -746,7 +746,7 @@ struct SkeletalShocktrooperAI : public ScriptedAI void JustDied(Unit*) { if (Unit* shard = m_creature->FindNearestCreature(NPC_NECROTIC_SHARD, 100.0f)) - DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CAST_TRIGGERED); + DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CF_TRIGGERED); } void UpdateAI(const uint32 uiDiff) @@ -807,7 +807,7 @@ struct SkeletalTrooperAI : public ScriptedAI void JustDied(Unit*) { if (Unit* shard = m_creature->FindNearestCreature(NPC_NECROTIC_SHARD, 100.0f)) - DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CAST_TRIGGERED); + DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CF_TRIGGERED); } void UpdateAI(const uint32 uiDiff) @@ -864,7 +864,7 @@ struct SpectralSpiritAI : public ScriptedAI void JustDied(Unit*) { if (Unit* shard = m_creature->FindNearestCreature(NPC_NECROTIC_SHARD, 100.0f)) - DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CAST_TRIGGERED); + DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CF_TRIGGERED); } void UpdateAI(const uint32 uiDiff) @@ -908,7 +908,7 @@ struct SpectralApparitionAI : public ScriptedAI void JustDied(Unit*) { if (Unit* shard = m_creature->FindNearestCreature(NPC_NECROTIC_SHARD, 100.0f)) - DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CAST_TRIGGERED); + DoCastSpellIfCan(me, SPELL_ZAP_CRYSTAL, CF_TRIGGERED); } void UpdateAI(const uint32 uiDiff) diff --git a/src/scripts/world/world_event_wareffort.cpp b/src/scripts/world/world_event_wareffort.cpp index 90798e451..7e2bcfcee 100644 --- a/src/scripts/world/world_event_wareffort.cpp +++ b/src/scripts/world/world_event_wareffort.cpp @@ -863,7 +863,7 @@ struct npc_resonating_CrystalAI : public ScriptedAI if (m_uiWisperingsTimer < uiDiff || (m_creature->GetCharm() && m_creature->GetCharm()->IsPolymorphed())) { if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - if (DoCastSpellIfCan(pTarget, SPELL_WHISPERINGS, CAST_AURA_NOT_PRESENT) == CAST_OK) + if (DoCastSpellIfCan(pTarget, SPELL_WHISPERINGS, CF_AURA_NOT_PRESENT) == CAST_OK) m_uiWisperingsTimer = 20000; } else