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

How Eluna work

Status
Not open for further replies.

miaxos

Respected Member
Hi. ^^

Something i want to know :p.

So, when we hook an Eluna's function to do something when we cast a spell, server'll check a lot of times in a second if a player cast a spell ? (Someone told me that, and i used to believe that Eluna weren't working like that for a script like http://emudevs.com/showthread.php/1713-Bladestorm-Fix )

Thank you !!!!

(I'm sorry for my poor English, as usual :p, if you don't understand, just tell me and i'll write again my post ^^)
 

Rochet2

Moderator / Eluna Dev
So, when we hook an Eluna's function to do something when we cast a spell, server'll check a lot of times in a second if a player cast a spell ?
(Someone told me that, and i used to believe that Eluna weren't working like that for a script like http://emudevs.com/showthread.php/1713-Bladestorm-Fix )
Eluna wont check if the player casts a spell, but the script is executed when a player casts a spell, which can happen many times a second.
All events are triggered from the C++ code when something happens.

The lua hooks / events etc work just like the C++ hooks / events.

For example, when a player casts a spell, the player sends a message to the server that it is casting a spell.
The server will then process the message for what spell is cast, on who and so on.
In that code there is a function that will trigger the function you registered in lua.
So all eluna code (C++ as well as lua) will only be executed when a certain event happens.

There is no checking every second if the player is doing something etc unless you make such a lua script.
 
Status
Not open for further replies.
Top