Author Topic: generic spellhook script  (Read 678 times)

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
generic spellhook script
« on: May 15, 2012, 01:25:34 pm »


               anybody happen to have a "blank" spellhook script?  i'd love it if somebody had one with a switch statement set up for every spell (i can even clean it out if you have one that's filled up already).

my module uses the wild magic system and EVERY spell script is modified to include a check for the wild magic override.  i figured this would be an excellent time to use the spellhook and condense all of those checks back into one spellhook.

i would have a spellhook that just checks for wild magic, but i also have a few dozen spells that are modified in some other way.  i figured that since i'm already checking the spellhook file, i should just put the changed spells in it and either continue calling the normal internal spell or stop it altogether.


anyway, does somebody happen to have a switch statement already set up?  would save me the trouble of building it myself :/
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
generic spellhook script
« Reply #1 on: May 15, 2012, 01:48:15 pm »


               This might save you some work, this is custom / prefab, spell hook system I threw together for the community....

Save the scripts under the name at the top of the script..

Also, due to forum bug, you will need to change all instances of "class" to ALL CAPS which is a constant, and change all isntances of "class" which is a function to capitalize the "c"...

UPDATED: Added fixs suggested by Lightfoot8 below (Simple to do)
------------------------------------------

//Script Name:    myhook
////////////////////////////////////////////
///Created by Genisys / Guile
// Created on: 6/12/08
// Updated On: 4/23/09
////////////////////////////////////////////
/*

I created this generic spellhooking script to give builders a resource
for a quality spell hook script which will include quite a few options
for all spells cast, and a variety of options for scripters. I tried to
comment this script the best I could to ensure nobody got
confused when reading the code below..

To ensure there were no conflicts or errors between nw_i0_spells and this
script I changed names of int / floats / strings to make sure that no
errors kicked out, if you find an error within nw_i0_spells
it's because you changed something here which is most likely used there..
(Simply change the name of your int / float / or string to correct this.)
(IMPORTANT, DO NOT SAVE nw_i0_spells  script!, if you do delete it!)

NOTE: This script requires intermediate to advanced scripting skills to edit
properly, if you want to edit it, but aren't a good scripter, you may want
to save it under a different name and keep this script as a reference!
All you will need to do is change the string on the module variable
(edit/mod properties advanced tab), change the string myhook to the
name of your script.

// */
////////////////IMPORTANT PLEASE READ/////////////////////////////
/*
//If you do NOT want to run the original spell script simply place
//the function below within the case statement {} of the spell you do
//not wish to allow to execute (ie. the spell does only what you script here!)

SetModuleOverrideSpellScriptFinished();

// */
///////////////////////////////////////////////////////////////////

// NO CASTING AREAS //////// OPTIONAL SETTING/////////////////////
/*

If you wish to dissallow casting of any spell (even from items) in a particular
area, simply open up the area, click edit at the top / then area properties,
select the advanced tab, select the variable button [...], then add the
the following int to the area.. (as shown below..)

Name: NOCASTING  Type: Int  Value: 1

Then click add.. and your done! (Make sure the int is there at the top!)
Open up the No Casting Area and edit the area to see how it's set up properly.


Optional Restrictions to Specific Spells (For an Area with these variables)

Name: NO_SANCTUARY  Type: Int   Value: 1

No Santuary or Greater Sanctuary Spells Allowed In THIS Area

Name: NO_TIMESTOP  Type: Int   Value: 1

Timestop NOT allowed in THIS Area

*/

///////////////////////////////////////////////////////////////////////////

//Do not delete any of these includes! (They are vital for this script)
#include "x2_inc_switches"
#include "nw_i0_spells"

//See this script to learn premade functions to use in this script
//Those functions save you time as this script is rather long!
//Also you can configure important settings to this script in that script!
//#include "spellfunc_inc"

///////////////////////////////////////////////////////////////////////////////
//PROTOTYPE DEFINED

//This checks to see if the spell being cast is NOT Hostile...
int GetIsNonHostileSpell(int nSpell)
{
 return !StringToInt(Get2DAString("spells","HostileSetting",nSpell));
}

//Main Script..
void main()
{
 //Determine who is casting this spell..
 object oCaster = OBJECT_SELF;

 //If it's a DM or NOT a PC!
 if(GetIsDM(oCaster) || !GetIsPC(oCaster))
 { return; }  ///Stop the script here!

 //Declare Major Variables;
 int nSpell=GetSpellId();
 int nNonHostile = GetIsNonHostileSpell(nSpell);
 int nCastLevel = GetCasterLevel(OBJECT_SELF);
 int zInt;

 //I used s instead of oTarget or nclass to denote "spell"
 object sTarget = GetSpellTargetObject();
 object sItem = GetSpellCastItem();
 object oArea = GetArea(oCaster);
 int nJail = GetLocalInt(oArea, "JAIL");
 int nPVP = GetLocalInt(oArea, "PVP");
 location sLocation = GetSpellTargetLocation();
 int sclass = GetLastSpellCastclass();
 string sTag = GetTag(sItem);
 int nType;
 int a;

 //Be sure to set these Variables to TRUE on areas you DO NOT want the
 //spells Timestop & Greater Sancuary Cast (I disallow these spells in Arena)
 int NoGS = GetLocalInt(GetArea(OBJECT_SELF), "NO_SANCUARY");
 int NoTS = GetLocalInt(GetArea(OBJECT_SELF), "NO_TIMESTOP");
 //For NO Timestop & No GS
 int nArena = GetLocalInt(GetArea(OBJECT_SELF), "ARENA_AREA");

//Manual override...
if(GetLocalInt(oCaster, "OVERRIDE_SPELL")==1)
{
  //Stop them cold!
  AssignCommand(oCaster, ClearAllActions());
  //Though the player may show animation, nothing happens! '<img'>
  SetModuleOverrideSpellScriptFinished();
  FloatingTextStringOnCreature("That item is too powerful for you to use!", oCaster, FALSE);
  return;
}


//Let's get the area of the PC
//string cArea = GetTag(GetArea(oCaster));

//This is here to dissallow the script to run if it's not a PC casting spells
//ie. monsters don't get to use the changed effects, only PCs, though if you
//this script to run always no matter who is casting simply type // before if
//to comment out the line below..
if(!GetIsPC(OBJECT_SELF) || GetIsDM(OBJECT_SELF) || GetIsDMPossessed(OBJECT_SELF))
{return;} //Stop the script here..

///////////////////////////////////////////////////////////////////////////////
//Handle Jail...
//NOTHING WORK IN JAIL!!!
if(nJail==1)
{

 //If it's an item!
 if(sItem!=OBJECT_INVALID)
 {
      AssignCommand(oCaster, ClearAllActions());
       //Though the player may show animation, nothing happens! '<img'>
      SetModuleOverrideSpellScriptFinished();
      return;
 }

 //Otherwise stop the spell COLD!
 else
 {
  AssignCommand(oCaster, ClearAllActions());
  //Though the player may show animation, nothing happens! '<img'>
  SetModuleOverrideSpellScriptFinished();
  return;
 }

}

//////////////////No Spells Allowed In Area///////////////////////////////////
//If the PC is in a no casting area, no spell will be cast (even from items!)
//To set up see the above outline

if(GetLocalInt(GetArea(OBJECT_SELF), "NOCASTING")==1)
{

 a = 0;

 //If the spell is NOT Hostile then DO NOT stop the spell!
 //Note this code allows the rest of the spell hook to run on the
 //non-hostile spell being cast (in town!)
 if(nNonHostile!=1)
 {
  a = 1;
 }

 if(a==1)
 {
   //If using a special power or spell from an item...

   //If it's not the listed special item..
   //& it is in fact a valid object!
   if(sItem!=OBJECT_INVALID && sTag != "ammo_maker" &&
   sTag != "namingtool" && sTag != "colorwand")
   {
     nType = GetBaseItemType(GetSpellCastItem());

     if(nType != BASE_ITEM_POTIONS &&
     nType != BASE_ITEM_ENCHANTED_POTION)
     {
      AssignCommand(oCaster, ClearAllActions());
       //Though the player may show animation, nothing happens! '<img'>
      SetModuleOverrideSpellScriptFinished();
      FloatingTextStringOnCreature("All spells fizzle in town.", oCaster);
      return;
     }
   }

     //Make them stop what they are doing instantly!
     AssignCommand(oCaster, ClearAllActions());
     //Though the player may show animation, nothing happens! '<img'>
     SetModuleOverrideSpellScriptFinished();
     FloatingTextStringOnCreature("You cannot cast hostile spell in this area.", oCaster);
     return;

 }
}

///////////////Handling Spells Cast From Items/////////////////////////////////

//This is what will happen if the spell was cast from an item..
if(GetSpellCastItem()!=OBJECT_INVALID)
{
//If the PC uses an item on a PC, and it's one of the following spells
//Then the spell will not work on the PC, note you can add other effects
//like if you don't like the spell level restriction of a spell on an item
//you could add aditional changes to the spell here to boost power. Or, if you
//don't like some aspect of a spell and don't want players abusing it, you could
//modify the spell here to run your edited version instead. (copy/paste original)
//Don't forget to add SetModuleOverrideSpellScriptFinished(); at the end
//to stop the original script from running.

//NO ITEMS WORK IN JAIL!!!
if(GetLocalInt(GetArea(oCaster), "JAIL")==1)
{
 AssignCommand(oCaster, ClearAllActions());
 //Though the player may show animation, nothing happens! '<img'>
 SetModuleOverrideSpellScriptFinished();
 return;
}


//Spells that will not be allowed to target other players (from an item!)..
switch (nSpell)
{
 //Feel free to copy/paste a case function and rename the spell to the
 //name of the spell you don't want PC's targeting PCs with from items only!
 //case SPELL_NAME:  (Like So)
 case SPELL_EPIC_RUIN:
 {
  if(GetIsPC(sTarget))
  {
  //Don't Cast the original spell
  AssignCommand(oCaster, ClearAllActions());
  SetModuleOverrideSpellScriptFinished();
  }
 }break;

//Copy everything above this line if you wish to add more case statements
//simply paste below this line and edit it to fit the spell
//PLEASE NOTE: You should have the spell names filed in alpahbetical order!

 case SPELL_HARM:
 {
  if(GetIsPC(sTarget))
  {
  //Don't cast the original spell at all
  AssignCommand(oCaster, ClearAllActions());
  SetModuleOverrideSpellScriptFinished();
  }
 }break;

 case SPELL_DROWN:
 {
  if(GetIsPC(GetSpellTargetObject()))
  {
  //Stop the original spell from running..
  AssignCommand(oCaster, ClearAllActions());
  SetModuleOverrideSpellScriptFinished();
  }
 }break;

//End switch statement
}

//End if statment
}

/////////////////////////////////////////////////////////////////////////////
//Main Script for handling ALL spells
///////////////////////////////////////////////////////////////////////////
///////////Modifications For All Individual Spells////////////////////////

//NOTE the /* is what is commenting out all of the spells NOT USED...
//you will need to make sure you add */ above the spell you wish to add
//and then add /* after the spell you are adding...

//NOTE: If you wish to edit ALL spells, then simply delete ALL /* & */

 //Switch/Case Statments (for all spells)
 switch(nSpell)
 {
  //This is here to comment out all non-used spells..
  /*  DO NOT DELETE! rather


  //Example on HOW to property add a spell to this system

  //The following goes ABOVE the spell you are editing..
  */
  case SPELL_ACID_FOG:
  {

   //Your Code Goes Here..

  }break;
  //The following goes BELOW the spell you are editing..
  /*

  case SPELL_ACID_SPLASH:
  {
  //Code Goes Here..
  }break;
  case SPELL_AID:
  {
  //Code Goes Here..
  }break;
  case SPELL_AMPLIFY:
  {
  //Code Goes Here..
  }break;
  case SPELL_ANIMATE_DEAD:
  {
  //Code Goes Here..
  }break;
  case SPELL_AURA_OF_VITALITY:
  {
  //Code Goes Here..
  }break;
  case SPELL_AURAOFGLORY:
  {
  //Code Goes Here..
  }break;
  case SPELL_AWAKEN:
  {
  //Code Goes Here..
  }break;
  case SPELL_BALAGARNSIRONHORN:
  {
  //Code Goes Here..
  }break;
  case SPELL_BALL_LIGHTNING:
  {
  //Code Goes Here..
  }break;
  case SPELL_BANE:
  {
  //Code Goes Here..
  }break;
  case SPELL_BANISHMENT:
  {
  //Code Goes Here..
  }break;
  case SPELL_BARKSKIN:
  {
  //Code Goes Here..
  }break;
  case SPELL_BATTLETIDE:
  {
  //Code Goes Here..
  }break;
  case SPELL_BESTOW_CURSE:
  {
  //Code Goes Here..
  }break;
  case SPELL_BIGBYS_CLENCHED_FIST:
  {
  //Code Goes Here..
  }break;
  case SPELL_BIGBYS_CRUSHING_HAND:
  {
  //Code Goes Here..
  }break;
  case SPELL_BIGBYS_FORCEFUL_HAND:
  {
  //Code Goes Here..
  }break;
  case SPELL_BIGBYS_GRASPING_HAND:
  {
  //Code Goes Here..
  }break;
  case SPELL_BIGBYS_INTERPOSING_HAND:
  {
  //Code Goes Here..
  }break;
  case SPELL_BLACK_BLADE_OF_DISASTER:
  {
  //Code Goes Here..
  }break;
  case SPELL_BLACKSTAFF:
  {
  //Code Goes Here..
  }break;
  case SPELL_BLADE_BARRIER:
  {
  //Code Goes Here..
  }break;
  case SPELL_BLADE_THIRST:
  {
  //Code Goes Here..
  }break;
  case SPELL_BLESS:
  {
  //Code Goes Here..
  }break;
  case SPELL_BLESS_WEAPON:
  {
  //Code Goes Here..
  }break;
  case SPELL_BLINDNESS_AND_DEAFNESS:
  {
  //Code Goes Here..
  }break;
  case SPELL_BLOOD_FRENZY:
  {
  //Code Goes Here..
  }break;
  case SPELL_BOMBARDMENT:
  {
  //Code Goes Here..
  }break;
  case SPELL_BULLS_STRENGTH:
  {
  //Code Goes Here..
  }break;
  case SPELL_BURNING_HANDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_CALL_LIGHTNING:
  {
  //Code Goes Here..
  }break;
  case SPELL_CAMOFLAGE:
  {
  //Code Goes Here..
  }break;
  case SPELL_CATS_GRACE:
  {
  //Code Goes Here..
  }break;
  case SPELL_CHAIN_LIGHTNING:
  {
  //Code Goes Here..
  }break;
  case SPELL_CHARM_MONSTER:
  {
  //Code Goes Here..
  }break;
  case SPELL_CHARM_PERSON:
  {
  //Code Goes Here..
  }break;
  case SPELL_CHARM_PERSON_OR_ANIMAL:
  {
  //Code Goes Here..
  }break;
  case SPELL_CIRCLE_OF_DEATH:
  {
  //Code Goes Here..
  }break;
  case SPELL_CIRCLE_OF_DOOM:
  {
  //Code Goes Here..
  }break;
  case SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE:
  {
  //Code Goes Here..
  }break;
  case SPELL_CLARITY:
  {
  //Code Goes Here..
  }break;
  case SPELL_CLOUD_OF_BEWILDERMENT:
  {
  //Code Goes Here..
  }break;
  case SPELL_CLOUDKILL:
  {
  //Code Goes Here..
  }break;
  case SPELL_COLOR_SPRAY:
  {
  //Code Goes Here..
  }break;
  case SPELL_COMBUST:
  {
  //Code Goes Here..
  }break;
  case SPELL_CONE_OF_COLD:
  {
  //Code Goes Here..
  }break;
  case SPELL_CONFUSION:
  {
  //Code Goes Here..
  }break;
  case SPELL_CONTAGION:
  {
  //Code Goes Here..
  }break;
  case SPELL_CONTINUAL_FLAME:
  {
  //Code Goes Here..
  }break;
  case SPELL_CONTROL_UNDEAD:
  {
  //Code Goes Here..
  }break;
  case SPELL_CREATE_GREATER_UNDEAD:
  {
  //Code Goes Here..
  }break;
  case SPELL_CREATE_UNDEAD:
  {
  //Code Goes Here..
  }break;
  case SPELL_CREEPING_DOOM:
  {
  //Code Goes Here..
  }break;
  case SPELL_CRUMBLE:
  {
  //Code Goes Here..
  }break;
  case SPELL_CURE_CRITICAL_WOUNDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_CURE_LIGHT_WOUNDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_CURE_MINOR_WOUNDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_CURE_MODERATE_WOUNDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_CURE_SERIOUS_WOUNDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_DARKFIRE:
  {
  //Code Goes Here..
  }break;
  case SPELL_DARKNESS:
  {
  //Code Goes Here..
  }break;
  case SPELL_DAZE:
  {
  //Code Goes Here..
  }break;
  case SPELL_DEAFENING_CLANG:
  {
  //Code Goes Here..
  }break;
  case SPELL_DEATH_ARMOR:
  {
  //Code Goes Here..
  }break;
  case SPELL_DEATH_WARD:
  {
  //Code Goes Here..
  }break;
  case SPELL_DELAYED_BLAST_FIREBALL:
  {
  //Code Goes Here..
  }break;
  case SPELL_DESTRUCTION:
  {
  //Code Goes Here..
  }break;
  case SPELL_DIRGE:
  {
  //Code Goes Here..
  }break;
  case SPELL_DISMISSAL:
  {
  //Code Goes Here..
  }break;
  case SPELL_DISPEL_MAGIC:
  {
  //Code Goes Here..
  }break;
  case SPELL_DISPLACEMENT:
  {
  //Code Goes Here..
  }break;
  case SPELL_DIVINE_FAVOR:
  {
  //Code Goes Here..
  }break;
  case SPELL_DIVINE_MIGHT:
  {
  //Code Goes Here..
  }break;
  case SPELL_DIVINE_POWER:
  {
  //Code Goes Here..
  }break;
  case SPELL_DOMINATE_ANIMAL:
  {
  //Code Goes Here..
  }break;
  case SPELL_DOMINATE_MONSTER:
  {
  //Code Goes Here..
  }break;
  case SPELL_DOMINATE_PERSON:
  {
  //Code Goes Here..
  }break;
  case SPELL_DOOM:
  {
  //Code Goes Here..
  }break;
  case SPELL_DROWN:
  {
  //Code Goes Here..
  }break;
  case SPELL_EAGLE_SPLEDOR:
  {
  //Code Goes Here..
  }break;
  case SPELL_EARTHQUAKE:
  {
  //Code Goes Here..
  }break;
  case SPELL_ELECTRIC_JOLT:
  {
  //Code Goes Here..
  }break;
  case SPELL_ELEMENTAL_SHIELD:
  {
  //Code Goes Here..
  }break;
  case SPELL_ELEMENTAL_SWARM:
  {
  //Code Goes Here..
  }break;
  case SPELL_ENDURANCE:
  {
  //Code Goes Here..
  }break;
  case SPELL_ENDURE_ELEMENTS:
  {
  //Code Goes Here..
  }break;
  case SPELL_ENERGY_BUFFER:
  {
  //Code Goes Here..
  }break;
  case SPELL_ENERGY_DRAIN:
  {
  //Code Goes Here..
  }break;
  case SPELL_ENERVATION:
  {
  //Code Goes Here..
  }break;
  case SPELL_ENTANGLE:
  {
  //Code Goes Here..
  }break;
  case SPELL_ENTROPIC_SHIELD:
  {
  //Code Goes Here..
  }break;
  case SPELL_EPIC_DRAGON_KNIGHT:
  {
  //Code Goes Here..
  }break;
  case SPELL_EPIC_HELLBALL:
  {
  //Code Goes Here..
  }break;
  case SPELL_EPIC_MAGE_ARMOR:
  {
  //Code Goes Here..
  }break;
  case SPELL_EPIC_MUMMY_DUST:
  {
  //Code Goes Here..
  }break;
  case SPELL_EPIC_RUIN:
  {
  //Code Goes Here..
  }break;
  case SPELL_ETHEREAL_VISAGE:
  {
  //Code Goes Here..
  }break;

  // */

  case SPELL_ETHEREALNESS: //Greater Sancuary
  {
   if(nPVP>=1 || nArena || NoGS)
   {
      SetModuleOverrideSpellScriptFinished();
      FloatingTextStringOnCreature("Something prevents you from using that spell in this area.", oCaster);
      return;
   }

  }break;

  /*

  case SPELL_EVARDS_BLACK_TENTACLES:
  {
  //Code Goes Here..
  }break;
  case SPELL_EXPEDITIOUS_RETREAT:
  {
  //Code Goes Here..
  }break;
  case SPELL_FEAR:
  {
  //Code Goes Here..
  }break;
  case SPELL_FEEBLEMIND:
  {
  //Code Goes Here..
  }break;
  case SPELL_FIND_TRAPS:
  {
  //Code Goes Here..
  }break;
  case SPELL_FINGER_OF_DEATH:
  {
  //Code Goes Here..
  }break;
  case SPELL_FIRE_STORM:
  {
  //Code Goes Here..
  }break;
  case SPELL_FIREBALL:
  {
  //Code Goes Here..
  }break;
  case SPELL_FIREBRAND:
  {
  //Code Goes Here..
  }break;
  case SPELL_FLAME_ARROW:
  {
  //Code Goes Here..
  }break;
  case SPELL_FLAME_LASH:
  {
  //Code Goes Here..
  }break;
  case SPELL_FLAME_STRIKE:
  {
  //Code Goes Here..
  }break;
  case SPELL_FLAME_WEAPON:
  {
  //Code Goes Here..
  }break;
  case SPELL_FLARE:
  {
  //Code Goes Here..
  }break;
  case SPELL_FLESH_TO_STONE:
  {
  //Code Goes Here..
  }break;
  case SPELL_FOXS_CUNNING:
  {
  //Code Goes Here..
  }break;
  case SPELL_FREEDOM_OF_MOVEMENT:
  {
  //Code Goes Here..
  }break;
  case SPELL_GATE:
  {
  //Code Goes Here..
  }break;
  case SPELL_GEDLEES_ELECTRIC_LOOP:
  {
  //Code Goes Here..
  }break;
  case SPELL_GHOSTLY_VISAGE:
  {
  //Code Goes Here..
  }break;
  case SPELL_GHOUL_TOUCH:
  {
  //Code Goes Here..
  }break;
  case SPELL_GLOBE_OF_INVULNERABILITY:
  {
  //Code Goes Here..
  }break;
  case SPELL_GLYPH_OF_WARDING:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREASE:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREAT_THUNDERCLAP:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_MAGIC_FANG:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_MAGIC_WEAPON:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_PLANAR_BINDING:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_RESTORATION:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_SHADOW_CONJURATION_MIRROR_IMAGE:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_SHADOW_CONJURATION_WEB:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_SPELL_BREACH:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_SPELL_MANTLE:
  {
  //Code Goes Here..
  }break;
  case SPELL_GREATER_STONESKIN:
  {
  //Code Goes Here..
  }break;
  case SPELL_GUST_OF_WIND:
  {
  //Code Goes Here..
  }break;
  case SPELL_HAMMER_OF_THE_GODS:
  {
  //Code Goes Here..
  }break;
  case SPELL_HARM:
  {
  //Code Goes Here..
  }break;
  case SPELL_HASTE:
  {
  //Code Goes Here..
  }break;
  case SPELL_HEAL:
  {
  //Code Goes Here..
  }break;
  case SPELL_HEALING_CIRCLE:
  {
  //Code Goes Here..
  }break;
  case SPELL_HEALING_STING:
  {
  //Code Goes Here..
  }break;
  case SPELL_HOLD_ANIMAL:
  {
  //Code Goes Here..
  }break;
  case SPELL_HOLD_MONSTER:
  {
  //Code Goes Here..
  }break;
  case SPELL_HOLD_PERSON:
  {
  //Code Goes Here..
  }break;
  case SPELL_HOLY_AURA:
  {
  //Code Goes Here..
  }break;
  case SPELL_HOLY_SWORD:
  {
  //Code Goes Here..
  }break;
  case SPELL_HORIZIKAULS_BOOM:
  {
  //Code Goes Here..
  }break;
  case SPELL_HORRID_WILTING:
  {
  //Code Goes Here..
  }break;
  case SPELL_ICE_DAGGER:
  {
  //Code Goes Here..
  }break;
  case SPELL_ICE_STORM:
  {
  //Code Goes Here..
  }break;
  case SPELL_IDENTIFY:
  {
  //Code Goes Here..
  }break;
  case SPELL_IMPLOSION:
  {
  //Code Goes Here..
  }break;
  case SPELL_IMPROVED_INVISIBILITY:
  {
  //Code Goes Here..
  }break;
  case SPELL_INCENDIARY_CLOUD:
  {
  //Code Goes Here..
  }break;
  case SPELL_INFERNO:
  {
  //Code Goes Here..
  }break;
  case SPELL_INFESTATION_OF_MAGGOTS:
  {
  //Code Goes Here..
  }break;
  case SPELL_INFLICT_CRITICAL_WOUNDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_INFLICT_LIGHT_WOUNDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_INFLICT_MINOR_WOUNDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_INFLICT_MODERATE_WOUNDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_INFLICT_SERIOUS_WOUNDS:
  {
  //Code Goes Here..
  }break;
  case SPELL_INVISIBILITY:
  {
  //Code Goes Here..
  }break;
  case SPELL_INVISIBILITY_PURGE:
  {
  //Code Goes Here..
  }break;
  case SPELL_INVISIBILITY_SPHERE:
  {
  //Code Goes Here..
  }break;
  case SPELL_IRONGUTS:
  {
  //Code Goes Here..
  }break;
  case SPELL_ISAACS_GREATER_MISSILE_STORM:
  {
  //Code Goes Here..
  }break;
  case SPELL_ISAACS_LESSER_MISSILE_STORM:
  {
  //Code Goes Here..
  }break;
  case SPELL_KEEN_EDGE:
  {
  //Code Goes Here..
  }break;
  case SPELL_KNOCK:
  {
  //Code Goes Here..
  }break;
  case SPELL_LEGEND_LORE:
  {
  //Code Goes Here..
  }break;
  case SPELL_LESSER_DISPEL:
  {
  //Code Goes Here..
  }break;
  case SPELL_LESSER_MIND_BLANK:
  {
  //Code Goes Here..
  }break;
  case SPELL_LESSER_PLANAR_BINDING:
  {
  //Code Goes Here..
  }break;
  case SPELL_LESSER_RESTORATION:
  {
  //Code Goes Here..
  }break;
  case SPELL_LESSER_SPELL_BREACH:
  {
  //Code Goes Here..
  }break;
  case SPELL_LESSER_SPELL_MANTLE:
  {
  //Code Goes Here..
  }break;
  case SPELL_LIGHT:
  {
  //Code Goes Here..
  }break;
  case SPELL_LIGHTNING_BOLT:
  {
  //Code Goes Here..
  }break;
  case SPELL_MAGE_ARMOR:
  {
  //Code Goes Here..
  }break;
  case SPELL_MAGIC_CIRCLE_AGAINST_CHAOS:
  {
  //Code Goes Here..
  }break;
  case SPELL_MAGIC_CIRCLE_AGAINST_EVIL:
  {
  //Code Goes Here..
  }break;
  case SPELL_MAGIC_CIRCLE_AGAINST_GOOD:
  {
  //Code Goes Here..
  }break;
  case SPELL_MAGIC_CIRCLE_AGAINST_LAW:
  {
  //Code Goes Here..
  }break;
  case SPELL_MAGIC_FANG:
  {
  //Code Goes Here..
  }break;
  case SPELL_MAGIC_MISSILE:
  {
  //Code Goes Here..
  }break;
  case SPELL_MAGIC_VESTMENT:
  {
  //Code Goes Here..
  }break;
  case SPELL_MAGIC_WEAPON:
  {
  //Code Goes Here..
  }break;
  case SPELL_MASS_BLINDNESS_AND_DEAFNESS:
  {
  //Code Goes Here..
  }break;
  case SPELL_MASS_CAMOFLAGE:
  {
  //Code Goes Here..
  }break;
  case SPELL_MASS_CHARM:
  {
  //Code Goes Here..
  }break;
  case SPELL_MASS_HASTE:
  {
  //Code Goes Here..
  }break;
  case SPELL_MASS_HEAL:
  {
  //Code Goes Here..
  }break;
  case SPELL_MELFS_ACID_ARROW:
  {
  //Code Goes Here..
  }break;
  case SPELL_MESTILS_ACID_BREATH:
  {
  //Code Goes Here..
  }break;
  case SPELL_MESTILS_ACID_SHEATH:
  {
  //Code Goes Here..
  }break;
  case SPELL_METEOR_SWARM:
  {
  //Code Goes Here..
  }break;
  case SPELL_MIND_BLANK:
  {
  //Code Goes Here..
  }break;
  case SPELL_MIND_FOG:
  {
  //Code Goes Here..
  }break;
  case SPELL_MINOR_GLOBE_OF_INVULNERABILITY:
  {
  //Code Goes Here..
  }break;
  case SPELL_MONSTROUS_REGENERATION:
  {
  //Code Goes Here..
  }break;
  case SPELL_MORDENKAINENS_DISJUNCTION:
  {
  //Code Goes Here..
  }break;
  case SPELL_MORDENKAINENS_SWORD:
  {
  //Code Goes Here..
  }break;
  case SPELL_NATURES_BALANCE:
  {
  //Code Goes Here..
  }break;
  case SPELL_NEGATIVE_ENERGY_BURST:
  {
  //Code Goes Here..
  }break;
  case SPELL_NEGATIVE_ENERGY_PROTECTION:
  {
  //Code Goes Here..
  }break;
  case SPELL_NEGATIVE_ENERGY_RAY:
  {
  //Code Goes Here..
  }break;
  case SPELL_NEUTRALIZE_POISON:
  {
  //Code Goes Here..
  }break;
  case SPELL_ONE_WITH_THE_LAND:
  {
  //Code Goes Here..
  }break;
  case SPELL_OWLS_INSIGHT:
  {
  //Code Goes Here..
  }break;
  case SPELL_OWLS_WISDOM:
  {
  //Code Goes Here..
  }break;
  case SPELL_PHANTASMAL_KILLER:
  {
  //Code Goes Here..
  }break;
  case SPELL_PLANAR_ALLY:
  {
  //Code Goes Here..
  }break;
  case SPELL_PLANAR_BINDING:
  {
  //Code Goes Here..
  }break;
  case SPELL_POISON:
  {
  //Code Goes Here..
  }break;
  case SPELL_POLYMORPH_SELF:
  {
  //Code Goes Here..
  }break;
  case SPELL_POWER_WORD_KILL:
  {
  //Code Goes Here..
  }break;
  case SPELL_POWER_WORD_STUN:
  {
  //Code Goes Here..
  }break;
  case SPELL_PRAYER:
  {
  //Code Goes Here..
  }break;
  case SPELL_PREMONITION:
  {
  //Code Goes Here..
  }break;
  case SPELL_PRISMATIC_SPRAY:
  {
  //Code Goes Here..
  }break;
  case SPELL_PROTECTION__FROM_CHAOS:
  {
  //Code Goes Here..
  }break;
  case SPELL_PROTECTION_FROM_ELEMENTS:
  {
  //Code Goes Here..
  }break;
  case SPELL_PROTECTION_FROM_EVIL:
  {
  //Code Goes Here..
  }break;
  case SPELL_PROTECTION_FROM_GOOD:
  {
  //Code Goes Here..
  }break;
  case SPELL_PROTECTION_FROM_LAW:
  {
  //Code Goes Here..
  }break;
  case SPELL_PROTECTION_FROM_SPELLS:
  {
  //Code Goes Here..
  }break;
  case SPELL_QUILLFIRE:
  {
  //Code Goes Here..
  }break;
  case SPELL_RAISE_DEAD:
  {
  //Code Goes Here..
  }break;
  case SPELL_RAY_OF_ENFEEBLEMENT:
  {
  //Code Goes Here..
  }break;
  case SPELL_RAY_OF_FROST:
  {
  //Code Goes Here..
  }break;
  case SPELL_REGENERATE:
  {
  //Code Goes Here..
  }break;
  case SPELL_REMOVE_BLINDNESS_AND_DEAFNESS:
  {
  //Code Goes Here..
  }break;
  case SPELL_REMOVE_CURSE:
  {
  //Code Goes Here..
  }break;
  case SPELL_REMOVE_DISEASE:
  {
  //Code Goes Here..
  }break;
  case SPELL_REMOVE_FEAR:
  {
  //Code Goes Here..
  }break;
  case SPELL_REMOVE_PARALYSIS:
  {
  //Code Goes Here..
  }break;
  case SPELL_RESIST_ELEMENTS:
  {
  //Code Goes Here..
  }break;
  case SPELL_RESISTANCE:
  {
  //Code Goes Here..
  }break;
  case SPELL_RESTORATION:
  {
  //Code Goes Here..
  }break;
  case SPELL_RESURRECTION:
  {
  //Code Goes Here..
  }break;

  // */

  case SPELL_SANCTUARY:
  {
   if(nPVP>0 || NoGS)
   {
      SetModuleOverrideSpellScriptFinished();
      FloatingTextStringOnCreature("Something prevents you from using that spell in this area.", oCaster);
      return;
   }
  //Code Goes Here..
  }break;

  /*

  case SPELL_SCARE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SCINTILLATING_SPHERE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SEARING_LIGHT:
  {
   //Code Goes Here..
  }break;
  case SPELL_SEE_INVISIBILITY:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADES_CONE_OF_COLD:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADES_FIREBALL:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADES_STONESKIN:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADES_SUMMON_SHADOW:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADES_WALL_OF_FIRE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADOW_CONJURATION_DARKNESS:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADOW_CONJURATION_INIVSIBILITY:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADOW_CONJURATION_MAGE_ARMOR:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADOW_CONJURATION_MAGIC_MISSILE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADOW_CONJURATION_SUMMON_SHADOW:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADOW_DAZE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHADOW_SHIELD:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHAPECHANGE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHELGARNS_PERSISTENT_BLADE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHIELD:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHIELD_OF_FAITH:
  {
  //Code Goes Here..
  }break;
  case SPELL_SHIELD_OF_LAW:
  {
  //Code Goes Here..
  }break;
  case SPELL_SILENCE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SLAY_LIVING:
  {
  //Code Goes Here..
  }break;
  case SPELL_SLEEP:
  {
  //Code Goes Here..
  }break;
  case SPELL_SLOW:
  {
  //Code Goes Here..
  }break;
  case SPELL_SOUND_BURST:
  {
  //Code Goes Here..
  }break;
  case SPELL_SPELL_MANTLE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SPELL_RESISTANCE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SPELLSTAFF:
  {
  //Code Goes Here..
  }break;
  case SPELL_SPHERE_OF_CHAOS:
  {
  //Code Goes Here..
  }break;
  case SPELL_SPIKE_GROWTH:
  {
  //Code Goes Here..
  }break;
  case SPELL_STINKING_CLOUD:
  {
  //Code Goes Here..
  }break;
  case SPELL_STONE_BONES:
  {
  //Code Goes Here..
  }break;
  case SPELL_STONE_TO_FLESH:
  {
  //Code Goes Here..
  }break;
  case SPELL_STONEHOLD:
  {
  //Code Goes Here..
  }break;
  case SPELL_STONESKIN:
  {
  //Code Goes Here..
  }break;
  case SPELL_STORM_OF_VENGEANCE:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUMMON_CREATURE_I:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUMMON_CREATURE_II:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUMMON_CREATURE_III:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUMMON_CREATURE_IV:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUMMON_CREATURE_IX:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUMMON_CREATURE_V:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUMMON_CREATURE_VI:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUMMON_CREATURE_VII:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUMMON_CREATURE_VIII:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUMMON_SHADOW:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUNBEAM:
  {
  //Code Goes Here..
  }break;
  case SPELL_SUNBURST:
  {
  //Code Goes Here..
  }break;
  case SPELL_TASHAS_HIDEOUS_LAUGHTER:
  {
  //Code Goes Here..
  }break;
  case SPELL_TENSERS_TRANSFORMATION:
  {
  //Code Goes Here..
  }break;

  // */

  case SPELL_TIME_STOP:
  {
    if(nPVP>=1 || nArena || NoTS)
    {
     FloatingTextStringOnCreature("Something prevents you from using Timestop in this area.", OBJECT_SELF, TRUE);
     //Though the player may show animation, nothing happens! '<img'>
     SetModuleOverrideSpellScriptFinished();
    }
  }break;

  /*

  case SPELL_TRUE_SEEING:
  {
  //Code Goes Here..
  }break;
  case SPELL_TRUE_STRIKE:
  {
  //Code Goes Here..
  }break;
  case SPELL_TYMORAS_SMILE:
  {
  //Code Goes Here..
  }break;
  case SPELL_UNDEATH_TO_DEATH:
  {
  //Code Goes Here..
  }break;
  case SPELL_UNDEATHS_ETERNAL_FOE:
  {
  //Code Goes Here..
  }break;
  case SPELL_UNHOLY_AURA:
  {
  //Code Goes Here..
  }break;
  case SPELL_VAMPIRIC_TOUCH:
  {
  //Code Goes Here..
  }break;
  case SPELL_VINE_MINE:
  {
  //Code Goes Here..
  }break;
  case SPELL_VINE_MINE_CAMOUFLAGE:
  {
  //Code Goes Here..
  }break;
  case SPELL_VINE_MINE_ENTANGLE:
  {
  //Code Goes Here..
  }break;
  case SPELL_VINE_MINE_HAMPER_MOVEMENT:
  {
  //Code Goes Here..
  }break;
  case SPELL_VIRTUE:
  {
  //Code Goes Here..
  }break;
  case SPELL_WAIL_OF_THE_BANSHEE:
  {
  //Code Goes Here..
  }break;
  case SPELL_WALL_OF_FIRE:
  {
  //Code Goes Here..
  }break;
  case SPELL_WAR_CRY:
  {
  //Code Goes Here..
  }break;
  case SPELL_WEB:
  {
  //Code Goes Here..
  }break;
  case SPELL_WEIRD:
  {
  //Code Goes Here..
  }break;
  case SPELL_WORD_OF_FAITH:
  {
  //Code Goes Here..
  }break;
  case SPELL_WOUNDING_WHISPERS:
  {
  //Code Goes Here..
  }break;

 //Default happens when a normal spell not listed here is cast...
 //Feel free to add any code you wish to apply to all spells not listed
 default:
 {
  //Code goes here
 }break;

 // */

//End Switch Statement
 }

//End Main Script
}

///////////////////////////////////////////////////

--------------------------------------------------------
(Copy Above This Line)
--------------------------------------------------------

In the OnModuleLoad Event Script you will need this function at the TOP of the script.....

SetLocalString(GetModule(), "X2_S_UD_SPELLSCRIPT", "myhook");
               
               

               


                     Modifié par _Guile, 15 mai 2012 - 02:14 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
generic spellhook script
« Reply #2 on: May 15, 2012, 01:50:07 pm »


               how exactly your wild magic work? my unofficial patch allows:
1) direct modify of internal spellhook without need to recompile all spell scripts (not regular spellhook this is the internal one that calls the regular and performs dozen other things)
2) override DC,metamagic,caster level and even spell itself using variables

So if you are simply calling another spell you could use the spell override feature to replace spell X for spell Y.

If you are modifying the spell effects then the regular spellhook is indeed best choice -> to make it easier you could make the default spellhook to execute "wildspell_X" script inside wild magic zone. That way your spellhook will not take thousands of lines and you can perform everyting in new script.
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
generic spellhook script
« Reply #3 on: May 15, 2012, 01:59:22 pm »


               nvm
               
               

               


                     Modifié par _Guile, 15 mai 2012 - 01:01 .
                     
                  


            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
generic spellhook script
« Reply #4 on: May 15, 2012, 02:57:36 pm »


               shadooow, i believe it's this one:

http://nwvault.ign.c....Detail&id=1855

it overwrites each spell with a check for:

if(WildMagicOverride(){ return; }


if wild magic happens, it does something funky in that function call and return 1 so that the rest of the spell doesn't execute.

essentially, it's a spellhook that isn't a hook, but overwrites each spell '<img'>  i would just stick that in my hook and delete all of the custom spells, but i know the previous developer modified some of the spells a bit so i need to go through them all to make sure i don't miss anything.  *sigh*

oh, and in lilac's spellhook tutorial, it's mentioned that the hook should be cached in the module's properties.  i thought i read something at one point that caching was either broken and did nothing or did bad things?  i guess i'm getting off-topic now.

anyway, to bring things back: thanks guile - starting at:

//Switch/Case Statments (for all spells)
switch(nSpell)
{
/*
case SPELL_ACID_FOG:
{
//Code Goes Here..
}break;
case SPELL_ACID_SPLASH:
{
//Code Goes Here..
}break;
case SPELL_AID:
{
//Code Goes Here..
}break;
case SPELL_AMPLIFY:
{
//Code Goes Here..
}break;


is exactly what i was looking for.
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
generic spellhook script
« Reply #5 on: May 15, 2012, 03:14:52 pm »


               From my experience, Cached Scripts cause problems...  Just saying...
               
               

               


                     Modifié par _Guile, 15 mai 2012 - 02:15 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
generic spellhook script
« Reply #6 on: May 15, 2012, 03:21:45 pm »


               

acomputerdood wrote...

shadooow, i believe it's this one:

http://nwvault.ign.c....Detail&id=1855

it overwrites each spell with a check for:

if(WildMagicOverride(){ return; }


if wild magic happens, it does something funky in that function call and return 1 so that the rest of the spell doesn't execute.

essentially, it's a spellhook that isn't a hook, but overwrites each spell '<img'>  i would just stick that in my hook and delete all of the custom spells, but i know the previous developer modified some of the spells a bit so i need to go through them all to make sure i don't miss anything.  *sigh*

oh, and in lilac's spellhook tutorial, it's mentioned that the hook should be cached in the module's properties.  i thought i read something at one point that caching was either broken and did nothing or did bad things?  i guess i'm getting off-topic now.

Looking into this package, its really bad idea to rewrite each spell. From the date it seems that author haven't other choice back these days as spellhook came first with HotU I believe.

Anyway, you will need to switch the spellid like Guile is doing in his snippet as the wild magic seems to work differently for different types of spells, aoe, boost, attack etc. So the original spellhook is the best way.


As for you second question, caching anything became obsolete with 1.69 and is actually contraproductive as scripts are now cached automatically.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
generic spellhook script
« Reply #7 on: May 15, 2012, 03:58:21 pm »


               yeah, i thought that was the case about caching.

it should be "simple" enough to find all the scripts with the wild magic check, compare them to the original spells, put the wild magic check with "value added" custom spells my server uses into the hook, and then delete the overwritten versions.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
generic spellhook script
« Reply #8 on: May 15, 2012, 04:51:20 pm »


               is there a way to extract the "original" spells from the module into text (or .nss)?  then i can just run a diff on my modified .nss and the originals rather than going through them by hand.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
generic spellhook script
« Reply #9 on: May 15, 2012, 05:05:52 pm »


               Get the original .nss
(1) Ask shadow for his compilation of the Original .nss
or
(2) Open up Neverwinter Explorer, drill down to the script resources, and extract all the spell scripts

Get your .nss
(1) Open your NWN Mod
(2) Go to the Module directory and find the Temp folder
(3) Select and copy all of the .nss files to another directory
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
generic spellhook script
« Reply #10 on: May 15, 2012, 05:14:43 pm »


               Yeah, I'd opt for the open the module, copy files from the temp directory, definitely smarter move..
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
generic spellhook script
« Reply #11 on: May 15, 2012, 05:17:54 pm »


               much appreciated - i went with option #2.  i'll just do a "cp *_s0_*" from all of the exported scripts to get the spell ones then.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
generic spellhook script
« Reply #12 on: May 15, 2012, 05:31:41 pm »


               

acomputerdood wrote...

is there a way to extract the "original" spells from the module into text (or .nss)?  then i can just run a diff on my modified .nss and the originals rather than going through them by hand.

or just download them '<img'> LINK
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
generic spellhook script
« Reply #13 on: May 15, 2012, 07:44:00 pm »


               Alway hold out for door #3. '<img'>
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
generic spellhook script
« Reply #14 on: May 17, 2012, 12:45:12 am »


               another quick question about this - i think i know the answer, but wanted to confirm.

i got the spellhook working with the wild magic override, so that's great.  i then thought: "hey, why don't i just convert all of my custom spells over to the spellhook system, too?"  i started copying over the re-written spells into the spellhook script so i could then delete the old custom spell.  it works like a charm.

after about 3 or 4 of them, i realized that monsters don't use the spellhooks because i didn't set the special monster variable.  so then they'll never use the custom spells i've been converting over.

i guess my question is: i assume they were using the custom spells before, right?  if you overwrite the spell file, then monsters will use that instead of the original bioware one?  so by deleting my overwritten ones, then monsters revert back to the originals.  correct?

next i need to figure out if i really care about that or not.