Neverwinter Nights > NwN Building
Probably basic but im lost
Mo:
--- Quote from: 420 on March 10, 2008, 09:32:20 PM ---Heh, that's because it's "global climate destabilization" get with the times man, this isn't 2006.
-420
--- End quote ---
Well it certainly is destabilized. For those keeping track, we've had a total of 350cm of snow up until yesterday. For you Americans that's 12 feet. Yes, enough to bury two men standing on each others heads. More than the past 2-3 years combined.
Calia:
That worked perfectly 420 :D your my hero hehe an item will be great im gonna attempt to make some of my DM tools usable as PC, along with a couple other items im trying to make :D i wish i could pull all the tag based stuff but i think its more tied into everything on the mod. then i even know considering the guild stuff I would much rather set up some type of database to handle guild factions and spell stuff though im almost tempted to just rework the spell script to up the damages and such for anyone not just guild members unless i make it go public
420:
Here is the script for the item. I just cut and paste the section from the spellhook script and changed the target to work with tag-based items.
If you run into the problem where it won't work on PC's that are "busy" then I suspect it has something to do with the script "_kw_activate" which is called before the tag-based item script.
NOTE: Make an item with the same tag as the name of this script (whatever you choose to call it). The item should have the item property "Cast Spell: Activate Item (Long Range) [Unlimited Uses a Day]" on it.
--- Code: ---//Script for a tag-based item that heals/rests target
//NOTE: The script name should match the tag of the item
//Created by 420 on 3/10/08
void main()
{
object oTarget = GetItemActivatedTarget();
//All of the following was taken from 02_rokspellhook -420
effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION_GREATER);
effect eBad = GetFirstEffect(oTarget);
//Search for negative effects
while(GetIsEffectValid(eBad))
{
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
GetEffectType(eBad) == EFFECT_TYPE_CURSE ||
GetEffectType(eBad) == EFFECT_TYPE_DISEASE ||
GetEffectType(eBad) == EFFECT_TYPE_POISON ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_CHARMED ||
GetEffectType(eBad) == EFFECT_TYPE_DOMINATED ||
GetEffectType(eBad) == EFFECT_TYPE_DAZED ||
GetEffectType(eBad) == EFFECT_TYPE_CONFUSED ||
GetEffectType(eBad) == EFFECT_TYPE_FRIGHTENED ||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_SLOW ||
GetEffectType(eBad) == EFFECT_TYPE_STUNNED ||
// Stealth: added petrification, silence and sleep removal
GetEffectType(eBad) == EFFECT_TYPE_PETRIFY ||
GetEffectType(eBad) == EFFECT_TYPE_SILENCE ||
GetEffectType(eBad) == EFFECT_TYPE_SLEEP)
{
RemoveEffect(oTarget, eBad);
}
eBad = GetNextEffect(oTarget);
}
//Stealth: modified full heal effect to only heal up to 100 HP
if(GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
//Apply the VFX impact and effects
int nHeal = GetMaxHitPoints(oTarget) - GetCurrentHitPoints(oTarget);
if (nHeal > 250) nHeal = 250;
effect eHeal = EffectHeal(nHeal);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
}
//Modified by 420 on 3/10/08
//DM Greater Restoration autorests target
if(GetIsDM(OBJECT_SELF))
{
ForceRest(oTarget);
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_GREATER_RESTORATION, FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget);
}
--- End code ---
420:
Here is a very simple script that will toggle your appearance between "Human" and your "original" appearance. I say "simple" because it's very easy to break if you do something like polymorph before hand or your form is already human. For instance, I haven't tested this script out at all but I suspect that if you start out as a human and use this item it will turn you into a dwarf.
To make it an elf just copy the script and replace the two instances of APPEARANCE_TYPE_HUMAN with APPEARANCE_TYPE_ELF.
NOTE: Make an item with the same tag as the name of this script. The item should have the property "Cast Spell: Unique Power Self Only [Unlimited Uses a Day]" on it.
--- Code: ---//Tag-based item script that will toggle between current appearance and Human
//Created by 420 on 3/10/08
void main()
{
object oPC = GetItemActivator();
object oItem = GetItemActivated();
int iForm = GetAppearanceType(oPC);
//Apply Human appearance if not currently Human
//Otherwise convert to "original" appearance
if(iForm != APPEARANCE_TYPE_HUMAN)
{
SetLocalInt(oPC, "TrueForm", iForm);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH), oPC);
SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_HUMAN);
}
else
{
iForm = GetLocalInt(oPC, "TrueForm");
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH), oPC);
SetCreatureAppearanceType(oPC, iForm);
}
}
--- End code ---
Calia:
Thank you so much 420! these are perfect :D I will continue to work on the other things and hope you don't mind if I bounce questiosn off you here and there :)
-Cal
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version