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.