Advertisement
Guest User

Untitled

a guest
Nov 1st, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.68 KB | None | 0 0
  1. --[[
  2.  
  3. ______ _ _ __ __
  4. | ____| | | | | \ \ / /
  5. | |__ ___ _ __ __ _ ___ | |_| |_ ___ _ __ _____\ \ /\ / /____ __
  6. | __/ _ \| '__/ _` |/ _ \| __| __/ _ \ '_ \______\ \/ \/ / _ \ \ /\ / /
  7. | | | (_) | | | (_| | (_) | |_| || __/ | | | \ /\ / (_) \ V V /
  8. |_| \___/|_| \__, |\___/ \__|\__\___|_| |_| \/ \/ \___/ \_/\_/
  9. __/ |
  10. |___/
  11. ]]
  12.  
  13. local file_dir = "scripts/logs/hs_logs.txt"
  14. local file = assert(io.open(file_dir, "a"))
  15. local bountyToken = 89998 --Bounty Token ID
  16. local ITEM_ID = 6948 -- Hearthstone ID
  17.  
  18.  
  19. function Teleporter_OnGossip(event, plr, item)
  20. if(plr:GetTeam() == 0) then
  21. plr:GossipMenuAddItem(0, "|cff00CDFFMain Cities ", 0, 2000)
  22. end
  23. if(plr:GetTeam() == 1) then
  24. plr:GossipMenuAddItem(0, "|cffB00808Main Cities", 0 , 3000)
  25. end
  26.  
  27.  
  28. plr:GossipMenuAddItem(0, "Teleports" , 0, 5000)
  29.  
  30.  
  31. if GetVIPLevel(plr:GetAccountId()) >= 1 then
  32. plr:GossipMenuAddItem(0, "|TInterface\\ChatFrame\\UI-ChatIcon-Vip.blp:0:2:0:0|t",0 , 4000,0)
  33. end
  34.  
  35.  
  36. plr:GossipMenuAddItem(0, "About You", 0, 7000)
  37. plr:GossipMenuAddItem(0, "Bounty System", 0, 300)
  38.  
  39.  
  40.  
  41. plr:GossipSendMenu(1, item)
  42. end
  43.  
  44. function Teleporter_OnClick(event, plr, creature, sender, intid, code)
  45.  
  46. if(intid == 1000) then
  47. plr:GossipMenuAddItem(0, "Task Area |TInterface\\ChatFrame\\UI-ChatIcon-PVE.blp:0:2:0:0|t",0 , 1,0)
  48. plr:GossipMenuAddItem(0, "Task Area |TInterface\\ChatFrame\\UI-ChatIcon-PVP.blp:0:2:0:0|t",0 , 1,0)
  49. end
  50.  
  51. if(intid == 7000)then
  52. plr:GossipMenuAddItem(0, "Your gear score is: " ..plr:GetGearLevel().. "" ,0, 7000)
  53. plr:GossipMenuAddItem(0, "Your VIP level is " ..GetVIPLevel(plr:GetAccountId()).. "", 0, 7000)
  54.  
  55. end
  56.  
  57. if(intid == 4000) then
  58. if GetVIPLevel(plr:GetAccountId()) <= 1 then
  59. --print "Unauthorized Acess to the vip function. " ..plr:GetName().. ""
  60. plr:SendBroadcastMessage("We detected that you have Unauthorized access to the vip panel this will be logged")
  61. local line = os.date("%x [%X]", os.time())..": "..plr:GetName().." Unauthorized Access to the vip function."
  62. file:write(line.."\n")
  63. file:flush()
  64. return
  65. end
  66. plr:GossipMenuAddItem(0, "Vip Mall", 0, 4003)
  67. plr:GossipMenuAddItem(0, "Repair All Item", 0, 4005)
  68. plr:GossipMenuAddItem(0, "Max Level", 0, 4002)
  69. plr:GossipMenuAddItem(0, "Bank", 0, 4001)
  70. plr:GossipMenuAddItem(0, "Set Home", 0, 4004)
  71. plr:GossipMenuAddItem(0, "Back", 0 , 100000)
  72. end
  73.  
  74. if(intid == 5000) then
  75. plr:GossipMenuAddItem(0, "Hearthstone", 0, 100)
  76. plr:GossipMenuAddItem(0, "Task Area",0 , 1000,0)
  77. plr:GossipMenuAddItem(0, "PVP Zone",0 , 10,0)
  78. plr:GossipMenuAddItem(0, "Instances",0 , 8900)
  79. plr:GossipMenuAddItem(0, "Item Preview",0 , 8901)
  80. plr:GossipMenuAddItem(0, "Back", 0 , 100000)
  81. end
  82.  
  83. if(intid == 2000) then
  84. plr:GossipMenuAddItem(0, "Stormwind", 0, 2001)
  85. plr:GossipMenuAddItem(0, "Ironfoge", 0, 2002)
  86. plr:GossipMenuAddItem(0, "The Exodar", 0, 2003)
  87. plr:GossipMenuAddItem(0, "Back", 0 , 100000)
  88. end
  89.  
  90. if(intid == 3000) then
  91. plr:GossipMenuAddItem(0, "Orgrimmar", 0, 3001)
  92. plr:GossipMenuAddItem(0, "Thunderbluff", 0, 3002)
  93. plr:GossipMenuAddItem(0, "Undercity", 0, 3003)
  94. plr:GossipMenuAddItem(0, "Back", 0 , 100000)
  95. end
  96.  
  97. if(intid == 8900) then
  98. plr:GossipMenuAddItem(0, "Deadmines", 0, 8903)
  99. plr:GossipMenuAddItem(0, "Molten Core", 0, 8902)
  100. plr:GossipMenuAddItem(0, "Back", 0 , 100000)
  101. end
  102.  
  103. if(intid == 300) then
  104. plr:GossipMenuAddItem(0, "This system is not perfect and there might still be some bugs, if you find any of them report it or if you have any suggestion regarding this system", 0, 300)
  105. plr:GossipMenuAddItem(0, "I would like to place a bounty", 0, 301)
  106. plr:GossipMenuAddItem(0, "Bounty List", 0, 302)
  107. plr:GossipMenuAddItem(0, "Back", 0 , 100000)
  108. end
  109.  
  110. if(intid == 301) then
  111.  
  112. plr:GossipMenuAddItem(0, "100 Bounty Tokens", 0, 3021, true, "Who would you like to place a bounty on?", 10000)
  113. plr:GossipMenuAddItem(0, "200 Bounty Tokens", 0, 3022, true, "Who would you like to place a bounty on?", 10000)
  114. plr:GossipMenuAddItem(0, "300 Bounty Tokens", 0, 3023, true, "Who would you like to place a bounty on?", 10000)
  115. plr:GossipMenuAddItem(0, "400 Bounty Tokens", 0, 3024, true, "Who would you like to place a bounty on?", 10000)
  116. plr:GossipMenuAddItem(0, "500 Bounty Tokens", 0, 3025, true, "Who would you like to place a bounty on?", 10000)
  117. end
  118.  
  119.  
  120. -- Bounty Hunter System
  121.  
  122. if(intid == 302) then
  123. local getNameQuery = AuthDBQuery("SELECT Playername, Price, Placer FROM bounty_db")
  124. if (getNameQuery) then
  125. repeat
  126. local name = getNameQuery:GetString(0)
  127. local price = getNameQuery:GetString(1)
  128. local placer = getNameQuery:GetString(2)
  129. plr:GossipMenuAddItem(0, "" ..name.. " Price: " ..price.. " Placer: " ..placer.. "" , 0, 302)
  130. until not getNameQuery:NextRow()
  131. end
  132. plr:GossipMenuAddItem(0, "Refresh", 0, 302)
  133. plr:GossipMenuAddItem(0, "Back", 0 , 300)
  134. end
  135.  
  136.  
  137. if(intid == 3021) then
  138. InsertBounty(code, 100, plr:GetName())
  139. plr:SendBroadcastMessange("You have placed bounty on: " ..code.."")
  140. plr:RemoveItem(89998, 100)
  141. end
  142. if(intid == 3022) then
  143. InsertBounty(code, 200, plr:GetName())
  144. plr:SendBroadcastMessange("You have placed bounty on: " ..code.."")
  145. plr:RemoveItem(89998, 200)
  146. end
  147. if(intid == 3023) then
  148. InsertBounty(code, 300, plr:GetName())
  149. plr:SendBroadcastMessange("You have placed bounty on: " ..code.."")
  150. plr:RemoveItem(89998, 300)
  151. end
  152. if(intid == 3024) then
  153. InsertBounty(code, 400, plr:GetName())
  154. plr:SendBroadcastMessange("You have placed bounty on: " ..code.."")
  155. plr:RemoveItem(89998, 400)
  156. end
  157. if(intid == 3025) then
  158. InsertBounty(code, 400, plr:GetName())
  159. plr:SendBroadcastMessange("You have placed bounty on: " ..code.."")
  160. plr:RemoveItem(89998, 500)
  161. end
  162. -- End Bounty System
  163.  
  164. if(intid == 100000) then
  165. Teleporter_OnGossip(event, plr, item)
  166. end
  167.  
  168. plr:GossipSendMenu(1, creature)
  169.  
  170. --------------------------------------------------------------------------
  171. -- under here i will put all the teleports and other things --
  172. --------------------------------------------------------------------------
  173.  
  174.  
  175. if(intid == 1) then -- Normal Mall
  176. plr:Teleport(530, -248.392258, 939.716187, 84.378456, 1.494630 )
  177. end
  178.  
  179. --Vip Stuff under here
  180.  
  181. if(intid == 4001) then -- opens up the player bank
  182. plr:SendShowBank(plr)
  183. end
  184.  
  185. if(intid == 4003) then --Vip MAll
  186. plr:Teleport(0,-4119.738281, -1090.597168, 168.953934, 5.988140)
  187.  
  188. end
  189.  
  190. if(intid == 4005) then -- Repair all items
  191. plr:DurabilityRepairAll()
  192. end
  193.  
  194. if(intid == 4002) then -- sets your level to 85
  195. plr:SetLevel(85)
  196. end
  197.  
  198. if(intid == 4004) then
  199. plr:SetBindPointAtPlayerLoc()
  200. end
  201.  
  202. --Cities goes under here
  203.  
  204. --Ally
  205. if(intid == 2001) then --Stormwind
  206. plr:Teleport(0, -8830.297852, 625.666199, 93.949638, 3.853518)
  207.  
  208. end
  209. if(intid == 2002) then --Ironforge
  210. plr:Teleport(0, -4923.146973, -948.432251, 501.552063, 5.372409)
  211.  
  212. end
  213.  
  214. if(intid == 2003) then --The Exodar
  215. plr:Teleport(530, -3964.102539, -11672.352539, -137.411285, 0.400547)
  216.  
  217. end
  218. --Horde
  219. if(intid == 3001) then --Orgrimmar
  220. plr:Teleport(1, 1629.359985, -4373.390137, 31.482185, 3.548390)
  221.  
  222. end
  223. if(intid == 3002) then --Thunderbluff
  224. plr:Teleport(1, -1277.369995, 124.804001, 131.286987, 5.222740)
  225.  
  226. end
  227.  
  228. if(intid == 3003) then --Undercity
  229. plr:Teleport(0, 1584.069946, 241.987000, -52.153400, 0.049647)
  230.  
  231. end
  232.  
  233. --other
  234.  
  235. if(intid == 100) then
  236. plr:CastSpell(plr, 8690)
  237. end
  238.  
  239. if(intid == 10) then --PvP Zone
  240. plr:Teleport(801, 561.474304, 1011.290527, 5.370491, 5.626557 )
  241. end
  242. if(intid == 8901) then --Preview zone
  243. plr:Teleport(0, -7143.082031, -3875.430908, 336.437500, 3.044534)
  244. end
  245.  
  246. --Instances
  247.  
  248. if(intid == 8903) then
  249. plr:Teleport(36, -16.400000, -383.070007, 61.779999, 1.860000)
  250. end
  251.  
  252. if(intid == 8902) then
  253. plr:Teleport(409, 1096.000000, -467.000000, -104.599998, 3.640000 )
  254. end
  255.  
  256.  
  257. end
  258.  
  259. function PlayerKilled(event, killer, plr)
  260.  
  261.  
  262. --Bounty
  263. plr:SendBroadcastMessage("You was killed by: " ..killer:GetName().. "")
  264. if(GetBountyPrice(plr:GetName()) >= 1) then
  265.  
  266. killer:SendBroadcastMessage("You killed: " ..plr:GetName().. " And recived: " ..GetBountyPrice(plr:GetName()).."")
  267. killer:AddItem(bountyToken, GetBountyPrice(plr:GetName()))
  268.  
  269. end
  270. playerDiedBounty(plr:GetName())
  271. end
  272.  
  273. --Custom Fucntions
  274. function GetVIPLevel(accountid)
  275. local VIPLevel = AuthDBQuery("SELECT VIPLevel from vip_players where accountID='" .. accountid .. "'")
  276. local level = 0
  277. if(VIPLevel) then
  278. repeat
  279. level = VIPLevel:GetUInt32(0)
  280. until not VIPLevel:NextRow()
  281. end
  282. return level
  283. end
  284.  
  285. function GetBountyPrice(Pname)
  286. local BountyPrice = AuthDBQuery("SELECT Price from bounty_db where playername='" .. Pname .. "'")
  287. local price = 0
  288. if(BountyPrice) then
  289. repeat
  290. price = BountyPrice:GetUInt32(0)
  291. until not BountyPrice:NextRow()
  292. end
  293. return price
  294. end
  295.  
  296.  
  297. function playerDiedBounty(PlayerName)
  298. AuthDBQuery("DELETE FROM bounty_db WHERE PlayerName='" .. PlayerName .. "'")
  299. end
  300.  
  301. function InsertBounty(Playername, Price, placer)
  302. AuthDBQuery("INSERT INTO `bounty_db` (`Playername`, `Price` , `placer`) VALUES ('" .. Playername .. "', '" ..Price.. "', '" ..placer.. "')")
  303. end
  304.  
  305.  
  306. RegisterItemGossipEvent(ITEM_ID, 1, Teleporter_OnGossip)
  307. RegisterItemGossipEvent(ITEM_ID, 2, Teleporter_OnClick)
  308. RegisterServerHook(6, PlayerKilled)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement