;'Rank Giver NPC (Ylerup)' - NPC script

TargetID=GetUserID(GetUserMessage(#USERID))

If TargetID < 1
	SendMessageToUser(#USERID,"Ylerup says, 'Tell me a player's name, and I'll give you information on that player.'",#MSG_SAY)
	GoTo END
EndIf

Strength=GetUserStrength(TargetID)
Agility=GetUserAgility(TargetID)
Endurance=GetUserEndurance(TargetID)
Wisdom=GetUserWisdom(TargetID)

Stats=Strength+Agility+Endurance+Wisdom

SendMessageToUser(#USERID,"Name: "+GetUserName(TargetID),#MSG_EMOTE)

If GetUserClass(TargetID) = 0 
	SendMessageToUser(#USERID,"Class: Human Soldier",#MSG_EMOTE)
ElseIf GetUserClass(TargetID) = 1 
	SendMessageToUser(#USERID,"Class: Human Civilian",#MSG_EMOTE)
ElseIf GetUserClass(TargetID) = 2 
	SendMessageToUser(#USERID,"Class: Blood Spectre",#MSG_EMOTE)
ElseIf GetUserClass(TargetID) = 3 
	SendMessageToUser(#USERID,"Class: Pale Spectre",#MSG_EMOTE)
ElseIf GetUserClass(TargetID) = 4 
	SendMessageToUser(#USERID,"Class: Plague Zombie",#MSG_EMOTE)
ElseIf GetUserClass(TargetID) = 5 
	SendMessageToUser(#USERID,"Class: Scavenger Zombie",#MSG_EMOTE)
ElseIf GetUserClass(TargetID) = 6 
	SendMessageToUser(#USERID,"Class: Ancient Skeleton",#MSG_EMOTE)
ElseIf GetUserClass(TargetID) = 7 
	SendMessageToUser(#USERID,"Class: Skeleton Guardian",#MSG_EMOTE)
Else
	SendMessageToUser(#USERID,"Class: Unknown",#MSG_EMOTE)
EndIf

If GetUserAccess(TargetID) > 0
	SendMessageToUser(#USERID,"Moderater rank "+GetUserAccess(TargetID),#MSG_EMOTE)
EndIf

If GetUserGuild(TargetID) <> 0
	If GetUserGuildRank(TargetID) = #GUILDRANK_INITIATE 
		SendMessageToUser(#USERID,GetGuildName(GetUserGuild(TargetID))+" servant",#MSG_EMOTE)
	ElseIf GetUserGuildRank(TargetID) = #GUILDRANK_MEMBER
		SendMessageToUser(#USERID,"Member of "+GetGuildName(GetUserGuild(TargetID)),#MSG_EMOTE)
	ElseIf GetUserGuildRank(TargetID) = #GUILDRANK_LORD
		SendMessageToUser(#USERID,"Lord of "+GetGuildName(GetUserGuild(TargetID)),#MSG_EMOTE)
	EndIf
EndIf

GenLevel = Floor(Stats/4)

SendMessageToUser(#USERID,"General level: "+GenLevel,#MSG_EMOTE)

If GenLevel > 99
	Title="High King"
ElseIf GenLevel > 94
	Title="King"
ElseIf GenLevel > 89
	Title="Ruler"
ElseIf GenLevel > 84
	Title="Great Lord"
ElseIf GenLevel > 79
	Title="Lord"
ElseIf GenLevel > 74
	Title="Grand Master"
ElseIf GenLevel > 69
	Title="Master"
ElseIf GenLevel > 64
	Title="Guardian"
ElseIf GenLevel > 59
	Title="Hero"
ElseIf GenLevel > 54
	Title="Warrior"
ElseIf GenLevel > 49
	Title="Adventurer"
ElseIf GenLevel > 44
	Title="Knight"
ElseIf GenLevel > 39
	Title="Traveler"
ElseIf GenLevel > 34
	Title="Fighter"
ElseIf GenLevel > 29
	Title="Guard"
ElseIf GenLevel > 24
	Title="Soldier"
ElseIf GenLevel > 19
	Title="Citizen"
ElseIf GenLevel > 14
	Title="Farmer"
ElseIf GenLevel > 9
	Title="Peasant"
ElseIf GenLevel > 4
	Title="Beginner"
Else
	Title="New Player"
EndIf

SendMessageToUser(#USERID,"Title: "+Title,#MSG_EMOTE)

Money=GetUserSilver(TargetID)
Money=Money+GetUserFlag(TargetID,47)
Wealth="Poor"
If Money > 50000000
	Wealth="More than he knows what to do with it"
ElseIf Money > 25000000
	Wealth="Measures by roomfills not weights"
ElseIf Money > 10000000
	Wealth="Has no need for more"
ElseIf Money > 5000000
	Wealth="Has a literal fortune"
ElseIf Money > 2500000
	Wealth="Multi-millionair"
ElseIf Money > 1000000
	Wealth="Millionair"
ElseIf Money > 500000
	Wealth="Exceedingly Wealthy"
ElseIf Money > 250000
	Wealth="Wealthy"
ElseIf Money > 100000
	Wealth="Moderately Wealthy"
ElseIf Money > 75000
	Wealth="Well off"
ElseIf Money > 50000
	Wealth="A fairly decent amount"
ElseIf Money > 10000
	Wealth="Enough for the time"
ElseIf Money > 5000
	Wealth="Getting by"
Else
	Wealth="Poor"
EndIf

SendMessageToUser(#USERID,"Wealth: "+Wealth,#MSG_EMOTE)

Label END

Continue = 1