This is for LOTF.
I want to show you how to creat your own basic quest.
Lets look on the steps we are going through:
1. Making the steps for the quests
2. Making it save to database everytime go to next step
3. Making the npc's for the quest
PLEASE READ EVERYTHING I HAVE WRITTEN CAUSE IS IMPORTANT IF YOU DONT WANT ERROR
Well there is those 3 steps.
Thats much huh? thats right.
Is not that hard to creat a quest.
Actually it is, but for basic noob quest is not.
Well lets go to the first step.
Step1: Making the quest steps
Open your character.cs
First you have to find this:
Code:
public byte Stamina = 0;
Lets make an easy quest and call it Test.
Okay add under the steps for quest.
Here is an example:
Code:
public uint QuestTestStart = 0; public uint QuestTestGetReward = 0; public uint QuestTestEnd = 0;
clear step.
Search for:
Code:
public void Save()
It have to be like this.
The redcoloured spots are where you put the steps name.
Code:
public void [COLOR="Red"]QuestTestStart[/COLOR]() { LastSave = DateTime.Now; if (MyClient.There) if (MyClient.Online) { DataBase.Save[COLOR="Red"]QuestTestStart[/COLOR](this); DataBase.SaveChar(this); } } public void [COLOR="Red"]QuestTestGetReward[/COLOR]() { LastSave = DateTime.Now; if (MyClient.There) if (MyClient.Online) { DataBase.Save[COLOR="Red"]QuestTestGetReward[/COLOR](this); DataBase.SaveChar(this); } } public void [COLOR="Red"]QuestTestEnd[/COLOR]() { LastSave = DateTime.Now; if (MyClient.There) if (MyClient.Online) { DataBase.Save[COLOR="Red"]QuestTestGetEnd[/COLOR](this); DataBase.SaveChar(this); } }
Now we need to make it save to database.
Open database.cs and search for:
Code:
public static void SaveChar(Character Charr)
If you know what i mean.
Well do it like this.
You have to put it over.
The red parts is for changing the name of quest step.
Why is it needed that it save the certain steps, well thats
because then you cant go back in the quest and do the same step again and
also you cant do the quest mroe then once.
Code:
public static void [COLOR="Red"]SaveQuestTestStart[/COLOR](Character Charr) { MySqlCommand Command = null; Command = new MySqlCommand("UPDATE `Characters` SET `[COLOR="Red"]QuestTestStart[/COLOR]` = '" + Charr.[COLOR="Red"]QuestTestStart[/COLOR] + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection); Command.ExecuteNonQuery(); } } public static void [COLOR="Red"]SaveQuestTestGetReward[/COLOR](Character Charr) { MySqlCommand Command = null; Command = new MySqlCommand("UPDATE `Characters` SET `[COLOR="Red"]QuestTestGetReward[/COLOR]` = '" + Charr.[COLOR="Red"]QuestTestGetReward[/COLOR] + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection); Command.ExecuteNonQuery(); } } public static void [COLOR="Red"]SaveQuestTestEnd[/COLOR](Character Charr) { MySqlCommand Command = null; Command = new MySqlCommand("UPDATE `Characters` SET `[COLOR="Red"]QuestTestEnd[/COLOR]` = '" + Charr.[COLOR="Red"]QuestTestEnd[/COLOR] + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection); Command.ExecuteNonQuery(); } }
Code:
DataRow DR = DSet.Tables["Character"].Rows[0];
You have to make it like this:
The red spots are for changing the steps name.
Code:
Charr.[COLOR="Red"]QuestTestStart[/COLOR] = (uint)DR["Save[COLOR="Red"]QuestTestStart[/COLOR]"]; Charr.[COLOR="Red"]QuestTestGetReward[/COLOR] = (uint)DR["Save[COLOR="Red"]QuestTestGetReward[/COLOR]"]; Charr.[COLOR="Red"]QuestTestEnd[/COLOR] = (uint)DR["Save[COLOR="Red"]QuestTestEnd[/COLOR]"];
Now we need to make it ingame.
What will it say?
We have to make the NPC.
Wow already step3.
Yeah you right, is done quickly right?
Step3: The NPC's
This is a quiet hard and can take long time to make it work.
But lets take it 1 step by 1 step, so
all can understand.
First you have to choose how many npc's to make.
For every NPC you will need to have 1 step.
More info about that look my release for the Quest:
BraveHeart, because im using 4 NPC's in that.
Well in this test quest i only have choosed to make 2 NPC, so
here we go.
First we have to make the steps for it.
so it says different things all after how long in quest you are.
You should set it up like this:
NPC1:
Code:
if (CurrentNPC == 25706)//Quest NPC1 { if (MyChar.QuestTestGetReward == 1 && MyChar.InventoryContains(721165, 1))//For getting reward, when have the item { { MyChar.RemoveItem(MyChar.ItemNext(721165));//Removing the needed item SendPacket(General.MyPackets.NPCSay("What ever it says, when give the item.")); SendPacket(General.MyPackets.NPCLink("Get Reward.", 1)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } } else if (MyChar.QuestTestEnd == 1)//If have cleard quest { SendPacket(General.MyPackets.NPCSay("You have already cleard the quest, you can't clear it 2 times.")); SendPacket(General.MyPackets.NPCLink("I see.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } } else { if (MyChar.QuestTestStart == 0)//If have not started the quest { SendPacket(General.MyPackets.NPCSay("What ever the NPC says to tell what the quest is about.")); SendPacket(General.MyPackets.NPCLink("Accepting quest.", 3)); SendPacket(General.MyPackets.NPCLink("Not Accepting quest.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } else if (MyChar.QuestTestStart == 1)//When quest is started { SendPacket(General.MyPackets.NPCSay("What ever the NPC says if you ahve started the quest.")); SendPacket(General.MyPackets.NPCLink("Accepting to go clear it.", 255)); SendPacket(General.MyPackets.NPCLink("Trashing task.", 2)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } }
Code:
if (CurrentNPC == 25706)//Quest NPC1 { if (Control == 1)//For getting reward { if (MyChar.QuestTestGetReward == 1) { MyChar.QuestTestEnd += 1; MyChar.QuestGetReward += 1; MyChar.AddItem("720028-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));//The reward MyChar.SaveQuestTestEnd(); MyChar.SaveQuestTestGetReward(); } } if (Control == 2)//For trashing quest { if (MyChar.QuestTestEnd == 1) { SendPacket(General.MyPackets.NPCSay("What ever it says when trying thrash a cleard quest.")); SendPacket(General.MyPackets.NPCLink("I see.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } } else { MyChar.QuestTestGetReward -= 1; MyChar.QuestTestStart -= 1; MyChar.SaveQuestTestGetReward(); MyChar.SaveQuestTestStart() } if (Control == 3)//For accepting the quest { MyChar.QuestTestStart += 1; MyChar.SaveQuestTestStart(); SendPacket(General.MyPackets.NPCSay("What ever it says you have to do.")); SendPacket(General.MyPackets.NPCLink("OK.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } }
This NPC isn't as big as the other 1.
The next NPC only do this:
•Taking item required
•Giving another item taht you have to bring to NPC1
•Saving your quest to next step
Thats not much, right?
Okay lets go.
Here is how you can make it:
Code:
if (CurrentNPC == 25707)//Quest NPC2 { if (MyChar.QuestTestStart == 1) { { if (MyChar.InventoryContains(723234, 1))//The item that is required { MyChar.RemoveItem(MyChar.ItemNext(723234));//Removing the item SendPacket(General.MyPackets.NPCSay("What ever it says when you give the item.")); SendPacket(General.MyPackets.NPCLink("You answer.", 1)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } } } else//If dont have the item or dont have started the quest { SendPacket(General.MyPackets.NPCSay("What ever it says if you dont have the item or havent started the quest.")); SendPacket(General.MyPackets.NPCLink("I see.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } }
Code:
if (CurrentNPC == 25707)//Quest NPC2 { if (Control == 1) { MyChar.QuestTestGetReward += 1; MyChar.QuestTestGetReward(); MyChar.AddItem("721165-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));//The item to give NPC1 SendPacket(General.MyPackets.NPCSay("What ever it says when you have to give the new item to the NPC1.")); SendPacket(General.MyPackets.NPCLink("Okay.", 255)); SendPacket(General.MyPackets.NPCSetFace(30)); SendPacket(General.MyPackets.NPCFinish()); } }
You have now made your own quest, how cool is that?
That is pretty cool huh?
For more advanced quest you have to know some C#, well
to know some more you should read hybrids guide for programming and also what
you should know before making a private server.
both have links here:
PRESS THANKS IF YOU LIKE IT, I KNOW YOU LIKE IT CAUSE IM SEXY!!
THERE SHOULDNT BE ANY PROBLEMS IF YOU AHVE FOLLOWED THE GUIDE.
THIS IS DIFFENTLY A 5* GUIDE