Terrormaster
Wanderer
Intercepting Mobile Packets - Hallucination Effect Redeaux
Hi all, this started off on another topic from Starbucks but tought I'd post it here since it's more of a coding support topic:
Essentially what I'm doing is coding a sanity system for a gothic/lovecraftian themed shard. One of the side effect of sanity loss are phobias and hallucinations. So for instance if your character has a fear of spiders and they fail a sanity check they should start seeing all human mobiles as spiders for a fixed period of time.
Now I've pretty much done my due diligence here and read through all the topics pertaining to hallucination effects with little to know resolution - it was determined it can be done but the concensus was that in order to do it right it would require a modification to the core.
So I got the source code and started digging through it. I have a lot of programming background so I'm not afraid to mess around with the core. However, since there's no documentation for the source (and nor am I asking for any - the core team has enough on their plates) I'm not sure WHERE I'll need to make the necessary changes to implement the sanity hallucination effects. I know HOW to do it, just not WHERE to do it.
On the script side I have flags in a custommobile script for different phobias and a sanity amount. In addition I have two properties: SeeMobilesAsBody and SeeMobilesAsHue.
So, when a phobia kicks in the two above values are set to non-zero values (setting hue to a -1 to generate a random hue).
Then on the core side I would look at these two values before sending out mobile packets. If SeeMobileAsBody is set to a value > 0 then all mobile packets destined to the infected player's client would have the body and hue set accordingly before the packet goes out.
The process is pretty straight forward. I just can't figure out where I need to code it. I've narrowed my search to the packets.cs file but I'm having difficulty decyphering which function needs to be changed. If anyone from the core team (or anyone else in the know) can just point me to the right function, I can drive from there. I'm pretty sure it's one of the functions that accepts beholder and beholdee.
The original topic on starbucks can be found here:
http://www.runuo.com/forum/showthread.php?t=60012
Thanks in advance for any and all help,
-TM
Hi all, this started off on another topic from Starbucks but tought I'd post it here since it's more of a coding support topic:
Essentially what I'm doing is coding a sanity system for a gothic/lovecraftian themed shard. One of the side effect of sanity loss are phobias and hallucinations. So for instance if your character has a fear of spiders and they fail a sanity check they should start seeing all human mobiles as spiders for a fixed period of time.
Now I've pretty much done my due diligence here and read through all the topics pertaining to hallucination effects with little to know resolution - it was determined it can be done but the concensus was that in order to do it right it would require a modification to the core.
So I got the source code and started digging through it. I have a lot of programming background so I'm not afraid to mess around with the core. However, since there's no documentation for the source (and nor am I asking for any - the core team has enough on their plates) I'm not sure WHERE I'll need to make the necessary changes to implement the sanity hallucination effects. I know HOW to do it, just not WHERE to do it.
On the script side I have flags in a custommobile script for different phobias and a sanity amount. In addition I have two properties: SeeMobilesAsBody and SeeMobilesAsHue.
So, when a phobia kicks in the two above values are set to non-zero values (setting hue to a -1 to generate a random hue).
Then on the core side I would look at these two values before sending out mobile packets. If SeeMobileAsBody is set to a value > 0 then all mobile packets destined to the infected player's client would have the body and hue set accordingly before the packet goes out.
The process is pretty straight forward. I just can't figure out where I need to code it. I've narrowed my search to the packets.cs file but I'm having difficulty decyphering which function needs to be changed. If anyone from the core team (or anyone else in the know) can just point me to the right function, I can drive from there. I'm pretty sure it's one of the functions that accepts beholder and beholdee.
The original topic on starbucks can be found here:
http://www.runuo.com/forum/showthread.php?t=60012
Thanks in advance for any and all help,
-TM