

IF
	AttackedBy([ANYONE],DEFAULT)
	!Race(Myself,ZOMBIE)
	!General(Myself,UNDEAD)
	Race(LastAttackerOf(Myself),ZOMBIE)
	Global("MyRaceBlood","LOCALS",4)
	HPLT(Myself,60)
	RandomNumLT(100,10)
THEN
	RESPONSE #100
		SetGlobal("ZombieSet","LOCALS",1)
END


IF 
  !Race(Myself,ZOMBIE)
  Global("MyRaceBlood","LOCALS",4)
  Global("ZombieSet","LOCALS",1)
THEN 
  RESPONSE #100
    SetGlobal("ZombieSet","LOCALS",2)
      CreateVisualEffectObject("SPDISPMA",Myself)
		DropInventory()
		PlayDead(60)
  SetGlobal("MyRaceBlood","LOCALS",3)
		GiveItemCreate("DAGG01",Myself,1,1,0) // Ring
		XEquipItem("DAGG01",Myself,SLOT_WEAPON,EQUIP) // Dagger	
TransformItem("DAGG01","B1-8")		

  ChangeAlignment(Myself,NEUTRAL_EVIL)
ChangeRace(Myself,ZOMBIE)
ChangeGeneral(Myself,UNDEAD)
RealSetGlobalTimer("ZombieDegeneration","LOCALS",ONE_DAY)
		ChangeStat(Myself,CHR,7,SET)
		ChangeStat(Myself,WIS,-1,ADD)
		ChangeStat(Myself,INT,-1,ADD)
	//	  ChangeAnimation("ZOMBIE")
END

IF
 Race(Myself,ZOMBIE)
 Global("ZombieSet","LOCALS",0)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",ONE_DAY)
END	



	
IF
 Race(Myself,ZOMBIE)
 GlobalTimerExpired("ZombieDegeneration","LOCALS")
 !CheckStatLT(Myself,4,WIS)
 RandomNumLT(100,20)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",ONE_DAY)
   	ChangeStat(Myself,WIS,-1,ADD)
END	

IF
 Race(Myself,ZOMBIE)
 GlobalTimerExpired("ZombieDegeneration","LOCALS")
 !CheckStatLT(Myself,4,INT)
 RandomNumLT(100,20)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",ONE_DAY)
   	ChangeStat(Myself,INT,-1,ADD)
END	


	
IF
 Race(Myself,ZOMBIE)
 GlobalTimerExpired("ZombieDegeneration","LOCALS")
 !CheckStatLT(Myself,4,WIS)
 RandomNumLT(100,20)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",TWO_DAYS)
   	ChangeStat(Myself,WIS,-1,ADD)
END	

IF
 Race(Myself,ZOMBIE)
 GlobalTimerExpired("ZombieDegeneration","LOCALS")
 !CheckStatLT(Myself,4,INT)
 RandomNumLT(100,20)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",TWO_DAYS)
   	ChangeStat(Myself,INT,-1,ADD)
END	


IF
 Race(Myself,ZOMBIE)
 GlobalTimerExpired("ZombieDegeneration","LOCALS")
 !CheckStatLT(Myself,4,CHR)
  RandomNumLT(100,20)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",TWO_DAYS)
   	ChangeStat(Myself,CHR,-1,ADD)
END	

IF
 Race(Myself,ZOMBIE)
 GlobalTimerExpired("ZombieDegeneration","LOCALS")
 !CheckStatLT(Myself,4,STR)
 RandomNumLT(100,10)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",ONE_DAY)
   	ChangeStat(Myself,STR,-1,ADD)
END	


IF
 Race(Myself,ZOMBIE)
 GlobalTimerExpired("ZombieDegeneration","LOCALS")
 !CheckStatLT(Myself,4,DEX)
 RandomNumLT(100,10)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",ONE_DAY)
   	ChangeStat(Myself,DEX,-1,ADD)
END	

IF
 Race(Myself,ZOMBIE)
 GlobalTimerExpired("ZombieDegeneration","LOCALS")
 !CheckStatLT(Myself,4,STR)
 RandomNumLT(100,10)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",TWO_DAYS)
   	ChangeStat(Myself,STR,-1,ADD)
END	


IF
 Race(Myself,ZOMBIE)
 GlobalTimerExpired("ZombieDegeneration","LOCALS")
 !CheckStatLT(Myself,4,DEX)
 RandomNumLT(100,10)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",TWO_DAYS)
   	ChangeStat(Myself,DEX,-1,ADD)
END	

IF
 Race(Myself,ZOMBIE)
 GlobalTimerExpired("ZombieDegeneration","LOCALS")
 !CheckStatLT(Myself,4,CHR)
THEN
  RESPONSE #100
    RealSetGlobalTimer("ZombieDegeneration","LOCALS",ONE_DAY)
   	ChangeStat(Myself,CHR,-1,ADD)
END	
		
 
