So Basically...
This..
if(nSpellLevel == 99)
{
string sCollumn = "Innate";
switch(nclass)
{
case class_TYPE_WIZARD:
case class_TYPE_SORCERER: sCollumn = "Wiz_Sorc"; break;
case class_TYPE_CLERIC: sCollumn = "Cleric"; break;
case class_TYPE_DRUID: sCollumn = "Druid"; break;
case class_TYPE_BARD: sCollumn = "Bard"; break;
case class_TYPE_RANGER: sCollumn = "Ranger"; break;
case class_TYPE_PALADIN: sCollumn = "Paladin"; break;
}
sCollumn = Get2DAString("spells",sCollumn,nSpellId);
if(sCollumn != "****" && sCollumn != "")
{
nSpellLevel = StringToInt(sCollumn);
if(bAOE) SetLocalInt(OBJECT_SELF,"AOE_INNATE",nSpellLevel+1);
}
}
int nMaxLevel;
if(GetHasSpellEffect(734,oTarget))
nMaxLevel = 8;
else if(GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oTarget))
nMaxLevel = 4;
else
if(GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oTarget) ||
GetHasSpellEffect(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oTarget))
nMaxLevel = 3;
else if(GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oTarget))
nMaxLevel
=
2;
//shadow ghostly visage
else
if(GetHasSpellEffect(SPELL_GHOSTLY_VISAGE,oTarget) ||
GetHasSpellEffect(SPELLABILITY_AS_GHOSTLY_VISAGE,oTarget) ||
GetHasSpellEffect(SPELL_GREATER_SHADOW_CONJURATION_MIRROR_IMAGE,oTarget))
nMaxLevel = 1;
if(nSpellLevel <= nMaxLevel)
{
return TRUE;//immunity via spell immunity effect like globe of invulnerability
}
string sSchool = Get2DAString("spells","School",nSpellId);
if(GetHasSpellEffect(SPELL_SHADOW_SHIELD,oTarget) && sSchool == "N")
{
return TRUE;//Necromantic spell cast at target with Shadow Shield
}
else if(GetHasSpellEffect(390,oTarget) && sSchool == "E")
{
return TRUE;//Enchantment spell cast at target polymorphed into pixie
}
int nSchool = -1;
if (sSchool == "A") nSchool = 0;
else if(sSchool == "C") nSchool = 1;
else if(sSchool == "D") nSchool = 2;
else if(sSchool == "E") nSchool = 3;
else if(sSchool == "V") nSchool = 4;
else if(sSchool == "I") nSchool = 5;
else if(sSchool == "N") nSchool = 6;
else if(sSchool == "T") nSchool = 7;
if(bAOE && !GetIsPC(oTarget))
{
if(bNoChange && GetLocalInt(oTarget,"IMMUNE_TO_"+IntToString(nSpellId)) == -1)
{
return FALSE;//immunity to AOE is not granted via itemproperty, no reason to repeat whole process again
}
else
{
SetLocalObject(oTarget,"ITEM_IN_RIGHT",oRight);
SetLocalObject(oTarget,"ITEM_IN_LEFT",oLeft);
}
}
& This
string sSchool = Get2DAString("spells","School",nSpellId);
Correct?
I was really looking for exact help (as in complete function), if you would be willing to do that ShadoOow?
One other question, would 2da String Lookup be slow?
I'm thinking it would be better to just like use a switch/case statement with all of the spells listed in each case, for speed, or would this be slow too?
Modifié par _Guile, 16 mai 2012 - 12:27 .