Spoiler
Scriptname VSDCoinsvcker extends ReferenceAlias MiscObject Property VSDGoldCoin AutoMiscObject Property Gold001 AutoEffectShader Property ChaurusPoisonFXShader AutoInt Count = 3600Event OnItemAdded(Form akBaseItem, Int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If akBaseItem == VSDGoldCoin RegisterForSingleUpdate(120.0) EndIfEndEventEvent OnUpdate() If Count >= 1 RegisterForSingleUpdate(120.0) ChaurusPoisonFXShader.Play(GetReference(),120.0) GetActorReference().DamageActorValue("Health",6.0) Count = Count - 1 Else ChaurusPoisonFXShader.Stop(GetReference()) UnregisterForUpdate() EndIfEndEventEvent OnDying(Actor akKiller) ChaurusPoisonFXShader.Stop(GetReference()) UnregisterForUpdate()EndEventEvent OnItemRemoved(Form akBaseItem, Int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) If akDestContainer == Game.GetPlayer() && akBaseItem == VSDGoldCoin Game.GetPlayer().RemoveItem(VSDGoldCoin,1,True) Game.GetPlayer().AddItem(Gold001,1,True) Debug.Notification("The plague has worn off this coin") EndIfEndEvent
I am wondering what I can do about a script on the VSDGoldCoin incase the NPC gets a coin by other methods (player reverse pickpockets or NPC picks coin up). I can import the quest script that forces the Ref. and use it on a container event but I'm thinking the alias script OnItemAdded event won't work since the item's been added before the alias was set.
Any ideas anyone?