View previous topic :: View next topic |
Author |
Message |
Zebranky
Joined: 04 Jun 2006 Posts: 415
|
Posted: Sun Mar 23, 2008 6:03 Post subject: Healing kits |
|
|
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 |
|
|
Ami
Joined: 01 Apr 2008 Posts: 1
|
Posted: Wed Apr 02, 2008 0:15 Post subject: Solution.. |
|
|
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 |
|
|
Disco
Joined: 06 Dec 2006 Posts: 152
|
Posted: Wed Apr 02, 2008 10:30 Post subject: |
|
|
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 |
|
|
Zebranky
Joined: 04 Jun 2006 Posts: 415
|
Posted: Mon Apr 14, 2008 19:52 Post subject: |
|
|
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 |
|
|
Zebranky
Joined: 04 Jun 2006 Posts: 415
|
Posted: Tue Apr 15, 2008 3:24 Post subject: |
|
|
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 |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Tue Apr 15, 2008 17:13 Post subject: Re: Solution.. |
|
|
That system doesn't seem to work in nwn2. |
|
Back to top |
|
|
Zebranky
Joined: 04 Jun 2006 Posts: 415
|
Posted: Mon May 26, 2008 4:55 Post subject: |
|
|
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 |
|
|
|