Aokromes

mangos Labyrinth

Mar 9th, 2012
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.50 KB | None | 0 0
  1. diff --git a/sql_mr/custom_mangos_tables.sql b/sql_mr/custom_mangos_tables.sql
  2. index cffee1d..4e7daad 100644
  3. --- a/sql_mr/custom_mangos_tables.sql
  4. +++ b/sql_mr/custom_mangos_tables.sql
  5. @@ -609,3 +609,101 @@ INSERT INTO mangos_string
  6. (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`)
  7. VALUES
  8. (983, 'Your Jail status was reset to 0 gesatzt', NULL, 'Votre statut a ?t? Jail ? 0 gesatzt', 'Dein Jail status wurde auf 0 zur?ck gesatzt', NULL, NULL, NULL, NULL, NULL);
  9. +
  10. +-- Custom Maze event
  11. +-- Here are the development of "Labyrinth."
  12. +
  13. +-- Labyrinth consisting of several layers is generated every time you call again, pseudorandomly. Algorithm throwing points: 5000 times in a closed square accidentally catches a point, randomly choose one of four directions, and from this point is the line up until it hits on another line (or until it reaches a maximum length). With this algorithm are obtained related to labyrinths (from anywhere can reach any other point), in addition, if you set a small limit of length - the maze is impossible to pass by the right / left hand.
  14. +
  15. +-- The patch adds two teams in the game:
  16. +-- ". Maze generate" - generates a maze of boxes and sets, walls, boxes, ladders, prize chest
  17. +-- ". Maze clean" - removes all objects from the map number 13 (Test)
  18. +-- The commands can be invoked from the server console or a character located on any map, but it is recommended that the character was on the map id 1913 (Testing).
  19. +
  20. +-- To work correctly, should be in the config Mangos change the following:
  21. +-- GuidReserveSize.GameObject = 1000000
  22. +
  23. +-- Labyrinth created in several game levels:
  24. +-- 1. The first level - the simplest and most ordinary maze task - to get out of the corner to the stairs in the center
  25. +-- 2. The second level - climbing the stairs to the wall of the maze proprygat on the walls to any angle to the next ladder
  26. +-- 3. The third level - a new maze at first, even easier than the first task - to get to the center, however, is closer to the center of the maze is complicated by increasing the walls and ceiling, closing the review.
  27. +-- 4. The fourth level - the most difficult, but small: indoor ceiling maze, a lot of holes in the floor (falling - a fine, return to level three), of hidden stairs difficult.
  28. +-- 5. The fifth level - the roof, here is the final chest-Quest Giver.
  29. +
  30. +-- SQL-patch creates a fully automated Event: Every Sunday at 21.00 at the site of memory Antonidas (Dalaran) there are 2 NPC giving the quest "Find the chest in the maze." After taking the quest, the player automatically teleported to the maze. Exit from the labyrinth - the return of the stone. Quest - a weekly, award - 25 posters Frost (you can easily modify it to the needs of the server).
  31. +
  32. +-- -> Levels maze created in such a way that you can easily monitor the players, flying over the levels.
  33. +-- + Before you run into a maze of players at the event-masters have the opportunity to hand editing in its structure - whether it be decorative jewelry, evil monsters (only on the lower level! ") Doors, or even new walkways / walls
  34. +
  35. +-- Authors:
  36. +-- Grayzer Rod
  37. +-- Liilith Rod
  38. +-- Vinolentus
  39. +
  40. +
  41. +-- = SQL = --
  42. +
  43. +-- Gameobject_template
  44. +REPLACE INTO `gameobject_template` VALUES
  45. +(13, 5, 31, 'Maze Box: Simple Wood (4)','','','', 0, 0, 3.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'' )
  46. +(12, 5, 31, 'Maze Box: Simple Wood (2)','','','', 0, 0, 1.6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'' )
  47. +(14, 3, 9069, 'Maze Winner Chest','','','', 0, 0, 1.5, 0, 0, 0, 0, 0, 0, 57, 14, 86400, 1, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'')
  48. +(18, 5, 6737, 'Maze Box: Fire Wood (4)','','','', 0, 0, 3.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'' )
  49. +(19, 5, 8994, 'Maze Box: Beer Wood (4)','','','', 0, 0, 3.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'' )
  50. +(15, 2, 9069, 'Maze Chest','','','', 0, 0, 1.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'');
  51. +
  52. +-- Rune npc
  53. +REPLACE INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid_1`, `modelid_2`, `modelid_3`, `modelid_4`, `name` , `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction_A`, `faction_H`, ` npcflag `,` speed_walk `,` speed_run `,` scale `,` rank `,` mindmg `,` maxdmg `,` dmgschool `,` attackpower `,` dmg_multiplier `,` baseattacktime `,` rangeattacktime `,` unit_class ` , `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, ` lootid `,` pickpocketloot `,` skinloot `,` resistance1 `,` resistance2 `,` resistance3 `,` resistance4 `,` resistance5 `,` resistance6 `,` spell1 `,` spell2 `,` spell3 `,` spell4 ` , `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `unk16`, `unk17`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, ` questItem4 `,` questItem5 `,` questItem6 `,` movementId `,` RegenHealth `,` equipment_id `,` trainer_id `,` vendor_id `,` mechanic_immune_mask `,` flags_extra `,` ScriptName `) VALUES (7, 0, 0 , 0, 0, 0, 11444, 11444, 11444, 11444, 'Rune', 'Thunderfury','', 0, 80, 80, 32000, 32000, 24000, 24000, 7637, 2007, 2007, 3, 1.48, 1.42857, 1, 4, 231, 346, 0, 87, 3.7, 2000, 1500, 1, 1, 0, 2, 0, 0, 0, 0, 185, 277, 70, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'', 0, 3, 1000, 1, 0, 0, 0, 0, 0, 0 , 0, 0, 1, 0, 0, 0, 1, 2,'');
  54. +DELETE FROM `creature` WHERE `id` = 7;
  55. +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation` , `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES
  56. +(230000, 7, 571, 1, 129, 0, 0, 5963.65, 693,663, 641,662, 4.1677, 25, 5, 0, 32000, 24000, 0, 0);
  57. +
  58. +-- Kerr npc
  59. +REPLACE INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid_1`, `modelid_2`, `modelid_3`, `modelid_4`, `name` , `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction_A`, `faction_H`, ` npcflag `,` speed_walk `,` speed_run `,` scale `,` rank `,` mindmg `,` maxdmg `,` dmgschool `,` attackpower `,` dmg_multiplier `,` baseattacktime `,` rangeattacktime `,` unit_class ` , `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, ` lootid `,` pickpocketloot `,` skinloot `,` resistance1 `,` resistance2 `,` resistance3 `,` resistance4 `,` resistance5 `,` resistance6 `,` spell1 `,` spell2 `,` spell3 `,` spell4 ` , `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `unk16`, `unk17`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, ` questItem4 `,` questItem5 `,` questItem6 `,` movementId `,` RegenHealth `,` equipment_id `,` trainer_id `,` vendor_id `,` mechanic_immune_mask `,` flags_extra `,` ScriptName `) VALUES (13, 0, 0 , 0, 0, 0, 599, 599, 599, 599, 'Kerr', 'Thunderfury','', 0, 80, 80, 32000, 32000, 24000, 24000, 7637, 2007, 2007, 3, 1.48, 1.42857, 1.5, 4, 231, 346, 0, 87, 3.7, 2000, 1500, 1, 1, 0, 2, 0, 0, 0, 0, 185, 277, 70, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'', 0, 3, 1000, 1, 0, 0, 0, 0, 0, 0 , 0, 0, 1, 0, 0, 0, 1, 2,'');
  60. +DELETE FROM `creature` WHERE `id` = 13;
  61. +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation` , `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES
  62. +(230001, 13, 571, 1, 129, 0, 0, 5961.85, 694,756, 641,521, 4.3507, 25, 5, 0, 32000, 24000, 0, 0);
  63. +
  64. +-- Quest 3
  65. +DELETE FROM `creature_questrelation` WHERE `quest` = 3;
  66. +DELETE FROM `gameobject_questrelation` WHERE `quest` = 3;
  67. +UPDATE `item_template` SET `StartQuest` = 0 WHERE `StartQuest` = 3;
  68. +INSERT INTO `creature_questrelation` (`id`, `quest`) VALUES (7, 3);
  69. +UPDATE `creature_template` SET `npcflag` = `npcflag` | 2 WHERE `entry` = 7;
  70. +DELETE FROM `creature_involvedrelation` WHERE `quest` = 3;
  71. +DELETE FROM `gameobject_involvedrelation` WHERE `quest` = 3;
  72. +INSERT INTO `gameobject_involvedrelation` (`id`, `quest`) VALUES (15, 3);
  73. +DELETE FROM `quest_start_scripts` WHERE `id` = 3;
  74. +INSERT INTO `quest_start_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3` , `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES
  75. +(3, 0, 6, 13, 0, 0, 0, 0, '0 ', '0', '0 ', '0', 123.8, 132.5, -144.7, 3.94, 'mazeAlliance');
  76. +REPLACE INTO `quest_template` (`entry`, `Method`, `ZoneOrSort`, `MinLevel`, `QuestLevel`, `Type`, `RequiredClasses`, `RequiredRaces`, `RequiredSkill`, `RequiredSkillValue`, `RepObjectiveFaction` , `RepObjectiveValue`, `RequiredMinRepFaction`, `RequiredMinRepValue`, `RequiredMaxRepFaction`, `RequiredMaxRepValue`, `SuggestedPlayers`, `LimitTime`, `QuestFlags`, `SpecialFlags`, `CharTitleId`, `PlayersSlain`, `BonusTalents`, ` PrevQuestId `,` NextQuestId `,` ExclusiveGroup `,` NextQuestInChain `,` RewXPId `,` SrcItemId `,` SrcItemCount `,` SrcSpell `,` Title `,` Details `,` Objectives `,` OfferRewardText `,` RequestItemsText ` , `EndText`, `CompletedText`, `ObjectiveText1`, `ObjectiveText2`, `ObjectiveText3`, `ObjectiveText4`, `ReqItemId1`, `ReqItemId2`, `ReqItemId3`, `ReqItemId4`, `ReqItemId5`, `ReqItemId6`, ` ReqItemCount1 `,` ReqItemCount2 `,` ReqItemCount3 `,` ReqItemCount4 `,` ReqItemCount5 `,` ReqItemCount6 ??`,` ReqSourceId1 `,` ReqSourceId2 `,` ReqSourceId3 `,` ReqSourceId4 `,` ReqSourceCount1 `,` ReqSourceCount2 `,` ReqSourceCount3 ` , `ReqSourceCount4`, `ReqCreatureOrGOId1`, `ReqCreatureOrGOId2`, `ReqCreatureOrGOId3`, `ReqCreatureOrGOId4`, `ReqCreatureOrGOCount1`, `ReqCreatureOrGOCount2`, `ReqCreatureOrGOCount3`, `ReqCreatureOrGOCount4`, `ReqSpellCast1`, `ReqSpellCast2`, `ReqSpellCast3`, ` ReqSpellCast4 `,` RewChoiceItemId1 `,` RewChoiceItemId2 `,` RewChoiceItemId3 `,` RewChoiceItemId4 `,` RewChoiceItemId5 `,` RewChoiceItemId6 `,` RewChoiceItemCount1 `,` RewChoiceItemCount2 `,` RewChoiceItemCount3 `,` RewChoiceItemCount4 `,` RewChoiceItemCount5 `,` RewChoiceItemCount6 ??` , `RewItemId1`, `RewItemId2`, `RewItemId3`, `RewItemId4`, `RewItemCount1`, `RewItemCount2`, `RewItemCount3`, `RewItemCount4`, `RewRepFaction1`, `RewRepFaction2`, `RewRepFaction3`, `RewRepFaction4`, ` RewRepFaction5 `,` RewRepValueId1 `,` RewRepValueId2 `,` RewRepValueId3 `,` RewRepValueId4 `,` RewRepValueId5 `,` RewRepValue1 `,` RewRepValue2 `,` RewRepValue3 `,` RewRepValue4 `,` RewRepValue5 `,` RewHonorAddition `,` RewHonorMultiplier ` , `RewOrReqMoney`, `RewMoneyMaxLevel`, `RewSpell`, `RewSpellCast`, `RewMailTemplateId`, `RewMailDelaySecs`, `PointMapId`, `PointX`, `PointY`, `PointOpt`, `DetailsEmote1`, `DetailsEmote2`, ` DetailsEmote3 `,` DetailsEmote4 `,` DetailsEmoteDelay1 `,` DetailsEmoteDelay2 `,` DetailsEmoteDelay3 `,` DetailsEmoteDelay4 `,` IncompleteEmote `,` CompleteEmote `,` OfferRewardEmote1 `,` OfferRewardEmote2 `,` OfferRewardEmote3 `,` OfferRewardEmote4 `,` OfferRewardEmoteDelay1 ` , `OfferRewardEmoteDelay2`, `OfferRewardEmoteDelay3`, `OfferRewardEmoteDelay4`, `StartScript`, `CompleteScript`) VALUES (3, 1, 0, 0, 0, 0, 0, 1101, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 32768, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 'Maze Enterance (Alliance)', 'Hi, my name is Rune and I - one of the founders of the giant, automatically generated maze in WoW. If you want, you can sign in and try to find a way upstairs to a chest that I have prepared for you. ',' Find chest in maze. ',' You finally found the trunk and take out a deserved reward from it. Thanks for playing! If you liked the maze, please visit http://diary.ru/ ~ world-of-warcraft> MAZE and leave your comments! ','',' Enter to maze ','','','','','', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49426, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0);
  77. +DELETE FROM `areatrigger_involvedrelation` WHERE `quest` = 3;
  78. +INSERT INTO `areatrigger_involvedrelation` (`id`, `quest`) VALUES (0, 3);
  79. +
  80. +-- Quest 4
  81. +DELETE FROM `creature_questrelation` WHERE `quest` = 4;
  82. +DELETE FROM `gameobject_questrelation` WHERE `quest` = 4;
  83. +UPDATE `item_template` SET `StartQuest` = 0 WHERE `StartQuest` = 4;
  84. +INSERT INTO `creature_questrelation` (`id`, `quest`) VALUES (13, 4);
  85. +UPDATE `creature_template` SET `npcflag` = `npcflag` | 2 WHERE `entry` = 13;
  86. +DELETE FROM `creature_involvedrelation` WHERE `quest` = 4;
  87. +DELETE FROM `gameobject_involvedrelation` WHERE `quest` = 4;
  88. +INSERT INTO `gameobject_involvedrelation` (`id`, `quest`) VALUES (15, 4);
  89. +DELETE FROM `quest_start_scripts` WHERE `id` = 4;
  90. +INSERT INTO `quest_start_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3` , `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES
  91. +(4, 0, 6, 13, 0, 0, 0, 0, '0 ', '0', '0 ', '0', -124.1, -132.5, -144.7, 0.81, 'mazeHorde');
  92. +REPLACE INTO `quest_template` (`entry`, `Method`, `ZoneOrSort`, `MinLevel`, `QuestLevel`, `Type`, `RequiredClasses`, `RequiredRaces`, `RequiredSkill`, `RequiredSkillValue`, `RepObjectiveFaction` , `RepObjectiveValue`, `RequiredMinRepFaction`, `RequiredMinRepValue`, `RequiredMaxRepFaction`, `RequiredMaxRepValue`, `SuggestedPlayers`, `LimitTime`, `QuestFlags`, `SpecialFlags`, `CharTitleId`, `PlayersSlain`, `BonusTalents`, ` PrevQuestId `,` NextQuestId `,` ExclusiveGroup `,` NextQuestInChain `,` RewXPId `,` SrcItemId `,` SrcItemCount `,` SrcSpell `,` Title `,` Details `,` Objectives `,` OfferRewardText `,` RequestItemsText ` , `EndText`, `CompletedText`, `ObjectiveText1`, `ObjectiveText2`, `ObjectiveText3`, `ObjectiveText4`, `ReqItemId1`, `ReqItemId2`, `ReqItemId3`, `ReqItemId4`, `ReqItemId5`, `ReqItemId6`, ` ReqItemCount1 `,` ReqItemCount2 `,` ReqItemCount3 `,` ReqItemCount4 `,` ReqItemCount5 `,` ReqItemCount6 ??`,` ReqSourceId1 `,` ReqSourceId2 `,` ReqSourceId3 `,` ReqSourceId4 `,` ReqSourceCount1 `,` ReqSourceCount2 `,` ReqSourceCount3 ` , `ReqSourceCount4`, `ReqCreatureOrGOId1`, `ReqCreatureOrGOId2`, `ReqCreatureOrGOId3`, `ReqCreatureOrGOId4`, `ReqCreatureOrGOCount1`, `ReqCreatureOrGOCount2`, `ReqCreatureOrGOCount3`, `ReqCreatureOrGOCount4`, `ReqSpellCast1`, `ReqSpellCast2`, `ReqSpellCast3`, ` ReqSpellCast4 `,` RewChoiceItemId1 `,` RewChoiceItemId2 `,` RewChoiceItemId3 `,` RewChoiceItemId4 `,` RewChoiceItemId5 `,` RewChoiceItemId6 `,` RewChoiceItemCount1 `,` RewChoiceItemCount2 `,` RewChoiceItemCount3 `,` RewChoiceItemCount4 `,` RewChoiceItemCount5 `,` RewChoiceItemCount6 ??` , `RewItemId1`, `RewItemId2`, `RewItemId3`, `RewItemId4`, `RewItemCount1`, `RewItemCount2`, `RewItemCount3`, `RewItemCount4`, `RewRepFaction1`, `RewRepFaction2`, `RewRepFaction3`, `RewRepFaction4`, ` RewRepFaction5 `,` RewRepValueId1 `,` RewRepValueId2 `,` RewRepValueId3 `,` RewRepValueId4 `,` RewRepValueId5 `,` RewRepValue1 `,` RewRepValue2 `,` RewRepValue3 `,` RewRepValue4 `,` RewRepValue5 `,` RewHonorAddition `,` RewHonorMultiplier ` , `RewOrReqMoney`, `RewMoneyMaxLevel`, `RewSpell`, `RewSpellCast`, `RewMailTemplateId`, `RewMailDelaySecs`, `PointMapId`, `PointX`, `PointY`, `PointOpt`, `DetailsEmote1`, `DetailsEmote2`, ` DetailsEmote3 `,` DetailsEmote4 `,` DetailsEmoteDelay1 `,` DetailsEmoteDelay2 `,` DetailsEmoteDelay3 `,` DetailsEmoteDelay4 `,` IncompleteEmote `,` CompleteEmote `,` OfferRewardEmote1 `,` OfferRewardEmote2 `,` OfferRewardEmote3 `,` OfferRewardEmote4 `,` OfferRewardEmoteDelay1 ` , `OfferRewardEmoteDelay2`, `OfferRewardEmoteDelay3`, `OfferRewardEmoteDelay4`, `StartScript`, `CompleteScript`) VALUES (4, 1, 0, 0, 0, 0, 0, 690, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 32768, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 'Maze Enterance (Horde)', 'Hi, my name is Kerr and I - one of the founders of the giant, automatically generated maze in WoW. If you want, you can sign in and try to find a way upstairs to a chest that I have prepared for you. ',' Find chest in maze. ',' You finally found the trunk and take out a deserved reward from it. Thanks for playing! If you liked the maze, please visit http://diary.ru/ ~ world-of-warcraft> MAZE and leave your comments! ','',' Enter to maze ','','','','','', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49426, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0);
  93. +
  94. +-- Game event 399
  95. +REPLACE INTO `game_event` (`entry`, `start_time`, `end_time`, `occurence`, `length`, `holiday`, `description`) VALUES (399, '2011-05-08 21:00:00 ', '2020-12-30 22:00:00', 10080, 240, 0, 'Maze Event');
  96. +DELETE FROM `game_event_creature` WHERE abs (`event`) = 399;
  97. +INSERT INTO `game_event_creature` (`guid`, `event`) VALUES
  98. +(230000,399)
  99. +(230001,399);
  100. +DELETE FROM `game_event_gameobject` WHERE abs (`event`) = 399;
  101. +
  102. +-- RUS local
  103. +REPLACE INTO `locales_quest` VALUES
  104. +(3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Entrance to the maze (the Alliance)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Hi, my name is Rune and I - one of the founders of the giant maze in WoW. If you prefer, you can sign in and try to find a way upstairs to a chest that I have prepared for you. ', NULL, NULL, NULL, NULL, NULL, NULL, NULL,' Find the chest in the maze. ', NULL, NULL, NULL, NULL, NULL, NULL, NULL,' Finally you have found the trunk and take out of it well deserved award. Thanks for playing! If you liked the maze, please visit http://diary.ru / ~ world-of-warcraft> MAZE and leave your comments! ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,' Sign in a maze . ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  105. +(4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Entrance to the maze (Horde)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Hi, my name is Kerr and I - one of the founders of the giant maze in WoW. If you prefer, you can sign in and try to find a way upstairs to a chest that I have prepared for you. ', NULL, NULL, NULL, NULL, NULL, NULL, NULL,' Find the chest in the maze. ', NULL, NULL, NULL, NULL, NULL, NULL, NULL,' Finally you have found the trunk and take out of it well deserved award. Thanks for playing! If you liked the maze, please visit http://diary.ru / ~ world-of-warcraft> MAZE and leave your comments! ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,' Sign in a maze . ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
  106. +
  107. diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
  108. index f3cf7c1..4b5331c 100644
  109. --- a/src/game/Chat.cpp
  110. +++ b/src/game/Chat.cpp
  111. @@ -744,6 +744,13 @@ ChatCommand * ChatHandler::getCommandTable()
  112. { NULL, 0, false, NULL, "", NULL }
  113. };
  114.  
  115. + static ChatCommand mazeCommandTable[] =
  116. + {
  117. + { "generate", SEC_GAMEMASTER, true, &ChatHandler::HandleMazeGenerateCommand, "", NULL },
  118. + { "clean", SEC_GAMEMASTER, true, &ChatHandler::HandleMazeCleanCommand, "", NULL },
  119. + { NULL, 0, true, NULL, "", NULL }
  120. + };
  121. +
  122. static ChatCommand commandTable[] =
  123. {
  124. { "account", SEC_PLAYER, true, NULL, "", accountCommandTable },
  125. @@ -764,6 +771,7 @@ ChatCommand * ChatHandler::getCommandTable()
  126. { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable },
  127. { "lookup", SEC_MODERATOR, true, NULL, "", lookupCommandTable },
  128. { "modify", SEC_MODERATOR, false, NULL, "", modifyCommandTable },
  129. + { "maze", SEC_GAMEMASTER, true, NULL, "", mazeCommandTable },
  130. { "npc", SEC_MODERATOR, false, NULL, "", npcCommandTable },
  131. { "pool", SEC_GAMEMASTER, true, NULL, "", poolCommandTable },
  132. { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable },
  133. diff --git a/src/game/Chat.h b/src/game/Chat.h
  134. index e617f41..70d5301 100644
  135. --- a/src/game/Chat.h
  136. +++ b/src/game/Chat.h
  137. @@ -326,6 +326,11 @@ class MANGOS_DLL_SPEC ChatHandler
  138. bool HandleLookupTeleCommand(char* args);
  139. bool HandleLookupTitleCommand(char* args);
  140.  
  141. + bool HandleMazeGenerateCommand(char* args);
  142. + bool HandleMazeCleanCommand(char* args);
  143. + bool MazeAddStaircase(int x, int y, int z, int height);
  144. + bool MazeAddGameObject(int id, float x, float y, float z, float o);
  145. +
  146. bool HandleModifyHPCommand(char* args);
  147. bool HandleModifyManaCommand(char* args);
  148. bool HandleModifyRageCommand(char* args);
  149. diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
  150. index 986c0ec..f15da29 100644
  151. --- a/src/game/Level2.cpp
  152. +++ b/src/game/Level2.cpp
  153. @@ -5421,3 +5421,339 @@ bool ChatHandler::HandleTitlesCurrentCommand(char* args)
  154.  
  155. return true;
  156. }
  157. +
  158. +// maze maze
  159. +
  160. +const int MAZE_MAP_ID = 13;
  161. +
  162. +bool ChatHandler::HandleMazeCleanCommand(char* args)
  163. +{
  164. + Map* map = sMapMgr.FindMap(MAZE_MAP_ID);
  165. + if (!map){
  166. + SendSysMessage("Maze Clean: Map (id 13) does not exist.");
  167. + return false;
  168. + }
  169. +
  170. + SendSysMessage("Maze Clean: start working");
  171. +
  172. + QueryResult *result = WorldDatabase.PQuery("SELECT guid FROM gameobject WHERE map = 13");
  173. + uint32 count = 0;
  174. +
  175. + if (result)
  176. + {
  177. + do
  178. + {
  179. + uint32 guid = result->Fetch()[0].GetUInt32();
  180. + if (GameObjectData const* data = sObjectMgr.GetGOData(guid)){
  181. + if (GameObject* obj = map->GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, data->id, guid))){
  182. + obj->SetRespawnTime(0);
  183. + obj->Delete();
  184. + ++count;
  185. + }
  186. + }
  187. + }
  188. + while (result->NextRow());
  189. + delete result;
  190. + }
  191. +
  192. + WorldDatabase.Execute("DELETE FROM gameobject WHERE map = 13");
  193. +
  194. + SendSysMessage("Maze Clean: All objects deleted from map 13");
  195. +
  196. + return true;
  197. +}
  198. +
  199. +int getRandomBoxId(){
  200. + switch(rand()%3){
  201. + case 0: return 13; break;
  202. + case 1: return 18; break;
  203. + case 2: return 19; break;
  204. + }
  205. + return 0;
  206. +}
  207. +
  208. +// Z: -144.708649
  209. +// map: 13 (Test)
  210. +// xy +- -145 (290-290)
  211. +// Runebox: 4.00f-4.27f (72-68)
  212. + const int iterations = 5000;
  213. + const float xStepSize = 4.00f;
  214. + const float yStepSize = 4.27f;
  215. + const float zStepSize = 4.00f;
  216. + const float xStart = -128.0f;
  217. + const float yStart = -136.79f;
  218. + const float zStart = -144.7f;
  219. +
  220. + const int xSteps = 64;
  221. + const int ySteps = 64;
  222. + const int zSteps = 4;
  223. + const int width = xSteps/8; // (64\8=8)
  224. +
  225. + // main maze bool array 3D
  226. + bool maze[xSteps+1][ySteps+1][zSteps+1];
  227. +
  228. +bool ChatHandler::HandleMazeGenerateCommand (char* args){
  229. + SendSysMessage("Maze Generate: start working, 'some lags was occured!'");
  230. + int level;
  231. + if (*args) level = (int)atoi(args);
  232. + else level = 0;
  233. +
  234. + int i, x, y, z;
  235. + int d, dx, dy, count;
  236. +
  237. + if (level==0||level==-1){
  238. + SendSysMessage("Maze Generate: maze[xSteps+1][ySteps+1][zSteps];");
  239. + int wallLength = 0;
  240. +// cleaning maze
  241. + for (x=0; x<=xSteps; x++)
  242. + for (y=0; y<=ySteps; y++)
  243. + for (z=0; z<=zSteps; z++)
  244. + maze[x][y][z]=false;
  245. +// get all floors (0..zSteps)
  246. + for (z=1; z<=zSteps; z++){
  247. + switch(z){
  248. + case 1: wallLength=8; break;
  249. + case 2: wallLength=6; break;
  250. + case 3: wallLength=4; break;
  251. + }
  252. +// draw perimeter
  253. + for (x=0; x<=xSteps; x++) {
  254. + maze[x][0][z]=true;
  255. + maze[x][ySteps][z]=true;
  256. + }
  257. + for (y=0; y<=ySteps; y++) {
  258. + maze[0][y][z]=true;
  259. + maze[xSteps][y][z]=true;
  260. + }
  261. + if (z==3){ // if floor 3 then need more perimetrs
  262. + for (x=0; x<=xSteps; x++) {
  263. + maze[x][1/4*ySteps][z]=true;
  264. + maze[x][3/4*ySteps][z]=true;
  265. + }
  266. + for (y=0; y<=ySteps; y++) {
  267. + maze[1/4*xSteps][y][z]=true;
  268. + maze[3/4*xSteps][y][z]=true;
  269. + }
  270. + }
  271. +// generate wall-bytes
  272. + for (i=0; i<=iterations; i++){
  273. + x = (rand() % (xSteps/2)) * 2;
  274. + y = (rand() % (ySteps/2)) * 2; // take a random even point within the maze
  275. + if (maze[x][y][z]) continue; // if at this point already is a wall, then continue to randomly throw points
  276. + d = rand() % 4; // otherwise recoverable random direction
  277. + switch (d){
  278. + case 0: dx= 1; dy= 0; break;
  279. + case 1: dx=-1; dy= 0; break;
  280. + case 2: dx= 0; dy= 1; break;
  281. + case 3: dx= 0; dy=-1; break;
  282. + } // and express it through dx, dy
  283. + count=0;
  284. + while (!maze[x][y][z] && count<=wallLength){ // until we meet another wall
  285. + maze[x][y][z]=true; // establish its wall
  286. + x+=dx;
  287. + y+=dy; // go to next cell
  288. + count++;
  289. + }
  290. + }
  291. +// make central cell empty for a staircase
  292. + maze[xSteps/2+0][ySteps/2+0][z]=false;
  293. + maze[xSteps/2+1][ySteps/2+0][z]=false;
  294. + maze[xSteps/2-1][ySteps/2+0][z]=false;
  295. + maze[xSteps/2+0][ySteps/2+1][z]=false;
  296. + maze[xSteps/2+0][ySteps/2-1][z]=false;
  297. + }
  298. + }
  299. +
  300. + if (level==0||level==1){
  301. + SendSysMessage("Maze Generate: placing level 1: walls of 1st floor");
  302. + for (int x = 0; x <= xSteps; x++)
  303. + for (int y = 0; y <= ySteps; y++)
  304. + if (maze[x][y][1]) // get info from maze[x][y][1]
  305. + MazeAddGameObject(getRandomBoxId(), xStart+(x*xStepSize), yStart+(y*yStepSize), zStart+((1-1)*zStepSize), 0.0f);
  306. + }
  307. +
  308. + if (level==0||level==2){
  309. + SendSysMessage("Maze Generate: placing level 2: walls of 1st floor, ground of microlevel");
  310. + for (int x = 0; x <= xSteps; x++)
  311. + for (int y = 0; y <= ySteps; y++)
  312. + if (maze[x][y][1]&&(((x+y)%4)!=0)) // get info from maze[x][y][1], but delete every 4th block
  313. + MazeAddGameObject(getRandomBoxId(), xStart+(x*xStepSize), yStart+(y*yStepSize), zStart+((2-1)*zStepSize), 0.0f);
  314. + }
  315. +//SendSysMessage("Maze Generate: skipping level 3: empty walls of 2st floor");
  316. +//SendSysMessage("Maze Generate: skipping level 4: empty roof of 2st floor");
  317. +
  318. + if (level==0||level==5){
  319. + SendSysMessage("Maze Generate: placing level 5: ground of 2nd floor");
  320. + for (int x = 0; x <= xSteps; x++)
  321. + for (int y = 0; y <= ySteps; y++){
  322. + if (!((x==1||x==xSteps-1)&&(y==1||y==ySteps-1)))
  323. + if (!maze[x][y][2])
  324. + MazeAddGameObject(13, xStart+(x*xStepSize), yStart+(y*yStepSize), zStart+((5-1)*zStepSize), 0.0f);
  325. + }
  326. + }
  327. +
  328. + if (level==0||level==6){
  329. + SendSysMessage("Maze Generate: placing level 6: walls of 2nd floor");
  330. + for (int x = 0; x <= xSteps; x++)
  331. + for (int y = 0; y <= ySteps; y++)
  332. + if (maze[x][y][2]) // get info from maze[x][y][2]
  333. + MazeAddGameObject(getRandomBoxId(), xStart+(x*xStepSize), yStart+(y*yStepSize), zStart+((6-1)*zStepSize), 0.0f);
  334. + }
  335. +
  336. + if (level==0||level==7){
  337. + SendSysMessage("Maze Generate: placing level 7: walls of 2nd floor (only in center 1\4)");
  338. + for (int x = 1*xSteps/4; x <= 3*xSteps/4; x++)
  339. + for (int y = 1*ySteps/4; y <= 3*ySteps/4; y++)
  340. + if (maze[x][y][2]) // get info from maze[x][y][2], but placing only in center 1\4
  341. + MazeAddGameObject(getRandomBoxId(), xStart+(x*xStepSize), yStart+(y*yStepSize), zStart+((7-1)*zStepSize), 0.0f);
  342. + }
  343. +
  344. + if (level==0||level==8){
  345. + SendSysMessage("Maze Generate: placing level 8: hole-roof of 2nd floor - hole-ground of 3rd floor ");
  346. + for (int x = 1*xSteps/4; x <= 3*xSteps/4; x++)
  347. + for (int y = 1*ySteps/4; y <= 3*ySteps/4; y++) // (only in center 1\4)
  348. + if ((((x+y)%2)!=0)||(x==1*xSteps/4||x==3*xSteps/4||y==1*ySteps/4||y==3*ySteps/4)) // every 2nd box to delete (except perimetr)
  349. + MazeAddGameObject(13, xStart+(x*xStepSize), yStart+(y*yStepSize), zStart+((8-1)*zStepSize), 0.0f);
  350. + }
  351. +
  352. + if (level==0||level==9){
  353. + SendSysMessage("Maze Generate: placing level 9: walls of 3rd floor");
  354. + for (int x = 1*xSteps/4; x <= 3*xSteps/4; x++)
  355. + for (int y = 1*ySteps/4; y <= 3*ySteps/4; y++) // (only in center 1\4)
  356. + if (maze[x][y][3]) // get info from maze[x][y][3]
  357. + MazeAddGameObject(getRandomBoxId(), xStart+(x*xStepSize), yStart+(y*yStepSize), zStart+((9-1)*zStepSize), 0.0f);
  358. + }
  359. +
  360. + if (level==0||level==10){
  361. + SendSysMessage("Maze Generate: placing level 10: walls(2) of 3rd floor");
  362. + for (int x = 1*xSteps/4; x <= 3*xSteps/4; x++)
  363. + for (int y = 1*ySteps/4; y <= 3*ySteps/4; y++) // (only in center 1\4)
  364. + if (maze[x][y][3]) // get info from maze[x][y][3]
  365. + MazeAddGameObject(getRandomBoxId(), xStart+(x*xStepSize), yStart+(y*yStepSize), zStart+((10-1)*zStepSize), 0.0f);
  366. + }
  367. +
  368. + if (level==0||level==11){
  369. + SendSysMessage("Maze Generate: placing level 11: roof of 3rd floor (only in center 1\4)");
  370. + for (int x = 1*xSteps/4; x <= 3*xSteps/4; x++)
  371. + for (int y = 1*ySteps/4; y <= 3*ySteps/4; y++)
  372. + if (!((x==xSteps/2+width+1||x==xSteps/2-width-1)&&(y==ySteps/2+width+1||y==ySteps/2-width-1))) // holes on 1\4 corner
  373. + MazeAddGameObject(13, xStart+(x*xStepSize), yStart+(y*yStepSize), zStart+((11-1)*zStepSize), 0.0f);
  374. + }
  375. +
  376. + if (level==0||level==12){
  377. + int lvl = 12;
  378. + SendSysMessage("Maze Generate: placing level 12: walls and chests of 4th WIN-floor");
  379. + for (int i = xSteps/2-width; i<=xSteps/2+width; i++){
  380. + MazeAddGameObject(19, xStart+(i*xStepSize), yStart+yStepSize*(ySteps/2-1), zStart+((lvl-1)*zStepSize), 0.0f);
  381. + MazeAddGameObject(19, xStart+(i*xStepSize), yStart+yStepSize*(ySteps/2-width), zStart+((lvl-1)*zStepSize), 0.0f);
  382. + MazeAddGameObject(19, xStart+(i*xStepSize), yStart+yStepSize*(ySteps/2+1), zStart+((lvl-1)*zStepSize), 0.0f);
  383. + MazeAddGameObject(19, xStart+(i*xStepSize), yStart+yStepSize*(ySteps/2+width), zStart+((lvl-1)*zStepSize), 0.0f);
  384. + }
  385. + for (int i = ySteps/2-width; i<=ySteps/2+width; i++){
  386. + MazeAddGameObject(19, xStart+xStepSize*(xSteps/2-1), yStart+(i*yStepSize), zStart+((lvl-1)*zStepSize), 0.0f);
  387. + MazeAddGameObject(19, xStart+xStepSize*(xSteps/2-width), yStart+(i*yStepSize), zStart+((lvl-1)*zStepSize), 0.0f);
  388. + MazeAddGameObject(19, xStart+xStepSize*(xSteps/2+1), yStart+(i*yStepSize), zStart+((lvl-1)*zStepSize), 0.0f);
  389. + MazeAddGameObject(19, xStart+xStepSize*(xSteps/2+width), yStart+(i*yStepSize), zStart+((lvl-1)*zStepSize), 0.0f);
  390. + }
  391. + // maze win chests
  392. + //MazeAddGameObject(14, xStart+(xSteps/2-width/2)*xStepSize, yStart+(ySteps/2-width/2)*yStepSize, zStart+((lvl-1)*zStepSize), 0.0f);
  393. + //MazeAddGameObject(14, xStart+(xSteps/2-width/2)*xStepSize, yStart+(ySteps/2+width/2)*yStepSize, zStart+((lvl-1)*zStepSize), 0.0f);
  394. + //MazeAddGameObject(14, xStart+(xSteps/2+width/2)*xStepSize, yStart+(ySteps/2-width/2)*yStepSize, zStart+((lvl-1)*zStepSize), 0.0f);
  395. + //MazeAddGameObject(14, xStart+(xSteps/2+width/2)*xStepSize, yStart+(ySteps/2+width/2)*yStepSize, zStart+((lvl-1)*zStepSize), 0.0f);
  396. +
  397. + MazeAddGameObject(19, xStart+(xSteps/2)*xStepSize, yStart+(ySteps/2)*yStepSize, zStart+((lvl-1)*zStepSize), 0.0f); // central box
  398. + MazeAddGameObject(15, xStart+(xSteps/2)*xStepSize, yStart+(ySteps/2)*yStepSize, zStart+((lvl+0)*zStepSize), 0.0f); // win chest
  399. + }
  400. +
  401. + if (level==0||level==-2){
  402. + SendSysMessage("Maze Generate: placing staircases");
  403. +// center 1->3
  404. + MazeAddStaircase(xSteps/2, ySteps/2, 0, 4);
  405. + // corner 3->6
  406. + MazeAddStaircase(xSteps-1, ySteps-1, 2, 6);
  407. + MazeAddStaircase( 1, ySteps-1, 2, 6);
  408. + MazeAddStaircase(xSteps-1, 1, 2, 6);
  409. + MazeAddStaircase( 1, 1, 2, 6);
  410. +// center 6->9
  411. + MazeAddStaircase(xSteps/2, ySteps/2, 5, 6);
  412. +// 1\8 corner 9->13
  413. + MazeAddStaircase(xSteps/2+width+1, ySteps/2+width+1, 8, 8);
  414. + MazeAddStaircase(xSteps/2-width-1, ySteps/2+width+1, 8, 8);
  415. + MazeAddStaircase(xSteps/2+width+1, ySteps/2-width-1, 8, 8);
  416. + MazeAddStaircase(xSteps/2-width-1, ySteps/2-width-1, 8, 8);
  417. + }
  418. +
  419. + SendSysMessage("Maze Generate: done!");
  420. + return true;
  421. +}
  422. +
  423. +bool ChatHandler::MazeAddStaircase(int x, int y, int z, int height){
  424. + int i;
  425. + float dx, dy;
  426. + for (i = 0; i<height; i++){
  427. + switch(i%4){
  428. + case 0: dx= 1.0f; dy= 1.0f; break;
  429. + case 1: dx=-1.0f; dy= 1.0f; break;
  430. + case 2: dx=-1.0f; dy=-1.0f; break;
  431. + case 3: dx= 1.0f; dy=-1.0f; break;
  432. + }
  433. + MazeAddGameObject(12, xStart+(x*xStepSize)+dx, yStart+(y*yStepSize)+dy, zStart+(z*zStepSize)+(i*zStepSize/2), 0.0f);
  434. + }
  435. + return true;
  436. +}
  437. +
  438. +bool ChatHandler::MazeAddGameObject(int id, float x, float y, float z, float o)
  439. +{
  440. + const GameObjectInfo *gInfo = ObjectMgr::GetGameObjectInfo(id);
  441. +
  442. + if (!gInfo)
  443. + {
  444. + // PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
  445. + SetSentErrorMessage(true);
  446. + return false;
  447. + }
  448. +
  449. + if (gInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(gInfo->displayId))
  450. + {
  451. + // report to DB errors log as in loading case
  452. + sLog.outErrorDb("Gameobject (Entry %u GoType: %u) have invalid displayId (%u), not spawned.",id, gInfo->type, gInfo->displayId);
  453. + // PSendSysMessage(LANG_GAMEOBJECT_HAVE_INVALID_DATA,id);
  454. + SetSentErrorMessage(true);
  455. + return false;
  456. + }
  457. +
  458. + Map* map = sMapMgr.FindMap(MAZE_MAP_ID);
  459. +
  460. + GameObject* pGameObj = new GameObject;
  461. +
  462. + // used guids from specially reserved range (can be 0 if no free values)
  463. + uint32 db_lowGUID = sObjectMgr.GenerateStaticGameObjectLowGuid();
  464. + if (!db_lowGUID)
  465. + {
  466. + SendSysMessage(LANG_NO_FREE_STATIC_GUID_FOR_SPAWN);
  467. + SetSentErrorMessage(true);
  468. + return false;
  469. + }
  470. +
  471. + if (!pGameObj->Create(db_lowGUID, gInfo->id, map, 1, x, y, z, o))
  472. + {
  473. + delete pGameObj;
  474. + return false;
  475. + }
  476. +
  477. + // fill the gameobject data and save to the db
  478. + pGameObj->SetRespawnTime(86400); // 24 hours
  479. + pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), 1);
  480. +
  481. + // this will generate a new guid if the object is in an instance
  482. + if (!pGameObj->LoadFromDB(db_lowGUID, map))
  483. + {
  484. + delete pGameObj;
  485. + return false;
  486. + }
  487. +
  488. + DEBUG_LOG(GetMangosString(LANG_GAMEOBJECT_CURRENT), gInfo->name, db_lowGUID, x, y, z, o);
  489. + map->Add(pGameObj);
  490. + sObjectMgr.AddGameobjectToGrid(db_lowGUID, sObjectMgr.GetGOData(db_lowGUID));
  491. + return true;
  492. +}
Advertisement
Add Comment
Please, Sign In to add comment