/////////////////////////////////////////////////////////////////// // rts_it_wooden /////////////////////////////////////////////////////////////////// void main() { object oPC=GetItemActivator(); object oT=GetItemActivatedTarget(); string sRes=GetResRef(oT); effect eParalyze=EffectParalyze(); int nR; int bVampire=FALSE; int nS; float fDist=GetDistanceBetween(oPC,oT); if (GetIsPC(oT)==TRUE&&GetLocalInt(oT,"nIsVampire")==TRUE) bVampire=TRUE; else if (sRes=="und12"||sRes=="und13"||sRes=="vampirespawn") bVampire=TRUE; if (bVampire==TRUE) { // target is a vampire nR=d20()+GetBaseAttackBonus(oPC); if (fDist<3.0) nR=nR+5; else if (fDist>8.0) nR=nR-10; if (nR>=GetAC(oT)) { // hit nR=4+d6(2); nS=FortitudeSave(oT,18); if (nS==1) nR=nR/2; // save for half fDist=IntToFloat(nR)*6.0; nR=nR*6; ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eParalyze,oT,fDist); SendMessageToPC(oPC,"You paralyze "+GetName(oT)+" with a wooden stake."); SendMessageToPC(oT,"You have been paralyzed for "+IntToString(nR)+" seconds by "+GetName(oPC)+"'s wooden stake."); } // hit else { SendMessageToPC(oPC,"You attempt to hit "+GetName(oT)+" with a wooden stake but, miss."); SendMessageToPC(oT,GetName(oPC)+" attempted to hit you with a wooden stake but, missed."); } } // target is a vampire }