Jump to content

Script to set qst stage when player has 8 specific items in inventory


morrowind1979

Recommended Posts

I am making a quest where the player has to get 7 sigil stones to advance to the next stage of the quest. My script is not working. I have attached the script to a player REF alias in my quest alias's can someone help please? here is the script that does not update the quest stage as I want it to:

Scriptname DaedricSealInvScript extends ReferenceAlias  

LeveledItem Property Pain  Auto  

LeveledItem Property Suffering  Auto  

LeveledItem Property Fear  Auto  

LeveledItem Property Flesh  Auto  

LeveledItem Property Death  Auto  

LeveledItem Property Bone  Auto  

LeveledItem Property Blood  Auto  

Quest Property POS  Auto  

EVENT onItemAdded(form itemAdded, int itemCount, objectReference itemRef, objectReference sourceRef)
		If game.getPlayer().getItemCount(Pain) == 1
		If game.getPlayer().getItemCount(Suffering) == 1
		If game.getPlayer().getItemCount(Fear) == 1
		If game.getPlayer().getItemCount(Flesh) == 1
		If game.getPlayer().getItemCount(Death) == 1
		If game.getPlayer().getItemCount(Bone) == 1
		If game.getPlayer().getItemCount(Blood) == 1
		POS.SetStage (50)
	Endif
	Endif
	Endif
	Endif
	Endif
	Endif
	Endif
EndEvent

Link to comment
Share on other sites

The problem is that you are using LeveledItems, which randomly adds items to the container that it is in. Because of this, your LeveledItem "Pain" is not the same "Pain" that the Player has in their inventory.

 

One thing you can do is check for each of the different items using "OR" a bunch of times (checking for all of the different Pain items, and the different Fear items, etc.), but that would probably get messy quickly.

 

Another thing that you can do is create a counter variable. Each time the Player picks up one of these items (I'm assuming that they can't be dropped), add 1 to the counter variable. Once the variable reaches 7, set the stage to 50.

 

EDIT: Posted right when you fixed it. :P Good luck!

Edited by ddmlink
Link to comment
Share on other sites

  • Recently Browsing   0 members

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