View previous topic :: View next topic |
Author |
Message |
Jambo
Joined: 24 Sep 2008 Posts: 22
|
Posted: Thu Oct 30, 2008 9:28 Post subject: EffectDispelMagicAll - how dpes NWN calculate it? |
|
|
For some time now I have been interested in the internal workings of EffectDispelMagicAll(). Unfortunately I'm not too great with debugging things, so I hoped someone here may be able to shed some light.
I had originally thought (naively) that NWN must keep track of the caster level associated with effects to be able to know what it should and shouldn't be dispelling when EffectDispelMagicAll() is called, but from what I've heard this isn't the case at all.
This has left me wondering how dispel checks are handled in multiple situations, ie: when someone has caster levels in more than one class, and when something is cast from an item.
What about if someone crashes? I know that tends to cause the creator of an effect to start being returned as OBJECT_INVALID. Does that also affect the EffectDispelMagicAll() function in some way?
Any insight would be greatly appreciated. |
|
Back to top |
|
|
acaos
Joined: 08 May 2007 Posts: 153
|
Posted: Thu Oct 30, 2008 19:32 Post subject: |
|
|
Poorly. We reimplemented it entirely on HG in script.
Acaos |
|
Back to top |
|
|
Jambo
Joined: 24 Sep 2008 Posts: 22
|
Posted: Thu Oct 30, 2008 21:29 Post subject: |
|
|
Any hints you can give me to get started with that?
If the caster becomes OBJECT_INVALID, or for items, I've no idea the best ways to track down information relevant to use for level comparisons on dispelling effects. |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Fri Oct 31, 2008 0:32 Post subject: |
|
|
Hi, I did a research, when I scripted No Ability Stacking ruleset. From what I found out, I think it is impossible to remake it properly on windows. On linux there is nwnx_struct plugin, which could do that.
Problems on windows:
If you create effect in spell script, it will carry OBJECT_SELF as creator (which will disappear when PC relog - and then on rest it dont work properly) and GetSpellId() as spell ID.
You can change creator if you do this:
Code: | AssignCommand(oAnybody,ApplyEffectToObject(EffectAbilityIncrease()))); | But, this way, effect lost spell ID reference and this will be -1.
Effect with spell ID -1, stack itself and that could be problem.
Then, Feat spells like BG's Bulls Strength returns CLASS_TYPE_INVALID as last cast class. And whenever you cast spell with bCheat=TRUE then last class will be also invalid. And, Im not totally sure but it seems that this spells cant be dispelled by this function.
Well its more but I see no way how to remade it without nwnx_struct.
If you have linux server, check nwnx_struct then, I think you find out way how to do that with this info., _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
|