Tommy
Founder
Hello everyone! I've been meaning to do this for awhile, so here it is! You can now update the weather when ever you like via Eluna (Lua).
COMMIT: https://github.com/ElunaLuaEngine/Eluna/commit/e6289936d511910f4694b8183286cd153036c790
New Global Functions:
(http://wiki.emudevs.com/doku.php?id=eluna_global_class)
New Weather Methods:
(http://wiki.emudevs.com/doku.php?id=eluna_weather_class)
Getters
Setters
Booleans
Other
Example:
Screenshot of the script above: (Note: I'm in Elwynn Forest and I made it snow)
COMMIT: https://github.com/ElunaLuaEngine/Eluna/commit/e6289936d511910f4694b8183286cd153036c790
New Global Functions:
(http://wiki.emudevs.com/doku.php?id=eluna_global_class)
- FindWeather(zoneId) - Finds the weather by zoneId and returns the weather
- AddWeather(zoneId) - Adds weather to the following zone, also returns weather
- RemoveWeather(zoneId) - Removes weather from a zone
- SendFineWeatherToPlayer(player) - Sends WEATHER_STATE_FINE weather to the player
New Weather Methods:
(http://wiki.emudevs.com/doku.php?id=eluna_weather_class)
Getters
- GetScriptId() - Returns the weather's scriptId
- GetZoneId() - Returns the weather's zoneId
Setters
- SetWeather(weatherType, grade) - Sets the weather by weather type and grade
Booleans
- Regenerate() - Calculates weather, returns true if the weather changed
- UpdateWeather() - Updates the weather in a zone that has players in it, returns false if players aren't found
Other
- SendWeatherUpdateToPlayer(player) - Sends weather update to the player
Example:
Code:
function Item_GossipHello(event, player, item)
player:GossipMenuAddItem(0, "Test Weather", 0, 1)
player:GossipMenuAddItem(0, "Nevermind..", 0, 2)
player:GossipSendMenu(1, item)
end
function Item_GossipSelect(event, player, item, sender, intid, code)
player:GossipClearMenu()
if (intid == 1) then
local weather = FindWeather(player:GetZoneId())
if (weather == nil) then
weather = AddWeather(player:GetZoneId())
end
print (weather:GetZoneId())
print (weather:GetScriptId())
weather:SetWeather(2, 3)
player:GossipComplete()
elseif (intid == 2) then
player:GossipComplete()
end
end
RegisterItemGossipEvent(60000, 1, Item_GossipHello)
RegisterItemGossipEvent(60000, 2, Item_GossipSelect)
Screenshot of the script above: (Note: I'm in Elwynn Forest and I made it snow)
Last edited: