27 lines
		
	
	
		
			720 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			720 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
#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_OF_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));
 | 
						|
}
 |