adding gemstone requirement for turnundead

dreinor

New member
Messages
54
Points
0
Github
dreinor
good day.. i customized the turn undead skill for it to be useable on any race.. but i want it to consume gemstones whenever the target is not an undead race or element.. can someone help me on this? this is the block which makes the skill require items in specific condition.. i don't know the code to be added for the gemstone requirement..
 


case PR_TURNUNDEAD:
if( itemid_isgemstone(skill->db[idx].itemid) && !battle->check_undead(tstatus->race, tstatus->def_ele) );
continue;
break;

 

the code in red doesn't seem to work.. it says after rebuilding tstatus is no a member of interference.. can someone help me on the code? thanks..

 
hi.. thanks for the reply..
default_biggrin.png
but the effect that it consumes gemstones is not exactly the effect that i want... i want it too work that if the target is undead, the skill will not consume any gemstone, but if the target is not undead eg. demi-human, insect, brute etch., it will consume a gemstone..
default_biggrin.png


 
already found the answer to this..
default_biggrin.png
here is the code..
default_biggrin.png

 

case PR_TURNUNDEAD:
if ((tstatus->race == RC_DEMON || tstatus->race == RC_DEMIHUMAN || tstatus->race == RC_ANGEL || tstatus->race == RC_BRUTE || tstatus->race == RC_PLANT || tstatus->race == RC_FORMLESS || tstatus->race == RC_INSECT || tstatus->race == RC_DRAGON || tstatus->race == RC_FISH) && (pc->search_inventory(sd, ITEMID_BLUE_GEMSTONE) == INDEX_NOT_FOUND || pc->delitem(sd,pc->search_inventory(sd,717),1,0,0,LOG_TYPE_CONSUME)))
break;
skill->attack(BF_MAGIC, src, src, bl, skill_id, skill_lv, tick, flag);
break;
 
Back
Top