Files
HeroesStone_PRC8/_removed/x0_s0_clight.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

69 lines
2.3 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Continual Flame
//:: x0_s0_clight.nss
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
Permanent Light spell
XP2
If cast on an item, item will get permanently
get the property "light".
Previously existing permanent light properties
will be removed!
*/
//:://////////////////////////////////////////////
//:: Created By: Brent Knowles
//:: Created On: July 18, 2002
//:://////////////////////////////////////////////
//:: VFX Pass By:
//:: Added XP2 cast on item code: Georg Z, 2003-06-05
//:://////////////////////////////////////////////
//#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run
// this spell.
if (!X2PreSpellCastCode())
{
return;
}
int nDuration;
int nMetaMagic;
object oTarget = GetSpellTargetObject();
// Handle spell cast on item....
if (GetObjectType(oTarget) == OBJECT_TYPE_ITEM && ! CIGetIsCraftFeatBaseItem(oTarget))
{
// Do not allow casting on not equippable items
if (!IPGetIsItemEquipable(oTarget))
{
// Item must be equipable...
FloatingTextStrRefOnCreature(83326,OBJECT_SELF);
return;
}
itemproperty ip = ItemPropertyLight (IP_CONST_LIGHTBRIGHTNESS_BRIGHT, IP_CONST_LIGHTCOLOR_WHITE);
IPSafeAddItemProperty(oTarget, ip, 0.0f,X2_IP_ADDPROP_POLICY_REPLACE_EXISTING,TRUE,TRUE);
// This will set the "Stolen" flag to true so that we can keep merchants from buying items with this spell
// This is essentially a monetary system exploit buster . . .
SetStolenFlag(oTarget,TRUE);
}
else
{
//Declare major variables
effect eVis = (EffectVisualEffect(VFX_DUR_LIGHT_WHITE_20));
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = SupernaturalEffect(EffectLinkEffects(eVis, eDur));
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 419, FALSE));
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 30000.0);
}
}