Area timer functions

meko

Core Developers
Messages
363
Points
0
IRC Nickname
meko
Github
Helianthella
Emulator
Hercules
Client Version
ManaPlus







View File

Area timer functions




This script provides functions to add (or remove) timers to every player in the area or map.

areatimer("<map>", <x1>, <y1>, <x2>, <y2>, <tick>, "<event>")
makes all players in the square area call <event> after <tick> ms
> returns the number of affected players

Code:
areatimer("prontera", 55, 60, 150, 180, 500, "MyNPC:MyEvent");

 
areatimer2("<map>", <x1>, <y1>, <x2>, <y2>, <tick>, "<event>")
identical to areatimer, but also removes any existing timer before adding the new one
> returns the number of affected players

Code:
areatimer2("prontera", 55, 60, 150, 180, 500, "MyNPC:MyEvent");
 
areadeltimer("<map>", <x1>, <y1>, <x2>, <y2>, "<event>")
makes all players in the square area remove their timers for <event>
> returns the number of affected players

Code:
areadeltimer("prontera", 55, 60, 150, 180, "MyNPC:MyEvent");
 
maptimer("<map>", <tick>, "<event>")
makes all players in the map call <event> after <tick> ms
> returns the number of affected players

Code:
maptimer("prontera", 500, "MyNPC:MyEvent");
 
maptimer2("<map>", <tick>, "<event>")
identical to maptimer() but also removes any existing timer before adding the new one
> returns the number of affected players

Code:
maptimer2("prontera", 500, "MyNPC:MyEvent");
 
mapdeltimer("<map>", "<event>")
makes all players on the map remove their timers for <event>
> returns the number of affected players

Code:
mapdeltimer("prontera", "MyNPC:MyEvent");
 
 
 
 
globaltimer(<tick>, "<event>")
makes all players everywhere call <event> after <tick> ms
> returns the number of affected players

globaltimer(500, "MyNPC:MyEvent");

Requires Hercules v2018.06.03 or newer version

--------------------------------------------------------------------------------------
This script was made by me, for The Mana World + Evol.
License: public domain (CC0)









 
Last edited by a moderator:
Back
Top