Help with plagued coins

Post » Mon Oct 28, 2013 1:09 am

I've been working on a little addition that introduces plague infected coins into the game, and after much mucking around decided that they only real way to implement this is by giving NPC's an infected coind and then force them into 1 of 20 aliases via dialogue and each getting this script.

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?
User avatar
jessica Villacis
 
Posts: 3385
Joined: Tue Jan 23, 2007 2:03 pm

Return to V - Skyrim