Joined: 07 Feb 2006 Posts: 52 Location: Rome, Italy
Posted: Thu Sep 21, 2006 7:33 am Post subject: Question about repsys hooklist
The new hooks (OnAttack,OnHelp) are useful, but they could be very very useful if we can prevent that a player become gray by double click or a target harmful/helpful (by returning different values).
Can you add in the next core?
Author
Message
Austin POL Developer
Joined: 30 Jan 2006 Posts: 355 Location: San Diego, California
Posted: Thu Sep 21, 2006 10:35 am Post subject:
This functionality already exists with these hooks...
Look at the 097 distro for an example. It uses the highlight color hook.
You would control it when OnHelp, OnAttack or OnDamage get triggered, then when the client pulls up the HighLightColor you would read the info set by one of those.. the above link shows a fully scripted reputation system that matches how the core's works.
Author
Message
VeNdOr
Joined: 07 Feb 2006 Posts: 52 Location: Rome, Italy
Posted: Thu Sep 21, 2006 11:29 am Post subject:
Austin wrote:
This functionality already exists with these hooks...
Look at the 097 distro for an example. It uses the highlight color hook.
You would control it when OnHelp, OnAttack or OnDamage get triggered, then when the client pulls up the HighLightColor you would read the info set by one of those.. the above link shows a fully scripted reputation system that matches how the core's works.
ok the example was helpful, because i didn't read on changelog that onattack and onhelp hooks will check on a return value.
thx for the info
Author
Message
Shinigami POL Core Developer
Joined: 30 Jan 2006 Posts: 292 Location: Germany, Bavaria
exported function NameColor(mobile, seen_by)
var color := 0;
if ( mobile.master )
return NameColor(mobile.master, seen_by);
...if someone creates a chain of master and slaves it could become critical ;oP
I'm sure, there are Shards having this problem in future
Shinigami, loving Pizza
Author
Message
Austin POL Developer
Joined: 30 Jan 2006 Posts: 355 Location: San Diego, California
Posted: Sat Sep 23, 2006 2:27 pm Post subject:
The hook example script matches (mostly) how it worked in the core..
So if someone chained them, it woulda become critical in the old way and new way.
I noticed that when I worked on the hook and was like "Welp, if someone DOES do it, he will learn pretty quick not-to."
Author
Message
CWO
Joined: 04 Feb 2006 Posts: 698 Location: Chicago, IL USA
Posted: Sat Sep 23, 2006 3:29 pm Post subject:
well I knew from spellcasting to avoid using a hook... I had to set most of it critical just to stop lag before the casting actually began. My spellcasting script does about 1000 instructions/cast too so it should have been quick but it apparently wasnt.
Author
Message
Austin POL Developer
Joined: 30 Jan 2006 Posts: 355 Location: San Diego, California
Posted: Sat Sep 23, 2006 3:39 pm Post subject:
and if two npcs were set so they were each other's masters, you got a freeze