Quote:
Originally Posted by Judgelemental
All I can think of is find a quest that's very similar -usually the chinese beginner ones- (with 2 NPCs), clone it and change the requirements to complete the quest to the same NPC.
|
Thank you so much for your reply @
[Only registered and activated users can see links. Click Here To Register...], so this is what I have tried.
First, I create the quest with 2 NPCs, just to be sure that I understood the basics of the lua script. This is the code that I used.
PHP Code:
function QNO_TEST_QUEST()
QUESTID = LuaGetQuestID("QNO_TEST_QUEST")
LuaSetStartCodition(2, QSC_QUEST, QSC_LEVEL, 1, 1)
QM_CONVERSATION = 1
LuaSetStartMethod(QM_CONVERSATION, 2, "NPC_CH_SMITH", "NPC_CH_POTION")
LuaQuestInsertNpc(2, "NPC_CH_SMITH", "NPC_CH_POTION")
LuaInsertMissionOrCompleteNpc("NPC_CH_POTION")
LuaSetAchievementLimit(0)
LuaSetMissionDataSize(QUESTID, 1)
LuaSetDialLogMissionData(QUESTID, 0, MISSION_TYPE_DIALOG, "SN_CON_QNO_TEST_QUEST", 1, "SN_TALK_QNO_CH_POTION_1_06")
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")
InsertQuestMenuStringList("NPC_CH_POTION", 2, "BASIC_MENUSTRING_GREETING", "SN_NPC_CH_POTION_QS", "BASIC_MENUSTRING_ACHIEVED", "SN_TALK_QNO_CH_POTION_1_06")
LuaSetMissionCompleteNum(0)
PAY_ITEM_METHOD_EXACT = 1
LuaSetAchievedItem(0, 0, 0, 0, 1, "ITEM_MALL_GLOBAL_CHATTING", 10)
LuaSetAchievedSkillPont(0)
end
Everything works fine, I start the quest on the blacksmith and then I finish it on the potion merchant to get the reward. Now, as you suggested, I modified the quest to 1 NPC like this.
PHP Code:
function QNO_TEST_QUEST()
QUESTID = LuaGetQuestID("QNO_TEST_QUEST")
LuaSetStartCodition(2, QSC_QUEST, QSC_LEVEL, 1, 1)
QM_CONVERSATION = 1
LuaSetStartMethod(QM_CONVERSATION, 1, "NPC_CH_SMITH")
LuaQuestInsertNpc(1, "NPC_CH_SMITH")
LuaInsertMissionOrCompleteNpc("NPC_CH_SMITH")
LuaSetAchievementLimit(0)
LuaSetMissionDataSize(QUESTID, 1)
LuaSetDialLogMissionData(QUESTID, 0, MISSION_TYPE_DIALOG, "SN_CON_QNO_TEST_QUEST", 1, "SN_TALK_QNO_TEST_QUEST_06")
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(0, 0, 0, 0, 1, "ITEM_MALL_GLOBAL_CHATTING", 10)
LuaSetAchievedSkillPont(0)
end
I can get the quest form the blacksmith, but when I try to return it, the NPC use the BASIC_MENUSTRING_NOT_ACHIEVED text, it doesn't recognize the quest as completed after I took it.
Searching on the sro-r lua script quests, I fond the accessories quest, and they're using this code on their function:
PHP Code:
LuaSetAutoComplete(QUESTID, 1)
I thought that code will finish the quest automatically, but when I insert it on my function, the quest just doesn't shows up on the NPC, no matter where I place the code, it doesn't show the quest.
I think that I need an statement, that lets the game know that after I took that quest, it should be finished. Or maybe, I have to create 2 separate quests with the same NPC, but that doesn't seems logic to me.
P.D: I'm using the test quest that is showed on the lua script release post.
I'll keep trying more stuffs, if I find anything, I'll update the post.