Little problem with Quest System of Alatar

Hello! I have the Alatar´s Quest System, and I have a trouble;

When I am in a Quest of Gatering items, and gater the item, always send me the text “1/X” (where x is the max items that I have to gather)

Doesn´t care how much items I gather, is always “1/X”

For example, I have to gather 20 Eggs; the TextMessage will be: “Quest: Eggs - You have 1/20 Eggs”, always :(

Any ideas??

This is the code of the Case QUEST_TYPE_GOGATHER 'Gather X amount of X item.

! ! Case QUEST_TYPE_GOGATHER 'Gather X amount of X item. ! If TargetIndex = Quest(QuestNum).Task(ActualTask).Item Then ! ! 'reset the count first ! Player(Index).PlayerQuest(QuestNum).CurrentCount = 0 ! ! 'Check inventory for the items ! For i = 1 To MAX_INV ! If GetPlayerInvItemNum(Index, i) = TargetIndex Then ! If Item(i).Type = ITEM_TYPE_CURRENCY Then ! Player(Index).PlayerQuest(QuestNum).CurrentCount = GetPlayerInvItemValue(Index, i) ! Else ! 'If is the correct item add it to the count ! Player(Index).PlayerQuest(QuestNum).CurrentCount = Player(Index).PlayerQuest(QuestNum).CurrentCount + 1 ! End If ! End If ! Next ! ! PlayerMsg Index, "Quest: " + Trim$(Quest(QuestNum).Name) + " - You have " + Trim$(Player(Index).PlayerQuest(QuestNum).CurrentCount) + "/" + Trim$(Quest(QuestNum).Task(ActualTask).Amount) + " " + Trim$(Item(TargetIndex).Name), Yellow ! ! If Player(Index).PlayerQuest(QuestNum).CurrentCount >= Quest(QuestNum).Task(ActualTask).Amount Then ! QuestMessage Index, QuestNum, "Task completed", 0 ! If CanEndQuest(Index, QuestNum) Then ! EndQuest Index, QuestNum ! Else ! Player(Index).PlayerQuest(QuestNum).CurrentCount = 0 ! Player(Index).PlayerQuest(QuestNum).ActualTask = ActualTask + 1 ! End If ! End If ! End If !

Make sure that the value is being updated. Also can you complete the quest after you get the eggs?

Make sure that the value is being updated. Also can you complete the quest after you get the eggs?

Its about the S and C list in ModEnumerations??

And No, I can´t complete it, because Its always in 1/20 eggs

But, I can complete it, If I set 1/1 eggs

Replace code with this.


Case QUEST_TYPE_GOGATHER 'Gather X amount of X item.

				 If TargetIndex = Quest(QuestNum).Task(ActualTask).Item Then

						 'reset the count first

						 'Player(Index).PlayerQuest(QuestNum).CurrentCount = 0

						 'Check inventory for the items

						 For i = 1 To MAX_INV

								 If GetPlayerInvItemNum(Index, i) = TargetIndex Then

										 If Item(i).Type = ITEM_TYPE_CURRENCY Then

												 Player(Index).PlayerQuest(QuestNum).CurrentCount = GetPlayerInvItemValue(Index, i)

										 Else

												 'If is the correct item add it to the count

												 Player(Index).PlayerQuest(QuestNum).CurrentCount = Player(Index).PlayerQuest(QuestNum).CurrentCount + 1

										 End If

								 End If

						 Next

						 PlayerMsg Index, "Quest: " + Trim$(Quest(QuestNum).Name) + " - You have " + Trim$(Player(Index).PlayerQuest(QuestNum).CurrentCount) + "/" + Trim$(Quest(QuestNum).Task(ActualTask).Amount) + " " + Trim$(Item(TargetIndex).Name), Yellow

						 If Player(Index).PlayerQuest(QuestNum).CurrentCount >= Quest(QuestNum).Task(ActualTask).Amount Then

								 QuestMessage Index, QuestNum, "Task completed", 0

								 If CanEndQuest(Index, QuestNum) Then

										 EndQuest Index, QuestNum

								 Else

										 Player(Index).PlayerQuest(QuestNum).CurrentCount = 0

										 Player(Index).PlayerQuest(QuestNum).ActualTask = ActualTask + 1

								 End If

						 End If

				 End If

That might work.

IT WORKS! :)

Thank you Abhi!

Solved

Log in to reply