Jump to content

[LE] How to move to the next stage after a container has been looted?


Recommended Posts

I'm designing a quest where one way of going through it is to loot armor from a chest, then bring it to another actor/NPC outside and have them equip it. I have a stage set up for the looting of the chest but I have no idea what I am doing here. I cannot find anything on making a quest advance stages through looting or making sure multiple things are in the player's inventory.

 

How can I make it so that once I have looted 3 pieces of armor from a chest (cuirass, gloves, boots respectively, all with aliases and their own IDs), the quest will advance?

 

On a side note, the other option is to kill 4 people in the dungeon. As a bonus question, how could I ensure that once the 4 actors/aliases are dead, the quest advances in stage? I find myself constantly creating new scripts trying to think of how to do it, I probably have like 10 empty scripts right now... I don't want to clutter up my scripts bank - I'd like to get it right, I just cannot for the life of me figure out how. Any help is appreciated. Thank you!

Link to comment
Share on other sites

You want to attach a script to the container that activates when it closes and detects if the player has the three pieces of armor in their inventory. I'm just free-handing this, but it would probably look like:

 

[Have your three item properties as ArmorProperty, GlovesProperty, and BootsProperty, and your quest as QuestProperty, or whatever you want them as. Change the SetStage to the stage it goes to]

 

Event OnClose(ObjectReference akActionRef)
if (akActionRef == Game.GetPlayer())
if (Game.GetPlayer().GetItemCount(ArmorProperty) == 1)

if (Game.GetPlayer().GetItemCount(GlovesProperty) == 1)

if (Game.GetPlayer().GetItemCount(BootsProperty) == 1)

 

QuestProperty.SetStage(50)

 

endIf

endIf

endIf

endIf
endEvent

 

 

The other option is a little more complicated because (I'm assuming) you can kill the four NPCs out of order. You could attach the script to all four of the NPCs that detects whether or not all four of them are dead. So something like.

 

Event OnDeath(Actor akKiller)
if (NPC1.GetDead == 1)

if (NPC2.GetDead == 1)

if (NPC3.GetDead == 1)

if (NPC4.GetDead == 1)

 

QuestProperty.SetStage(50)

 

endIf

endIf

endIf

endIf
endEvent

 

You can give that a try and see if either of those work. Hopefully they shouldn't create any issues.

Link to comment
Share on other sites

Thank you. I wound up doing it in a similar way to how the Thieve's Guild did their first quest (where you confronted 3 people) since the objective was very similar. I wound up making a separate objective and stage for each item, then created an int called something like 'LootedArmor'. Then set each piece of armor to go to a certain stage and wrote scripts using kmyQuest that said if this stage was entered, bump the int up by 1. Once it's 3 or higher, go to the stage where you need to give the armor to the NPC. Probably more complicated than necessary, as seen by your solution, but it works. There's time for cleanup later. LOL

Edited by BeastlyBeast
Link to comment
Share on other sites

Thank you. I wound up doing it in a similar way to how the Thieve's Guild did their first quest (where you confronted 3 people) since the objective was very similar. I wound up making a separate objective and stage for each item, then created an int called something like 'LootedArmor'. Then set each piece of armor to go to a certain stage and wrote scripts using kmyQuest that said if this stage was entered, bump the int up by 1. Once it's 3 or higher, go to the stage where you need to give the armor to the NPC. Probably more complicated than necessary, as seen by your solution, but it works. There's time for cleanup later. LOL

 

You can add this function and properties to your quest script ( the one you created using kmyquest )

int Property DeadBandits  Auto  Conditional
{tracks how many bandits are killed}

int Property TotalBandits  Auto  Conditional
{how many bandits do you need to kill?}

function IncrementDeadBandits()
	DeadBandits = DeadBandits + 1
	if DeadBandits >= TotalBandits
		setStage(20) ;change this to whatever stage you want
	endif
endFunction

And fill the properties in the CK.

 

And place this on your Bandits

Scriptname aaaaaBanditScript extends ReferenceAlias 

whateveryourquestscriptnameis myQuestScript

Event OnDeath(Actor akKiller)
	; increment dead count
	myQuestScript = GetOwningQuest() as whateveryourquestscriptnameis
	myQuestScript.IncrementDeadBandits()
endEvent

These two small scripts will count how many bandits have been killed and when the correct number has been reached will set the next quest stage.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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