Amon_PRC8/_module/nss/fastbuff_inc.nss
Jaysyn904 c5cffc37af Initial Commit
Initial Commit [v1.01]
2025-04-03 19:00:46 -04:00

1064 lines
49 KiB
Plaintext
Raw Blame History

/*----------------------------------------------------------------
// Title: Fast buffing Include
//----------------------------------------------------------------
// Scriptname: fastbuff_inc.nss
//----------------------------------------------------------------
// Description
//----------------------------------------------------------------
// This is the include required for fastbuff.nss to work
// It contains part of Tarot Redhand's arrays script
// It contains part of HGLL system for getting spells names
// It contains my own code for checking for party members,
// checking for weapon types and creating the array nedded if
// it's not created yet.
//----------------------------------------------------------------
// Created By: Stefano, 30/October/2020
// Modified By: Stefano, 20/November/2020
//--------------------------------------------------------------*/
// Required include
#include "X2_i0_spells"
// Change the numbers bellow according to your custom weapon
// In your baseitems.2da file. It can be either their number
// in baseitems.2da or BASE_ITEM_*
// DO NOT ADD OR REMOVE ANY OF THEM JUST EDIT THEIR NUMBERS
// OR BASE_ITEM_*
const int BASE_ITEM_MELEE_A = 150;
const int BASE_ITEM_MELEE_B = BASE_ITEM_CLUB;
const int BASE_ITEM_MELEE_C = 152;
const int BASE_ITEM_MELEE_D = 153;
const int BASE_ITEM_MELEE_E = 154;
const int BASE_ITEM_MELEE_F = 155;
const int BASE_ITEM_MELEE_G = 156;
const int BASE_ITEM_MELEE_H = 157;
const int BASE_ITEM_MELEE_I = 158;
const int BASE_ITEM_MELEE_J = 159;
const int BASE_ITEM_MELEE_K = 160;
const int BASE_ITEM_SLASHING_A = 161;
const int BASE_ITEM_SLASHING_B = BASE_ITEM_LONGSWORD;
const int BASE_ITEM_SLASHING_C = 163;
const int BASE_ITEM_SLASHING_D = 164;
const int BASE_ITEM_SLASHING_E = 165;
const int BASE_ITEM_SLASHING_G = 166;
const int BASE_ITEM_SLASHING_F = 167;
const int BASE_ITEM_SLASHING_H = 168;
const int BASE_ITEM_SLASHING_I = 169;
const int BASE_ITEM_SLASHING_J = 170;
const int BASE_ITEM_SLASHING_K = 171;
const int BASE_ITEM_RANGED_A = 172;
const int BASE_ITEM_RANGED_B = BASE_ITEM_LONGBOW;
const int BASE_ITEM_RANGED_C = 174;
const int BASE_ITEM_RANGED_D = 175;
const int BASE_ITEM_RANGED_E = 176;
const int BASE_ITEM_RANGED_F = 177;
const int BASE_ITEM_RANGED_G = 178;
const int BASE_ITEM_RANGED_H = 179;
const int BASE_ITEM_RANGED_I = 180;
const int BASE_ITEM_RANGED_J = 181;
const int BASE_ITEM_RANGED_K = 182;
// DO NOT TOUCH ANYTHING BELOW UNLESS YOU KNOW WHAT YOU'RE DOING
// TAROT REDHAND'S ARRAY INC
// ---------------
// -- Constants --
// ---------------
const int ARRAY_INDEX_INVALID = -1;
// -------------------------
// -- Function prototypes --
// -------------------------
// Clears an integer array named sName stored on oObject;
// Calling this function is redundant when creating a new array
void ClearIntArray(string sName, object oObject=OBJECT_INVALID);
// Creates an integer array named sName of size equal to nArraySize stored on oObject;
// The array will be global if oObject is invalid;
// A global array is technically stored on the module object, but remains separate
// from an array created specifically on the module object
void CreateIntArray(string sName, int nArraySize=0, object oObject=OBJECT_INVALID);
// Returns size of an integer array named sName stored on oObject
int GetIntArraySize(string sName, object oObject=OBJECT_INVALID);
// Sets an element at nIndex of an integer array named sName stored on oObject to nValue
void SetIntArrayElement(string sName, int nIndex, int nValue, object oObject=OBJECT_INVALID);
// Gets an element at nIndex of an integer array named sName stored on oObject
int GetIntArrayElement(string sName, int nIndex, object oObject=OBJECT_INVALID);
// Adds an element to an integer array named sName stored on oObject;
// If nBeginning is TRUE, the element is added at the beginning, otherwise it is added at the end
void AddIntArrayElement(string sName, int nValue, int nBeginning=FALSE, object oObject=OBJECT_INVALID);
// Deletes an element at nIndex of an integer array named sName stored on oObject;
// The array will be resized upon element deletion
void DeleteIntArrayElement(string sName, int nIndex, object oObject=OBJECT_INVALID);
// Creates a copy named oDestName on oDestObject of an integer array named sSourceName on oSourceObject
void CopyIntArray(string sSourceName, string sDestName, object oSourceObject=OBJECT_INVALID, object oDestObject=OBJECT_INVALID);
// Returns the index of nValue stored in an integer array named sName stored on oObject;
// nOccurence equal to 1 will return the index of the first occurence of the specified element in the array,
// nOccurence equal to 2 will return the index of the second occurence, etc;
// Returns ARRAY_INDEX_INVALID if the array does not contain the specified element or if nOccurence is lower than 1
int GetIntArrayIndexByValue(string sName, int nValue, int nOccurence=1, object oObject=OBJECT_INVALID);
// -----------------------------
// -- Function implementation --
// -----------------------------
//Clearing arrays
void ClearIntArray(string sName, object oObject=OBJECT_INVALID)
{
string global = "";
if (oObject == OBJECT_INVALID)
{
oObject = GetModule();
global = "g";
}
int nArraySize = GetLocalInt(oObject, sName+"[<5B><>]"+global);
int i;
for (i = 0; i < nArraySize; i++)
DeleteLocalInt(oObject, sName+"[R"+IntToString(i)+"]"+global);
DeleteLocalInt(oObject, sName+"[<5B><>]"+global);
}
//Creating arrays
void CreateIntArray(string sName, int nArraySize=0, object oObject=OBJECT_INVALID)
{
string global = "";
if (oObject == OBJECT_INVALID)
{
oObject = GetModule();
global = "g";
}
ClearIntArray(sName, oObject);
SetLocalInt(oObject, sName+"[<5B><>]"+global, nArraySize);
}
//Getting size
int GetIntArraySize(string sName, object oObject=OBJECT_INVALID)
{
string global = "";
if (oObject == OBJECT_INVALID)
{
oObject = GetModule();
global = "g";
}
return GetLocalInt(oObject, sName+"[<5B><>]"+global);
}
//Setting elements
void SetIntArrayElement(string sName, int nIndex, int nValue, object oObject=OBJECT_INVALID)
{
string global = "";
if (oObject == OBJECT_INVALID)
{
oObject = GetModule();
global = "g";
}
if (nIndex >= GetLocalInt(oObject, sName+"[<5B><>]"+global) || nIndex < 0) return;
SetLocalInt(oObject, sName+"[R"+IntToString(nIndex)+"]"+global, nValue);
}
//Getting elements
int GetIntArrayElement(string sName, int nIndex, object oObject=OBJECT_INVALID)
{
string global = "";
if (oObject == OBJECT_INVALID)
{
oObject = GetModule();
global = "g";
}
if (nIndex >= GetLocalInt(oObject, sName+"[<5B><>]"+global) || nIndex < 0) return 0;
return GetLocalInt(oObject, sName+"[R"+IntToString(nIndex)+"]"+global);
}
//Add elements
void AddIntArrayElement(string sName, int nValue, int nBeginning=FALSE, object oObject=OBJECT_INVALID)
{
string global = "";
if (oObject == OBJECT_INVALID)
{
oObject = GetModule();
global = "g";
}
int nArraySize = GetLocalInt(oObject, sName+"[<5B><>]"+global);
SetLocalInt(oObject, sName+"[<5B><>]"+global, nArraySize+1);
if (!nBeginning)
{
SetLocalInt(oObject, sName+"[R"+IntToString(nArraySize)+"]"+global, nValue);
return;
}
int i;
for (i = nArraySize-1; i >= 0; i--)
SetLocalInt(oObject, sName+"[R"+IntToString(i+1)+"]"+global, GetLocalInt(oObject, sName+"[R"+IntToString(i)+"]"+global));
SetLocalInt(oObject, sName+"[R0]"+global, nValue);
}
//Deleting elements
void DeleteIntArrayElement(string sName, int nIndex, object oObject=OBJECT_INVALID)
{
string global = "";
if (oObject == OBJECT_INVALID)
{
oObject = GetModule();
global = "g";
}
int nArraySize = GetLocalInt(oObject, sName+"[<5B><>]"+global);
if (nIndex >= nArraySize || nIndex < 0) return;
int i;
for (i = nIndex; i < nArraySize-1; i++)
SetLocalInt(oObject, sName+"[R"+IntToString(i)+"]"+global, GetLocalInt(oObject, sName+"[R"+IntToString(i+1)+"]"+global));
DeleteLocalInt(oObject, sName+"[R"+IntToString(nArraySize-1)+"]"+global);
SetLocalInt(oObject, sName+"[<5B><>]"+global, nArraySize-1);
}
//Copying arrays
void CopyIntArray(string sSourceName, string sDestName, object oSourceObject=OBJECT_INVALID, object oDestObject=OBJECT_INVALID)
{
int nSize = GetIntArraySize(sSourceName, oSourceObject);
CreateIntArray(sDestName, nSize, oDestObject);
int i;
for (i = 0; i < nSize; i++)
SetIntArrayElement(sDestName, i, GetIntArrayElement(sSourceName, i, oSourceObject), oDestObject);
}
//Getting indexes
int GetIntArrayIndexByValue(string sName, int nValue, int nOccurence=1, object oObject=OBJECT_INVALID)
{
if (nOccurence < 1) return ARRAY_INDEX_INVALID;
string global = "";
if (oObject == OBJECT_INVALID)
{
oObject = GetModule();
global = "g";
}
//int nArraySize = GetLocalInt(oObject, sName+"[<5B>]"+global);
int nArraySize = GetLocalInt(oObject, sName+"[<5B><>]"+global);
int i;
for (i = 0; i < nArraySize; i++)
{
if (GetLocalInt(oObject, sName+"[R"+IntToString(i)+"]"+global) == nValue)
nOccurence--;
if (nOccurence == 0) return i;
}
return ARRAY_INDEX_INVALID;
}
// -------------------
// -- TR's CODE END --
// -------------------
// HGLL'S CODE to translate spell ID to readable Spell Name
// Get Spell ID and returns readable spell name
string GetSpellName(int iSpellID);
// HGLL'S SPELLNAMES
string GetSpellName(int iSpellID)
{
string sResult = "";
switch (iSpellID/150)
{
case 0://0-149
switch (iSpellID/25)
{
case 0://0-24
switch (iSpellID)
{
case 0: sResult = "Acid Fog"; break;
case 1: sResult = "Aid"; break;
case 2: sResult = "Animate Dead"; break;
case 3: sResult = "Barkskin"; break;
case 4: sResult = "Bestow Curse"; break;
case 5: sResult = "Blade Barrier"; break;
case 6: sResult = "Bless"; break;
case 7: sResult = "Bless Weapon"; break;
case 8: sResult = "Blindness and Deafness"; break;
case 9: sResult = "Bull's Strength"; break;
case 10: sResult = "Burning Hands"; break;
case 11: sResult = "Call Lightning"; break;
case 12: sResult = "Calm Emotions"; break;
case 13: sResult = "Cat's Grace"; break;
case 14: sResult = "Chain Lightning"; break;
case 15: sResult = "Charm Monster"; break;
case 16: sResult = "Charm Person"; break;
case 17: sResult = "Charm Person or Animal"; break;
case 18: sResult = "Circle of Death"; break;
case 19: sResult = "Circle of Doom"; break;
case 20: sResult = "Clairaudience and Clairvoyance"; break;
case 21: sResult = "Clarity"; break;
case 22: sResult = "Cloak of Chaos"; break;
case 23: sResult = "Cloudkill"; break;
case 24: sResult = "Color Spray"; break;
}
break;
case 1://25-49
switch (iSpellID)
{
case 25: sResult = "Cone of Cold"; break;
case 26: sResult = "Confusion"; break;
case 27: sResult = "Contagion"; break;
case 28: sResult = "Control Undead"; break;
case 29: sResult = "Create Greater Undead"; break;
case 30: sResult = "Create Undead"; break;
case 31: sResult = "Cure Critical Wounds"; break;
case 32: sResult = "Cure Light Wounds"; break;
case 33: sResult = "Cure Minor Wounds"; break;
case 34: sResult = "Cure Moderate Wounds"; break;
case 35: sResult = "Cure Serious Wounds"; break;
case 36: sResult = "Darkness"; break;
case 37: sResult = "Daze"; break;
case 38: sResult = "Death Ward"; break;
case 39: sResult = "Delayed Blast Fireball"; break;
case 40: sResult = "Dismissal"; break;
case 41: sResult = "Dispel Magic"; break;
case 42: sResult = "Divine Power"; break;
case 43: sResult = "Dominate Animal"; break;
case 44: sResult = "Dominate Monster"; break;
case 45: sResult = "Dominate Person"; break;
case 46: sResult = "Doom"; break;
case 47: sResult = "Elemental Shield"; break;
case 48: sResult = "Elemental Swam"; break;
case 49: sResult = "Endurance"; break;
}
break;
case 2://50-74
switch (iSpellID)
{
case 50: sResult = "Endure Elements"; break;
case 51: sResult = "Energy Drain"; break;
case 52: sResult = "Enervation"; break;
case 53: sResult = "Entangle"; break;
case 54: sResult = "Fear"; break;
case 55: sResult = "Feeblemind"; break;
case 56: sResult = "Finger of Death"; break;
case 57: sResult = "Fire Storm"; break;
case 58: sResult = "Fireball"; break;
case 59: sResult = "Flame Arrow"; break;
case 60: sResult = "Flame Lash"; break;
case 61: sResult = "Flame Strike"; break;
case 62: sResult = "Freedom of Movement"; break;
case 63: sResult = "Gate"; break;
case 64: sResult = "Ghoul Touch"; break;
case 65: sResult = "Globe of Invulnerability"; break;
case 66: sResult = "Grease"; break;
case 67: sResult = "Greater Dispelling"; break;
case 68: sResult = "Greater Magic Weapon"; break;
case 69: sResult = "Greater Planar Binding"; break;
case 71: sResult = "Greater Shadow Conjuration"; break;
case 72: sResult = "Greater Spell Breach"; break;
case 73: sResult = "Greater Spell Mantle"; break;
case 74: sResult = "Greater Stoneskin"; break;
}
break;
case 3://75-99
switch (iSpellID)
{
case 75: sResult = "Gust of Wind"; break;
case 76: sResult = "Hammer of the Gods"; break;
case 77: sResult = "Harm"; break;
case 78: sResult = "Haste"; break;
case 79: sResult = "Heal"; break;
case 80: sResult = "Healing Circle"; break;
case 81: sResult = "Hold Animal"; break;
case 82: sResult = "Hold Monster"; break;
case 83: sResult = "Hold Person"; break;
case 84: sResult = "Holy Aura"; break;
case 85: sResult = "Holy Sword"; break;
case 86: sResult = "Identify"; break;
case 87: sResult = "Implosion"; break;
case 88: sResult = "Improved Invisibility"; break;
case 89: sResult = "Incendiary Cloud"; break;
case 90: sResult = "Invisibility"; break;
case 91: sResult = "Invisibility Purge"; break;
case 92: sResult = "Invisibility Sphere"; break;
case 93: sResult = "Knock"; break;
case 94: sResult = "Lesser Dispel"; break;
case 95: sResult = "Lesser Mind Blank"; break;
case 96: sResult = "Lesser Planar Binding"; break;
case 97: sResult = "Lesser Restoration"; break;
case 98: sResult = "Lesser Spell Breach"; break;
case 99: sResult = "Lesser Spell Mantle"; break;
}
break;
case 4://100-124
switch (iSpellID)
{
case 100: sResult = "Light"; break;
case 101: sResult = "Lightning Bolt"; break;
case 102: sResult = "Mage Armor"; break;
case 103: sResult = "Magic Circle against Chaotic"; break;
case 104: sResult = "Magic Circle agains Evil"; break;
case 105: sResult = "Magic Circle agains Good"; break;
case 106: sResult = "Magic Circle agains Lawful"; break;
case 107: sResult = "Magic Missle"; break;
case 108: sResult = "Gruumsh Blinding Spittle"; break;
case 109: sResult = "Gruumsh Command Horde"; break;
case 110: sResult = "Mass Blindness and Deafness"; break;
case 111: sResult = "Mass Charm"; break;
case 112: sResult = "Mass Domination"; break;
case 113: sResult = "Mass Haste"; break;
case 114: sResult = "Mass Heal"; break;
case 115: sResult = "Melf's Acid Arrow"; break;
case 116: sResult = "Meteor Swarm"; break;
case 117: sResult = "Mind Blank"; break;
case 118: sResult = "Mind Fog"; break;
case 119: sResult = "Minor Globe of Invulnerability"; break;
case 120: sResult = "Ghostly Visage"; break;
case 121: sResult = "Ethereal Visage"; break;
case 122: sResult = "Mordenkainen's Disjunction"; break;
case 123: sResult = "Mordenkainen's Sword"; break;
case 124: sResult = "Nature's Balance"; break;
}
break;
case 5://125-149
switch (iSpellID)
{
case 125: sResult = "Negative Energy Protection"; break;
case 126: sResult = "Neutralize Poison"; break;
case 127: sResult = "Phantasmal Killer"; break;
case 128: sResult = "Planar Binding"; break;
case 129: sResult = "Poison"; break;
case 130: sResult = "Polymorph Self"; break;
case 131: sResult = "Power Word Kill"; break;
case 132: sResult = "Power Word Stun"; break;
case 133: sResult = "Prayer"; break;
case 134: sResult = "Premonition"; break;
case 135: sResult = "Premonition"; break;
case 136: sResult = "Protection from Chaotic"; break;
case 137: sResult = "Protection from Elements"; break;
case 138: sResult = "Protection from Evil"; break;
case 139: sResult = "Protection from Good"; break;
case 140: sResult = "Protection from Lawful"; break;
case 141: sResult = "Protection from Spells"; break;
case 142: sResult = "Raise Dead"; break;
case 143: sResult = "Ray of Enfeeblement"; break;
case 144: sResult = "Ray of Frost"; break;
case 145: sResult = "Remove Blindness and Deafness"; break;
case 146: sResult = "Remove Curse"; break;
case 147: sResult = "Remove Disease"; break;
case 148: sResult = "Remove Fear"; break;
case 149: sResult = "Remove Paralysis"; break;
}
break;
}
break;
case 1://150-299
switch (iSpellID/25)
{
case 6://150-174
switch (iSpellID)
{
case 150: sResult = "Resist Elements"; break;
case 151: sResult = "Resistance"; break;
case 152: sResult = "Restoration"; break;
case 153: sResult = "Resurrection"; break;
case 154: sResult = "Sanctuary"; break;
case 155: sResult = "Scare"; break;
case 156: sResult = "Searing Light"; break;
case 157: sResult = "See Invisibility"; break;
case 158: sResult = "Shades"; break;
case 159: sResult = "Shadow Conjuration"; break;
case 160: sResult = "Shadow Shield"; break;
case 161: sResult = "Shapechange"; break;
case 162: sResult = "Shield of Law"; break;
case 163: sResult = "Silence"; break;
case 164: sResult = "Slay Living"; break;
case 165: sResult = "Sleep"; break;
case 166: sResult = "Slow"; break;
case 167: sResult = "Sound Burst"; break;
case 168: sResult = "Spell Resistance"; break;
case 169: sResult = "Spell Mantle"; break;
case 170: sResult = "Sphere of Chaos"; break;
case 171: sResult = "Stinking Cloud"; break;
case 172: sResult = "Stoneskin"; break;
case 173: sResult = "Storm of Vengeance"; break;
case 174: sResult = "Summon Creature I"; break;
}
break;
case 7://175-199
switch (iSpellID)
{
case 175: sResult = "Summon Creature II"; break;
case 176: sResult = "Summon Creature III"; break;
case 177: sResult = "Summon Creature IV"; break;
case 178: sResult = "Summon Creature IX"; break;
case 179: sResult = "Summon Creature V"; break;
case 180: sResult = "Summon Creature VI"; break;
case 181: sResult = "Summon Creature VII"; break;
case 182: sResult = "Summon Creature VIII"; break;
case 183: sResult = "Sunbeam"; break;
case 184: sResult = "Tenser's Transformation"; break;
case 185: sResult = "Timestop"; break;
case 186: sResult = "True Seeing"; break;
case 187: sResult = "Unholy Aura"; break;
case 188: sResult = "Vampric Touch"; break;
case 189: sResult = "Virtue"; break;
case 190: sResult = "Wail of the Banshee"; break;
case 191: sResult = "Wall of Fire"; break;
case 192: sResult = "Web"; break;
case 193: sResult = "Weird"; break;
case 194: sResult = "Word of Faith"; break;
case 195: sResult = "Aura of Blinding"; break;
case 196: sResult = "Aura of Cold"; break;
case 197: sResult = "Aura of Electricity"; break;
case 198: sResult = "Aura of Fear"; break;
case 199: sResult = "Aura of Fire"; break;
}
break;
}
break;
case 2://300-449
switch (iSpellID/25)
{
case 12://300-324
switch (iSpellID)
{
case 301: sResult = "Rage"; break;
case 302: sResult = "Smoke Claw"; break;
case 303: sResult = "Summon Slaad"; break;
case 304: sResult = "Summon Tanarri"; break;
case 305: sResult = "Trumpet Blast"; break;
case 306: sResult = "Tyrant Fog Mist"; break;
case 307: sResult = "Barbarian Rage"; break;
case 308: sResult = "Turn Undead"; break;
case 309: sResult = "Wholeness of Body"; break;
case 310: sResult = "Quivering Palm"; break;
case 311: sResult = "Empty Body"; break;
case 312: sResult = "Detect Evil"; break;
case 313: sResult = "Lay on Hands"; break;
case 314: sResult = "Aura of Courage"; break;
case 315: sResult = "Smite Evil"; break;
case 316: sResult = "Remove Disease"; break;
case 317: sResult = "Summon Animal Companion"; break;
case 318: sResult = "Summon Familiar"; break;
case 319: sResult = "Elemental Shape"; break;
case 320: sResult = "Wild Shape"; break;
case 321: sResult = "Protection from Alignment"; break;
case 322: sResult = "Magic Circle Against Alignment"; break;
case 323: sResult = "Aura vs. Alignment"; break;
}
break;
case 14://350-374
switch (iSpellID)
{
case 354: sResult = "Eagle's Splendor"; break;
case 355: sResult = "Owl's Wisdom"; break;
case 356: sResult = "Fox's Cunning"; break;
case 357: sResult = "Greater Eagle Splendor"; break;
case 358: sResult = "Greater Owl's Wisdom"; break;
case 359: sResult = "Greater Fox's Cunning"; break;
case 360: sResult = "Greater Bull's Strength"; break;
case 361: sResult = "Greater Cat's Grace"; break;
case 362: sResult = "Greater Endurance"; break;
case 363: sResult = "Awaken"; break;
case 364: sResult = "Creeping Doom"; break;
case 365: sResult = "Ultravision"; break;
case 366: sResult = "Destruction"; break;
case 367: sResult = "Horrid Wilting"; break;
case 368: sResult = "Ice Storm"; break;
case 369: sResult = "Energy Buffer"; break;
case 370: sResult = "Negative Energy Burst"; break;
case 371: sResult = "Negative Energy Ray"; break;
case 372: sResult = "Aura of Vitality"; break;
case 373: sResult = "War Cry"; break;
case 374: sResult = "Regenerate"; break;
}
break;
case 15://375-399
switch (iSpellID)
{
case 375: sResult = "Evard's Black Tentacles"; break;
case 376: sResult = "Legend Lore"; break;
case 377: sResult = "Find Traps"; break;
case 378: sResult = "Summon Mephit"; break;
case 379: sResult = "Summon Celestial"; break;
case 380: sResult = "Battle Mastery Spell"; break;
case 381: sResult = "Divine Strength"; break;
case 382: sResult = "Divine Protection"; break;
case 383: sResult = "Negative Plane Avatar"; break;
case 384: sResult = "Divine Trickery"; break;
case 385: sResult = "Rogue's Cunning"; break;
case 386: sResult = "Activate Item: Targeted"; break;
case 387: sResult = "Polymorph: Giant Spider"; break;
case 388: sResult = "Polymorph: Troll"; break;
case 389: sResult = "Polymorph: Umber Hulk"; break;
case 390: sResult = "Polymorph: Pixie"; break;
case 391: sResult = "Polymorph: Zombie"; break;
case 392: sResult = "Shapechange: Red Dragon"; break;
case 393: sResult = "Shapechange: Fire Giant"; break;
case 394: sResult = "Shapechange: Balor"; break;
case 395: sResult = "Shapechange: Death Slaad"; break;
case 396: sResult = "Shapechange: Iron Golem"; break;
case 397: sResult = "Elemental Shape: Fire"; break;
case 398: sResult = "Elemental Shape: Water"; break;
case 399: sResult = "Elemental Shape: Earth"; break;
}
break;
case 16://400-424
switch (iSpellID)
{
case 400: sResult = "Elemental Shape: Air"; break;
case 401: sResult = "Wild Shape: Brown Bear"; break;
case 402: sResult = "Wild Shape: Panther"; break;
case 403: sResult = "Wild Shape: Wolf"; break;
case 404: sResult = "Wild Shape: Boar"; break;
case 405: sResult = "Wild Shape: Badger"; break;
case 406: sResult = "Alcohol: Beer"; break;
case 407: sResult = "Alcohol: Wine"; break;
case 408: sResult = "Alcohol: Spirits"; break;
case 409: sResult = "Herb: Belladonna"; break;
case 410: sResult = "Herb: Garlic"; break;
case 411: sResult = "Bard's Song"; break;
case 412: sResult = "Dragon's Aura of Fear"; break;
case 413: sResult = "Activate Item: Self"; break;
case 414: sResult = "Divine Favor"; break;
case 415: sResult = "True Strike"; break;
case 416: sResult = "Flare"; break;
case 417: sResult = "Shield"; break;
case 418: sResult = "Entropic Shield"; break;
case 419: sResult = "Continual Flame"; break;
case 420: sResult = "One with the Land"; break;
case 421: sResult = "Camoflage"; break;
case 422: sResult = "Blood Frenzy"; break;
case 423: sResult = "Bombardment"; break;
case 424: sResult = "Acid Splash"; break;
}
break;
case 17://425-449
switch (iSpellID)
{
case 425: sResult = "Quillfire"; break;
case 426: sResult = "Earthquake"; break;
case 427: sResult = "Sunburst"; break;
case 428: sResult = "Activate Item: Self 2"; break;
case 429: sResult = "Aura of Glory"; break;
case 430: sResult = "Banishment"; break;
case 431: sResult = "Inflict Minor Wounds"; break;
case 432: sResult = "Inflict Light Wounds"; break;
case 433: sResult = "Inflict Moderate Wounds"; break;
case 434: sResult = "Inflict Serious Wounds"; break;
case 435: sResult = "Inflict Critical Wounds"; break;
case 436: sResult = "Balagarn's Iron Horn"; break;
case 437: sResult = "Drown"; break;
case 438: sResult = "Owl's Insight"; break;
case 439: sResult = "Electric Jolt"; break;
case 440: sResult = "Firebrand"; break;
case 441: sResult = "Wounding Whispers"; break;
case 442: sResult = "Amplify"; break;
case 443: sResult = "Greater Sanctuary"; break;
case 444: sResult = "Undeath's Eternal Foe"; break;
case 445: sResult = "Dirge"; break;
case 446: sResult = "Inferno"; break;
case 447: sResult = "Isaac's Lesser Missle Storm"; break;
case 448: sResult = "Isaac's Greater Missle Storm"; break;
case 449: sResult = "Bane"; break;
}
break;
}
break;
case 3://450-569
switch (iSpellID/25)
{
case 18://450-474
switch (iSpellID)
{
case 450: sResult = "Shield of Faith"; break;
case 451: sResult = "Planar Ally"; break;
case 452: sResult = "Magic Fang"; break;
case 453: sResult = "Greater Magic Fang"; break;
case 454: sResult = "Spike Growth"; break;
case 455: sResult = "Mass Camoflage"; break;
case 456: sResult = "Expeditious Retreat"; break;
case 457: sResult = "Tasha's Hideous Laughter"; break;
case 458: sResult = "Displacement"; break;
case 459: sResult = "Bigby's Interposing Hand"; break;
case 460: sResult = "Bigby's Forceful Hand"; break;
case 461: sResult = "Bigby's Grasping Hand"; break;
case 462: sResult = "Bigby's Clenched Fist"; break;
case 463: sResult = "Bigby's Crushing Hand"; break;
case 464: sResult = "Grenade: Alchemist Fire"; break;
case 465: sResult = "Grenade: Tangle"; break;
case 466: sResult = "Grenade: Holy"; break;
case 467: sResult = "Grenade: Choking"; break;
case 468: sResult = "Grenade: Thunderstone"; break;
case 469: sResult = "Grenade: Acid"; break;
case 470: sResult = "Grenade: Generic"; break;
case 471: sResult = "Grenade: Caltrops"; break;
case 472: sResult = "Activate Item: Portal"; break;
case 473: sResult = "Divine Might"; break;
case 474: sResult = "Divine Shield"; break;
}
break;
case 19://475-499
switch (iSpellID)
{
case 475: sResult = "Shadow Daze"; break;
case 476: sResult = "Summon Shadow"; break;
case 477: sResult = "Shadow Evade"; break;
case 478: sResult = "Tymora's Smile"; break;
case 479: sResult = "Craft Harper Item"; break;
case 480: sResult = "Sleep"; break;
case 481: sResult = "Cat's Grace"; break;
case 482: sResult = "Eagle's Splendor"; break;
case 483: sResult = "Invisibility"; break;
case 485: sResult = "Flesh to Stone"; break;
case 486: sResult = "Stone to Flesh"; break;
case 487: sResult = "Trap: Arrow"; break;
case 488: sResult = "Trap: Bolt"; break;
case 493: sResult = "Trap: Dart"; break;
case 494: sResult = "Trap: Shuriken"; break;
case 495: sResult = "Petrifying Breath"; break;
case 496: sResult = "Petrifying Touch"; break;
case 497: sResult = "Petrifying Gaze"; break;
case 498: sResult = "Manticore Spikes"; break;
}
break;
case 20://500-524
switch (iSpellID)
{
case 511: sResult = "Kobold: Jump"; break;
case 512: sResult = "Crumble"; break;
case 513: sResult = "Infestation of Maggots"; break;
case 514: sResult = "Healing Sting"; break;
case 515: sResult = "Great Thunderclap"; break;
case 516: sResult = "Ball Lightning"; break;
case 517: sResult = "Battletide"; break;
case 518: sResult = "Combust"; break;
case 519: sResult = "Death Armor"; break;
case 520: sResult = "Gedlee's Electric Loop"; break;
case 521: sResult = "Horizikaul's Boom"; break;
case 522: sResult = "Ironguts"; break;
case 523: sResult = "Mestil's Acid Breath"; break;
case 524: sResult = "Mestil's Acid Sheath"; break;
}
break;
case 21://525-549
switch (iSpellID)
{
case 525: sResult = "Monstrous Regeneration"; break;
case 526: sResult = "Scintillating Sphere"; break;
case 527: sResult = "Stone Bones"; break;
case 528: sResult = "Undeath to Death"; break;
case 529: sResult = "Vine Mine"; break;
case 530: sResult = "Vine Mine Entangle"; break;
case 531: sResult = "Vine Mine Hamper Movement"; break;
case 532: sResult = "Vine Mine Camouflage"; break;
case 533: sResult = "Black Blade of Disaster"; break;
case 534: sResult = "Shelgarn's Persistent Blade"; break;
case 535: sResult = "Blade Thirst"; break;
case 536: sResult = "Deafening Clang"; break;
case 537: sResult = "Bless Weapon"; break;
case 538: sResult = "Holy Sword"; break;
case 539: sResult = "Keen Edge"; break;
case 541: sResult = "Blackstaff"; break;
case 542: sResult = "Flame Weapon"; break;
case 543: sResult = "Ice Dagger"; break;
case 544: sResult = "Magic Weapon"; break;
case 545: sResult = "Greater Magic Weapon"; break;
case 546: sResult = "Magic Vesment"; break;
case 547: sResult = "Stonehold"; break;
case 548: sResult = "Darkfire"; break;
case 549: sResult = "Glyph of Warding"; break;
}
break;
case 22://550-574
switch (iSpellID)
{
case 553: sResult = "Goblin: Ballista Fireball"; break;
case 554: sResult = "Ioun Stone: Dusty Rose"; break;
case 555: sResult = "Ioun Stone: Pale Blue"; break;
case 556: sResult = "Ioun Stone: Scarlet Blue"; break;
case 557: sResult = "Ioun Stone: Blue"; break;
case 558: sResult = "Ioun Stone: Deep Red"; break;
case 559: sResult = "Ioun Stone: Pink"; break;
case 560: sResult = "Ioun Stone: Pink Green"; break;
case 561: sResult = "Whirlwind"; break;
case 562: sResult = "Aure of Glory"; break;
case 563: sResult = "Haste Slow"; break;
case 564: sResult = "Summon Shadow"; break;
case 565: sResult = "Tide of Battle"; break;
case 566: sResult = "Evil Blight"; break;
case 567: sResult = "Cure Critical Wounds"; break;
case 568: sResult = "Restoration"; break;
case 569: sResult = "Cloud of Bewilderment"; break;
}
break;
}
break;
}
return sResult;
}
// STEFANO'S CODE
// Create array for spells
void CreateArray();
// Returns true if oTarget is a member of the oPC's party
int GetIsPartyMember(object oPC, object oTarget);
// Returns weapon type the Player has equipped
// It checks if the player has an weapon equipped (either on left or right hand)
// It'll check if the player has a quarterstaff, slashing weapon or melee weapon.
// It knows that quarterstaff is also melee and slashing are also melee
int GetWeaponType(object oPC);
void CreateArray()
{
CreateIntArray("SpellBuff", 0, GetModule());
// Needs Slashing Weapon
AddIntArrayElement("SpellBuff", 535, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 539, FALSE, GetModule());
// Needs Melee Weapon
AddIntArrayElement("SpellBuff", 548, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 542, FALSE, GetModule());
// Needs weapon Weapon
AddIntArrayElement("SpellBuff", 414, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 536, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 537, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 538, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 544, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 545, FALSE, GetModule());
// No requirements
AddIntArrayElement("SpellBuff", 1, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 3, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 6, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 9, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 13, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 20, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 21, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 38, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 42, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 47, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 49, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 50, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 62, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 65, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 73, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 74, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 78, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 84, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 86, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 88, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 90, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 92, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 95, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 99, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 100, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 102, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 103, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 104, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 105, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 106, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 113, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 117, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 119, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 120, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 121, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 124, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 125, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 133, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 134, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 136, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 137, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 138, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 139, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 140, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 141, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 150, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 151, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 157, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 160, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 163, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 169, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 168, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 172, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 186, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 187, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 189, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 321, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 322, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 323, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 354, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 355, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 356, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 357, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 358, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 359, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 360, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 361, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 362, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 363, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 365, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 369, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 372, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 373, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 374, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 376, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 415, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 417, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 418, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 419, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 420, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 421, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 422, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 429, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 438, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 441, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 442, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 444, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 450, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 453, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 455, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 456, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 458, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 519, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 522, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 524, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 525, FALSE, GetModule());
AddIntArrayElement("SpellBuff", 546, FALSE, GetModule());
// Black Staff - Needs quarterstaff
AddIntArrayElement("SpellBuff", 541, FALSE, GetModule());
SetLocalInt(GetModule(), "Spell_Array_Created", 1);
}
// Returns true if oTarget is a member of the oPC's party
int GetIsPartyMember(object oPC, object oTarget)
{
// If the player is the target
if(oPC == oTarget) return TRUE;
// Default state
int nPartyMember = FALSE;
// Check for first Player in party
object oPartyMember = GetFirstFactionMember(oPC, FALSE);
// While there is(are) a party member(s)
while(GetIsObjectValid(oPartyMember) == TRUE)
{
if(oPartyMember == oTarget)
{
nPartyMember = TRUE;
break;
}
oPartyMember = GetNextFactionMember(oPC, FALSE);
}
// Return the default state
return nPartyMember;
}
int GetWeaponType(object oPC)
{
// Declaring variables
object oWeapon;
int iSlot;
int i;
// Check if player has a weapon equipped either on right or left hand
if(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC) != OBJECT_INVALID)
{
iSlot = INVENTORY_SLOT_RIGHTHAND;
}
else if(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC) != OBJECT_INVALID)
{
iSlot = INVENTORY_SLOT_LEFTHAND;
}
else
{
return 0;
}
// Sets oWeapon object if the above statement isn't invalid
oWeapon = GetItemInSlot(iSlot, oPC);
// If it's a quarterstaff (and is also melee)
if(GetBaseItemType(oWeapon) == BASE_ITEM_QUARTERSTAFF ||
GetBaseItemType(oWeapon) == BASE_ITEM_MAGICSTAFF)
{
return 1;
}
switch(GetBaseItemType(oWeapon))
{
case BASE_ITEM_MELEE_A: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_A) return 2; break;
case BASE_ITEM_MELEE_B: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_B) return 2; break;
case BASE_ITEM_MELEE_C: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_C) return 2; break;
case BASE_ITEM_MELEE_D: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_D) return 2; break;
case BASE_ITEM_MELEE_E: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_E) return 2; break;
case BASE_ITEM_MELEE_F: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_F) return 2; break;
case BASE_ITEM_MELEE_G: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_G) return 2; break;
case BASE_ITEM_MELEE_H: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_H) return 2; break;
case BASE_ITEM_MELEE_I: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_I) return 2; break;
case BASE_ITEM_MELEE_J: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_J) return 2; break;
case BASE_ITEM_MELEE_K: if(GetBaseItemType(oWeapon) == BASE_ITEM_MELEE_K) return 2; break;
case BASE_ITEM_SLASHING_A: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_A) return 3; break;
case BASE_ITEM_SLASHING_B: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_B) return 3; break;
case BASE_ITEM_SLASHING_C: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_C) return 3; break;
case BASE_ITEM_SLASHING_D: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_D) return 3; break;
case BASE_ITEM_SLASHING_E: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_E) return 3; break;
case BASE_ITEM_SLASHING_F: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_F) return 3; break;
case BASE_ITEM_SLASHING_G: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_G) return 3; break;
case BASE_ITEM_SLASHING_H: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_H) return 3; break;
case BASE_ITEM_SLASHING_I: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_I) return 3; break;
case BASE_ITEM_SLASHING_J: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_J) return 3; break;
case BASE_ITEM_SLASHING_K: if(GetBaseItemType(oWeapon) == BASE_ITEM_SLASHING_K) return 3; break;
case BASE_ITEM_RANGED_A: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_A) return 4; break;
case BASE_ITEM_RANGED_B: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_B) return 4; break;
case BASE_ITEM_RANGED_C: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_C) return 4; break;
case BASE_ITEM_RANGED_D: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_D) return 4; break;
case BASE_ITEM_RANGED_E: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_E) return 4; break;
case BASE_ITEM_RANGED_F: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_F) return 4; break;
case BASE_ITEM_RANGED_G: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_G) return 4; break;
case BASE_ITEM_RANGED_H: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_H) return 4; break;
case BASE_ITEM_RANGED_I: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_I) return 4; break;
case BASE_ITEM_RANGED_J: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_J) return 4; break;
case BASE_ITEM_RANGED_K: if(GetBaseItemType(oWeapon) == BASE_ITEM_RANGED_K) return 4; break;
}
// If it's a slashing weapon (and is also melee)
if(GetSlashingWeapon(oWeapon) == TRUE)
{
return 2;
}
// If weapon is melee
if(GetMeleeWeapon(oWeapon) == TRUE)
{
return 3;
}
// If weapon is ranged
if(GetWeaponRanged(oWeapon) == TRUE)
{
return 4;
}
// Default
return 4;
}
//void main() {}