• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

How To Creat your own Quest

Newbie Spellweaver
Joined
Sep 27, 2011
Messages
26
Reaction score
3
So i managed to make a quest work as it should but something still bugs me ...

The part of .lua quest file related to text string looks like this:

Code:
  InsertQuestMenuStringList("NPC_CH_SMITH", 8,  "BASIC_MENUSTRING_GREETING", "SN_NPC_CH_SMITH_QS",  "BASIC_MENUSTRING_REQUEST_ACCEPT_QUEST", "SN_TALK_QNO_DAILY_TEST_1_01",  "BASIC_MENUSTRING_AT_ACCEPT", "SN_TALK_QNO_DAILY_TEST_1_02",  "BASIC_MENUSTRING_AT_DENY", "SN_TALK_QNO_DAILY_TEST_1_03",  "BASIC_MENUSTRING_NOT_ACHIEVED", "SN_TALK_QNO_DAILY_TEST_1_04",  "BASIC_MENUSTRING_ACHIEVED", "SN_TALK_QNO_DAILY_TEST_1_05",  "BASIC_MENUSTRING_ACHIEVED_NOW", "SN_TALK_QNO_DAILY_TEST_1_06",  "BASIC_MENUSTRING_COUNT_LIMIT", "SN_TALK_QNO_DAILY_TEST_1_07")

textquest_queststring.txt part looks like this
Code:
1    SN_TALK_QNO_DAILY_TEST_1_01    0    0    0    0    0    0    Basic accept quest.    0    0    0    0    0    0    0    
1    SN_TALK_QNO_DAILY_TEST_1_02    0    0    0    0    0    0    At accept quest.    0    0    0    0    0    0    0    
1    SN_TALK_QNO_DAILY_TEST_1_03    0    0    0    0    0    0    At deny quest.    0    0    0    0    0    0    0    
1    SN_TALK_QNO_DAILY_TEST_1_04    0    0    0    0    0    0    Not achieved.    0    0    0    0    0    0    0    
1    SN_TALK_QNO_DAILY_TEST_1_05    0    0    0    0    0    0     Achieved finished quest.    0    0    0    0    0    0    0    
1    SN_TALK_QNO_DAILY_TEST_1_06    0    0    0    0    0    0    Achieved now quest.    0    0    0    0    0    0    0    
1    SN_TALK_QNO_DAILY_TEST_1_07    0    0    0    0    0    0    Count limit quest.    0    0    0    0    0    0    0

So, everything else works as it should but this part of the Quest text string, the message that should be in the quest description, etc, etc. it doesn't show up.
The accept, deny, ok, cancel buttons appear, there are no 0's also there are no errors.
When you press Q, the quest shows us perfectly, the count works, the title and so on.

Anyone got any idea how can i make this part of text string work ? Or, what i'm doing wrong ? o_O
naaxt420

Your strings are fine, I think your problem is that your text editor is using the Unix Format for your EOL settings. You should keep the original sro file settings on your media's .txt files (UCS-2 Little Endian under Windows Format) in order to avoid anoying problems like the one you have.

For example, if you are using Notepad++ you can go to (View -> Show Simbol -> Show All Characters) and you can start to see some simbols at every End Of Line of your .txt

For your lines, you should see the Unix EOL format ("LF")
For the rest of the lines, you should see the Windows EOL format ("CR LF")

So you have to convert your EOL format into Windows EOL format.
On Notepad++, just go to (Edit -> EOL Conversion -> Convert to Windows Format) to fix your EOL's

And that is all, if you success fixing your EOL your strings will appear ingame.

-- Update

Take care when converting the EOL of (textuisystem.txt). Your launcher wont start if you change all the EOL of the file. When working with the (textuisystem.txt) I suggest you to edit line by line.
 
Last edited:
Newbie Spellweaver
Joined
Sep 20, 2014
Messages
27
Reaction score
2
With some help i figured out the CRLF at the end of the lines.
It's fixed now.

Got any ideas why, at the end of the quest when i should receive the reward there are no "squares" showing my items, but, after i click to receive the items i do receive it.
It's just a blank place where there should be the squared that holds the items.

Thank you for your reply valcro.
 
Newbie Spellweaver
Joined
Sep 27, 2011
Messages
26
Reaction score
3
With some help i figured out the CRLF at the end of the lines.
It's fixed now.

Got any ideas why, at the end of the quest when i should receive the reward there are no "squares" showing my items, but, after i click to receive the items i do receive it.
It's just a blank place where there should be the squared that holds the items.

Thank you for your reply valcro.

I never had a problem like that, maybe you forgot to add the item reward in your Media or at the Lua Script?

Here you got an example of a quest that gives you a D1 Shield SUN as reward:

Quest.sct
Code:
function QNO_TO_SHIELDBORN_1()
  QUESTID = LuaGetQuestID("QNO_TO_SHIELDBORN_1")
  LuaSetStartCodition(2, QSC_QUEST, QSC_LEVEL, 1, 1)
  QM_CONVERSATION = 1
  LuaSetStartMethod(QM_CONVERSATION, 1, "NPC_SHIELDBORN")
  LuaInsertMissionOrCompleteNpc("NPC_SHIELDBORN")
  LuaQuestInsertNpc(1, "NPC_SHIELDBORN")
  LuaSetAchievementLimit(1)
  LuaSetMissionDataSize(QUESTID, 1)
  LuaSetMissionData_EX(QUESTID, 0, MISSION_TYPE_KILL_MONSTER, "SN_CON_QNO_TO_SHIELDBORN_1", 1, "MOB_CH_MANGNYANG", 0, 30, 0, 1)
  InsertQuestMenuStringList("NPC_SHIELDBORN", 8, "BASIC_MENUSTRING_GREETING", "SN_NPC_CH_POTION_QS", "BASIC_MENUSTRING_REQUEST_ACCEPT_QUEST", "SN_TALK_QNO_TO_SHIELDBORN_1_01", "BASIC_MENUSTRING_AT_ACCEPT", "SN_TALK_QNO_TO_SHIELDBORN_1_02", "BASIC_MENUSTRING_AT_DENY", "SN_TALK_QNO_TO_SHIELDBORN_1_03", "BASIC_MENUSTRING_NOT_ACHIEVED", "SN_TALK_QNO_TO_SHIELDBORN_1_04", "BASIC_MENUSTRING_INVENTORY_FULL", "SN_TALK_QNO_TO_SHIELDBORN_1_05", "BASIC_MENUSTRING_ACHIEVED", "SN_TALK_QNO_TO_SHIELDBORN_1_06", "BASIC_MENUSTRING_ACHIEVED_NOW", "SN_TALK_QNO_TO_SHIELDBORN_1_07")
  LuaSetMissionCompleteNum(0)
  PAY_ITEM_METHOD_EXACT = 1
  [COLOR="#FF0000"][B]LuaSetAchievedItem(1, 375, 0, 0, 1, "ITEM_CH_SHIELD_01_C_RARE", 1)[/B][/COLOR]
  LuaSetAchievedSkillPont(1500)
end

DB -> RefQuestRewardItem
Code:
1	1042	QNO_TO_SHIELDBORN_1	0	ITEM_CH_SHIELD_01_C_RARE	xxx	0	1	xxx	0	xxx	0	xxx

MEDIA -> refquestrewarditems.txt
Code:
1042	QNO_TO_SHIELDBORN_1	0	ITEM_CH_SHIELD_01_C_RARE	xxx	xxx	0	1	0	xxx	0	xxx
 
Newbie Spellweaver
Joined
Sep 20, 2014
Messages
27
Reaction score
2
Thank you for your reply valcro.
Now, i have another problem it seems that i cannot get the reward from this quests no matter what i do in the code.

The code, now a little bit messed up cuz i tried everything i found in the files to fix it somehow looks like this:

PHP:
function QNO_LV_WEAPON_CH_1()
  QUESTID = LuaGetQuestID("QNO_LV_WEAPON_CH_1")
  LuaSetStartCodition(1, QSC_LEVEL, 1)
  QM_CONVERSATION = 1
  LuaSetStartMethod(QM_CONVERSATION, 3, "NPC_LEVEL_SUPPLIES_GOODS_CH", "NPC_LEVEL_SUPPLIES_GOODS_WC", "NPC_LEVEL_SUPPLIES_GOODS_KT")
  LuaQuestInsertNpc(3, "NPC_LEVEL_SUPPLIES_GOODS_CH", "NPC_LEVEL_SUPPLIES_GOODS_WC" , "NPC_LEVEL_SUPPLIES_GOODS_KT")
  LuaInsertMissionCompleteNpcList(3, "NPC_LEVEL_SUPPLIES_GOODS_CH", "NPC_LEVEL_SUPPLIES_GOODS_WC", "NPC_LEVEL_SUPPLIES_GOODS_KT")
  LuaSetAchievementLimit(1)
  LuaSetDivideType(5)
  LuaSetMissionDataSize(QUESTID, 1)
  LuaSetDialLogMissionData(QUESTID, 0, MISSION_TYPE_DIALOG, "SN_CON_QNO_LV_WEAPON_CH_1_1")
  InsertQuestMenuStringList("NPC_LEVEL_SUPPLIES_GOODS_CH", 3, "BASIC_MENUSTRING_ACHIEVED_NOW", "SN_TALK_QNO_LV_WEAPON_CH_1_05", "BASIC_MENUSTRING_INVENTORY_FULL", "SN_TALK_QNO_LV_WEAPON_CH_1_04", "BASIC_MENUSTRING_ACHIEVED", "SN_TALK_QNO_LV_WEAPON_CH_1_03")
  InsertQuestMenuStringList("NPC_LEVEL_SUPPLIES_GOODS_WC", 3, "BASIC_MENUSTRING_ACHIEVED_NOW", "SN_TALK_QNO_LV_WEAPON_CH_1_05", "BASIC_MENUSTRING_INVENTORY_FULL", "SN_TALK_QNO_LV_WEAPON_CH_1_04", "BASIC_MENUSTRING_ACHIEVED", "SN_TALK_QNO_LV_WEAPON_CH_1_03")
  InsertQuestMenuStringList("NPC_LEVEL_SUPPLIES_GOODS_KT", 3, "BASIC_MENUSTRING_ACHIEVED_NOW", "SN_TALK_QNO_LV_WEAPON_CH_1_05", "BASIC_MENUSTRING_INVENTORY_FULL", "SN_TALK_QNO_LV_WEAPON_CH_1_04", "BASIC_MENUSTRING_ACHIEVED", "SN_TALK_QNO_LV_WEAPON_CH_1_03")
  LuaSetMissionCompleteNum(0)
end

Everything is fine in the database / client files.
The unknown error is nowhere to find.



This quest is added in DB to start at lvl 1 ( when u create a new char ).
Is it wrong because it's set as a Dialog quest ? Is there any other type of quest for this ... ?
 
Last edited:
Newbie Spellweaver
Joined
Sep 27, 2011
Messages
26
Reaction score
3
Thank you for your reply valcro.
Now, i have another problem it seems that i cannot get the reward from this quests no matter what i do in the code.

The code, now a little bit messed up cuz i tried everything i found in the files to fix it somehow looks like this:

PHP:
function QNO_LV_WEAPON_CH_1()
  QUESTID = LuaGetQuestID("QNO_LV_WEAPON_CH_1")
  LuaSetStartCodition(1, QSC_LEVEL, 1)
  QM_CONVERSATION = 1
  LuaSetStartMethod(QM_CONVERSATION, 3, "NPC_LEVEL_SUPPLIES_GOODS_CH", "NPC_LEVEL_SUPPLIES_GOODS_WC", "NPC_LEVEL_SUPPLIES_GOODS_KT")
  LuaQuestInsertNpc(3, "NPC_LEVEL_SUPPLIES_GOODS_CH", "NPC_LEVEL_SUPPLIES_GOODS_WC" , "NPC_LEVEL_SUPPLIES_GOODS_KT")
  LuaInsertMissionCompleteNpcList(3, "NPC_LEVEL_SUPPLIES_GOODS_CH", "NPC_LEVEL_SUPPLIES_GOODS_WC", "NPC_LEVEL_SUPPLIES_GOODS_KT")
  LuaSetAchievementLimit(1)
  LuaSetDivideType(5)
  LuaSetMissionDataSize(QUESTID, 1)
  LuaSetDialLogMissionData(QUESTID, 0, MISSION_TYPE_DIALOG, "SN_CON_QNO_LV_WEAPON_CH_1_1")
  InsertQuestMenuStringList("NPC_LEVEL_SUPPLIES_GOODS_CH", 3, "BASIC_MENUSTRING_ACHIEVED_NOW", "SN_TALK_QNO_LV_WEAPON_CH_1_05", "BASIC_MENUSTRING_INVENTORY_FULL", "SN_TALK_QNO_LV_WEAPON_CH_1_04", "BASIC_MENUSTRING_ACHIEVED", "SN_TALK_QNO_LV_WEAPON_CH_1_03")
  InsertQuestMenuStringList("NPC_LEVEL_SUPPLIES_GOODS_WC", 3, "BASIC_MENUSTRING_ACHIEVED_NOW", "SN_TALK_QNO_LV_WEAPON_CH_1_05", "BASIC_MENUSTRING_INVENTORY_FULL", "SN_TALK_QNO_LV_WEAPON_CH_1_04", "BASIC_MENUSTRING_ACHIEVED", "SN_TALK_QNO_LV_WEAPON_CH_1_03")
  InsertQuestMenuStringList("NPC_LEVEL_SUPPLIES_GOODS_KT", 3, "BASIC_MENUSTRING_ACHIEVED_NOW", "SN_TALK_QNO_LV_WEAPON_CH_1_05", "BASIC_MENUSTRING_INVENTORY_FULL", "SN_TALK_QNO_LV_WEAPON_CH_1_04", "BASIC_MENUSTRING_ACHIEVED", "SN_TALK_QNO_LV_WEAPON_CH_1_03")
  LuaSetMissionCompleteNum(0)
end

Everything is fine in the database / client files.
The unknown error is nowhere to find.



This quest is added in DB to start at lvl 1 ( when u create a new char ).
Is it wrong because it's set as a Dialog quest ? Is there any other type of quest for this ... ?

It does not give you any rewards because you did not set the rewards on the script.

For adding rewards, you have to use the function (LuaSetAchievedItem)

Code:
LuaSetAchievedItem(1, 375, 0, 0, 1, "<Your Item CodeName>", 1)
 
Newbie Spellweaver
Joined
Sep 20, 2014
Messages
27
Reaction score
2
As i said, that code was just a copy paste after a tested file.
I've added the strings like this:
PHP:
  PAY_ITEM_METHOD_EXACT = 1
  LuaSetAchievedItem(5, 0, 0, 0, 1, "ITEM_EVENT_CH_SPEAR_01_A_RARE", 1, 1, "ITEM_EVENT_CH_TBLADE_01_A_RARE", 1, 1, "ITEM_EVENT_CH_BOW_01_A_RARE", 1, 1, "ITEM_EVENT_CH_SWORD_01_A_RARE", 1, 1, "ITEM_EVENT_CH_BLADE_01_A_RARE", 1)

But, the point is ... In this quest you need to choose 1 item from 5.
When you go to take your reward, the items are there but you can't click (select) just one, it's trying to give all of the 5 items to you and since in the database it's set to only 1 it fails here.

Got any idea how to make it able to select 1 item from 5 ( just an example ) from the .lua file of the quest ?

Thank you.

Later edit: Is there a way of making a quest one time able ?
Also, is there any other documentation related to quests ? :p
 
Last edited:
Newbie Spellweaver
Joined
Sep 20, 2014
Messages
27
Reaction score
2
You can also try using "MISSION_TYPE_GATHER_ITEM_FROM_FIELD" for a specific area.
Any1 figured out how to make a quest one-time-able ?
 
Back
Top