eluna-scripts-mangoszero/lua_scripts/examples/example_creature_weather_gossip.lua
Salja 6d88b02c97 added few lua scripts for zero
Signed-off-by: Salja <salja8840@gmail.com>
2014-07-21 11:59:53 +02:00

27 lines
No EOL
817 B
Lua

local NpcId =
local function TestMenuWeather(event, plr, unit)
plr:GossipMenuAddItem(0, "Test Weather", 0, 1)
plr:GossipMenuAddItem(0, "Nevermind..", 0, 2)
plr:GossipSendMenu(1, unit)
end
local function TestMenuSelectWeather(event, plr, unit, sender, intid, code)
if (intid == 1) then
local weather = FindWeather(plr:GetZoneId()) or AddWeather(plr:GetZoneId())
if (not weather) then
error("Unable to find or add weather to zone ("..plr:GetZoneId()..")")
return
end
print (weather:GetZoneId())
weather:SetWeather(2, 3)
plr:GossipComplete()
elseif (intid == 2) then
plr:GossipComplete()
end
end
RegisterCreatureGossipEvent(NpcId, 1, TestMenuWeather)
RegisterCreatureGossipEvent(NpcId, 2, TestMenuSelectWeather)