المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : |►(●̮●)♔حصريا:عمل Quest♔(●̮●)◄|


™Dev Microsoft™
20-12-2013, 07:21 PM
http://i241.photobucket.com/albums/ff271/Ben-Tareqtito2/logo.jpg




Hello Silkroad4arab members

today i will tell you how to make your own quest



http://i.epvpimg.com/hyBtf.png



Program you will need to Work with script program




Download: Visual C++ 2008 Redistributable Package (x64) - Microsoft Download Center - Download Details (http://www.microsoft.com/en-us/download/details.aspx?id=15336)

Download: Visual C++ 2008 Redistributable Package (x86) - Microsoft Download Center - Download Details (http://www.microsoft.com/en-us/download/details.aspx?id=29)

Download: Microsoft .NET Framework 4 (Standalone Installer) - Microsoft Download Center - Download Details (http://www.microsoft.com/en-us/download/details.aspx?id=17718)

Notepad++ v6.1.8 - Current Version (http://notepad-plus-plus.org/download/v6.1.8.html)





If you already have This Program Good don't Download this





Download:


Silkroad lua scripts:
http://www.mediafire.com/download/wz5wncn34q45cjb/Silkroad_Scripts.rar



http://i.epvpimg.com/hyBtf.png





1st step - lua scripts





Ok, first of all you'll have to create the lua script file for your new quest. To do that you create a new lua file in the "Quest" directory. I call it "@SN_QNO_TEST_QUEST.lua", but you can call it however you want I think. (I don't know if the "@" is really necessary but I'll be using it anyway)


Now open the file with any text editor (I'm using notepad++) and enter the following






function QNO_TEST_QUEST() -- you should match this with your filename!
QUESTID = LuaGetQuestID("QNO_TEST_QUEST") -- IMPORTANT: must match with the name in your database
LuaSetStartCodition(2, QSC_QUEST, QSC_LEVEL, 1, 1)
QM_CONVERSATION = 1
LuaSetStartMethod(QM_CONVERSATION, 1, "NPC_CH_SMITH")
LuaInsertMissionOrCompleteNpc("NPC_CH_SMITH")
LuaQuestInsertNpc(1, "NPC_CH_SMITH")
LuaSetAchievementLimit(1)
LuaSetMissionDataSize(QUESTID, 1)
LuaSetMissionData_EX(QUESTID, 0, MISSION_TYPE_KILL_MONSTER, "SN_CON_QNO_TEST_QUEST", 1, "MOB_CH_MANGNYANG", 0, 20, 0, 1)
InsertQuestMenuStringList("NPC_CH_SMITH", 8, "BASIC_MENUSTRING_GREETING", "SN_NPC_CH_POTION_QS", "BASIC_MENUSTRING_REQUEST_ACCEPT_QUEST", "SN_TALK_QNO_TEST_QUEST_01", "BASIC_MENUSTRING_AT_ACCEPT", "SN_TALK_QNO_TEST_QUEST_02", "BASIC_MENUSTRING_AT_DENY", "SN_TALK_QNO_TEST_QUEST_03", "BASIC_MENUSTRING_NOT_ACHIEVED", "SN_TALK_QNO_TEST_QUEST_04", "BASIC_MENUSTRING_INVENTORY_FULL", "SN_TALK_QNO_TEST_QUEST_05", "BASIC_MENUSTRING_ACHIEVED", "SN_TALK_QNO_TEST_QUEST_06", "BASIC_MENUSTRING_ACHIEVED_NOW", "SN_TALK_QNO_TEST_QUEST_07")
LuaSetMissionCompleteNum(0)
PAY_ITEM_METHOD_EXACT = 1
LuaSetAchievedItem(1, 7200, 0, 0, 1, "ITEM_MALL_GLOBAL_CHATTING", 10)
LuaSetAchievedSkillPont(0)
end I'm not going to explain the whole lua code, just a few tips:


- LuaGetQuestID("QNO_TEST_QUEST") must match with the quest name in your database!


- LuaSetStartCodition(2, QSC_QUEST, QSC_LEVEL, 1, 1) describes that the quest with the questId "1" & char level "1" is required to start the


quest


- LuaSetAchievedItem(1, 7200, 0, 0, 1, "ITEM_MALL_GLOBAL_CHATTING", 10) selfexplaining, if you finish the quest you'll get 7200 exp & 10 global chattings





Just look around in other quest files and it'll become clear.





Now save the file and open "QuestList.lua"


Add a new line to the end of the file with the following





LuaInsertQuest(TYPE_ID, "SN_QNO_TEST_QUEST.lua", "QNO_TEST_QUEST")





http://www13.0zz0.com/2012/09/27/04/465857341.png





The second & third parameter should of course match the filename & the function name of your quest





Now, if you are done with that, execute make_questlist.bat and make_quest.bat. This should create two new files, QuestList.sct and Quest.sct. Copy them to YOURSERVER\Script\VIETNAM or YOURSERVER\Script\THAILAND if you are using black rogue files. (make sure you made a backup of the old files)


http://i.epvpimg.com/hyBtf.png



2nd step - database





Insert the following lines to the shard database:


_RefQuest
1 816 QNO_TEST_QUEST 0 <??>???? ?? SN_QNO_TEST_QUEST SN_PAY_QNO_TEST_QUEST xxx SN_PAYCON_QNO_TEST_QUEST SN_NN_QNO_TEST_QUEST SN_NC_QNO_TEST_QUESTQNO_TEST_QUEST should match your quest name





_RefQuestReward
1 [ID] QNO_TEST_QUEST 1 1 1 0 0 0 0 0 7200 0 0 0 xxx 0 0 0 0 0 xxx 0 xxx 0 xxxID of _RefQuest table





_RefQuestRewardItems (only if item reward, in my case the reward will be 10 global chattings)


1 [ID] QNO_TEST_QUEST 0 ITEM_MALL_GLOBAL_CHATTING xxx 0 10 xxx 0 xxx 0 xxx






ID of _RefQuest table


NOTE: If you want to reward multiple items then you'll also have to add multiple lines to the table. (of course, you'll have to modify the lua script too)


Ok, now you are done with the database! If you now start your gameserver you'll hopefully see a new quest initialization!


http://www6.0zz0.com/2012/09/27/04/299368006.png

If you cannot see that, or it shows quest initialize[0][questname], then you have obviously did something wrong









http://i.epvpimg.com/hyBtf.png



3rd step - client





You have completely added a new quest now! Wait... but only server sided, you'll have to add the quest in the client too. I'm going to show you how to do that. (because I'm great, haha)


Anyways, just follow me, I'm not going to explain everything.





You have to insert a couple of lines. So let's start with the file:


(by the way all files are located at media\server_dep\silkroad\textdata)





questdata.txt
1 [ID] QNO_TEST_QUEST 0 <??>???? ?? SN_QNO_TEST_QUEST SN_PAY_QNO_TEST_QUEST xxx SN_PAYCON_QNO_TEST_QUEST SN_NN_QNO_TEST_QUEST SN_NC_TEST_QUESTID of _RefQuest table





Here too, match QNO_TEST_QUEST with your quest name!





questcontentsdata.txt
QNO_TEST_QUEST 0 0 xxx 1 SN_CON_QNO_TEST_QUEST xxx xxx xxx xxx xxx xxx xxx 0 xxx xxx 0refqusetreward.txt


[ID] QNO_TEST_QUEST 1 1 1 0 0 0 0 0 0 7200 0 0 0 xxx 0 0 0 0 xxx 0 xxx 0 xxx[ID] column of _RefQuest table


Well, basically it's the same as _RefQuestReward table in your database.





refquestrewarditems.txt


[ID] QNO_TEST_QUEST 0 ITEM_MALL_GLOBAL_CHATTING xxx xxx 0 10 0 xxx 0 xxx
[ID] column of _RefQuest table


It's the same as _RefQuestRewardItems in your database.


Remember, multiple item rewards = multiple lines!


See the number "10"? This is the amount of global chattings





textquest_queststring.txt
1 SN_TALK_QNO_TEST_QUEST_01 0 0 0 0 0 0 Kill 15 mangyangs lols. 0 0 0 0 0 0 0 1 SN_TALK_QNO_TEST_QUEST_02 0 0 0 0 0 0 Good. I knew that you would agree to do this. I'll reward you more than enough, of course. 0 0 0 0 0 0 0 1 SN_TALK_QNO_TEST_QUEST_03 0 0 0 0 0 0 Hmm. I've misjudged you. 0 0 0 0 0 0 0 1 SN_TALK_QNO_TEST_QUEST_04 0 0 0 0 0 0 Please kill a few more mangyangs please. 0 0 0 0 0 0 0 1 SN_TALK_QNO_TEST_QUEST_05 0 0 0 0 0 0 I want to reward you but your inventory is full. Please dispose of some unneccessary items first. 0 0 0 0 0 0 0 1 SN_TALK_QNO_TEST_QUEST_06 0 0 0 0 0 0 Thank you. Now I can sleep well. This is your reward. Take this. 0 0 0 0 0 0 0 1 SN_TALK_QNO_TEST_QUEST_07 0 0 0 0 0 0 The hunting of Mangyangs is completed. Go and report to Chulsan. 0 0 0 0 0 0 0These are the different tabs in the NPC, write whatever you want.





textquest_speech&name.txt
1 SN_PAY_QNO_TEST_QUEST 0 0 0 0 0 0 Test quest 0 0 0 0 0 0 0 1 SN_CON_QNO_TEST_QUEST 0 0 0 0 0 0 Hunt 20 Mangyang (%d) 0 0 0 0 0 0 0



Your quest name and the task.


http://www13.0zz0.com/2012/09/27/04/275011627.png

Done


!








http://i.epvpimg.com/hyBtf.png



Credits to : madengo (http://forum.ragezone.com/members/1333430037.html) & startti