
IF
	!Global("DMWWLevelUpWarning","LOCALS",1)
	InParty(Myself)
	CheckStatGT(Myself,0,Level)  //This just disables the level-up code for someone who is already the right level (e.g. 3rd-party-added modifications to Khalid and Montaron)
THEN	
	RESPONSE #100
		SetGlobal("DMWWLevelUpWarning","LOCALS",1)
		SetGlobal("DMWWLevelUp","LOCALS",1)
END


IF
	!Global("DMWWLevelUpWarning","LOCALS",1)
	Class(Myself,RANGER_ALL)
	InParty(Myself)
	CheckStat(Myself,0,Level)
THEN
	RESPONSE #100
		DisplayStringNoName(Myself,444444)
		SetGlobal("DMWWLevelUpWarning","LOCALS",1)
		ApplySpellRES("dw#rang",Myself)
END


IF
	!Global("DMWWLevelUpWarning","LOCALS",1)
	!Class(Myself,RANGER_ALL)
	InParty(Myself)
	CheckStat(Myself,0,Level)
THEN
	RESPONSE #100
		DisplayStringNoName(Myself,444444)
		SetGlobal("DMWWLevelUpWarning","LOCALS",1)
END


IF
	!Global("DMWWLevelUp","LOCALS",1)
	CheckStat(Myself,1,Level)
	InParty(Myself)
	XPGT(Player1,32000)
THEN	
	RESPONSE #100
		SetGlobal("DMWWLevelUp","LOCALS",1)
		ApplySpell(Myself,RESTORE_FULL_HEALTH)
		ApplySpellRES("dw#hp",Myself)
		AddXPObject(Myself,32000)
END


IF
	!Global("DMWWLevelUp","LOCALS",1)
	CheckStat(Myself,1,Level)
	InParty(Myself)
	XPGT(Player1,16000)
THEN	
	RESPONSE #100
		SetGlobal("DMWWLevelUp","LOCALS",1)
		ApplySpell(Myself,RESTORE_FULL_HEALTH)
 		ApplySpellRES("dw#hp",Myself)
		AddXPObject(Myself,16000)
END


IF
	!Global("DMWWLevelUp","LOCALS",1)
	CheckStat(Myself,1,Level)
	InParty(Myself)
	XPGT(Player1,8000)
THEN	
	RESPONSE #100
		SetGlobal("DMWWLevelUp","LOCALS",1)
		ApplySpell(Myself,RESTORE_FULL_HEALTH)
 		ApplySpellRES("dw#hp",Myself)
		AddXPObject(Myself,8000)
END


IF
	!Global("DMWWLevelUp","LOCALS",1)
	CheckStat(Myself,1,Level)
	InParty(Myself)
	XPGT(Player1,4000)
THEN	
	RESPONSE #100
		SetGlobal("DMWWLevelUp","LOCALS",1)
		ApplySpell(Myself,RESTORE_FULL_HEALTH)
 		ApplySpellRES("dw#hp",Myself)
		AddXPObject(Myself,4000)
END


IF
	!Global("DMWWLevelUp","LOCALS",1)
	CheckStat(Myself,1,Level)
	InParty(Myself)
	XPGT(Player1,2000)
THEN	
	RESPONSE #100
		SetGlobal("DMWWLevelUp","LOCALS",1)
		ApplySpell(Myself,RESTORE_FULL_HEALTH)
		ApplySpellRES("dw#hp",Myself)
		AddXPObject(Myself,2000)
END

IF
	!Global("DMWWLevelUp","LOCALS",1)
	CheckStat(Myself,1,Level)
	InParty(Myself)
THEN	
	RESPONSE #100
		SetGlobal("DMWWLevelUp","LOCALS",1)
		ApplySpell(Myself,RESTORE_FULL_HEALTH)
 		ApplySpellRES("dw#hp",Myself)
		AddXPObject(Myself,1)
END



