If GetMapType(GetUserMap(#USERID))=#MAPTYPE_FRIENDLY
	SendMessageToUser(#USERID,"You cannot do this on a friendly map!", #MSG_CRITICAL)
	Goto End
Endif


If GetUserMana(#USERID)<GetUserMaxMana(#USERID)
	SendMessageToUser(#USERID,"You need all your blood to do this!", #MSG_CRITICAL)
	Goto End
Endif

If GetUserAtXY(#MAPID,#XPOS,#YPOS+1)<>0
	TargetUser=GetUserAtXY(#MAPID,#XPOS,#YPOS+1)
	Goto SkillSpew
Endif
If GetUserAtXY(#MAPID,#XPOS,#YPOS-1)<>0
	TargetUser=GetUserAtXY(#MAPID,#XPOS,#YPOS-1)
	Goto SkillSpew
Endif
If GetUserAtXY(#MAPID,#XPOS+1,#YPOS+1)<>0
	TargetUser=GetUserAtXY(#MAPID,#XPOS+1,#YPOS+1)
	Goto SkillSpew
Endif
If GetUserAtXY(#MAPID,#XPOS+1,#YPOS-1)<>0
	TargetUser=GetUserAtXY(#MAPID,#XPOS+1,#YPOS-1)
	Goto SkillSpew
Endif
If GetUserAtXY(#MAPID,#XPOS-1,#YPOS+1)<>0
	TargetUser=GetUserAtXY(#MAPID,#XPOS-1,#YPOS+1)
	Goto SkillSpew
Endif
If GetUserAtXY(#MAPID,#XPOS-1,#YPOS-1)<>0
	TargetUser=GetUserAtXY(#MAPID,#XPOS-1,#YPOS-1)
	Goto SkillSpew
Endif
If GetUserAtXY(#MAPID,#XPOS+1,#YPOS)<>0
	TargetUser=GetUserAtXY(#MAPID,#XPOS+1,#YPOS)
	Goto SkillSpew
Endif
If GetUserAtXY(#MAPID,#XPOS-1,#YPOS)<>0
	TargetUser=GetUserAtXY(#MAPID,#XPOS-1,#YPOS)
	Goto SkillSpew
Endif

SendMessageToUser(#USERID,"There is no one next to you to spew chemicals on!", #MSG_CRITICAL)
Goto End



Label SkillSpew

ChemReduce=Floor(GetUserStrength(TargetUser)+GetUserAgility(TargetUser)+GetUserWisdom(TargetUser)+GetUserEndurance(TargetUser))/4
ChemReduceMin=Floor(ChemReduce/6)
ChemReduceMax=Floor(ChemReduce/2)
ChemReduceFinal=Random(ChemReduceMin,ChemReduceMax)
UserDamage=Random(GetUserMaxMana(#USERID),GetUserMaxMana(#USERID)*2)

SetUserMana(#USERID,0)
SetUserMana(TargetUser,0)

SendMessageToMap(#MAPID,GetUserName(#USERID)+" spews chemicals all over "+GetUserName(TargetUser)+" and does "+UserDamage+" damage!", #MSG_CRITICAL)
SendMessageToMap(#MAPID,GetUserName(TargetUser)+" is weakened...", #MSG_CRITICAL)

UserDamageUser(#USERID,UserDamage,TargetUser)

Timer5(295,5000,TargetUser,GetUserStrengthBonus(TargetUser),GetUserAgilityBonus(TargetUser),GetUserWisdomBonus(TargetUser),GetUserEnduranceBonus(TargetUser))

SetUserStrengthBonus(TargetUser,GetUserStrengthBonus(TargetUser)-ChemReduceFinal)
SetUserAgilityBonus(TargetUser,GetUserAgilityBonus(TargetUser)-ChemReduceFinal)
SetUserWisdomBonus(TargetUser,GetUserWisdomBonus(TargetUser)-ChemReduceFinal)
SetUserEnduranceBonus(TargetUser,GetUserEnduranceBonus(TargetUser)-ChemReduceFinal)





Label End

Continue = 1