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

Convo/Quest combo problem


Growlith1223
 Share

Recommended Posts

Hi i am making a Convo/quest option so it gives you a quest but…

When i do, in server, it erros and highlights

```
QuestMessage index, Conv(convNum).Conv(curChat).Data1, Quest(Conv(convNum).Conv(curChat).Data1).Speech(1), Quest(Conv(convNum).Conv(curChat).Data1).Speech(1)

```In SendChat Sub…

Here is the full code of that sub.

```
    Dim convNum As Long
    Dim curChat As Long
    Dim mainText As String
    Dim optText(1 To 4) As String
    Dim P_GENDER As String
    Dim P_NAME As String
    Dim P_CLASS As String
    Dim i As Long

    If TempPlayer(index).inChatWith > 0 Then
        convNum = NPC(TempPlayer(index).inChatWith).Conv
        curChat = TempPlayer(index).curChat

        ' check for unique events and trigger them early
        If Conv(convNum).Conv(curChat).Event > 0 Then
            Select Case Conv(convNum).Conv(curChat).Event
                Case 1 ' Open Shop
                    If Conv(convNum).Conv(curChat).Data1 > 0 Then ' shop exists?
                        SendOpenShop index, Conv(convNum).Conv(curChat).Data1
                        TempPlayer(index).InShop = Conv(convNum).Conv(curChat).Data1 ' stops movement and the like
                    End If
                    ' exit the chat
                    TempPlayer(index).inChatWith = 0
                    TempPlayer(index).curChat = 0
                    ' send chat update
                    sendChat index
                    ' send npc dir
                    With MapNpc(TempPlayer(index).c_mapNum).NPC(TempPlayer(index).c_mapNpcNum)
                        If .c_inChatWith = index Then
                            .c_inChatWith = 0
                            .Dir = .c_lastDir
                            NpcDir TempPlayer(index).c_mapNum, TempPlayer(index).c_mapNpcNum, .Dir
                        End If
                    End With
                    ' clear last of data
                    TempPlayer(index).c_mapNpcNum = 0
                    TempPlayer(index).c_mapNum = 0
                    ' exit out early so we don't send chat update twice
                    Exit Sub
                Case 2 ' Open Bank
                    SendBank index
                Case 3 ' Give Item
                    Dim b As Long
                    b = FindOpenInvSlot(index, Conv(convNum).Conv(curChat).Data1)
                    Call SetPlayerInvItemNum(index, b, Conv(convNum).Conv(curChat).Data1)
                    Call SetPlayerInvItemValue(index, b, Conv(convNum).Conv(curChat).Data2)
                    SendInventory index
                Case 4 ' Give Quest
                    'QuestMessage index, Conv(convNum).Conv(curChat).Data1, Quest(Conv(convNum).Conv(curChat).Data1).Speech(1), Quest(Conv(convNum).Conv(curChat).Data1).Speech(1)
            End Select
        End If

continue:
        ' cache player's details
        If Player(index).Sex = SEX_MALE Then
            P_GENDER = "man"
        Else
            P_GENDER = "woman"
        End If
        P_NAME = Trim$(Player(index).Name)
        P_CLASS = Trim$(Class(Player(index).Class).Name)

        mainText = Conv(convNum).Conv(curChat).Conv
        For i = 1 To 4
            optText(i) = Conv(convNum).Conv(curChat).rText(i)
        Next
    End If

    SendChatUpdate index, TempPlayer(index).inChatWith, mainText, optText(1), optText(2), optText(3), optText(4)

```
Help will be greatly appreciated! :D
Link to comment
Share on other sites

why u used data from conversation to be used as data for questmessage?
This is data for questmessage, you must add them as byvals to top of sub and send them when sending sendchat. You must send Questnum ande NpcNum i think

QuestMessage attacker, NPC(NPCNum).QuestNum, Trim$(Quest(NPC(NPCNum).QuestNum).Speech(1)), NPC(NPCNum).QuestNum
Link to comment
Share on other sites

@ZeroX8:

> Hi i am making a Convo/quest option so it gives you a quest but…

@Deathbeam
I think he is trying to combine the conv with quest so that quest can be initated with a conv.
You will have to edit something most likely with the choices of the conv system. Something like intiate chat when the choice marked with a quest intiate.
Link to comment
Share on other sites

well ive tried this method

(edit some part in the convo tut)

follow this step

for example like this

find  the send chat sub
add another index ( the case for events )

and add this line of code on that case ( replace the attacker and npcnum below )

                            Call CheckTasks(attacker, QUEST_TYPE_GOTALK, npcNum)
                            Call CheckTasks(attacker, QUEST_TYPE_GOGIVE, npcNum)
                            Call CheckTasks(attacker, QUEST_TYPE_GOGET, npcNum)

                            If NPC(npcNum).Quest = YES Then
                                If Player(attacker).PlayerQuest(NPC(npcNum).Quest).Status = QUEST_COMPLETED Then
                                    If Quest(NPC(npcNum).Quest).Repeat = YES Then
                                        Player(attacker).PlayerQuest(NPC(npcNum).Quest).Status = QUEST_COMPLETED_BUT
                                        Exit Function
                                    End If
                                End If
                                If CanStartQuest(attacker, NPC(npcNum).QuestNum) Then
                                    'if can start show the request message (speech1)
                                    QuestMessage attacker, NPC(npcNum).QuestNum, Trim$(Quest(NPC(npcNum).QuestNum).Speech(1)), NPC(npcNum).QuestNum
                                    Exit Function
                                End If
                                If QuestInProgress(attacker, NPC(npcNum).QuestNum) Then
                                    'if the quest is in progress show the meanwhile message (speech2)
                                    QuestMessage attacker, NPC(npcNum).QuestNum, Trim$(Quest(NPC(npcNum).QuestNum).Speech(2)), 0
                                    Exit Function
                                End If
                            End If
                        End If

after that on client

just add another name on the event list ( on the conv editor )

PS you will need quest and conv system here
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...