• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Eluna - Added Weather functions and methods

Status
Not open for further replies.

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

  • 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



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)

mdu4.png
 
Last edited:

Salja

Respected Member
Small Update for MaNGOS add ScriptName to game_weather so yet workd all with weather =)
 
Status
Not open for further replies.
Top