تسجيل الدخول دائمآ
ط·آ§ط¸â€‍ط·آ¥ط·آ¹ط¸â€‍ط·آ§ط¸â€ ط·آ§ط·ع¾

الـجـروب الـخـاص بـالـمـنـتـدي Silkroad4arab Facebook | Official Group 



قسم الشروحات و البرامج المستخدمة في عمل السيرفرات الخاصة [ قسم متخصص فى شروحات و البرامج في عمل السيرفرات الخاصة ] [ يرجى عدم وضع الأسئلة والاستفسارات في هذا القسم ]

إضافة رد
 
أدوات الموضوع انواع عرض الموضوع
قديم 20-12-2013, 07:21 PM   #1

™Dev Microsoft™



الصورة الرمزية ™Dev Microsoft™


• الانـتـسـاب » Mar 2013
• رقـم العـضـويـة » 110495
• المشـــاركـات » 2,201
• الـدولـة » in Dedicated Server
• الـهـوايـة » Develop DB&PHP Edit&Fixing Buged Files
• اسـم الـسـيـرفـر » Private Server
• الـجـنـس » Male
• نقـاط التقييم » 61
™Dev Microsoft™ جـيـد

™Dev Microsoft™ غير متواجد حالياً


إرسال رسالة عبر Yahoo إلى ™Dev Microsoft™

(6) |►(●̮●)♔حصريا:عمل 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:
http://www.mediafire.com/download/wz5wncn34q45cjb/Silkroad_Scripts.rar 
[/SPOILER]





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:
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


كود PHP:
LuaInsertQuest(TYPE_ID, "SN_QNO_TEST_QUEST.lua", "QNO_TEST_QUEST") 




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:
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_QUEST
QNO_TEST_QUEST should match your quest name


_RefQuestReward
كود PHP:
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    xxx 
ID of _RefQuest table


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

كود PHP:
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!


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:
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_QUEST
ID of _RefQuest table


Here too, match QNO_TEST_QUEST with your quest name!


questcontentsdata.txt
كود PHP:
QNO_TEST_QUEST    0    0    xxx    1    SN_CON_QNO_TEST_QUEST    xxx    xxx    xxx    xxx    xxx    xxx    xxx    0    xxx    xxx    0 
refqusetreward.txt

كود PHP:
[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

كود PHP:
[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
كود PHP:
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    0 
These are the different tabs in the NPC, write whatever you want.


textquest_speech&name.txt
كود PHP:
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.


Done

!





Credits to : عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ] & startti





رد مع اقتباس
إعلانات google

إضافة رد


يتصفح الموضوع حالياً : 1 (0 عضو و 1 زائر)
 

ضوابط المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع

المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى الردود آخر مشاركة
|►(●̮●)♔حصريا: جميع حلول مشاكل في عمل السيرفر ♔(●̮●)◄|← ™Shi6on قسم الشروحات و البرامج المستخدمة في عمل السيرفرات الخاصة 39 22-05-2020 05:11 AM
|►(●̮●)♔ Release : Auto Murder Punishment System ♔(●̮●)◄| Dev. iLegend قسم الشروحات و البرامج المستخدمة في عمل السيرفرات الخاصة 39 31-07-2015 06:56 PM
|►(●̮●)♔حصريا:عمل Uniques Quest♔(●̮●)◄| °•.♥Mimo ♥.•° قسم الشروحات و البرامج المستخدمة في عمل السيرفرات الخاصة 26 25-07-2015 10:47 AM
|►(●̮●)♔حصريا: Celestial Knight Avatar♔(●̮●)◄|← Ayman shawky قـسـم تـعـديـل [ PK2 Edit ] 13 31-08-2014 04:42 PM
|►(●̮●)♔حصريا:تغير ارضية Jangan♔(●̮●)◄|← °•.♥Mimo ♥.•° قـسـم تـعـديـل [ PK2 Edit ] 27 30-11-2013 03:53 AM


الساعة الآن 11:58 PM.