Ahoy everyone
Ive been now in the emulation world since a while (lets say about 4 years) and a lot people asked me before if id make a lua engine for mangos or trinity. So far i wasnt interested at all but yesterday i thought it might be a funny thing working once again with LUA as i remembered some fun times working with luabind in my own emulator years ago. So i started this morning implementing the stuff in trinity (after struggling with trinity yesterday evening till 3am...) and things go pretty fast.
Currently exported are about 400 functions from the player class, all the stuff that the server calls in PlayerScript's and WorldScript's can be registered from LUA as well as the whole gossip system.
Here is just an example script which shows some functions:
Code:
function OnMotdChanged(motd)
print("New motd: " .. motd)
end
function OnHandleChat(plr, type, lang, message)
print("A wild chat message appears: " .. message)
end
function GossipHello(plr, creature)
menu = GossipMenu(creature, plr, 1)
menu:AddMenuItem(GossipMenu.IconTaxi, 1, "A wild gossip menu appears")
menu:AddMenuItem(GossipMenu.IconBattle, 2, "Another wild gossip menu appears")
menu:Send()
end
function GossipSelect(plr, creature, id)
if(id == 1) then
plr:Say("I have selected item 1", 0)
end
if(id == 2) then
plr:Yell("I have selected item2", 0)
end
plr:Yell("Im at " .. plr.X .. "/" .. plr.Y .. "/" .. plr.Z, 0)
plr:CloseGossip()
end
RegisterMotdChanged("OnMotdChanged")
RegisterOnChat("OnHandleChat")
RegisterGossipScript("testGossipLUA", "GossipHello", "GossipSelect")
Ill keep you up to date in this thread and i guess i can make a first release this weekend with already a lot of stuff implemented.
Greetings
Cromon