Further file organization
Further file organization
This commit is contained in:
49
nwn/nwnprc/trunk/scripts/prc_wwcurse.nss
Normal file
49
nwn/nwnprc/trunk/scripts/prc_wwcurse.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: OnHit for Curse of the Lycanthrope
|
||||
//:: prc_wwcurse
|
||||
//:: Copyright (c) 2004 Shepherd Soft
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Russell S. Ahlstrom
|
||||
//:: Created On: May 15, 2004
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "x2_inc_switches"
|
||||
#include "prc_alterations"
|
||||
|
||||
void main()
|
||||
{
|
||||
int nEvent =GetUserDefinedItemEventNumber();
|
||||
object oPC;
|
||||
object oItem;
|
||||
|
||||
// * This code runs when the item has the OnHitCastSpell: Unique power property
|
||||
// * and it hits a target(weapon) or is being hit (armor)
|
||||
// * Note that this event fires for non PC creatures as well.
|
||||
if (nEvent ==X2_ITEM_EVENT_ONHITCAST)
|
||||
{
|
||||
oItem = GetSpellCastItem(); // The item casting triggering this spellscript
|
||||
object oSpellOrigin = OBJECT_SELF ;
|
||||
object oSpellTarget = PRCGetSpellTargetObject();
|
||||
oPC = OBJECT_SELF;
|
||||
|
||||
if (!GetIsPC(oSpellTarget)) return;
|
||||
|
||||
int nRoll = d20(1);
|
||||
int nConBonus = GetAbilityModifier(ABILITY_CONSTITUTION, oSpellTarget);
|
||||
int nFortitude = GetFortitudeSavingThrow(oSpellTarget);
|
||||
|
||||
if ((nRoll + nConBonus + nFortitude) < 15)
|
||||
{
|
||||
//Only send message if player isn't already a lycanthrope.
|
||||
if (GetLocalInt(oSpellTarget, "PRC_AllowWWolf") != 0)
|
||||
{
|
||||
FloatingTextStringOnCreature("You have contracted lycanthropy!", oSpellTarget, FALSE);
|
||||
}
|
||||
SetLocalInt(oSpellTarget, "PRC_AllowWWolf", 0);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user