Advertisement
Guest User

Untitled

a guest
Jul 31st, 2009
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 17.48 KB | None | 0 0
  1. /*
  2. Required SQL Tables.  Load these into your Character DataBase.
  3. */
  4. /*
  5. # HeidiSQL Dump
  6. #
  7. # --------------------------------------------------------
  8. # Host:                         127.0.0.1
  9. # Database:                     logon_conquest
  10. # Server version:               5.1.30-community
  11. # Server OS:                    Win32
  12. # Target compatibility:         ANSI SQL
  13. # HeidiSQL version:             4.0
  14. # Date/time:                    2009-07-31 04:32:26
  15. # --------------------------------------------------------
  16.  
  17. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI,NO_BACKSLASH_ESCAPES';*/
  18. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;*/
  19.  
  20.  
  21. DROP TABLE IF EXISTS "ab_guild_lands";
  22.  
  23. #
  24. # Table structure for table 'ab_guild_lands'
  25. #
  26.  
  27. CREATE TABLE "ab_guild_lands" (
  28.   "guild_id" int(6) unsigned NOT NULL DEFAULT '0',
  29.   "posX" float NOT NULL DEFAULT '0',
  30.   "posY" float NOT NULL DEFAULT '0',
  31.   "posZ" float NOT NULL DEFAULT '0',
  32.   "mapId" int(10) unsigned NOT NULL DEFAULT '0',
  33.   "zoneid" int(10) unsigned NOT NULL COMMENT 'zone id',
  34.   "areaid" int(10) unsigned NOT NULL COMMENT 'area id',
  35.   PRIMARY KEY ("zoneid")
  36. );
  37.  
  38.  
  39.  
  40. DROP TABLE IF EXISTS "ab_land_data";
  41.  
  42. #
  43. # Table structure for table 'ab_land_data'
  44. #
  45.  
  46. CREATE TABLE "ab_land_data" (
  47.   "guild_id" int(6) unsigned NOT NULL,
  48.   "hostility" enum('HOSTILE','PASSIVE') NOT NULL DEFAULT 'PASSIVE' COMMENT 'Hostility checks',
  49.   "deed" enum('NOTFORSALE','FORSALE') NOT NULL DEFAULT 'NOTFORSALE',
  50.   "landtax" enum('0','1','2','3','4','5','6','7','8','9','10') NOT NULL DEFAULT '0',
  51.   "SalePrice" enum('10K','15K','20K','25K','50K','75K','100k','125K','150K','175K','200K') NOT NULL DEFAULT '10K' COMMENT 'sales checks',
  52.   "mapid" int(10) unsigned NOT NULL,
  53.   "areaid" int(10) unsigned NOT NULL,
  54.   "zoneid" int(10) unsigned NOT NULL,
  55.   PRIMARY KEY ("zoneid")
  56. );
  57.  
  58. /*!40101 SET SQL_MODE=@OLD_SQL_MODE;*/
  59. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;*/
  60.  
  61. */
  62.  
  63.  
  64. #include "StdAfx.h"
  65. #include "Setup.h"
  66.  
  67. // The Defines below are not yet implemented, please be patient, its hot and muggy
  68. // out here in Tac Town
  69.  
  70. #define REQ_LEVEL                   80 // change this for level requirements
  71.  
  72. // REMOVING GOLD REMOVAL UNTIL CODED PROPERLY
  73. // #define REQ_COINAGE                  1500000000  // 1500000000 = 150k Gold
  74. #define PORT_REQ_COINAGE            15000       // ??
  75. #define FOOD_ID                     45932
  76. //#define SETPRICE_10               10K
  77. //#define SETPRICE_15               15K
  78. //#define SETPRICE_20               20K
  79. //#define SETPRICE_25               25K
  80. //#define SETPRICE_50               50K
  81. //#define SETPRICE_75               75K
  82. //#define SETPRICE_100              100K
  83. //#define SETPRICE_125              125K
  84. //#define SETPRICE_150              150K
  85. //#define SETPRICE_175              175K
  86. //#define SETPRICE_200              200K
  87. //#define GUILD_SHOP_NPC            993311      // Jotoxs Sick Automated Vendor.(look on mmowned for the updated script)
  88. //#define SPELL_BUFF                22888       // I chose Rallying Cry of the Dragon
  89. static bool bypassCombat = false;//If set to true, will enable players to #event while in combat
  90.  
  91. // Chat Commands
  92. static string COMS              = "#help";          // Lists commands
  93.  
  94. static string COM_ZONE          = "#zone";
  95. static string SET_4_SALE        = "#zone sell";     // sets land for sale
  96. static string BUYLAND           = "#zone buy";      // Buys land if its available for purchase in world.
  97. static string SET_NOT_4_SALE    = "#zone reset";    // sets not for sale
  98. static string G_HEARTH          = "#zone port";     // Ports player to closest Guild house if in a Zone owned by Guild
  99. static string SET_G_HEARTH      = "#zone hearth";   // Sets the location for #zone port
  100.  
  101. static string COM_ADD           = "#add";
  102. static string ADD_FOOD          = "#add food";      // Gives player food/drink
  103. static string ADD_ITEM          = "#add item";      // Gives player items
  104.  
  105.  
  106. static string plr_evn_cmd       = "#event";
  107. static string event_com         = "#event on";
  108. static string event_off         = "#event off";
  109. static string mall_cmd          = "#mall";
  110. static string mall_nort         = "#mall northrend";
  111. static string mall_outl         = "#mall outlands";
  112. static string mall_kalim        = "#mall kalimdor";
  113. static string mall_azero        = "#mall azeroth";
  114.  
  115. //Default Values
  116. static bool event_on = false;
  117. static uint32 emapid = 0;
  118. static float ex = 0.0f;
  119. static float ey = 0.0f;
  120. static float ez = 0.0f;
  121.  
  122. // commented out statics will be usable functions in the near future.
  123.  
  124. //static string WORLD_CHAT      = "#world";
  125. //static string SHOP            = "#guild shop";        //will spawn Jotox's NPC ID - I will not provide his script, I just really love his Vendor Script :)
  126. //static string BUFFME          = "#buffme";            // Gives player buffs - dont have correct functions for adding buffs properly yet
  127.  
  128.  
  129.  
  130. void AddItem(PlayerPointer Plr, const uint32 &ItemID, const uint32 &Amt, const bool &Stack)
  131. {
  132.     ItemPointer ITEM_PTR;
  133.     SlotResult SlotID;
  134.    
  135.     if(Plr == NULL)
  136.         return;
  137.     if(Stack)
  138.     {
  139.     ITEM_PTR = Plr->GetItemInterface()->FindItemLessMax(ItemID, Amt, false);
  140.         if(ITEM_PTR != NULLITEM)
  141.         {
  142.         ITEM_PTR->ModUnsigned32Value(ITEM_FIELD_STACK_COUNT, Amt);
  143.         ITEM_PTR->m_isDirty = true;
  144.         Plr->BroadcastMessage("You have recieved %s%s x%u.", MSG_COLOR_GREEN, ITEM_PTR->GetProto()->Name1, Amt);
  145.         return;
  146.         }      
  147.     }
  148.     for(uint32 i = 1;i <= Amt;i++)
  149.     {
  150.     ITEM_PTR = objmgr.CreateItem(ItemID, Plr);
  151.         if(ITEM_PTR == NULLITEM)
  152.         return;
  153.         SlotID = Plr->GetItemInterface()->FindFreeInventorySlot(ITEM_PTR->GetProto());
  154.         if(SlotID.Result)
  155.         {
  156.         Plr->GetItemInterface()->SafeAddItem(ItemID, SlotID.ContainerSlot, SlotID.Slot);
  157.         Plr->BroadcastMessage("You have recieved %s%s x%u.", MSG_COLOR_GREEN, ITEM_PTR->GetProto()->Name1, Amt);
  158.         }
  159.         else
  160.         Plr->SendAreaTriggerMessage("You Do not have enough Free Space.");
  161.     }
  162. }
  163.  
  164. bool Guild_Chat(PlayerPointer Plr, uint32 Type, uint32 Lang, string Message, string Misc)
  165. {
  166. if(Message == COMS)
  167.     {
  168.         Plr->BroadcastMessage("[Commands List]");
  169.         Plr->BroadcastMessage("[YOU MUST USE LOWERCASE!]");
  170.         Plr->BroadcastMessage("#help - Shows available Commands.");
  171.         Plr->BroadcastMessage("#zone - Used for zone commands.");
  172.         Plr->BroadcastMessage("#add - Adds an Item to your Bags.");
  173.         Plr->BroadcastMessage("#mall - available mall ports.");
  174.         Plr->BroadcastMessage("#event - join available events.");
  175.  
  176. return true;
  177. }
  178. else if(Message == COM_ZONE)
  179.     {
  180.         Plr->BroadcastMessage("[Commands List]");
  181.         Plr->BroadcastMessage("#zone sell - Sets your land For Sale");
  182.         Plr->BroadcastMessage("#zone buy - Use this command to purchase Land for your Guild.");
  183.         Plr->BroadcastMessage("#zone reset - Resets your land Sale - Must be done before another player purchases land.");
  184.         Plr->BroadcastMessage("#zone port - Teleports you to nearest Guild House on Land you own.");
  185.         Plr->BroadcastMessage("#zone hearth - Resets Your Guilds Hearth Location per Zone.");
  186. return true;
  187. }
  188. else if(Message == COM_ADD)
  189.     {
  190.         Plr->BroadcastMessage("[Commands List]");
  191.         Plr->BroadcastMessage("#add food - Adds Food to your Bags.");
  192. return true;
  193. }
  194. //else if(Message == COM_ADD_ITEM)
  195. //  {
  196. //      Plr->BroadcastMessage("[Commands List]");
  197. //      Plr->BroadcastMessage("#add item swords - Adds Food to your Bags.");
  198. //return true;
  199. //}
  200. else if(Message == BUYLAND)
  201.     {
  202.     QueryResult * Q_RES_BUY_COM = CharacterDatabase.Query("SELECT * FROM ab_guild_lands WHERE guild_id = %u AND zoneid = %u", Plr->GetGuildId(), Plr->GetZoneId());
  203.     QueryResult * Q_RES_BUY_FORSALE = CharacterDatabase.Query("SELECT * FROM ab_land_data WHERE zoneid = %u AND deed = FORSALE", Plr->GetZoneId());
  204.     if(Plr->GetMapId() != 0 && Plr->GetMapId() != 1 && Plr->GetMapId() != 530 && Plr->GetMapId() != 571)
  205.     {
  206.         Plr->BroadcastMessage("You can't purchase Instances!");
  207.         return true;
  208.     }
  209.     if(
  210.         Plr->CombatStatus.IsInCombat())
  211.     {
  212.         Plr->BroadcastMessage("You are in Combat!");
  213.         return true;
  214.     }
  215.     if(
  216.         Plr->getLevel() < REQ_LEVEL) // I run a High rate server, so I set this level cap to 80 for default
  217.     {
  218.         Plr->BroadcastMessage("You must be level 80.");
  219.         return true;
  220.     }
  221.     if(
  222.         Plr->GetGuildId() == NULL)
  223.     {  
  224.         Plr->BroadcastMessage("You are not in a Guild.");
  225.         return true;
  226.     }
  227.     if(
  228.         Plr->GetGuild()->GetGuildLeader() != Plr->GetGUID())
  229.     {
  230.         Plr->BroadcastMessage("You are not the Guild Master.");
  231.         return true;
  232.     }
  233.     if(Q_RES_BUY_FORSALE != NULL)
  234.     {
  235.         Plr->BroadcastMessage("This area is not for sale.");
  236.     }
  237.     if(Q_RES_BUY_FORSALE == NULL)
  238.     {
  239.         CharacterDatabase.Execute("REPLACE INTO ab_land_data VALUES('%u', 'PASSIVE', 'NOTFORSALE', '0', '10K', '%u', '%u', '%u')", Plr->GetGuildId(), Plr->GetMapId(), Plr->GetAreaID(), Plr->GetZoneId());
  240.         CharacterDatabase.Execute("REPLACE INTO ab_guild_lands VALUES('%u', '%f', '%f', '%f', '%u', '%u', '%u')", Plr->GetGuildId(), Plr->GetPositionX(), Plr->GetPositionY(), Plr->GetPositionZ(), Plr->GetMapId(), Plr->GetZoneId(), Plr->GetAreaID());
  241.         Plr->BroadcastMessage("Congrats! You just purchased this Zone From another Guild.");
  242.     }
  243.     if(Q_RES_BUY_COM != NULL)
  244.     {
  245.         Plr->BroadcastMessage("This area has already been purchased.");
  246.     }
  247.     if(Q_RES_BUY_COM == NULL)
  248.     {
  249.         CharacterDatabase.Execute("INSERT INTO ab_guild_lands VALUES('%u', '%f', '%f', '%f', '%u', '%u', '%u')", Plr->GetGuildId(), Plr->GetPositionX(), Plr->GetPositionY(), Plr->GetPositionZ(), Plr->GetMapId(), Plr->GetZoneId(), Plr->GetAreaID());
  250.         CharacterDatabase.Execute("INSERT INTO ab_land_data VALUES('%u', 'PASSIVE', 'NOTFORSALE', '0', '10K', '%u', '%u', '%u')", Plr->GetGuildId(), Plr->GetMapId(), Plr->GetAreaID(), Plr->GetZoneId());
  251.         Plr->BroadcastMessage("Gratz! Your Guild now Owns this area.");
  252.             }
  253.         return true;
  254.         }
  255. else if(Message == SET_G_HEARTH)
  256.     {
  257.     QueryResult * Q_RES_G_HEARTH_SET = CharacterDatabase.Query("SELECT * FROM ab_guild_lands WHERE guild_id = %u AND zoneid = %u", Plr->GetGuildId(), Plr->GetZoneId());
  258.     if(Plr->GetMapId() != 0 && Plr->GetMapId() != 1 && Plr->GetMapId() != 530 && Plr->GetMapId() != 571)
  259.     {
  260.         Plr->BroadcastMessage("You can't use this command in Instances!");
  261.         return true;
  262.     }
  263.     if(
  264.         Plr->CombatStatus.IsInCombat())
  265.     {
  266.         Plr->BroadcastMessage("You are in Combat!");
  267.         return true;
  268.     }
  269.     if(
  270.         Plr->getLevel() < REQ_LEVEL)
  271.     {
  272.         Plr->BroadcastMessage("You must be level 80.");
  273.         return true;
  274.     }
  275.     if(
  276.         Plr->GetGuildId() == NULL)
  277.     {  
  278.         Plr->BroadcastMessage("You are not in a Guild.");
  279.         return true;
  280.     }
  281.     if(
  282.         Plr->GetGuild()->GetGuildLeader() != Plr->GetGUID())
  283.     {
  284.         Plr->BroadcastMessage("You are not the Guild Master.");
  285.         return true;
  286.     }
  287.     if(Q_RES_G_HEARTH_SET == NULL)
  288.     {
  289.         Plr->BroadcastMessage("Your Guild does not Own Land in this Area.");
  290.     }
  291.     if(Q_RES_G_HEARTH_SET != NULL)
  292.     {
  293.         CharacterDatabase.Execute("REPLACE INTO ab_guild_lands VALUES('%u', '%f', '%f', '%f', '%u', '%u', '%u')", Plr->GetGuildId(), Plr->GetPositionX(), Plr->GetPositionY(), Plr->GetPositionZ(), Plr->GetMapId(), Plr->GetZoneId(), Plr->GetAreaID());
  294.         Plr->BroadcastMessage("Your Guild Hearth Is Now Set.");
  295.             }
  296.         return true;
  297.         }
  298. else if(Message == SET_4_SALE)
  299.     {
  300.     QueryResult * Q_RES_SET_4_SALE = CharacterDatabase.Query("SELECT * FROM ab_guild_lands WHERE guild_id = %u AND zoneid = %u", Plr->GetGuildId(), Plr->GetZoneId());
  301.     uint32 PLR_COINAGE = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
  302.     QueryResult * Q_RES_SET_DATA = CharacterDatabase.Query("SELECT * FROM ab_land_data WHERE guild_id = %u AND zoneid = %u AND deed = NOTFORSALE", Plr->GetGuildId(), Plr->GetZoneId());
  303.     if(Plr->GetMapId() != 0 && Plr->GetMapId() != 1 && Plr->GetMapId() != 530 && Plr->GetMapId() != 571)
  304.     {
  305.         Plr->BroadcastMessage("You can't use this command in Instances!");
  306.         return true;
  307.     }
  308.     if(
  309.         Plr->CombatStatus.IsInCombat())
  310.     {
  311.         Plr->BroadcastMessage("You are in Combat!");
  312.         return true;
  313.     }
  314.     if(
  315.         Plr->getLevel() < REQ_LEVEL)
  316.     {
  317.         Plr->BroadcastMessage("You must be level 80.");
  318.         return true;
  319.     }
  320.     if(
  321.         Plr->GetGuildId() == NULL)
  322.     {  
  323.         Plr->BroadcastMessage("You are not in a Guild.");
  324.         return true;
  325.     }
  326.     if(
  327.         Plr->GetGuild()->GetGuildLeader() != Plr->GetGUID())
  328.     {
  329.         Plr->BroadcastMessage("You are not the Guild Master.");
  330.         return true;
  331.     }
  332.     if(Q_RES_SET_4_SALE == NULL)
  333.     {
  334.         Plr->BroadcastMessage("Your Guild does not Own Land in this Area.");
  335.     }
  336.     if(Q_RES_SET_DATA == NULL)
  337.     {
  338.         Plr->BroadcastMessage("Your Guild does not Own Land in this Area.");
  339.     }
  340.     if(Q_RES_SET_4_SALE != NULL)
  341.     {
  342.         CharacterDatabase.Execute("REPLACE INTO ab_land_data VALUES('%u', 'PASSIVE', 'FORSALE', '0', '10K', '%u', '%u', '%u')", Plr->GetGuildId(), Plr->GetMapId(), Plr->GetAreaID(), Plr->GetZoneId());
  343.        
  344.         Plr->BroadcastMessage("Your Land is now for Sale, you still have the option to reset your sale, but this must be done before someone purchases the land.");
  345.             }
  346.     if(Q_RES_SET_DATA != NULL)
  347.     {
  348.         CharacterDatabase.Execute("REPLACE INTO ab_land_data VALUES('%u', 'PASSIVE', 'FORSALE', '0', '10K', '%u', '%u', '%u')", Plr->GetGuildId(), Plr->GetMapId(), Plr->GetAreaID(), Plr->GetZoneId());
  349.        
  350.         Plr->BroadcastMessage("Your Land is now for Sale, you still have the option to reset your sale, but this must be done before someone purchases the land.");
  351.             }
  352.         return true;
  353.         }
  354. else if(Message == SET_NOT_4_SALE)
  355.     {
  356.     QueryResult * Q_RES_SET_NOT_4_SALE = CharacterDatabase.Query("SELECT * FROM ab_guild_lands WHERE guild_id = %u AND zoneid = %u", Plr->GetGuildId(), Plr->GetZoneId());
  357.     uint32 PLR_COINAGE = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
  358.     QueryResult * Q_RES_SET_DATA2 = CharacterDatabase.Query("SELECT * FROM ab_land_data WHERE guild_id = %u AND zoneid = %u AND deed = FORSALE", Plr->GetGuildId(), Plr->GetZoneId());
  359.     if(Plr->GetMapId() != 0 && Plr->GetMapId() != 1 && Plr->GetMapId() != 530 && Plr->GetMapId() != 571)
  360.     {
  361.         Plr->BroadcastMessage("You can't use this command in Instances!");
  362.         return true;
  363.     }
  364.     if(
  365.         Plr->CombatStatus.IsInCombat())
  366.     {
  367.         Plr->BroadcastMessage("You are in Combat!");
  368.         return true;
  369.     }
  370.     if(
  371.         Plr->getLevel() < REQ_LEVEL)
  372.     {
  373.         Plr->BroadcastMessage("You must be level 80.");
  374.         return true;
  375.     }
  376.     if(
  377.         Plr->GetGuildId() == NULL)
  378.     {  
  379.         Plr->BroadcastMessage("You are not in a Guild.");
  380.         return true;
  381.     }
  382.     if(
  383.         Plr->GetGuild()->GetGuildLeader() != Plr->GetGUID())
  384.     {
  385.         Plr->BroadcastMessage("You are not the Guild Master.");
  386.         return true;
  387.     }
  388.     if(Q_RES_SET_NOT_4_SALE == NULL)
  389.     {
  390.         Plr->BroadcastMessage("Your Guild does not Own Land in this Area.");
  391.     }
  392.     if(Q_RES_SET_DATA2 == NULL)
  393.     {
  394.         Plr->BroadcastMessage("Your Guild does not Own Land in this Area.");
  395.     }
  396.     if(Q_RES_SET_NOT_4_SALE != NULL)
  397.     {
  398.         CharacterDatabase.Execute("REPLACE INTO ab_land_data VALUES('%u', 'PASSIVE', 'NOTFORSALE', '0', '10K', '%u', '%u', '%u')", Plr->GetGuildId(), Plr->GetMapId(), Plr->GetAreaID(), Plr->GetZoneId());
  399.        
  400.         Plr->BroadcastMessage("Your Land is no longer for sale.");
  401.             }
  402.     if(Q_RES_SET_DATA2 != NULL)
  403.     {
  404.         CharacterDatabase.Execute("REPLACE INTO ab_land_data VALUES('%u', 'PASSIVE', 'NOTFORSALE', '0', '10K', '%u', '%u', '%u')", Plr->GetGuildId(), Plr->GetMapId(), Plr->GetAreaID(), Plr->GetZoneId());
  405.        
  406.         Plr->BroadcastMessage("Your Land is no longer for sale.");
  407.             }
  408.         return true;
  409.         }
  410.  
  411.         else if(Message == ADD_FOOD)
  412.         {
  413.         AddItem(Plr, FOOD_ID, 1, true);// "1" is the amount of the item to give - True means we stack item
  414.         return true;
  415.         }
  416.         else if(Message == event_com && Plr->GetSession()->HasGMPermissions())
  417.         {
  418.         event_on = true;
  419.         ex = Plr->GetPositionX();
  420.         ey = Plr->GetPositionY();
  421.         ez = Plr->GetPositionZ();
  422.         emapid = Plr->GetMapId();
  423.         return true;
  424.         }
  425.         else if(Message == event_off && Plr->GetSession()->HasGMPermissions())
  426.         {
  427.         event_on = false;
  428.         return true;
  429.         }
  430.         else if(Message == plr_evn_cmd)
  431.         {
  432.         if(event_on)
  433.         if(bypassCombat || !Plr->CombatStatus.IsInCombat())
  434.         Plr->EventTeleport(emapid, ex, ey, ez);
  435.         else
  436.         Plr->BroadcastMessage("You can't port while in combat.");
  437.         else
  438.         Plr->BroadcastMessage("There's no active event at the moment.");
  439.         return true;
  440.         }
  441.         else if(Message == mall_cmd)
  442.         {
  443.         if(bypassCombat || !Plr->CombatStatus.IsInCombat())
  444.         if( Plr->GetTeam() == 1 )
  445.         Plr->EventTeleport(571, 2827.1, 6176.8, 122); //<---Done Horde Mall--->//
  446.         else
  447.         Plr->EventTeleport(571, 2314.69, 5258.58, 12); //<-----Done Ally Mall--->//
  448.         else
  449.             Plr->BroadcastMessage("You can't port while in combat.");  
  450.     return true;
  451.     }
  452. else if(Message == G_HEARTH)
  453.     {
  454.     QueryResult * Q_RES_LOWBIE = CharacterDatabase.Query("SELECT * FROM ab_guild_lands WHERE guild_id = %u AND zoneid = %u", Plr->GetGuildId(), Plr->GetZoneId());
  455.     if(Q_RES_LOWBIE == NULL)
  456.     {
  457.         Plr->BroadcastMessage("Your Guild does not own any Land Nearby.");
  458.         Plr->Gossip_Complete();
  459.     return true;
  460.     }
  461.     if(Q_RES_LOWBIE->GetRowCount() > 1)
  462.     {
  463.         Plr->BroadcastMessage("Error 421 - Please Report this on the Forums - MYSQL Error - Too much Data to Input");
  464.         Plr->Gossip_Complete();
  465.     return true;
  466.     }
  467.         float x, y, z;
  468.         uint32 MapID;
  469.         Field * F_RES = Q_RES_LOWBIE->Fetch();
  470.         x = F_RES[1].GetFloat();
  471.         y = F_RES[2].GetFloat();
  472.         z = F_RES[3].GetFloat();
  473.         MapID = F_RES[4].GetUInt32();
  474.         Plr->EventTeleport(MapID, x, y, z);
  475.         }
  476.     return true;
  477. }
  478.  
  479. void ZoneCheckSyStem(PlayerPointer Plr, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
  480. {   QueryResult * RES_IS_LAND_HOSTILE = CharacterDatabase.Query("SELECT * FROM ab_land_data WHERE zoneid = %u AND hostility = HOSTILE", Plr->GetZoneId());
  481.     if(RES_IS_LAND_HOSTILE == NULL)
  482.     {
  483.     Plr->SetFFAPvPFlag();
  484.     sChatHandler.SystemMessage(Plr->GetSession(), "Be wary young Traveler, This land is hostile to you... ");
  485.     return;
  486.     }
  487.     else if(RES_IS_LAND_HOSTILE != NULL)
  488.     {
  489.     Plr->RemoveFFAPvPFlag();
  490.     sChatHandler.SystemMessage(Plr->GetSession(), "You are in a Passive zone, you are now safe... for now.");
  491.     return;
  492.     }
  493. }
  494. void SetupGuild_Chat(ScriptMgr * mgr)
  495. {
  496.     mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, &Guild_Chat);
  497.     mgr->register_hook(SERVER_HOOK_EVENT_ON_ZONE, &ZoneCheckSyStem);
  498. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement