Guest User

Untitled

a guest
Oct 13th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 6.60 KB | None | 0 0
  1. /* ****************
  2. SMART_AI Pattern
  3. **************** */
  4.  
  5. DELETE FROM `smart_scripts` WHERE  `entryorguid`=0 AND `source_type`=0 AND `id`=0 AND `link`=0 LIMIT 1;
  6. INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
  7. (0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'COMMENT');
  8.  
  9. /* **************
  10. GOSSIP Pattern
  11. ************** */
  12.  
  13. SET @ENTRY:= XXXXX;
  14.  
  15. UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
  16. UPDATE `creature_template` SET `gossip_menu_id`=@ENTRY WHERE  `entry`=@ENTRY LIMIT 1;
  17. UPDATE `creature_template` SET `npcflag`=1 WHERE  `entry`=@ENTRY LIMIT 1;
  18.  
  19. DELETE FROM `npc_text` WHERE `ID`=@ENTRY;
  20. INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `lang0`, `prob0`, `em0_0`, `em0_1`, `em0_2`, `em0_3`, `em0_4`, `em0_5`, `text1_0`, `text1_1`, `lang1`, `prob1`, `em1_0`, `em1_1`, `em1_2`, `em1_3`, `em1_4`, `em1_5`, `text2_0`, `text2_1`, `lang2`, `prob2`, `em2_0`, `em2_1`, `em2_2`, `em2_3`, `em2_4`, `em2_5`, `text3_0`, `text3_1`, `lang3`, `prob3`, `em3_0`, `em3_1`, `em3_2`, `em3_3`, `em3_4`, `em3_5`, `text4_0`, `text4_1`, `lang4`, `prob4`, `em4_0`, `em4_1`, `em4_2`, `em4_3`, `em4_4`, `em4_5`, `text5_0`, `text5_1`, `lang5`, `prob5`, `em5_0`, `em5_1`, `em5_2`, `em5_3`, `em5_4`, `em5_5`, `text6_0`, `text6_1`, `lang6`, `prob6`, `em6_0`, `em6_1`, `em6_2`, `em6_3`, `em6_4`, `em6_5`, `text7_0`, `text7_1`, `lang7`, `prob7`, `em7_0`, `em7_1`, `em7_2`, `em7_3`, `em7_4`, `em7_5`, `WDBVerified`) VALUES
  21. (@ENTRY, 'NPC_TEXT', NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 1);
  22.  
  23. DELETE FROM `gossip_menu_option` WHERE `menu_id`=@ENTRY;
  24. INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES
  25. (@ENTRY, 0, 0, 'PLAYER_TEXT', 1, 1, 0, 0, 0, 0, NULL);
  26.  
  27. DELETE FROM `gossip_menu` WHERE `entry`=@ENTRY;
  28. INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
  29. (@ENTRY, @ENTRY);
  30.  
  31. /* ********************
  32. LOOT_TEMPLATE Pattern
  33. ******************** */
  34.  
  35. -- Creature
  36. DELETE FROM `creature_loot_template` WHERE  `entry`=0 AND `item`=0 LIMIT 1;
  37. INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES
  38. (0, 0, 100, 1, 0, 1, 1);
  39.  
  40. -- Gobject
  41. DELETE FROM `gameobject_loot_template` WHERE  `entry`=0 AND `item`=0 LIMIT 1;
  42. INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES
  43. (0, 0, 100, 1, 0, 1, 1);
  44.  
  45. -- Item
  46. DELETE FROM `item_loot_template` WHERE  `entry`=0 AND `item`=0 LIMIT 1;
  47. INSERT INTO `item_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES
  48. (0, 0, 100, 1, 0, 1, 1);
  49.  
  50. /* *************
  51. SPAWN Patterns
  52. ************* */
  53.  
  54. -- Creature
  55. SET @GUID := XXXXX;
  56.  
  57. DELETE FROM `creature` WHERE  `guid`=@GUID LIMIT 1;
  58. INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
  59. (@GUID, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0);
  60.  
  61. -- Object
  62. SET @GUID := XXXXX;
  63.  
  64. DELETE FROM `gameobject` WHERE  `guid`=@GUID LIMIT 1;
  65. INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
  66. (@GUID, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  67.  
  68. /* ****************
  69. CONDITION Pattern
  70. **************** */
  71.  
  72. DELETE FROM `conditions` WHERE  `SourceTypeOrReferenceId`=0 AND `SourceGroup`=0 AND `SourceEntry`=0 AND `SourceId`=0 AND `ElseGroup`=0 AND `ConditionTypeOrReference`=0 AND `ConditionTarget`=0 AND `ConditionValue1`=0 AND `ConditionValue2`=0 AND `ConditionValue3`=0 LIMIT 1;
  73. INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
  74. (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 'COMMENT');
  75.  
  76. /* **************************
  77. CREATURE_AI_SCRIPT Pattern
  78. ************************** */
  79. SET @ID := XXXXX
  80.  
  81. DELETE FROM `creature_ai_scripts` WHERE  `id`=@ID LIMIT 1;
  82. INSERT INTO `creature_ai_scripts` (`id`, `creature_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`, `comment`) VALUES
  83. (@ID, 0, 0, 0, 100, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'COMMENT');
  84.  
  85. /* **************************
  86. GAMEOBJECT_SCRIPT Pattern
  87. ************************** */
  88.  
  89. DELETE FROM `gameobject_scripts` WHERE  `id`=0 AND `delay`=0 AND `command`=0 LIMIT 1;
  90. INSERT INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES
  91. (0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  92.  
  93. /* **************************
  94. GAMEOBJECT_SCRIPT Pattern
  95. ************************** */
  96.  
  97. DELETE FROM `spell_scripts` WHERE  `id`=0 AND `effIndex`=0 AND `delay`=0 AND `command`=0 LIMIT 1;
  98. INSERT INTO `spell_scripts` (`id`, `effIndex`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES
  99. (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  100.  
  101. /* ***************
  102. UPDATES Patterns
  103. *************** */
  104.  
  105. UPDATE `quest_template` SET `QuestFlags`=0 WHERE `entry`=y;
  106. UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=y;
  107. UPDATE `creature_template` SET `AIName`='EventAI' WHERE `entry`=y;
  108. UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=y;
  109.  
  110.  
  111. -- END --
Add Comment
Please, Sign In to add comment