Initial Commit

Initial Commit.
This commit is contained in:
Jaysyn904
2025-09-14 15:40:46 -04:00
parent 7083b33d71
commit 1eefc84201
19230 changed files with 11539227 additions and 0 deletions

37
_module/nss/storering.nss Normal file
View File

@@ -0,0 +1,37 @@
#include "x2_inc_switches"
#include "prc_x2_itemprop"
#include "prc_inc_spells"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
object oPC=OBJECT_SELF;
object oItem;
float fLvl;
if (nEvent==X2_ITEM_EVENT_SPELLCAST_AT)
{
oItem = PRCGetSpellTargetObject();
int nSpell = PRCGetSpellId();
int nLvl = StringToInt(Get2DAString("spells","innate",nSpell));
if (nLvl==0) fLvl = 0.5;
else fLvl = IntToFloat(nLvl);
fLvl = GetLocalFloat(oItem,"CurrentLvl") + fLvl;
//this function determines how powerful ring is - higher the more dope
if ( fLvl > 3.0)
{
SendMessageToPC(oPC,"The ring can't store this spell");
SetExecutedScriptReturnValue();
return;
}
itemproperty ipProp = ItemPropertyCastSpell(IPGetIPConstCastSpellFromSpellID(nSpell),IP_CONST_CASTSPELL_NUMUSES_0_CHARGES_PER_USE);
IPSafeAddItemProperty(oItem,ipProp,0.0,X2_IP_ADDPROP_POLICY_IGNORE_EXISTING,FALSE,FALSE);
SetLocalFloat(oItem,"CurrentLvl",fLvl);
SendMessageToPC(oPC,"You have stocked this spell");
}
SetExecutedScriptReturnValue();
}