Scriptname SuH_comES_sperm extends activemagiceffect  

SuH_Fun property _Fun auto

GlobalVariable property SuH_PCSstackmaxsperm auto
GlobalVariable property SuH_PCSstacksperm auto
GlobalVariable property SuH_rank_lusciousliquids auto
GlobalVariable property SuH_rank_valuestacker auto

;ent/ Actors
Actor property PlayerRef auto
;end/

Event OnEffectStart(Actor akTarget, Actor akCaster)
	if akTarget == PlayerRef ; If player consumes
		; Call functions from SuH_Fun
		_Fun.XPcalc("PCsperm", 0.0, 0, 0.0, False)
		_Fun.STATcalc(PlayerRef, TRUE, "PCsperm", "All", False, 0.0, 0.0, False)
		; Give Stack
		int sperm = SuH_PCSstacksperm.GetValue() as int
		int msperm = SuH_PCSstackmaxsperm.GetValue() as int
		if sperm < msperm
			int valuestacker = SuH_rank_valuestacker.GetValue() as int
			int tstack = sperm + valuestacker + 1
			if tstack < msperm
				SuH_PCSstackmaxsperm.SetValue(tstack)
			else
				SuH_PCSstackmaxsperm.SetValue(msperm)
			endIf
		endIf
		int k = Math.Floor(SuH_rank_lusciousliquids.GetValue() * 5)
		akTarget.RestoreActorValue("Health", k)
		akTarget.RestoreActorValue("Magicka", k)
		akTarget.RestoreActorValue("Stamina", k)
	else ; If NPC consumes
		; [][][] Currently Disabled
	endIf
endEvent