Alangara_PRC8/_module/nss/mn_onhitcast.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

37 lines
1.3 KiB
Plaintext

#include "prc_inc_spells"
void main()
{
object oItem; // The item casting triggering this spellscript
object oSpellTarget; // On a weapon: The one being hit. On an armor: The one hitting the armor
object oSpellOrigin; // On a weapon: The one wielding the weapon. On an armor: The one wearing an armor
// fill the variables
oSpellOrigin = OBJECT_SELF;
oSpellTarget = PRCGetSpellTargetObject();
oItem = PRCGetSpellCastItem();
// FloatingTextStringOnCreature("On Hit!", GetFirstPC(), FALSE);
object oPlayer = OBJECT_SELF;
string sResRef = GetResRef (oItem);
// FloatingTextStringOnCreature("Inside if", GetFirstPC(), FALSE);
if (GetTag(oItem) == "MN_LASTWORD")
{
// FloatingTextStringOnCreature("Inside lastword", GetFirstPC(), FALSE);
if (GetObjectType(oSpellTarget) == OBJECT_TYPE_CREATURE && !GetIsPC(oSpellTarget))
{
// FloatingTextStringOnCreature("Objecttype ok", GetFirstPC(), FALSE);
SetPlotFlag(oSpellTarget, FALSE);
SetImmortal(oSpellTarget, FALSE);
effect visual = EffectVisualEffect(VFX_FNF_SCREEN_BUMP);
ApplyEffectToObject(DURATION_TYPE_INSTANT, visual, oSpellTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, SupernaturalEffect(EffectDeath(TRUE, TRUE)), oSpellTarget);
}
}
}