logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
EffectDispelMagicAll - how dpes NWN calculate it?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Jambo



Joined: 24 Sep 2008
Posts: 22

PostPosted: Thu Oct 30, 2008 9:28    Post subject: EffectDispelMagicAll - how dpes NWN calculate it? Reply with quote

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
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Thu Oct 30, 2008 19:32    Post subject: Reply with quote

Poorly. We reimplemented it entirely on HG in script.

Acaos
Back to top
View user's profile Send private message
Jambo



Joined: 24 Sep 2008
Posts: 22

PostPosted: Thu Oct 30, 2008 21:29    Post subject: Reply with quote

Any hints you can give me to get started with that? Very Happy

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
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Oct 31, 2008 0:32    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group