sorry william i couldn't find where to put this hopes this is the right area...well for know its on elysium side and im nto the maker but i fixed it all to work exept this part....
the code is here but thats the unfixed one lol
http://splamm.com/elysium/forums/viewtopic.php?t=2760&postdays=0&postorder=asc&start=0
Code:
Function DoQuest(ByVal questnum As Long, ByVal index As Long, ByVal npcnum As Long)
If ReadINI(Player(index).Char(Player(index).CharNum).Name, "QUEST" & Npc(npcnum).Quest, App.Path + "\qflag.ini") = 2 Then
Call PlayerMsg(index, "A " & Trim(Npc(npcnum).Name) & " says, '" & Trim(Quest(Npc(npcnum).Quest).After) & "'", SayColor)
ElseIf ReadINI(Player(index).Char(Player(index).CharNum).Name, "QUEST" & Npc(npcnum).Quest, App.Path + "\qflag.ini") = 1 Then
Call SendDataTo(index, "questprompt" & SEP_CHAR & questnum & SEP_CHAR & npcnum & SEP_CHAR & END_CHAR)
Else
Debug.Print "NOT COMPLETED Quest"
Call StartQuest(questnum, index, npcnum)
End If
End Function
Code:
Sub SaveLine(File As Integer, Header As String, Var As String, Value As String)
Print #File, Var & "=" & Value
End Sub
Code:
Function StartQuest(questnum As Long, index As Long, npcnum As Long)
If MeetReq(questnum, index) Then
If Quest(questnum).StartOn = 0 Then
Call WriteINI(Player(index).Char(Player(index).CharNum).Name, "QUEST" & Npc(npcnum).Quest, "1", App.Path + "\qflag.ini")
Call PlayerMsg(index, "A " & Trim(Npc(npcnum).Name) & " says, '" & Trim(Quest(Npc(npcnum).Quest).Start) & "'", SayColor)
ElseIf Quest(questnum).StartOn = 1 Then
Call GiveQuestItem(index, Quest(questnum).StartItem, Quest(questnum).Startval, npcnum)
End If
Else
Call PlayerMsg(index, "A " & Trim(Npc(npcnum).Name) & " says, '" & Trim(Quest(Npc(npcnum).Quest).Before) & "'", SayColor)
End If
End Function
Code:
Function MeetReq(questnum As Long, index As Long) As Boolean
If Quest(questnum).ClassIsReq = 0 And Quest(questnum).LevelIsReq = 0 Then
MeetReq = True
Exit Function
ElseIf Quest(questnum).ClassIsReq = 1 And Quest(questnum).LevelIsReq = 0 Then
If Player(index).Char(Player(index).CharNum).Class = Quest(questnum).ClassReq Then
MeetReq = True
Exit Function
Else
MeetReq = False
Exit Function
End If
ElseIf Quest(questnum).ClassIsReq = 0 And Quest(questnum).LevelIsReq = 1 Then
If Player(index).Char(Player(index).CharNum).Level >= Quest(questnum).LevelReq Then
MeetReq = True
Exit Function
Else
MeetReq = False
Exit Function
End If
ElseIf Quest(questnum).ClassIsReq = 1 And Quest(questnum).LevelIsReq = 1 Then
If Player(index).Char(Player(index).CharNum).Class = Quest(questnum).ClassReq And Player(index).Char(Player(index).CharNum).Level >= Quest(questnum).LevelReq Then
MeetReq = True
Exit Function
Else
MeetReq = False
Exit Function
End If
End If
End Function
Code:
Sub GiveQuestItem(ByVal index As Long, ByVal ItemNum As Long, ByVal ItemVal As Long, ByVal npcnum As Long)
Dim I As Long
Dim Curr As Boolean
Dim Has As Boolean
' Check for subscript out of range
If IsPlaying(index) = False Or ItemNum <= 0 Or ItemNum > MAX_ITEMS Then
Exit Sub
End If
If Item(ItemNum).Type = 12 Then Curr = True Else Curr = False
For I = 1 To MAX_INV
If Curr = True Then
If GetPlayerInvItemNum(index, I) = ItemNum Then
Call SetPlayerInvItemValue(index, I, GetPlayerInvItemValue(index, I) + ItemVal)
Call SendInventoryUpdate(index, I)
Has = True
Exit For
End If
Else
If GetPlayerInvItemNum(index, I) = 0 Then
Call SetPlayerInvItemNum(index, I, ItemNum)
Call SetPlayerInvItemValue(index, I, 1)
If (Item(ItemNum).Type = ITEM_TYPE_ARMOR) Or (Item(ItemNum).Type = ITEM_TYPE_WEAPON) Or (Item(ItemNum).Type = ITEM_TYPE_HELMET) Or (Item(ItemNum).Type = ITEM_TYPE_SHIELD) Then
Call SetPlayerInvItemDur(index, I, Item(ItemNum).Data1)
End If
Call SendInventoryUpdate(index, I)
Has = True
Exit For
End If
End If
Next I
If Has = False Then
Call PlayerMsg(index, "Your inventory is full. Please come back when it is not", BrightRed)
Exit Sub
Else
Call WriteINI(Player(index).Char(Player(index).CharNum).Name, "QUEST" & Npc(npcnum).Quest, "1", App.Path + "\qflag.ini")
Call PlayerMsg(index, "A " & Trim(Npc(npcnum).Name) & " says, '" & Trim(Quest(Npc(npcnum).Quest).Start) & "'", SayColor)
End If
End Sub
Code:
Sub GiveRewardItem(ByVal index As Long, ByVal ItemNum As Long, ByVal ItemVal As Long, ByVal npcnum As Long)
Dim I As Long
Dim Curr As Boolean
Dim Has As Boolean
' Check for subscript out of range
If IsPlaying(index) = False Or ItemNum <= 0 Or ItemNum > MAX_ITEMS Then
Exit Sub
End If
If Item(ItemNum).Type = 12 Then Curr = True Else Curr = False
For I = 1 To MAX_INV
If Curr = True Then
If GetPlayerInvItemNum(index, I) = ItemNum Then
Call SetPlayerInvItemValue(index, I, GetPlayerInvItemValue(index, I) + ItemVal)
Call SendInventoryUpdate(index, I)
Has = True
Exit For
End If
Else
If GetPlayerInvItemNum(index, I) = 0 Then
Call SetPlayerInvItemNum(index, I, ItemNum)
Call SetPlayerInvItemValue(index, I, 1)
If (Item(ItemNum).Type = ITEM_TYPE_ARMOR) Or (Item(ItemNum).Type = ITEM_TYPE_WEAPON) Or (Item(ItemNum).Type = ITEM_TYPE_HELMET) Or (Item(ItemNum).Type = ITEM_TYPE_SHIELD) Then
Call SetPlayerInvItemDur(index, I, Item(ItemNum).Data1)
End If
Call SendInventoryUpdate(index, I)
Has = True
Exit For
End If
End If
Next I
If Has = False Then
Call PlayerMsg(index, "Your inventory is full. Please come back when it is not", BrightRed)
Exit Sub
Else
Call PlayerMsg(index, "A " & Trim(Npc(npcnum).Name) & " says, '" & Trim(Quest(Npc(npcnum).Quest).End) & "'", SayColor)
Call WriteINI(Player(index).Char(Player(index).CharNum).Name, "QUEST" & Npc(npcnum).Quest, "2", App.Path + "/qflag.ini")
If Item(Quest(Npc(npcnum).Quest).RewardNum).Type = 12 Then
Call TakeItem(index, Quest(Npc(npcnum).Quest).ItemReq, Quest(Npc(npcnum).Quest).ItemVal)
Else
Call TakeItem(index, Quest(Npc(npcnum).Quest).ItemReq, 1)
End If
Call SendInventoryUpdate(index, I)
End If
End Sub