Quest description not updated correctly if you kill Ukruk

Make all T-Engine/ToME 4 bug reports here

Moderator: Moderator

Post Reply
Message
Author
RFlaum
Low Yeek
Posts: 6
Joined: Sat Sep 04, 2021 9:09 am

Quest description not updated correctly if you kill Ukruk

#1 Post by RFlaum »

If you win the encounter with Ukruk, the quest description isn't updated correctly to tell you that you need to go to Last Hope. Looking at the code, the error appears to be here:

Code: Select all

	if self:isCompleted("ambush") and not self:isCompleted("ambush-died") then
		desc[#desc+1] = _t"On your way out of the Dreadfell you were ambushed by a band of orcs."
		desc[#desc+1] = _t"They asked about the staff."
	elseif self:isCompleted("ambush-died") and not self:isCompleted("survived-ukruk") then
		desc[#desc+1] = _t"On your way out of the Dreadfell you were ambushed by a band of orcs and left for dead."
		desc[#desc+1] = _t"They asked about the staff and stole it from you."
		desc[#desc+1] = _t"#LIGHT_GREEN#Go at once to Last Hope to report those events!"
	elseif not self:isCompleted("ambush-died") and self:isCompleted("survived-ukruk") then
		desc[#desc+1] = _t"On your way out of the Dreadfell you were ambushed by a band of orcs."
		desc[#desc+1] = _t"They asked about the staff and stole it from you."
		desc[#desc+1] = _t"You told them nothing and vanquished them."
		desc[#desc+1] = _t"#LIGHT_GREEN#Go at once to Last Hope to report those events!"
	else
		desc[#desc+1] = _t"In its remains, you found a strange staff. It radiates power and danger and you dare not use it yourself."
		desc[#desc+1] = _t"You should bring it to the elders of Last Hope in the southeast."
	end
(from data/quests/staff-absorption.lua). The intent is that the fourth block gets executed if you've beat Ukruk, but in fact the first one will be so it never gets to the fourth.

ScienceBall
Higher
Posts: 70
Joined: Thu Jun 10, 2021 12:58 pm

Re: Quest description not updated correctly if you kill Ukruk

#2 Post by ScienceBall »

When you say "fourth block", are you counting the line
"Deep in the Dreadfell you fought and destroyed the Master, a powerful vampire."
as the first block, or are you only counting the parts inside the if-else statement? Because I think the third block in the if-else should get executed if you beat Ukruk, and the fourth block in the if-else looks like it's intended for if you're still in Dreadfell and you haven't been ambushed yet.

I agree with you about the code error.

RFlaum
Low Yeek
Posts: 6
Joined: Sat Sep 04, 2021 9:09 am

Re: Quest description not updated correctly if you kill Ukruk

#3 Post by RFlaum »

ScienceBall wrote: Sat Sep 04, 2021 11:34 am When you say "fourth block", are you counting the line
"Deep in the Dreadfell you fought and destroyed the Master, a powerful vampire."
as the first block, or are you only counting the parts inside the if-else statement? Because I think the third block in the if-else should get executed if you beat Ukruk, and the fourth block in the if-else looks like it's intended for if you're still in Dreadfell and you haven't been ambushed yet.

I agree with you about the code error.
The third block says "They asked about the staff and stole it from you." If you win, then they never stole it from you, did they? I think the third block is supposed to be executed if you kill Ukruk himself but are then killed by the other orcs, hence the self:isCompleted("ambush-died") check. On the other hand, the block does say you "vanquished" them, so... I dunno, I'm confused.

ScienceBall
Higher
Posts: 70
Joined: Thu Jun 10, 2021 12:58 pm

Re: Quest description not updated correctly if you kill Ukruk

#4 Post by ScienceBall »

RFlaum wrote: Sat Sep 04, 2021 11:41 am I think the third block is supposed to be executed if you kill Ukruk himself but are then killed by the other orcs, hence the self:isCompleted("ambush-died") check.
The check is "not self:isCompleted("ambush-died")". Also the code that sets "ambush-died" is removed when Ukruk dies, so "ambush-died" won't be set if you killed Ukruk and then died to the other orcs. (Same reason as why you lose a life in that situation.) So I think "ambush-died" and "survived-ukruk" are mutually exclusive, therefore the "not self:isCompleted("ambush-died")" check for the third block is redundant. (Unless something funny can happen with switching party members, or time travel, or something.)

I think the third block is for if you beat Ukruk and the other orcs, and the "They asked about the staff and stole it from you." text is a mistake (for that block) and it should just say "They asked about the staff.".

I don't think any of the blocks are for the case where you beat Ukruk and die to the other orcs. I don't think that possibility was thought about much.

Post Reply