Advertisement
Guest User

Untitled

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