//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::: Shayan's Subrace Engine ::::::::::::::::::::::::::::: //:::::::::::::::::::File Name: _potion_blood :::::::::::::::::::::::::::::::::: //::::::::::::::::::::: Potion script :::::::::::::::::::::::::::::::::::: //:: Written By: Shayan. //:: Contact: mail_shayan@yahoo.com // //:: This script is not an esstential part of Shayan's Subrace Engine. // //::This script is for the Vial of Blood that PCs belonging to an Undead Subrace //::can drink and be healed. #include "sha_subr_methds" void main() { object oPC = GetItemActivator(); object oPotion = GetItemActivated(); string sTag = GetTag(oPotion); effect eDmg; effect eVisual = EffectVisualEffect(VFX_IMP_HARM); if(sTag != "_potion_blood") { return; } if(Subrace_GetIsUndead(oPC)) { eDmg = EffectHeal(GetMaxHitPoints(oPC)); } else { int iDmg = GetCurrentHitPoints(oPC) - d4(); if(iDmg < 1) { iDmg = 1; } eDmg = EffectDamage(iDmg, DAMAGE_TYPE_NEGATIVE, DAMAGE_POWER_ENERGY); } ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDmg, oPC); ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVisual, GetLocation(oPC)); }