Player Resource Consortium

 

Author Topic: Just a tip  (Read 274 times)

0 Members and 1 Guest are viewing this topic.

January 12, 2018, 01:35:12 PM
  • Adept
  • *
  • Posts: 16
  • Karma: +0/-0
  • New Member
    • View Profile

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.


January 13, 2018, 07:31:33 AM
Reply #1
  • Adept
  • *
  • Posts: 16
  • Karma: +0/-0
  • New Member
    • View Profile

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 :)