07 Sep, 2007, Vladaar wrote in the 1st comment:
Votes: 0

I have made a skill that creates a weapon that gains certain wear spells at certain levels. The problem with it I have is it unfortunately uses spell sn numbers which change when you add a new spell and reboot. What would be the easiest way to fix this do you guys think. I have more then one affects on the object, and want the affects to happen at certain levels or I'd just use oset <object> affected weaponspell <sn>

if(ch->level > 10 )
paf->type = -1;
paf->duration = -1;
paf->location = APPLY_WEAPONSPELL;
paf->modifier = 263; /* This is the sn number of the spell */
LINK(paf, obj->first_affect, obj->last_affect, next, prev);

I appreciate all ideas.


07 Sep, 2007, Zeno wrote in the 2nd comment:
Votes: 0
Why don't you just lookup the sn? I believe there is a function to lookup the skill using the skill name.
07 Sep, 2007, Guest wrote in the 3rd comment:
Votes: 0
Yep. Seems the easiest way to fix it would be:
paf->modifier = skill_lookup( "the name of your spell here" );
08 Sep, 2007, Vladaar wrote in the 4th comment:
Votes: 0
Wow worked perfectly, I wish I would've thought to try that.