PDA

View Full Version : [Release-LuaHypArc] LunarSCR ChatCommands v2



Onlykl
05-12-09, 12:06 PM
Update v2.1 added faction checker on some locations
Here is Script that i update old name was Teleporter with Chat Commands but now it is LunarSCR ChatCommands and last version is v2..Example if you want to go in Orgrimmar and you cant find teleporter just type #Orgrimmar...
You must have LuaHypArc to get this working...
You can get it from here: LuaHypArc - Revision 25: /installer (http://my-svn.assembla.com/svn/LuaHypArc/installer)




--[[

Scripted by Onlykl.
Do not repost without my permission.
Do not take credits for what you haven't scripted.
I hope you like this script.
If you like my scripts feel free to request one.
Credits to Grasy for Donation script!

--]]

print("LunarSCR ChatCommands v2- Do not remove credits,Please.")

-- Messages:
local RELOAD_MSG = "#Reload"
local SHATTRATH_MSG = "#Shattrath"
local DALARAN_MSG = "#Dalaran"
local ORGRIMMAR_MSG = "#Orgrimmar"
local THUNDERBLUFF_MSG = "#Thunderbluff"
local SILVERMOON_MSG = "#Silvermoon"
local UNDERCITY_MSG = "#Undercity"
local STORMWIND_MSG = "#Stormwind"
local IRONFORGE_MSG = "#Ironforge"
local EXODAR_MSG = "#Exodar"
local DARNASSUS_MSG = "#Darnassus"
local GURUBASHI_MSG = "#Gurubashi"
local MALL_MSG = "#Mall"
local REVIVE_MSG = "#Revive"
local LEVELROAD_MSG = "#LvlRoad"
local REMOVERESS_MSG = "#RemoveRess"
local HEAL_MSG = "#Heal"
local REPAIRGNOME_MSG = "#RepairMe"
local SETLEVEL_MSG = "#Level80"
local BUFFS_MSG = "#Buffs"
local DRINK_MSG = "#drink"
local FOOD_MSG = "#food"
local GENDER_MSG = "#gender"
local OnlinePlayers_MSG = "#Onplayers"
local race = pPlayer:GetPlayerRace()
local COMMANDLIST_MSG = "#commands"
local Don1 = "#Donator1"
local Don2 = "#Donator2"
local Don3 = "#Donator3"
local Don4 = "#Donator4"
local Don5 = "#Donator5"

-- Config:
local MALL = {MAP = 0, X = 0, Y = 0, Z = 0} -- change to the map, x, y, and z coordinates of your mall (self explanatory).
local LEVELROAD= {MAP = 0, X = 0, Y = 0, Z = 0} -- change to the map, x, y, and z coordinates of your Leveling Road (self explanatory).
local BUFFIDS = {58452, 48104, 48102, 48469, 61024, 20217, 48161, 48073, 48169, 54675, 15366, 33077, 53307, 43017, 5697, 132, 1706, 16618, 48100, 58451} -- add/remove spell IDs for buffs (used in the buff command).
local FOOD_ID = 45932 -- change to the entry ID for the food to be added to the player (20 of the item is added each time).
local DRINK_ID = 42777 -- same as food, just the drink's entry ID
-- Config end.
-- Do not change anything below this unless you know what you're doing.

function OnChat(event, pPlayer, message, type, language)
if(message == RELOAD_MSG and pPlayer:IsGm()) then
ReloadLuaEngine()
end
if(message == ORGRIMMAR_MSG and race == 2 or race == 5 or race == 6 or race == 8 or race == 10) then
pPlayer:Teleport(1, 1502.71, -4415.42, 22.5512)
end
if(message == THUNDERBLUFF_MSG and race == 2 or race == 5 or race == 6 or race == 8 or race == 10) then
pPlayer:Teleport(1, -1285.42, 176.523, 130.994)
end
if(message == SILVERMOON_MSG and race == 2 or race == 5 or race == 6 or race == 8 or race == 10) then
pPlayer:Teleport(530, 9414.18, -7278.97, 15.2031)
end
if(message == UNDERCITY_MSG and race == 2 or race == 5 or race == 6 or race == 8 or race == 10) then
pPlayer:Teleport(0, 1831.26, 238.53, 61.52)
end
if(message == STORMWIND_MSG and race == 1 or race == 3 or race == 4 or race == 7 or race == 11) then
pPlayer:Teleport(0, -8913.23, 554.633, 94.7944)
end
if(message == IRONFORGE_MSG and race == 1 or race == 3 or race == 4 or race == 7 or race == 11) then
pPlayer:Teleport(0, -4981.25, -881.542, 502.66)
end
if(message == EXODAR_MSG and race == 1 or race == 3 or race == 4 or race == 7 or race == 11) then
pPlayer:Teleport(530, -4014.08, -11895.8, -0.99324)
end
if(message == DARNASSUS_MSG and race == 1 or race == 3 or race == 4 or race == 7 or race == 11) then
pPlayer:Teleport(1, 8795.8, 969.427, 31.1955)
end
if(message == REPAIRGNOME_MSG) then
local x = pPlayer:GetX ()
local y = pPlayer:GetY ()
local z = pPlayer:GetZ ()
local o = pPlayer:GetO ()
pPlayer:SpawnCreature (19383, x, y, z, o, 35, 70000)
end
if (message == MALL_MSG) then
pPlayer:Teleport(MALL.MAP, MALL.X, MALL.Y, MALL.Z)
end
if(message == REVIVE_MSG) then
pPlayer:CastSpell(50768)
end
if (message == LEVELROAD_MSG) then
pPlayer:Teleport(LEVELROAD.MAP, LEVELROAD.X, LEVELROAD.Y, LEVELROAD.Z)
end
if(message == HEAL_MSG) then
pPlayer:CastSpell(58053)
end
if (message == BUFF_MSG) then
for k, v in pairs(BUFFIDS) do
pPlayer:CastSpell(v) -- pPlayer:AddAura(v, 600000, true)
end
if(message == REMOVERESS_MSG) then
pPlayer:LearnSpell(15007)
pPlayer:UnlearnSpell(15007)
end
if(message == SETLEVEL_MSG) then
if(pPlayer:PlayerLevel() < 80) then
pPlayer:SetPlayerLeveL(80)
end
elseif (pPlayer:GetPlayerLevel() == 80) then
pPlayer:SendChatMessageToPlayer(15, 0, "You are already 80!)
end
if(message == GURUBASHI_MSG) then
pPlayer:Teleport(0, -13152.9, 342.729, 53.1328)
end
if(message == DALARAN_MSG) then
pPlayer:Teleport(571, 5785.24, 724.91, 641.081)
end
if(message == SHATTRATH_MSG) then
pPlayer:Teleport(530, -1722.58, 5382.7, 2.47504)
end
if (message == FOOD_MSG) then
pPlayer:AddItem(FOOD_ID, 20)
end
if (message == DRINK_MSG) then
pPlayer:AddItem(DRINK_ID, 20)
end
if(message == GENDER_MSG) then
if (pPlayer:GetGender() == 0
pPlayer:SendBroadcastMessage("Your gender has been changed!")
pPlayer:SetGender(1)
elseif (pPlayer:GetGender() == 1
pPlayer:SendBroadcastMessage("Your gender has been changed!")
pPlayer:SetGender(0)
end
if (message == OnlinePlayers_MSG) then
local Players = GetPlayersInWorld()
local Size = #Players
if (Size == 1) then
pPlayer:SendBroadcastMessage("There is "..Size.." player online.")
else
pPlayer:SendBroadcastMessage("There are "..Size.." players online.")
end
if (message == COMMANDLIST_MSG) then
pPlayer:SendBroadcastMessage("Current commands:\n"..ORGRIMMAR_MSG.." - teleports you to the Orgimmar.\n"..THUNDERBLUFF_MSG.." - teleports you to the ThunderBluff.\n"..SILVERMOON_MSG.." - teleports you to the SilverMoon.\n"..UNDERCITY_MSG.." - teleports you to the UnderCity.\n"..STORMWIND_MSG.." - teleports you to the StormWind.\n"..IRONFORGE_MSG.." - teleports you to the IronForge.\n"..EXODAR_MSG .." - teleports you to the Exodar.\n"..DARNASSUS_MSG.." - teleports you to the Darnassus.\n"..REPAIRGNOME_MSG.." - Are you broken!??? Ohh damn call then our mighty gnome with this command.\n"..HEAL_MSG.." - Do you need HEAL?? Then this is right Command for you.\n"..REMOVERESS_MSG.." - Revmove your ressickness.\n"..SETLEVEL_MSG.." - Level you up to level 80.\n"..GURUBASHI_MSG.." - teleports you to the Gurubashi Arena.\n"..DALARAN_MSG.." - teleports you to the Dalaran.\n"..SHATTRATH_MSG.." - teleports you to the Shattrath.\n"..LEVELROAD_MSG.." - teleports you to the Leveling Road.\n"..MALL_MSG.." - teleports you to the mall.\n"..FOOD_MSG.." - adds food to your inventory.\n"..DRINK_MSG.." - adds drink to your inventory.\n"..BUFF_MSG.." - adds a number of buffs to you.\n"..GENDER_MSG.." - Change your grender to female or male.\n"..OnlinePlayers_MSG.." - Shows you how much players are online.\n"..COMMANDLIST_MSG.." - displays a list of commands.")
end
if (message == Don1) then
if (pPlayer:CanUseCommand("5") == true) then
pPlayer:Teleport(0, -8690.655273, -1511.988403, 264.880066)
else
pPlayer:SendBroadcastMessage("You need to donate for that command.")
end
if (message == Don2) then
if (pPlayer:CanUseCommand("6") == true) then
pPlayer:Teleport(0, -8594.282227, -2005.017212, 220.799423)
else
pPlayer:SendBroadcastMessage("You need to donate for that command.")
end
if (message == Don3) then
if (pPlayer:CanUseCommand("7") == true) then
pPlayer:Teleport(1, 621.804810, -4956.007813, 139.634186)
else
pPlayer:SendBroadcastMessage("You need to donate for that command.")
end
if (message == Don4) then
if (pPlayer:CanUseCommand("8") == true) then
pPlayer:Teleport(1, 2203.900635, -5235.758789, 254.322845)
else
pPlayer:SendBroadcastMessage("You need to donate for that command.")
end
if (message == Don5) then
if (pPlayer:CanUseCommand("9") == true) then
pPlayer:Teleport(1, 2558.365234, -5841.585449, 623.132629)
else
pPlayer:SendBroadcastMessage("You need to donate for that command.")
end
end


RegisterServerHook(16, "OnChat")

Sql
pastebin - collaborative debugging tool (http://pastebin.com/m13b8c489)

Report any bugs that you find and i will fix..