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

Alatar

Members
  • Posts

    558
  • Joined

  • Last visited

    Never

Everything posted by Alatar

  1. Hello there :) I've been working on ~~a custom map editor~~ editing the visual structure of EO's map editor and just wanted to know what do you people think about it (the form) and if it feels like easy to use for mappers. ![](http://i52.tinypic.com/2cpap6p.png) ![](http://i51.tinypic.com/2ufac15.png) ![](http://i51.tinypic.com/2w53frq.png)
  2. Athagekin in that case I think it's because the quest giver "talks" with QuestMessage procedure, instead of PlayerMsg. Haven't checked the conversation system yet but I think that maybe it's that the problem. Ryoku what's that for? xD A INFO message over every single friendly npc's head that has a conversation to do?
  3. Did you convert your NPC using this?: http://www.touchofdeathforums.com/smf/index.php/topic,70502.msg809345.html#msg809345 The "quest giver npc type" it's no longer used here.
  4. I was thinking about the same thing. Haven't stress tested it. The loop could be a problem. That's why I put a break but I don't know if it would be enought in a map full of npc's or something like that. Anyway, if I want this to be done well I will need to do it with surfaces.
  5. > Warning - while you were typing a new reply has been posted. You may wish to review your post. @Ryoku: > Hey Alatar! =3 > > I did some of your todo list for you ;D I did the "!" or "?" above quest NPCs =3 you can add it if you want Lol! I was just going to post about that right now! Check below, and thanks Ryoku :cheesy: * * * @Justn: > oops sorry altar just wanted to make sure, I didn't see the to do list. I'll add it in np. Everything else is working great so far thanks everyone for the help. Oh, i need to add it to this topic to-do list lol, it's in my own to-do list .txt file :P On the other hand, there are some other stuff that would need to be added for the next version, the main thing is one with coding the currency items to work fine with this source edition. There is a long road until this is completed people :embarrassed: @Ryoku: > still in class got on their network with my laptop. > > FIX EXP: > > Server side > > in modSvQuests find 'give experience > replace the line under it with > ``` > 'give experience > > GivePlayerEXP Index, Quest(QuestNum).RewardExp > > > ``` > > * * * > > ! or ? mark above quest NPCs: > > Client Side > > in modText > > In Public Sub DrawNpcName > > before ' Error handler > > add > ``` > If NPC(NPCNum).Quest = YES Then > Name = "?" 'or ! > > TextX = ConvertMapX(MapNpc(Index).x * PIC_X) + MapNpc(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name))) > If NPC(NPCNum).Sprite < 1 Or NPC(NPCNum).Sprite > NumCharacters Then > TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - 16 > Else > ' Determine location for text > TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - (DDSD_Character(NPC(NPCNum).Sprite).lHeight / 4) + 4 'adjust last number to get it to fit right > End If > ' Draw name > Call DrawText(TexthDC, TextX, TextY, Name, color) > End If > > > ``` Nice one, but it will only show the "?" if the npc is a quest giver, and it will show it all the time. Here's my try about it (i'm thinking anyway to work in a dd7 version of it, but first I'll need to learn dd7 xD): * * * **NEW: Add "?" or "!" to the NPCs** "[?]" is if you need to talk to X npc in any quest, and "[!]" is if you can take a new quest from one npc. Client-side, go to modText, find DrawNpcName, find this: ``` Call DrawText(TexthDC, TextX, TextY, Name, color) ```Paste this: ``` 'Alatar v1.2 Dim i As Long For i = 1 To MAX_QUESTS 'check if the npc is the next task to any quest: [?] symbol If Player(MyIndex).PlayerQuest(i).Status = QUEST_STARTED Then If Quest(i).Task(Player(MyIndex).PlayerQuest(i).ActualTask).NPC = npcNum Then Name = "[?]" TextX = ConvertMapX(MapNpc(Index).x * PIC_X) + MapNpc(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name))) If NPC(npcNum).Sprite < 1 Or NPC(npcNum).Sprite > NumCharacters Then TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - 16 Else TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - (DDSD_Character(NPC(npcNum).Sprite).lHeight / 4) End If Call DrawText(TexthDC, TextX, TextY, Name, QBColor(Yellow)) Exit For End If End If 'check if the npc is the starter to any quest: [!] symbol 'can accept the quest as a new one? If Player(MyIndex).PlayerQuest(i).Status = QUEST_NOT_STARTED Or Player(MyIndex).PlayerQuest(i).Status = QUEST_COMPLETED_BUT Then 'the npc gives this quest? If NPC(npcNum).QuestNum = i Then Name = "[!]" TextX = ConvertMapX(MapNpc(Index).x * PIC_X) + MapNpc(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name))) If NPC(npcNum).Sprite < 1 Or NPC(npcNum).Sprite > NumCharacters Then TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - 16 Else TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - (DDSD_Character(NPC(npcNum).Sprite).lHeight / 4) End If Call DrawText(TexthDC, TextX, TextY, Name, QBColor(Yellow)) Exit For End If End If Next '/Alatar v1.2 ```
  6. About the Exp, you're right. I've done it quickly and haven't seen that there's a proper function to work with exp. @Justn: > Thanks! Umm ok I downloaded the premade copy to see if i screwed up somewhere but it doesn't show anything in the Requirements slot or the Rewards slot of the quest log no matter what you set it to It's in the ToDo list. Although it's not hard to finish it.
  7. @Chukillz: > hey alatar do you have the post for v1.0 still? maybe you can email it to me or something? also what do i do if i have added things to my frmMain? i would have to go and re add everything wouldnt i? would you be able to show the code and stuff that you did to it? or would i have to go through and try to find it my self? Check the first post. There's a link at the bottom for the v1.0, but I think you should use v1.1 instead. @Ryoku: > >.> so what about adding this stuff to already custom NPC editors, and frmMains…. It's really a simple edit, just check the code and the form and you'll see it. :/ @Captain: > I'm seriously questioning some things above. ?
  8. @Ryoku: > >.> ALATAR… I should slap you. > > you STILL haven't ever gotten past using MAX_BYTE for rewards, USE MAX_INTEGER YOU TWIT! > > I NO ONE WANTS TO TOP OUT AT 255 FOR EXP REWARDS! Oh you're right! lol my bad I wasn't focusing too much on the reward stuff for this release :P
  9. I can't believe I haven't seen this before. This is awesome one of the few worthy custom edits over here. Downloading right now :) @Encyclopedia: > So this is an uber late reply but, considering almost every custom engine in this board is once again tutorials crammed together with no originality or optimizations, **I will once again be working on this project.** :cheesy: EDIT: lol, there are a few GUI errors :P with scrollbars on Item Editor and NPC Editor, also when I hit the Resource button I get a 380 RTE and highlights this line: ``` .scrlResourceEditor(5).Value = Resource(EditorIndex).health ```
  10. **Update your Quest System from v1.0 to v1.1** Some people asked for a simple tutorial that update their previous version without having to restart all of that stuff :) **First of all**: Download the **Extra Files** and past them in the correct places. [modSvQuest -> [b]Server] [modQuest + frmEditor_Quest + (replace frmEditor_NPC & frmMain) -> [b]Client] **Server** **modCombat** In Sub CanPlayerAttackNpc find: ``` If NPC(npcNum).Behaviour NPC_BEHAVIOUR_FRIENDLY And NPC(npcNum).Behaviour NPC_BEHAVIOUR_SHOPKEEPER And NPC(npcNum).Behaviour NPC_BEHAVIOUR_QUEST Then ```Replace with: ``` If NPC(npcNum).Behaviour NPC_BEHAVIOUR_FRIENDLY And NPC(npcNum).Behaviour NPC_BEHAVIOUR_SHOPKEEPER Then ```Note: there are 2 of this, replace both! Find: If Len(Trim$(NPC(npcNum).AttackSay)) > 0 Then Replace the: ``` If NPC(npcNum).Behaviour = NPC_BEHAVIOUR_QUEST Then Call ShowQuest(attacker, NPC(npcNum).QuestNum) Exit Function End If If NPC(npcNum).Behaviour = NPC_BEHAVIOUR_FRIENDLY Then Call CheckTasks(attacker, QUEST_TYPE_GOTALK, npcNum) Call CheckTasks(attacker, QUEST_TYPE_GOGIVE, npcNum) Call CheckTasks(attacker, QUEST_TYPE_GOGET, npcNum) End If ```With this: ``` If NPC(npcNum).Behaviour = NPC_BEHAVIOUR_FRIENDLY Then 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 CanStartQuest(attacker, NPC(npcNum).QuestNum) Then 'if can start show the request message (chat1) QuestMessage attacker, NPC(npcNum).QuestNum, Trim$(Quest(NPC(npcNum).QuestNum).Chat(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 (chat2) PlayerMsg attacker, Trim$(NPC(npcNum).Name) + ": " + Trim$(Quest(NPC(npcNum).QuestNum).Chat(2)), BrightGreen 'QuestMessage attacker, NPC(npcNum).QuestNum, Trim$(Quest(NPC(npcNum).QuestNum).Chat(2)), 0 Exit Function End If End If End If ``` Sub PlayerAttackNpc, find: ``` Call CheckTasks(attacker, QUEST_TYPE_GOKILL, 0) ```Replace with: ``` Call CheckTasks(attacker, QUEST_TYPE_GOKILL, victim) ``` **modHandleData** Go to the end of the sub, delete everything from this line to the bottom: ``` Sub HandleRequestEditQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) ```And paste this: ``` Sub HandleRequestEditQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Buffer As clsBuffer ' Prevent hacking If GetPlayerAccess(Index) < ADMIN_DEVELOPER Then Exit Sub End If Set Buffer = New clsBuffer Buffer.WriteLong SQuestEditor SendDataTo Index, Buffer.ToArray() Set Buffer = Nothing End Sub Sub HandleSaveQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim n As Long Dim Buffer As clsBuffer Dim QuestSize As Long Dim QuestData() As Byte Set Buffer = New clsBuffer Buffer.WriteBytes Data() ' Prevent hacking If GetPlayerAccess(Index) < ADMIN_DEVELOPER Then Exit Sub End If n = Buffer.ReadLong 'CLng(Parse(1)) If n < 0 Or n > MAX_QUESTS Then Exit Sub End If ' Update the Quest QuestSize = LenB(Quest(n)) ReDim QuestData(QuestSize - 1) QuestData = Buffer.ReadBytes(QuestSize) CopyMemory ByVal VarPtr(Quest(n)), ByVal VarPtr(QuestData(0)), QuestSize Set Buffer = Nothing ' Save it Call SendUpdateQuestToAll(n) Call SaveQuest(n) Call AddLog(GetPlayerName(Index) & " saved Quest #" & n & ".", ADMIN_LOG) End Sub Sub HandleRequestQuests(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) SendQuests Index End Sub Sub HandlePlayerHandleQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Buffer As clsBuffer Dim QuestNum As Long, Order As Long, i As Long Set Buffer = New clsBuffer Buffer.WriteBytes Data() QuestNum = Buffer.ReadLong Order = Buffer.ReadLong '1 = accept, 2 = cancel If Order = 1 Then Player(Index).PlayerQuest(QuestNum).Status = QUEST_STARTED '1 Player(Index).PlayerQuest(QuestNum).ActualTask = 1 Player(Index).PlayerQuest(QuestNum).CurrentCount = 0 PlayerMsg Index, "New quest accepted: " & Trim$(Quest(QuestNum).Name) & "!", BrightGreen 'Add item on start If Quest(QuestNum).QuestGiveItem > 0 And Quest(QuestNum).QuestGiveItem < MAX_ITEMS Then If Quest(QuestNum).QuestGiveItemValue > 0 And Quest(QuestNum).QuestGiveItemValue < MAX_INV Then 'ToDo: stuff with currency GiveInvItem Index, Quest(QuestNum).QuestGiveItem, Quest(QuestNum).QuestGiveItemValue End If End If ElseIf Order = 2 Then Player(Index).PlayerQuest(QuestNum).Status = QUEST_NOT_STARTED '2 Player(Index).PlayerQuest(QuestNum).ActualTask = 1 Player(Index).PlayerQuest(QuestNum).CurrentCount = 0 PlayerMsg Index, Trim$(Quest(QuestNum).Name) & " has been canceled!", BrightGreen End If SavePlayer Index SendPlayerData Index SendPlayerQuests Index Set Buffer = Nothing End Sub Sub HandleQuestLogUpdate(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) SendPlayerQuests Index End Sub ``` **modTypes** In Private Type NpcRec, find: ``` QuestNum As Long ```Replace with: ``` Quest As Byte QuestNum As Long ``` **Client** **modGameEditors** Find: ``` .scrlQuest.Value = NPC(EditorIndex).QuestNum ```Replace with: ``` .chkQuest.Value = NPC(EditorIndex).Quest .scrlQuest.Value = NPC(EditorIndex).QuestNum ``` **modHandleData** Go to the end of the sub, delete everything from this line to the bottom: ``` Private Sub HandleQuestEditor() ```And paste this: ``` Private Sub HandleQuestEditor() Dim i As Long With frmEditor_Quest Editor = EDITOR_TASKS .lstIndex.Clear ' Add the names For i = 1 To MAX_QUESTS .lstIndex.AddItem i & ": " & Trim$(Quest(i).Name) Next .Show .lstIndex.ListIndex = 0 QuestEditorInit End With End Sub Private Sub HandleUpdateQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim n As Long Dim Buffer As clsBuffer Dim QuestSize As Long Dim QuestData() As Byte Set Buffer = New clsBuffer Buffer.WriteBytes Data() n = Buffer.ReadLong ' Update the Quest QuestSize = LenB(Quest(n)) ReDim QuestData(QuestSize - 1) QuestData = Buffer.ReadBytes(QuestSize) CopyMemory ByVal VarPtr(Quest(n)), ByVal VarPtr(QuestData(0)), QuestSize Set Buffer = Nothing End Sub Private Sub HandlePlayerQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Buffer As clsBuffer Dim i As Long Set Buffer = New clsBuffer Buffer.WriteBytes Data() For i = 1 To MAX_QUESTS Player(MyIndex).PlayerQuest(i).Status = Buffer.ReadLong Player(MyIndex).PlayerQuest(i).ActualTask = Buffer.ReadLong Player(MyIndex).PlayerQuest(i).CurrentCount = Buffer.ReadLong Next RefreshQuestLog Set Buffer = Nothing End Sub Private Sub HandleQuestMessage(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Buffer As clsBuffer Dim i As Long, QuestNum As Long, QuestNumForStart As Long Dim Message As String Set Buffer = New clsBuffer Buffer.WriteBytes Data() QuestNum = Buffer.ReadLong Message = Trim$(Buffer.ReadString) QuestNumForStart = Buffer.ReadLong frmMain.lblQuestName = Trim$(Quest(QuestNum).Name) frmMain.lblQuestSay = Message frmMain.picQuestDialogue.Visible = True If QuestNumForStart > 0 And QuestNumForStart
  11. **IMPORTANT**: I made a converter that transfers the files from v1.0 to the new format in v1.1 **Download here**: http://www.mediafire.com/?s1npryuo6hganio (I'm also including the source in case you've done source edit to the UDT). **How it works?** Simple, first paste in the correct folders the files you want to convert (example, you have Quest1.dat, Quest2.dat and Quest3.dat from your v0.1, copy+paste them in the "quests_1_0" folder). Open the program then select if you wan't to convert NPCs or Quests from the v0.1, now select the starting value (in this case will be 1) and the limit value (in this case 3) and run. If everything goes okay, open the _1_1 folder (in this case the "quests_1_1") and you will have there the converted files. Copy+paste them in the proper folder in your server/data and that's it :)
  12. Solved. It was a silly mistake. Ignore this, i need a cup of coffee :embarrassed: >! Hi people. I was making a converter for my quest system to transfer the previous versions quests to the new format. I've done a converter long ago, by emulating one that Lightning made for items. >! Now i don't know why i'm getting a RTE 52 (Bad file name or number), while trying to do the convertion. >! Here's the code of the sub: >! ``` Public Sub ConvertQuests(ByVal Start As Integer, ByVal Limit As Integer) Dim i As Long, n As Long lstStatus.AddItem "Starting the quests convertion." For i = Start To Limit Path_From = App.Path & "\quests_1_0\quest" & i & ".dat" Path_To = App.Path & "\quests_1_1\quest" & i & ".dat" If LenB(Dir(Path_From)) > 0 Then lstStatus.AddItem "Loading file # " & i 'Load the v1.0 Open Path_From For Binary As #1 Get #F, , Quest10.Name Get #F, , Quest10.QuestLog Get #F, , Quest10.TasksCount Get #F, , Quest10.Repeat For n = 1 To 3 Get #F, , Quest10.Requirement(n) Next Get #F, , Quest10.StartItem Get #F, , Quest10.StartItemValue Get #F, , Quest10.StartRemoveItem Get #F, , Quest10.StartRemoveItemValue For n = 1 To 3 Get #F, , Quest10.Chat(n) Next Get #F, , Quest10.RewardItem Get #F, , Quest10.RewardItemAmount For n = 1 To MAX_TASKS Get #F, , Quest10.Task(n) Next Close #1 lstStatus.AddItem "Writing file # " & i 'Start writing the previous stuff in the new Rec With Quest11 .Name = Quest10.Name .QuestLog = Quest10.QuestLog .TasksCount = Quest10.TasksCount .Repeat = Quest10.Repeat For n = 1 To 3 .Requirement(n) = Quest10.Requirement(n) Next .QuestGiveItem = Quest10.StartItem .QuestGiveItemValue = Quest10.StartItemValue .QuestRemoveItem = Quest10.StartRemoveItem .QuestRemoveItemValue = Quest10.StartRemoveItemValue For n = 1 To 3 .Chat(n) = Trim$(Quest10.Chat(n)) Next .RewardExp = 0 .RewardItem = Quest10.RewardItem .RewardItemAmount = Quest10.RewardItemAmount For n = 1 To MAX_TASKS .Task(n) = Quest10.Task(n) Next End With lstStatus.AddItem "Saving file # " & i 'Save the v1.1 Open Path_To For Binary As #1 Put #F, , Trim$(Quest11.Name) Put #F, , Trim$(Quest11.QuestLog) Put #F, , Quest11.TasksCount Put #F, , Quest11.Repeat For n = 1 To 3 Put #F, , Quest11.Requirement(n) Next Put #F, , Quest11.QuestGiveItem Put #F, , Quest11.QuestGiveItemValue Put #F, , Quest11.QuestRemoveItem Put #F, , Quest11.QuestRemoveItemValue For n = 1 To 3 Put #F, , Quest11.Chat(n) Next Put #F, , Quest11.RewardExp Put #F, , Quest11.RewardItem Put #F, , Quest11.RewardItemAmount For n = 1 To MAX_TASKS Put #F, , Quest11.Task(n) Next Close #1 Else lstStatus.AddItem "Process failed at file #" & i & "!" MsgBox "File " & i & " does not exist, the convertion ends now.": Exit Sub End If Next lstStatus.AddItem "Convertion done :)" End Sub ``` And here's a screenie: ![](http://i54.tinypic.com/j9n5v7.png) >! PS: The quest file that is trying to load is totally working in the previous version of the engine. >! :embarrassed:
  13. Working on a simple program that converts quests and npcs from v1.0 to v1.1, will be ready soon
  14. Hmm, now i'm thinking on making a small tut to port the v1.0 to v1.1. On the other hand, i've changed a few stuff on how the data is stored so yep, you people are going to re-do the quests/npc's or make a converter. @Chukillz: > nice work alatar :) thank you, here are a few questions/concerns that i have tho. > > 1) is there a way that we would be able to use the same NPC for different quests? like we get done with one quest and then we go back to that NPC that gave us the quest, can we get a new quest from that NPC? (if you dont understand i can explain it more in detail. > > 2) is there a way that we can put a ! or a ? over the NPC to let us know that there is a quest available or already in progress? > > Thanks again 1) No in the way the system is coded, for now each npc can only give one quest. 2) Hmm looks nice. I will add it to the to-do list.
  15. Version 1.1: >! **Alatar's Quest System v1.1** >! ![](http://i53.tinypic.com/2jfgbd5.jpg) >! * * * >! Hello and welcome. This is a tutorial for EO 2.0, and also includes the entire project if you wan't to use it right away without the need of following the tutorial. I've started with the idea of this system months ago, and although I abandon it a few times and moved to other things, finally in the past few days I've manage to finish it. I'm just learning to program like many here, so this was my first 'big' personal challenge. So please report any error or suggestion and I will try to do my best ^^ Ok, let's go to the important. (And please forgive me, English is not my main language) >! **Features** >! This quest system is a bit different to others due to the fact that it allow developers to create dinamyc quests with different purpose and itinerary, like "_go talk to X npc, then kill X amount of X npc, then talk to Y npc and gather X amount of X item, finally come back and talk to me_". Each quest can have several tasks to do, each of one fully customizable. The quest system also has a fully working QuestLog and QuestSpeech window. >! **Types of Tasks** >! * **GoSlay**: Kill **X** amount of **X** npc's. * **GoGather**: Gather **X** amount of **X** item. * **GoTalk**: Interact with **X** npc. * **GoTravel**: Reach **X** map. * **GoGive**: Give **X** amount of **X** item to **X** npc. * **GoKill**: Kill **X** amount of players. * **GoTrain**: Hit **X** amount of times **X** resource. * **GoGet**: Get **X** amount of **X** item from **X** npc. >! **To-Do List** >! * Fix a currency issue. * Multiple rewards. * Add "?" and "!" symbols. >! **How it Works** Temporary, it's working this way, but you could add buttons if you wish, and edit the ugly GUI forms and stuff. To open the Quest Editor type /editquest, to open the QuestLog press the white button. >! **Changelog from v1.0 to v1.1** >! >! * New Quest Form. * New QuestLog and QuestDialogue Form (still ugly, but works better). * Fixed the GoGather Task that allowed an exploit by dropping and taking the item. Also re-coded the entire task to make it work better and fix other minor bugs. * Fixed a GoTrain Task micro bug. * Fixed and re-coded the GoGive Task. * Fixed the GoKill bug that when a player kill another player the quests gets completed. * Fixed the QuestLog issue that counts only for the first connected player. * Fixed that when accepting a quest the questlog fails to update. * Remove the NPC BEHAVIOUR QUEST, now handled with the friendly ones. * Fixed a bug that wont allow to restart a quest if it was completed and then saved as repeatitive. * Added the "Give-on-Start" and "Remove-on-the-end" item stuff. * Fixed the GoSlay bug when counting enemies for quests. * Added EXP reward. >! Ok, let's go with the code. :huh: >! There are two ways to use this. >! **Way 1** [Download the full system](http://www.mediafire.com/?8oq70z4cq2qik26) already added to a blank EO and go test it. That's all, you don't need to follow the steps. >! **Way 2** Install the system on your own EO manually, following the steps below and **remember** to [download the extra files](http://www.mediafire.com/?g1gn1bosic8aan1) and add them to your project: >! **Server Side** >! **Add the modSvQuest to your project.** >! **modCombat** >! Find: ``` If Len(Trim$(NPC(npcNum).AttackSay)) > 0 Then ```Above, after the Else, put ``` If NPC(npcNum).Behaviour = NPC_BEHAVIOUR_FRIENDLY Then 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 CanStartQuest(attacker, NPC(npcNum).QuestNum) Then 'if can start show the request message (chat1) QuestMessage attacker, NPC(npcNum).QuestNum, Trim$(Quest(NPC(npcNum).QuestNum).Chat(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 (chat2) PlayerMsg attacker, Trim$(NPC(npcNum).Name) + ": " + Trim$(Quest(NPC(npcNum).QuestNum).Chat(2)), BrightGreen 'QuestMessage attacker, NPC(npcNum).QuestNum, Trim$(Quest(NPC(npcNum).QuestNum).Chat(2)), 0 Exit Function End If End If End If ``` Sub PlayerAttackNpc, find: ``` ' send death to the map ```Above place this: ``` Call CheckTasks(attacker, QUEST_TYPE_GOSLAY, npcNum) ``` Sub PlayerAttackNpc, find: ``` Call OnDeath(victim) ```Above place this: ``` Call CheckTasks(attacker, QUEST_TYPE_GOKILL, victim) ``` **modGeneral** >! In InitServer find: ``` ChkDir App.Path & "\Data\", "spells" ```past this below: ``` ChkDir App.Path & "\Data\", "quests" ``` In ClearGameData find: ``` Call ClearAnimations ```past this below: ``` Call SetStatus("Clearing quests...") Call ClearQuests ``` In LoadGameData find: ``` Call LoadAnimations ```past this below: ``` Call SetStatus("Loading quests...") Call LoadQuests ``` **modHandleData** >! Find: ``` HandleDataSub(CPartyLeave) = GetAddress(AddressOf HandlePartyLeave) ```Paste: ``` HandleDataSub(CRequestEditQuest) = GetAddress(AddressOf HandleRequestEditQuest) HandleDataSub(CSaveQuest) = GetAddress(AddressOf HandleSaveQuest) HandleDataSub(CRequestQuests) = GetAddress(AddressOf HandleRequestQuests) HandleDataSub(CPlayerHandleQuest) = GetAddress(AddressOf HandlePlayerHandleQuest) HandleDataSub(CQuestLogUpdate) = GetAddress(AddressOf HandleQuestLogUpdate) ``` At the end of the module add this: >! ``` Sub HandleRequestEditQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Buffer As clsBuffer >! ' Prevent hacking If GetPlayerAccess(Index) < ADMIN_DEVELOPER Then Exit Sub End If >! Set Buffer = New clsBuffer Buffer.WriteLong SQuestEditor SendDataTo Index, Buffer.ToArray() Set Buffer = Nothing End Sub >! Sub HandleSaveQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim n As Long Dim Buffer As clsBuffer Dim QuestSize As Long Dim QuestData() As Byte Set Buffer = New clsBuffer Buffer.WriteBytes Data() >! ' Prevent hacking If GetPlayerAccess(Index) < ADMIN_DEVELOPER Then Exit Sub End If >! n = Buffer.ReadLong 'CLng(Parse(1)) >! If n < 0 Or n > MAX_QUESTS Then Exit Sub End If ' Update the Quest QuestSize = LenB(Quest(n)) ReDim QuestData(QuestSize - 1) QuestData = Buffer.ReadBytes(QuestSize) CopyMemory ByVal VarPtr(Quest(n)), ByVal VarPtr(QuestData(0)), QuestSize Set Buffer = Nothing ' Save it Call SendUpdateQuestToAll(n) Call SaveQuest(n) Call AddLog(GetPlayerName(Index) & " saved Quest #" & n & ".", ADMIN_LOG) End Sub >! Sub HandleRequestQuests(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) SendQuests Index End Sub >! Sub HandlePlayerHandleQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Buffer As clsBuffer Dim QuestNum As Long, Order As Long, i As Long Set Buffer = New clsBuffer Buffer.WriteBytes Data() QuestNum = Buffer.ReadLong Order = Buffer.ReadLong '1 = accept, 2 = cancel If Order = 1 Then Player(Index).PlayerQuest(QuestNum).Status = QUEST_STARTED '1 Player(Index).PlayerQuest(QuestNum).ActualTask = 1 Player(Index).PlayerQuest(QuestNum).CurrentCount = 0 PlayerMsg Index, "New quest accepted: " & Trim$(Quest(QuestNum).Name) & "!", BrightGreen 'Add item on start If Quest(QuestNum).QuestGiveItem > 0 And Quest(QuestNum).QuestGiveItem < MAX_ITEMS Then If Quest(QuestNum).QuestGiveItemValue > 0 And Quest(QuestNum).QuestGiveItemValue < MAX_INV Then 'ToDo: stuff with currency GiveInvItem Index, Quest(QuestNum).QuestGiveItem, Quest(QuestNum).QuestGiveItemValue End If End If ElseIf Order = 2 Then Player(Index).PlayerQuest(QuestNum).Status = QUEST_NOT_STARTED '2 Player(Index).PlayerQuest(QuestNum).ActualTask = 1 Player(Index).PlayerQuest(QuestNum).CurrentCount = 0 PlayerMsg Index, Trim$(Quest(QuestNum).Name) & " has been canceled!", BrightGreen End If SavePlayer Index SendPlayerData Index SendPlayerQuests Index Set Buffer = Nothing End Sub >! Sub HandleQuestLogUpdate(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) SendPlayerQuests Index End Sub ``` **modTypes** >! In Private Type PlayerRec, find: ``` Dir As Byte ```Paste: ``` PlayerQuest(1 To MAX_QUESTS) As PlayerQuestRec ``` In Private Type NpcRec, find: ``` Level As Long ```Paste: ``` Quest As Byte QuestNum As Long ``` **modEnumerations** >! Find: ``` SPartyVitals ```Paste: ``` SQuestEditor SUpdateQuest SPlayerQuest SQuestMessage ``` Find: ``` CPartyLeave ```Paste: ``` CRequestEditQuest CSaveQuest CRequestQuests CPlayerHandleQuest CQuestLogUpdate ``` **modPlayer** >! Find: ``` Call SendHotbar(Index) ```Paste: ``` Call SendQuests(Index) ``` In PlayerWarp, find: ``` TempPlayer(Index).GettingMap = YES ```Paste: ``` Call CheckTasks(Index, QUEST_TYPE_GOREACH, mapNum) ``` In PlayerMapGetItem, find: ``` SendActionMsg GetPlayerMap(Index), Msg, White, 1, (GetPlayerX(Index) * 32), (GetPlayerY(Index) * 32) ```Paste: ``` Call CheckTasks(Index, QUEST_TYPE_GOGATHER, GetItemNum(Trim$(Item(GetPlayerInvItemNum(Index, n)).Name))) ``` In CheckResource find: ``` SendMapSound Index, rX, rY, SoundEntity.seResource, Resource_index ```Paste: ``` Call CheckTasks(Index, QUEST_TYPE_GOTRAIN, Resource_index) ``` >! **Client Side** >! **Add the modQuests to your project. Add the frmEditor_Quest to your project. Replace your frmEditor_NPC and frmMain with the ones that I provide you.** >! **modGameEditors** >! In NpcEditorInit find: ``` .txtDamage.text = NPC(EditorIndex).Damage ```Paste: ``` .chkQuest.Value = NPC(EditorIndex).Quest .scrlQuest.Value = NPC(EditorIndex).QuestNum ``` **modEnumerations** >! Find: ``` SPartyVitals ```Paste: ``` SQuestEditor SUpdateQuest SPlayerQuest SQuestMessage ``` Find: ``` CPartyLeave ```Paste: ``` CRequestEditQuest CSaveQuest CRequestQuests CPlayerHandleQuest CQuestLogUpdate ``` **modHandleData** >! Find: ``` HandleDataSub(SPartyVitals) = GetAddress(AddressOf HandlePartyVitals) ```Paste: ``` HandleDataSub(SQuestEditor) = GetAddress(AddressOf HandleQuestEditor) HandleDataSub(SUpdateQuest) = GetAddress(AddressOf HandleUpdateQuest) HandleDataSub(SPlayerQuest) = GetAddress(AddressOf HandlePlayerQuest) HandleDataSub(SQuestMessage) = GetAddress(AddressOf HandleQuestMessage) ``` At the end of the module, past this: ``` Private Sub HandleQuestEditor() Dim i As Long With frmEditor_Quest Editor = EDITOR_TASKS .lstIndex.Clear >! ' Add the names For i = 1 To MAX_QUESTS .lstIndex.AddItem i & ": " & Trim$(Quest(i).Name) Next >! .Show .lstIndex.ListIndex = 0 QuestEditorInit End With >! End Sub >! Private Sub HandleUpdateQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim n As Long Dim Buffer As clsBuffer Dim QuestSize As Long Dim QuestData() As Byte Set Buffer = New clsBuffer Buffer.WriteBytes Data() n = Buffer.ReadLong ' Update the Quest QuestSize = LenB(Quest(n)) ReDim QuestData(QuestSize - 1) QuestData = Buffer.ReadBytes(QuestSize) CopyMemory ByVal VarPtr(Quest(n)), ByVal VarPtr(QuestData(0)), QuestSize Set Buffer = Nothing End Sub >! Private Sub HandlePlayerQuest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Buffer As clsBuffer Dim i As Long >! Set Buffer = New clsBuffer Buffer.WriteBytes Data() For i = 1 To MAX_QUESTS Player(MyIndex).PlayerQuest(i).Status = Buffer.ReadLong Player(MyIndex).PlayerQuest(i).ActualTask = Buffer.ReadLong Player(MyIndex).PlayerQuest(i).CurrentCount = Buffer.ReadLong Next RefreshQuestLog Set Buffer = Nothing End Sub >! Private Sub HandleQuestMessage(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Buffer As clsBuffer Dim i As Long, QuestNum As Long, QuestNumForStart As Long Dim Message As String Set Buffer = New clsBuffer Buffer.WriteBytes Data() QuestNum = Buffer.ReadLong Message = Trim$(Buffer.ReadString) QuestNumForStart = Buffer.ReadLong frmMain.lblQuestName = Trim$(Quest(QuestNum).Name) frmMain.lblQuestSay = Message frmMain.picQuestDialogue.Visible = True If QuestNumForStart > 0 And QuestNumForStart ! Find: ``` SendRequestEditSpell ```Paste: ``` Case "/editquest" If GetPlayerAccess(MyIndex) < ADMIN_DEVELOPER Then GoTo Continue SendRequestEditQuest ``` **modTypes** >! In Private Type PlayerRec, find: ``` Step As Byte ```Paste: ``` PlayerQuest(1 To MAX_QUESTS) As PlayerQuestRec ``` In Private Type NpcRec, find: ``` Level As Long ```Paste: ``` Quest As Byte QuestNum As Long ``` >! * * * >! And that's all! Tell me if anything goes wrong. I hope that this system could be useful to your project, and if you use it please give credits ;) >! **_- Alatar_** >! * * * >! Special thanks to Erwin and people who help here bugfixing while I was inactive. :) And to the people who reported bugs ^^ >! * * * >! **All Versions** >! * Alatar's Quest System v1.1: [Link](http://www.touchofdeathforums.com/smf/index.php/topic,70502.msg809248.html#msg809248) * Alatar's Quest System v1.0: [Link](http://www.touchofdeathforums.com/smf/index.php/topic,70502.msg758371.html#msg758371). >! * * * >! **Extras** >! * [Convert quests from v1.0 to v1.1](http://www.touchofdeathforums.com/smf/index.php/topic,70502.msg809345.html#msg809345) * [Update your whole system from v1.0 to v1.1](http://www.touchofdeathforums.com/smf/index.php/topic,70502.msg809347.html#msg809347) **Changelog**: * New Quest Form. * New QuestLog and QuestDialogue Form (still ugly, but works better). * Fixed the GoGather Task that allowed an exploit by dropping and taking the item. Also re-coded the entire task to make it work better and fix other minor bugs. * Fixed a GoTrain Task micro bug. * Fixed and re-coded the GoGive Task. * Fixed the GoKill bug that when a player kill another player the quests gets completed. * Fixed the QuestLog issue that counts only for the first connected player. * Fixed that when accepting a quest the questlog fails to update. * Remove the NPC BEHAVIOUR QUEST, now handled with the friendly ones. * Fixed a bug that wont allow to restart a quest if it was completed and then saved as repeatitive. * Added the "Give-on-Start" and "Remove-on-the-end" item stuff. * Fixed the GoSlay bug when counting enemies for quests. * Added EXP reward.
  16. :) Yep that's is the bug I think. On the other hand, PEOPLE OF ECLIPSE, i will have some spare time tomorrow morning so I will program and launch the next version! Stay tuned (?) EDIT: A little update, i've fixed almost everything that was reported, anyway there are some things that i'm not going to look now but I think its now working fine. I still have to do some work over here and then I'll upload the new version :)
  17. A paintball game! Looks good :D
  18. Wandering over the internet, i've found this, looks interesting http://rpgjs.com/?lang=en
  19. @Murdock: > The give item function is not working properly. If you have the item needed the quest will end as it should, but the item still remains in the inventory. > > Note: The bug-fix for items taken/given at "start" by Erwin does not fix this. Oh that, if I remember well it's not coded. PS: I'm starting in my spare time to try to reproduce the bugs and find solutions to them.
  20. @Kocho: > gracias por responder alatar… estoy usando tu sistema se quest en mi juego y va muy bien lo único que falla es el PvP ya que cuando matas a otro jugador se completan todas las quest > my game: https://sites.google.com/site/zeldaonlinehdh/ > > Sorry for spanish ^^ Sé que pasa eso, ni bien pueda y tengo tiempo veo si puedo arreglarlo. Pero hablá en inglés que esta no es la sección en español xD. @Erwin: > Why are you talking Spanish on a English board and why are you advertising for your game? > > Anyway, I've seen that this Quest system isn't really finished so I'll take another look in it soon and I'll post more bugfixes. ;) He's talking about the killing-player-error. I think he was talking in spanish because I was the mod of the spanish section (i'm from Argentina), maybe it's for that, I really don't know. On the other hand, yes, please report every single bug, and help for all your work on bug-fixing this by yourself Erwin :)
  21. @Ultrasnofire: > when ever someone finnishes a quest the item they are meant to give dosnt get taken away how could i fix it? It's not coded… yet. But check this if you want: http://www.touchofdeathforums.com/smf/index.php/topic,70502.msg786374.html#msg786374 @Kocho: > EPIC FAIL!!! > > when I kill another player my missions are completed > Please give me a solution Hmmm, I need to test that with another client when I get the time to work on this. @Murdock: > I have two problems Im hoping someone can help me with. When I change maps the quest log does not refresh properly to show the quests in queue. Hmmm, try with adding the a reference to the sub refreshquestlog in the sub handlemapdone. @Murdock: > And also, when completed the quests do not disappear from the quest log. Is it supposed to be that way? If so, how do i change it? Yes, it is supposed to be that way. If you want to remove them you need to find the RefreshQuestLog and remove the "Or QuestCompleted(i)". @Prince: > This quest system still need more bugs fix. Yep :( @Suppositoire: > How can I add experience to reward? :confused: Hmmm, forgot about that :embarrassed: err… you need to code it using the sub EndQuest.
  22. Err… yes I know, I have to fix this. Sorry people, i'm out of time right now. Will work on it soon, but I really don't know if I have the time to make a step-by-step tutorial or to give support daily on the release. @RobJanes: > This quest code looks like it was heavily modified from the old SamuMod I released a long time ago, a lot has been added, but some of the same commands and variable names such as 'CurrentCount' are the same. Either we share a brain wave, or I inspired someone to improve upon my old, horrid code. I haven't seen yours actually, but maybe we share a brain wave lol.
  23. Alatar

    [EO]Building System?

    Hmmm, do not use that.
  24. Thanks to both, I've added what I could find in the first post. I need to start with the debug as soon as possible xD
×
×
  • Create New...