Player Resource Consortium

Neverwinter Nights => Help => Topic started by: Arbaal on January 12, 2018, 08:35:12 AM

Title: Just a tip
Post by: Arbaal on January 12, 2018, 08:35:12 AM
Hi, i've done my spellhooking script and it works.

It recalls original nwn spells (modified from prc) without problems, and it does what it's been programmed to do.

I've only a problem. The code calls the spells by constant SPELL_XXXX_XXX, by using the switch function and "case by case" script.
Prc spells does not have constants.

How can i call the prc spell scripts? Is there a syntax to recall directly the spell scripts?

Below the first part of code:
Code: [Select]
void main()
{
object oTarget;
int nSpell=GetSpellId();
int nSpellDC=GetSpellSaveDC();
int nCastLevel=GetCasterLevel(OBJECT_SELF);
object oCaster = OBJECT_SELF;
if (GetCasterLevel(OBJECT_SELF) > 20)
{
nCastLevel = (GetCasterLevel(OBJECT_SELF) + (GetLevelByXP(OBJECT_SELF)-40));
}


     switch (nSpell)
     {

//*Arcane Sfera 1

         //* Evoca I
    case SPELL_SUMMON_CREATURE_I:
               {int nMetaMagic = GetMetaMagicFeat();
               int nDuration = nCastLevel;

and so on...case by case.

Can you help me to recall the spell scripts in my script? I would like to edit by spellhooking the spells/epic spells effects, without importing, exporting, compiling.
Title: Re: Just a tip
Post by: Arbaal on January 13, 2018, 02:31:33 AM
SOLVED
Prc script can be recalled by

case x (where x is the ID row in 2da spells file)

I'm very proud and happy of this :)