From 443f62d1ecad0fd1967a6ed0cb4c0e996f45485d Mon Sep 17 00:00:00 2001 From: etorth Date: Sun, 13 Aug 2023 21:03:30 -0700 Subject: [PATCH] f --- ...5\345\207\272\346\261\237\346\271\226.lua" | 72 +++++++++++------- ...4\345\245\207\345\225\206\344\274\232.lua" | 74 ++++++++++++------- 2 files changed, 91 insertions(+), 55 deletions(-) diff --git "a/server/script/quest/\345\210\235\345\207\272\346\261\237\346\271\226.lua" "b/server/script/quest/\345\210\235\345\207\272\346\261\237\346\271\226.lua" index 8bb40cd34..925723b08 100644 --- "a/server/script/quest/\345\210\235\345\207\272\346\261\237\346\271\226.lua" +++ "b/server/script/quest/\345\210\235\345\207\272\346\261\237\346\271\226.lua" @@ -152,12 +152,15 @@ setQuestFSMTable( } ]]) - uidRemoteCall(getNPCharUID('仓库_1_007', '大老板_1'), uid, getUID(), getQuestName(), + setupNPCQuestBehavior('仓库_1_007', '大老板_1', uid, + [[ + return getQuestName() + ]], [[ - local playerUID, questUID, questName = ... + local questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -170,7 +173,7 @@ setQuestFSMTable( ]=], SYS_EXIT) end, - }) + } ]]) setUIDQuestState{uid=uid, state='quest_find_chicken_blood'} @@ -195,12 +198,15 @@ setQuestFSMTable( end, quest_done_chicken_blood = function(uid, value) - uidRemoteCall(getNPCharUID('仓库_1_007', '大老板_1'), uid, getUID(), getQuestName(), + setupNPCQuestBehavior('仓库_1_007', '大老板_1', uid, [[ - local playerUID, questUID, questName = ... + return getUID(), getQuestName() + ]], + [[ + local questUID, questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -216,21 +222,24 @@ setQuestFSMTable( uidRemoteCall(questUID, uid, [=[ local playerUID = ... - setUIDQuestState(playerUID, 'quest_prepare_to_wang') + setUIDQuestState(playerUID, 'quest_prepare_to_wang'} ]=]) end, - }) + } ]]) end, quest_prepare_to_wang = function(uid, value) if uidRemoteCall(uid, [[ return getLevel() ]]) < 6 then - uidRemoteCall(getNPCharUID('道馆_1', '士官_1'), uid, getQuestName(), + setupNPCQuestBehavior('道馆_1', '士官_1', uid, + [[ + return getQuestName() + ]], [[ - local playerUID, questName = ... + local questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -242,7 +251,7 @@ setQuestFSMTable( ]=], SYS_EXIT) end, - }) + } ]]) uidRemoteCall(uid, getUID(), @@ -262,12 +271,15 @@ setQuestFSMTable( ]]) else - uidRemoteCall(getNPCharUID('道馆_1', '士官_1'), uid, getUID(), getQuestName(), + setupNPCQuestBehavior('道馆_1', '士官_1', uid, [[ - local playerUID, questUID, questName = ... + return getUID(), getQuestName() + ]], + [[ + local questUID, questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -296,21 +308,24 @@ setQuestFSMTable( uidRemoteCall(questUID, uid, [=[ local playerUID = ... - setUIDQuestState{uid=playerUID, state='quest_accept_wang_book') + setUIDQuestState{uid=playerUID, state='quest_accept_wang_book'} ]=]) end, - }) + } ]]) end end, quest_accept_wang_book = function(uid, value) - uidRemoteCall(getNPCharUID('道馆_1', '士官_1'), uid, getQuestName(), + setupNPCQuestBehavior('道馆_1', '士官_1', uid, + [[ + return getQuestName() + ]], [[ - local playerUID, questName = ... + local questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -322,15 +337,18 @@ setQuestFSMTable( ]=], SYS_EXIT) end, - }) + } ]]) - uidRemoteCall(getNPCharUID('比奇县_0', '王大人_1'), uid, getUID(), getQuestName(), + setupNPCQuestBehavior('比奇县_0', '王大人_1', uid, + [[ + return getUID(), getQuestName() + ]], [[ - local playerUID, questUID, questName = ... + local questUID, questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -372,7 +390,7 @@ setQuestFSMTable( uidRemoteCall(questUID, uid, [=[ local playerUID = ... - setUIDQuestState{uid=playerUID, state='quest_done_wang_book') + setUIDQuestState{uid=playerUID, state='quest_done_wang_book'} ]=]) end, @@ -388,7 +406,7 @@ setQuestFSMTable( ]=], SYS_EXIT) end, - }) + } ]]) end, diff --git "a/server/script/quest/\346\257\224\345\245\207\345\225\206\344\274\232.lua" "b/server/script/quest/\346\257\224\345\245\207\345\225\206\344\274\232.lua" index 0b2102fa9..e13e2058a 100644 --- "a/server/script/quest/\346\257\224\345\245\207\345\225\206\344\274\232.lua" +++ "b/server/script/quest/\346\257\224\345\245\207\345\225\206\344\274\232.lua" @@ -43,12 +43,15 @@ setQuestFSMTable( end, quest_refuse_quest = function(uid, value) - uidRemoteCall(getNPCharUID('比奇县_0', '王大人_1'), uid, getUID(), getQuestName(), + setupNPCQuestBehavior('比奇县_0', '王大人_1', uid, [[ - local playerUID, questUID, questName = ... + return getUID(), getQuestName() + ]], + [[ + local questUID, questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -81,7 +84,7 @@ setQuestFSMTable( ]=], SYS_EXIT) end, - }) + } ]]) end, @@ -837,12 +840,15 @@ setQuestFSMTable(fsmName_persuade_librarian, setQuestFSMTable(fsmName_persuade_pharmacist, { [SYS_ENTER] = function(uid, value) - uidRemoteCall(getNPCharUID('比奇县_0', '药剂师_1'), uid, getQuestName(), + setupNPCQuestBehavior('比奇县_0', '药剂师_1', uid, + [[ + return getQuestName() + ]], [[ - local playerUID, questName = ... + local questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -865,15 +871,18 @@ setQuestFSMTable(fsmName_persuade_pharmacist, ]=], SYS_EXIT) end, - }) + } ]]) - uidRemoteCall(getNPCharUID('毒蛇山谷_2', '金中医_1'), uid, getUID(), getQuestName(), + setupNPCQuestBehavior('毒蛇山谷_2', '金中医_1', uid, + [[ + return getUID(), getQuestName() + ]], [[ - local playerUID, questUID, questName = ... + local questUID, questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -947,7 +956,7 @@ setQuestFSMTable(fsmName_persuade_pharmacist, setUIDQuestState{uid=playerUID, fsm=fsmName_persuade_pharmacist, state='quest_purchase_with_agreed_price', args=100} ]=]) end, - }) + } ]]) end, @@ -1036,12 +1045,12 @@ setQuestFSMTable(fsmName_persuade_pharmacist, end, quest_wait_purchase = function(uid, value) - uidRemoteCall(getNPCharUID('毒蛇山谷_2', '金中医_1'), uid, value, getUID(), getQuestName(), + setupNPCQuestBehavior('毒蛇山谷_2', '金中医_1', uid, string.format([[ return %d, getUID(), getQuestName() ]], value), [[ - local playerUID, askedGold, questUID, questName = ... + local askedGold, questUID, questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -1062,17 +1071,20 @@ setQuestFSMTable(fsmName_persuade_pharmacist, setUIDQuestState{uid=playeUID, fsm=fsmName_persuade_pharmacist, state='quest_purchase_with_agreed_price', args=askedGold} ]=]) end, - }) + } ]]) end, quest_purchase_with_free_price = function(uid, value) - uidRemoteCall(getNPCharUID('毒蛇山谷_2', '金中医_1'), uid, getUID(), getQuestName(), + setupNPCQuestBehavior('毒蛇山谷_2', '金中医_1', uid, + [[ + getUID(), getQuestName() + ]], [[ - local playerUID, questUID, questName = ... + local questUID, questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -1101,17 +1113,20 @@ setQuestFSMTable(fsmName_persuade_pharmacist, setUIDQuestState{uid=playerUID, fsm=fsmName_persuade_pharmacist, state='quest_purchased_tooth'} ]=]) end, - }) + } ]]) end, quest_purchased_tooth = function(uid, value) - uidRemoteCall(getNPCharUID('毒蛇山谷_2', '金中医_1'), uid, getQuestName(), + setupNPCQuestBehavior('毒蛇山谷_2', '金中医_1', uid, + [[ + return getQuestName() + ]], [[ - local playerUID, questName = ... + local questName = ... local questPath = {SYS_EPUID, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -1123,15 +1138,18 @@ setQuestFSMTable(fsmName_persuade_pharmacist, ]=], SYS_EXIT) end, - }) + } ]]) - uidRemoteCall(getNPCharUID('比奇县_0', '药剂师_1'), uid, getUID(), getQuestName(), + setupNPCQuestBehavior('比奇县_0', '药剂师_1', uid, [[ - local playerUID, questUID, questName = ... + return getUID(), getQuestName() + ]], + [[ + local questUID, questName = ... local questPath = {SYS_EPQST, questName} - setUIDQuestHandler(playerUID, questName, + return { [SYS_ENTER] = function(uid, value) uidPostXML(uid, questPath, @@ -1151,7 +1169,7 @@ setQuestFSMTable(fsmName_persuade_pharmacist, setUIDQuestState{uid=playerUID, fsm=fsmName_persuade_pharmacist, state=SYS_DONE} ]=]) end, - }) + } ]]) end, })