![]() |
|►(●̮●)♔حصريا:عمل Quest♔(●̮●)◄|
Hello Silkroad4arab members today i will tell you how to make your own quest Program you will need to Work with script program If you already have This Program Good don't Download this Download: Silkroad lua scripts: [SPOILER]كود PHP:
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 كود PHP:
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 كود PHP:
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) 2nd step - database Insert the following lines to the shard database: _RefQuest كود PHP:
QNO_TEST_QUEST should match your quest name _RefQuestReward كود PHP:
ID of _RefQuest table _RefQuestRewardItems (only if item reward, in my case the reward will be 10 global chattings) كود PHP:
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! If you cannot see that, or it shows quest initialize[0][questname], then you have obviously did something wrong 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 كود PHP:
ID of _RefQuest table Here too, match QNO_TEST_QUEST with your quest name! questcontentsdata.txt كود PHP:
refqusetreward.txt كود PHP:
[ID] column of _RefQuest table Well, basically it's the same as _RefQuestReward table in your database. refquestrewarditems.txt كود PHP:
[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 كود PHP:
These are the different tabs in the NPC, write whatever you want. textquest_speech&name.txt كود PHP:
Your quest name and the task. Done ! Credits to : madengo & startti |
| الساعة الآن 08:43 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions, Inc.