Is there an easy way to do it? I’m doing a custom melee/ranged attack script and i have managed to simulate most of the item properties of the weapon/projectile, i can get the spell id, the caster level and the DC if the item property haves one, the problem comes when i need to cast the spell, i’m using ActionCastSpellAtObject and the domain level does nothing.
The easy way that i was thinking was the following:
//oDefender is the Target of the spell
object oPoint = CreateObject(OBJECT_TYPE_CREATURE, “c_invisiblenode” , GetLocation(oDefender));
SetScriptHidden(oPoint,TRUE,FALSE);
DestroyObject(oPoint,6.0);
int nLevelup;
int i;
while(i<=nLvL)//nLvL is the Caster level that i’m retrieving from the itemproperty
{
nLevelup = LevelUpHenchman(oPoint,CLASS_TYPE_WIZARD);
i++;
}
//nSpellID is retrieved from the itemproperty as well
AssignCommand(oPoint,ActionCastSpellAtObject(nSpellID,oDefender,METAMAGIC_ANY,TRUE,nLvL,PROJECTILE_PATH_TYPE_DEFAULT,TRUE));
The problem with this is that it seems that Scripthidden objects can’t cast spell, they can move with the actions functions so i don’t know why the actioncastspell doesn’t works.
The other option that i was thinking was by using a local var that gets deleted after the spell is successfully casted but i would need to edit every single spell script which is something that i want to avoid. Maybe i’m going to go for this option since i’m going to edit almost all of the spells anyway since i’m making a custom class that has some abilities that affect them.