Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Little problem with Quest System of Alatar


troglodite
 Share

Recommended Posts

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 ![:(](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/sad.png)

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
>! ```
Link to comment
Share on other sites

> 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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...