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 
 
Healing kits

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Sun Mar 23, 2008 6:03    Post subject: Healing kits Reply with quote

Has anyone hooked the use of healing kits? If not, and you're looking for a project, could you look into this? I've tried, but my debugger-fu is still too weak.

The ideal result of this would be to allow us to make healing kits NOT heal disease. Our world's setting has very prevalent and strong disease, and we've created custom healing items that don't cure disease, but we're linked to other worlds where everyone and his mother has standard healing kits.

Thanks for any insight anyone can bring to this.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
Ami



Joined: 01 Apr 2008
Posts: 1

PostPosted: Wed Apr 02, 2008 0:15    Post subject: Solution.. Reply with quote

Probably better to ask on the NWN forums, as doing this does not require NWNX. I found this post while searching Google for something unrelated, but I'll post the solution here anyway, in case you don't have it:

Bioware has already hooked spell effects for you, and healing kits are simply spell effects.

To use their spellhooking system, you need to edit your module variables. Add a variable string named X2_S_UD_SPELLSCRIPT with the value spelloverride, or something similar that you can easily remember.

Now make a script named "spelloverride". In this script, type:

Code:

#include "x2_inc_switches"

void main(){
int ispell = GetSpellId(); //ID of the spell, uses spells.2da
int ilevel = GetCasterLevel(OBJECT_SELF); //Caster level of spell.
object oPC = OBJECT_SELF; //Person casting the spell

//If the spell is cast at the ground, it will use lTarget for location.
//Otherwise, if it is cast at a person or object, it will use oTarget.
object oTarget = GetSpellTargetObject();
location lTarget = GetSpellTargetLocation();
int iclass = GetLastSpellCastClass(); //Class of the spellcaster.


if (ispell==506){ //506 is healing kit, if using default spells.2da

//INSERT YOUR OWN CODE HERE.

/* This next line tells NWN to not run the default spellscript.  Remove this line if you want to run the default spell script after your hook.
*/
SetModuleOverrideSpellScriptFinished();

} //End spellhook for healing kit.

} //End void main()


You can override other spells and spell effects in this way, or prevent spells from working on certain people, or do extra damage to certain people, or create wild/null magic zones, or require users to have a spellbook in order to cast spells. Code isn't tested, but it should work in theory. Just insert whatever you want the healing kit to do at the comment line.


This also allows you to override potions and clerical spells that cure disease. For even more fun, you can make diseases which are resistant to clerical spells or potions by using the same script, or make diseases that only clerics or specific spells or potions can cure.
Back to top
View user's profile Send private message
Disco



Joined: 06 Dec 2006
Posts: 152

PostPosted: Wed Apr 02, 2008 10:30    Post subject: Reply with quote

The actual feat hooks would be mjummy, though.

I'd LOVE to be able to intercept pickpocketing, for example.

Yes, Windauws here.
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Mon Apr 14, 2008 19:52    Post subject: Reply with quote

Wow, I was completely convinced heal kits were hardcoded. Thanks a lot!
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Tue Apr 15, 2008 3:24    Post subject: Reply with quote

How about diseases getting past immunity to disease?
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Tue Apr 15, 2008 17:13    Post subject: Re: Solution.. Reply with quote

That system doesn't seem to work in nwn2.
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Mon May 26, 2008 4:55    Post subject: Reply with quote

Heal kits ARE, in fact, hardcoded. However, I was able to hook this and cause all diseases to have a heal DC of 16777215, which I think is sufficiently high for my needs...

PM me if you're interested in this.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development 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