;'(Green) Viper' Death script

;For Viper Hunting quests
If GetUserFlag(#USERID,38) = 4
	If GetUserFlag(#USERID,39) < 150
		SetUserFlag(#USERID,39,GetUserFlag(#USERID,39)+1)
		SendMessageToUser(#USERID,GetUserFlag(#USERID,39)+" vipers killed.",#MSG_EMOTE)
	Else
		SendMessageToUser(#USERID,"You've killed 150 vipers. Return to the Outpost and complete the quest.",#MSG_EMOTE)
	EndIf
EndIf

;This is the script that is called when the green viper,
;#132, dies. It has a chance of poisoning the killer.

;If the user is immune to diseases
If GetUserFlag(#USERID,7) = 2
	GoTo END
EndIf

If Random(0,GetUserWisdomTotal(#USERID)) = 0
	SendCombatMessage(#USERID,"The Viper's venom has been injected into you! ")
Else
	GoTo END
EndIf

Loops = 50 - Floor(GetUserEnduranceTotal(#USERID) * 0.5)
Damage = 8 - Floor(GetUserAgilityTotal(#USERID) * 0.25)

If Loops < 15
	Loops = 15
EndIf

If Damage < 1
	Damage = 1
EndIf

Timer(393,1000,#USERID,Damage,Loops)

Label END

Continue = 1