

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

IF 
  !Race(Myself,GHOUL)
  Global("MyRaceBlood","LOCALS",4)
  Global("GhoulSet","LOCALS",1)
   RandomNumLT(10,4)  
THEN 
  RESPONSE #100
    SetGlobal("GhoulSet","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","GHAST1")		

  ChangeAlignment(Myself,CHAOTIC_EVIL)
ChangeRace(Myself,GHOUL)
ChangeGeneral(Myself,UNDEAD)
RealSetGlobalTimer("GhoulDegeneration","LOCALS",ONE_DAY)
		ChangeStat(Myself,CHR,-2,ADD)
		ChangeStat(Myself,WIS,-1,ADD)
		ChangeStat(Myself,INT,-1,ADD)

END



IF 
  !Race(Myself,GHOUL)
  Global("MyRaceBlood","LOCALS",4)
  Global("GhoulSet","LOCALS",1)
  
THEN 
  RESPONSE #100
    SetGlobal("GhoulSet","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","GHOUL1")		

  ChangeAlignment(Myself,CHAOTIC_EVIL)
ChangeRace(Myself,GHOUL)
ChangeGeneral(Myself,UNDEAD)
RealSetGlobalTimer("GhoulDegeneration","LOCALS",ONE_DAY)
		ChangeStat(Myself,CHR,-3,ADD)
		ChangeStat(Myself,WIS,-1,ADD)
		ChangeStat(Myself,INT,-1,ADD)

END

IF
 Race(Myself,GHOUL)
 Global("GhoulDegeneration","LOCALS",0)
THEN
  RESPONSE #100
    RealSetGlobalTimer("GhoulDegeneration","LOCALS",ONE_DAY)
END	



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

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


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

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


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

IF
 Race(Myself,GHOUL)
 GlobalTimerExpired("GhoulDegeneration","LOCALS")
 !CheckStatGT(Myself,18,STR)
 RandomNumLT(100,10)
THEN
  RESPONSE #100
    RealSetGlobalTimer("GhoulDegeneration","LOCALS",ONE_DAY)
   	ChangeStat(Myself,STR,1,ADD)
END	


IF
 Race(Myself,GHOUL)
 GlobalTimerExpired("GhoulDegeneration","LOCALS")
 !CheckStatGT(Myself,18,DEX)
 RandomNumLT(100,10)
THEN
  RESPONSE #100
    RealSetGlobalTimer("GhoulDegeneration","LOCALS",ONE_DAY)
   	ChangeStat(Myself,DEX,1,ADD)
END	

IF
 Race(Myself,GHOUL)
 GlobalTimerExpired("GhoulDegeneration","LOCALS")
 !CheckStatLT(Myself,18,STR)
 RandomNumLT(100,10)
THEN
  RESPONSE #100
    RealSetGlobalTimer("GhoulDegeneration","LOCALS",TWO_DAYS)
   	ChangeStat(Myself,STR,1,ADD)
END	


IF
 Race(Myself,GHOUL)
 GlobalTimerExpired("GhoulDegeneration","LOCALS")
 !CheckStatLT(Myself,18,DEX)
 RandomNumLT(100,10)
THEN
  RESPONSE #100
    RealSetGlobalTimer("GhoulDegeneration","LOCALS",TWO_DAYS)
   	ChangeStat(Myself,DEX,1,ADD)
END	

IF
 Race(Myself,GHOUL)
 GlobalTimerExpired("GhoulDegeneration","LOCALS")
 !CheckStatLT(Myself,7,CHR)
THEN
  RESPONSE #100
    RealSetGlobalTimer("GhoulDegeneration","LOCALS",ONE_DAY)
   	ChangeStat(Myself,CHR,-1,ADD)
END	
		
 
