[REQUEST] CO Quests system base (C#)

11/01/2011 00:13 hyperco#1
Hello ElitePVPers, how long huh?

well i'm making a research to start developing quests sytem on 5525 source,

im an amateur on C# and can't make it without help (not yet)..

well, i also got the packet id, its 1135 for Quest board and 1134 when you are about to acept...


if anyone help me with an base code, in almost 1month i could release it so

i will be w8ing...




Thanks for reading...
11/01/2011 01:32 XMasterrrr#2
sorry for interrupting your thread but is there a release source for patch 5525? if there is one please help me by posting the link of it :) sorry again...
11/01/2011 07:03 .Kinshi#3
Hi, I'm an amateur and know nothing about the programming language, or programming in general. But I want to jump right in and code things that require knowledge I don't have! YES! Sounds like a super great plan!
11/01/2011 16:02 hyperco#4
yeah, i need just a base code, after it i can do it by myself (I think)...


@about the 5225 source, yes, there is a release, but I can not post it here, because it would be leeching it from another forum

sorry for my bad english...
11/01/2011 22:17 { Angelius }#5
i wold say .... start with something easier first and then when you learn the basic things move on and code such systems .

i cant really help you by posting the actual codes and shit but...

a mini guide:
go to the client folder/ini/Questinfo.ini
the quests info should be all listed in that file .
and to do: first thing you need to load and save some information to your server from that file such as mission id/level required/job required/etc

so....

Quote:
public class Quest
{
public uint MissionID, etc,etc;
}
a struct or a class it doesent really matter its just to make it easier to pull the information we need.

and then somewhere else in the project to save the Quests after you load them
Quote:
Dictionary<uint, Quest> Quests = new Dictionary<uint, Quest>();
and when you lead the quests you do something like

Quote:
while(reading the ini file)
{
Quest Q = new Quest()
Q.MissionID = Reader.readwhatever;
//etc etc
//add the Quests to the list
Quests.add(Q.MissionID, Q);
}
once you got that done you can pull the Quest by its id so..

Quote:
Quest NewQuest = Quests[the quest id];
and we need that information cus most of these Quests have some kind of a sequence (you cant do the Y quest before you do the X quest) or (you cant do the quest before a certain level) etc

so every player should have a list to save the accepted quests and a uint or ushort value that stands for a temporary quest id.

IE:
Quote:
public uint TempMissionID = 0;
List<uint> acceptedQuests = new List<uint>();
the TempMissionID well be used in case you clicked the accept button to start path finding once you reach the npc if the TempMissionID > 0 and and the mission has been coded already the npc well start talking and hell apply the mission for you adding it to the (acceptedQuests) to pick it up from where you left it. (Where you left the quest depends on the quest id)

some quests is been made for a certain class (warrior only/archers only/etc) and its about 99 quest for each class so...

you need to split them and give each class its own list of quests on char creation.

for me its something like...

Quote:
public int[] TrojansStartUpMissions = new int[99] { ID1, ID2, ID3, ID4, etc};
the (TrojansStartUpMissions) can be used to identify the valid quests for the Trojan class and to do the quests system in a back words way

Example: on start up (class Trojan)

Quote:
Client.AvailableMissions = new TrojansStartUpMissions();
that (AvailableMissions) is saved in the database and every time the player finishes a quest remove it.

you can use the (AvailableMissions) to check if the player can do a certain quest or not + split the quests on login to show the client what quests he finished and whats left and its better to delete every quest thats been finished from the data base than adding it to the data base .


lets make it a little bit easier :P

lets say you accepted a mission and you are now path finding (case 1134)
once you click the accept button the client spits a 1134 packet to the server telling what mission you have accepted .

and so far all we are gonna do it (TempMissionID = missionID from the client)

ok so when you reach the target npc (Path finding system well spit another packet with the npc id to the server to open the dialog 0).

dialog 0:

Quote:
if (Client.AvailableMissions.contains(the mission id))
{
pull the Quest by its id and check if its a valid one .
start the quest and add it to the accepted missions
}
else
{
send the normal dialog 0 for that npc
}
well i think thats enough for now tho. and i dident think its gonna take that much of explanation . so if you are (STILL) interested and (what i just typed meant something to you/helped you) lemme know and i'll see what i can do .

PS. i have them all coded.

good luck.
11/01/2011 22:25 diedwarrior#6
Angelius, the girl in the pic in your signature looks so cute omg.....
Sorry for the off-topic but i just had to say it...
11/03/2011 04:26 hyperco#7
hey man i got your point, i will start to code my system tmorrow, i just ask now what about the reward packet, i mean when i finishish the quest what packet i got from the client?

and how i make to check if the player had done the quest ??

(I still have so much to learn.. but i want to goo farr))


if you can post here a suggestion code i will thanks you forever...
11/03/2011 05:06 pro4never#8
You write a database to keep track of quest completion and use that for your server.

Then when they login you send all active quests (accepted, available, completed etc) which fills in the information client side
11/03/2011 18:09 hyperco#9
i think i got it too, i will keep trying, thanks guys!

sorry for the double post..


but how i make the client show the completed quests?
i tried to do it but client doesn't....
11/03/2011 22:43 { Angelius }#10
Quote:
Originally Posted by hyperco View Post
i think i got it too, i will keep trying, thanks guys!

sorry for the double post..


but how i make the client show the completed quests?
i tried to do it but client doesn't....
you respond back with the same packets (1134/1135) you just have to find the right sub types .... you have to use a packet sniffer and if you dont have one then Trial and error.

one of the login sequence packets is 1134 (2 large ones that contains all missions ids for a certain class) those you should edit them adding the right values for each quest (accepted, available, etc) and send them back

good luck.
11/03/2011 23:19 hyperco#11
well i was trying to make to send a message showing the quest id i have acepted when server send the 1134 packet, but im fail, because its always [1].

i used this code...

Code:
case 1134:
{
client.Send(new Message("AceptedQuestID: " + packet[4], System.Drawing.Color.White, Message.Whisper));
}
i think that the way is trying and failing...

if you angelius could help me finding the right packet subtype for quests, i thank you..

PS.: i dont know how to packet sniff on 5525 version...



@Edit


Can you show me an exemple of Subtype?
11/05/2011 22:27 hyperco#12
#closed