need a bit of scripting advice, i'm trying to....make harms...for experimental purposes. and I figure adding the undead harm script (monster ability) into a called script specially for the item via using unique self property could work.
however, I read this
http://nwn.bioware.com/builders/sctutorial10.html and from what I gather it calls the items script through the onactivate, rather than needing to make the on activate massivly overcrowded...how do I make sure the items script is named right so it is called? and also would it work semi-automatically so long as the script is there?
I actually get the scripting part itself, just not the structure.
ed: by adding I mean splicing, ripping apart and usng the bit that calls the effect =)
ed2: k, it seams I get -some of- the script...I can read it just not entirely 100% on all of it.
--
omg it worked >_>
modded a heal, tag is NW_ITEM_HARMS, script with the same name contains this spliced bit of code.
Quote:
#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
object oPC;
object oItem;
object oTarget;
if (nEvent == X2_ITEM_EVENT_ACTIVATE)
{
oPC = GetItemActivator();
oItem = GetItemActivated();
oTarget = GetItemActivatedTarget();
int nHP;
effect eHealth;
effect eEffect;
{
nHP = GetCurrentHitPoints(oPC)-1;
eHealth = EffectDamage(nHP);
eEffect = EffectVisualEffect(VFX_IMP_HARM);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHealth, oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
}
}
}
this does lack I think, the undead healing properties though...