Jump to content

Varla Stone Script


AurianaValoria1

Recommended Posts

I'm working with this Varla Stone Script, and I want to add a line that makes it essentially "cursed." It functions as normal, but knocks off half of the player's health to recharge items. What would I put and where would I add it?

 

scriptname AV1VarlaStoneScript

ref container
ref item
ref base

short max
short charge

Begin OnEquip

       let container := PlayerRef
       ForEach (item <- container)
               let base := item.GetBaseObject
               let max := GetObjectCharge base
               if (item.GetCurrentCharge < max)
                       item.SetCurrentCharge max
                       let charge := 1
               endif
       loop
       
       if (charge == 1)
               Message "You have used a Varla Stone's power to restore your enchanted items charge, and now it is gone."
               PlaySound ITMWelkyndStoneUse
               RemoveMe
       else
               Message "Your equipment is fully charged."
       endif

End

Link to comment
Share on other sites

Change the script to this:

 

scriptname AV1VarlaStoneScript

ref container
ref item
ref base

float hpdrain

short max
short charge

Begin OnEquip

let container := PlayerRef
ForEach (item <- container)
	let base := item.GetBaseObject
	let max := GetObjectCharge base
	if (item.GetCurrentCharge < max)
		item.SetCurrentCharge max
		let charge := 1
	endif
loop

if (charge == 1)
	Message "You have used a Varla Stone's power to restore your enchanted items charge, and now it is gone."
	PlaySound ITMWelkyndStoneUse
	let hpdrain := (Player.GetBaseAV Health) / (-2)
	Player.ModAV2 Health hpdrain
	RemoveMe
else
	Message "Your equipment is fully charged."
endif

End

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...