InuYasha 4 Report post Posted October 22, 2016 I Wonder If Some one can share Dialy Quest Function Extension with me Quote Share this post Link to post Share on other sites
Vasil 71 Report post Posted October 22, 2016 Daily*..dude come on. Quote Share this post Link to post Share on other sites
Ximboliex 80 Report post Posted October 24, 2016 (edited) You need serialize.lua run in you server DailyFolder = "script/extension/DailyQuest/" function CheckDayLog(role,ID) local CharID = GetCharID(role) if exists_file(GetResPath(DailyFolder..""..CharID..".txt")) == false then table.save({},GetResPath(DailyFolder..""..CharID..".txt"),"a") end local Table = {} local NowDay = GetNowDay() Table = table.load(GetResPath(DailyFolder..""..CharID..".txt"),"r") if Table[ID] == nil then Table[ID] = { Day = 0 } table.save(Table,GetResPath(DailyFolder..""..CharID..".txt"),"r") end if Table[ID].Day ~= NowDay then return 1 else return 0 end end function AddDayLog(role,ID) local CharID = GetCharID(role) Table = table.load(GetResPath(DailyFolder..""..CharID..".txt"),"r") local NowDay = GetNowDay() Table[ID].Day = NowDay table.save(Table,GetResPath(DailyFolder..""..CharID..".txt"),"r") return 1 end in conditions inside MissionSdk.lua add: elseif conditions[i].func == CheckDayLog then PRINT( "ConditionsTest:CheckDayLog, p1 = ", conditions[i].p1 ) local ret = CheckDayLog( character , conditions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ConditionsTest:CheckDayLog = false" ) return LUA_FALSE end in actions inside MissionSdk.lua add it: elseif actions[i].func == AddDayLog then PRINT( "ActionsProc:AddDayLog, p1 = ", actions[i].p1 ) local ret = AddDayLog( character , actions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ActionsProc:AddDayLog failed!" ) return LUA_FALSE end Ex: DefineMission(6888, "(Daily Quest) Kal Runestone", 1884) MisBeginTalk( "<t>Kal Runestone is a Item that can get with Novice, Standard and Expert Chests in Pk Areas And can be used to exchange some items.") MisBeginCondition(CheckDayLog,1884) -- here add checkday MisBeginCondition(NoMission,1884) MisBeginAction(AddMission, 1884) MisBeginAction(AddTrigger, 18841, TE_GETITEM , 3457 , 1 ) MisCancelAction(ClearMission, 1884) MisNeed(MIS_NEED_DESP, "Colect 1x Kal Runestone in Demonic World, Chaos Argent and Arena Island.") MisNeed(MIS_NEED_ITEM, 3457, 1, 10, 1) MisPrize(MIS_PRIZE_ITEM, 7329, 1, 4) MisPrizeSelAll() MisHelpTalk("<t>You can get Kal Runestone With Novice, Standard and Expert Chests in Pk Areas.") MisResultTalk("<t>Thanks! You got that.") MisResultCondition(HasMission, 1884) MisResultCondition(HasItem, 3457, 1) MisResultAction(TakeItem, 3457, 1) MisResultAction(ClearMission, 1884) MisResultAction(AddDayLog,1884) -- here add addDaylog Edited October 24, 2016 by Ximboliex 1 Quote Share this post Link to post Share on other sites
blazi10 36 Report post Posted February 11, 2017 On 24.10.2016 at 3:40 PM, Ximboliex said: You need serialize.lua run in you server DailyFolder = "script/extension/DailyQuest/" function CheckDayLog(role,ID) local CharID = GetCharID(role) if exists_file(GetResPath(DailyFolder..""..CharID..".txt")) == false then table.save({},GetResPath(DailyFolder..""..CharID..".txt"),"a") end local Table = {} local NowDay = GetNowDay() Table = table.load(GetResPath(DailyFolder..""..CharID..".txt"),"r") if Table[ID] == nil then Table[ID] = { Day = 0 } table.save(Table,GetResPath(DailyFolder..""..CharID..".txt"),"r") end if Table[ID].Day ~= NowDay then return 1 else return 0 end end function AddDayLog(role,ID) local CharID = GetCharID(role) Table = table.load(GetResPath(DailyFolder..""..CharID..".txt"),"r") local NowDay = GetNowDay() Table[ID].Day = NowDay table.save(Table,GetResPath(DailyFolder..""..CharID..".txt"),"r") return 1 end in conditions inside MissionSdk.lua add: elseif conditions[i].func == CheckDayLog then PRINT( "ConditionsTest:CheckDayLog, p1 = ", conditions[i].p1 ) local ret = CheckDayLog( character , conditions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ConditionsTest:CheckDayLog = false" ) return LUA_FALSE end in actions inside MissionSdk.lua add it: elseif actions[i].func == AddDayLog then PRINT( "ActionsProc:AddDayLog, p1 = ", actions[i].p1 ) local ret = AddDayLog( character , actions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ActionsProc:AddDayLog failed!" ) return LUA_FALSE end Ex: DefineMission(6888, "(Daily Quest) Kal Runestone", 1884) MisBeginTalk( "<t>Kal Runestone is a Item that can get with Novice, Standard and Expert Chests in Pk Areas And can be used to exchange some items.") MisBeginCondition(CheckDayLog,1884) -- here add checkday MisBeginCondition(NoMission,1884) MisBeginAction(AddMission, 1884) MisBeginAction(AddTrigger, 18841, TE_GETITEM , 3457 , 1 ) MisCancelAction(ClearMission, 1884) MisNeed(MIS_NEED_DESP, "Colect 1x Kal Runestone in Demonic World, Chaos Argent and Arena Island.") MisNeed(MIS_NEED_ITEM, 3457, 1, 10, 1) MisPrize(MIS_PRIZE_ITEM, 7329, 1, 4) MisPrizeSelAll() MisHelpTalk("<t>You can get Kal Runestone With Novice, Standard and Expert Chests in Pk Areas.") MisResultTalk("<t>Thanks! You got that.") MisResultCondition(HasMission, 1884) MisResultCondition(HasItem, 3457, 1) MisResultAction(TakeItem, 3457, 1) MisResultAction(ClearMission, 1884) MisResultAction(AddDayLog,1884) -- here add addDaylog Can you help me? im getting error: in game: "npc script quest stat[NpcState] trans fail lua_err: [02-11 15:03:14].../resource/script/extension/DailyQuest/DailyQuest.lua:6: attempt to call global `exists_file' (a nil value) it's quest: Spoiler DefineMission( 2040, "Demonic World Daily", 2030 ) MisBeginTalk("You Going to Demonic World?") MisBeginCondition(NoMission, 2030) MisBeginCondition(NoRecord, 2030) MisBeginCondition(LvCheck, ">", 65) MisBeginCondition(CheckDayLog,2030) -- here add checkday MisBeginAction(AddMission, 2030) MisBeginAction(SetFlag, 2030, 1) MisBeginAction(AddTrigger, 20301, TE_GETITEM, 3430, 40) MisBeginAction(AddTrigger, 20302, TE_GETITEM, 3427, 99) MisBeginAction(AddTrigger, 20303, TE_GETITEM, 7305, 20) MisCancelAction(ClearMission, 2030) MisPrize(MIS_PRIZE_MONEY, 400000, 1) MisPrizeSelAll() MisNeed(MIS_NEED_DESP, "Rune's and Magical rune fragment You can get in <rDemonic World>") MisNeed(MIS_NEED_ITEM, 3430, 40, 10, 40) MisNeed(MIS_NEED_ITEM, 3427, 99, 20, 99) MisNeed(MIS_NEED_ITEM, 7305, 20, 30, 20) MisResultTalk("Perfect! Come Back tommorow") MisHelpTalk("The items you Can Get in <rDemonic World>") MisResultCondition(HasMission, 2030) MisResultCondition(HasItem, 3430, 40) MisResultCondition(HasItem, 3427, 99) MisResultCondition(HasItem, 7305, 20) MisResultAction(TakeItem, 3430, 40) MisResultAction(TakeItem, 3427, 99) MisResultAction(TakeItem, 7305, 20) MisResultAction(SetRecord, 2030 ) MisResultAction(ClearMission, 2030) MisResultAction(AddDayLog,2030) -- here add addDaylog InitTrigger() TriggerCondition(1, IsItem, 3430) TriggerAction(1, AddNextFlag, 2030, 10, 40) RegCurTrigger(20301) InitTrigger() TriggerCondition(1, IsItem, 3427) TriggerAction(1, AddNextFlag, 2030, 20, 99) RegCurTrigger(20302) InitTrigger() TriggerCondition(1, IsItem, 7305) TriggerAction(1, AddNextFlag, 2030, 30, 20) RegCurTrigger(20303) Quest's i need make in missionscript right? or in daily file? Quote Share this post Link to post Share on other sites
Ximboliex 80 Report post Posted February 11, 2017 @blazi10 Make sure you have set these functions correctly elseif conditions[i].func == CheckDayLog then PRINT( "ConditionsTest:CheckDayLog, p1 = ", conditions[i].p1 ) local ret = CheckDayLog( character , conditions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ConditionsTest:CheckDayLog = false" ) return LUA_FALSE end in actions inside MissionSdk.lua add it: elseif actions[i].func == AddDayLog then PRINT( "ActionsProc:AddDayLog, p1 = ", actions[i].p1 ) local ret = AddDayLog( character , actions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ActionsProc:AddDayLog failed!" ) return LUA_FALSE end Quote Share this post Link to post Share on other sites
blazi10 36 Report post Posted February 11, 2017 12 minutes ago, Ximboliex said: @blazi10 Make sure you have set these functions correctly elseif conditions[i].func == CheckDayLog then PRINT( "ConditionsTest:CheckDayLog, p1 = ", conditions[i].p1 ) local ret = CheckDayLog( character , conditions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ConditionsTest:CheckDayLog = false" ) return LUA_FALSE end in actions inside MissionSdk.lua add it: elseif actions[i].func == AddDayLog then PRINT( "ActionsProc:AddDayLog, p1 = ", actions[i].p1 ) local ret = AddDayLog( character , actions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ActionsProc:AddDayLog failed!" ) return LUA_FALSE end I did it before run gameserver Quote Share this post Link to post Share on other sites
Shako 97 Report post Posted March 21, 2017 On 2/11/2017 at 9:14 PM, blazi10 said: Can you help me? im getting error: in game: "npc script quest stat[NpcState] trans fail lua_err: [02-11 15:03:14].../resource/script/extension/DailyQuest/DailyQuest.lua:6: attempt to call global `exists_file' (a nil value) u need the function exists_file () to use it. @Ximboliex 1 Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
blazi10 36 Report post Posted March 21, 2017 7 hours ago, Shako said: u need the function exists_file () to use it. how this function will look? @Ximboliex can you share? Quote Share this post Link to post Share on other sites
Blanquitoh 48 Report post Posted March 21, 2017 (edited) function exists_file(name) local f=io.open(name,"r") if f~=nil then io.close(f) return true else return false end end You can get help by a group of devs on here:https://discord.gg/bFWwmwx Edited March 21, 2017 by Blanquitoh 3 Quote Share this post Link to post Share on other sites
blazi10 36 Report post Posted March 21, 2017 (edited) 36 minutes ago, Blanquitoh said: function exists_file(name) local f=io.open(name,"r") if f~=nil then io.close(f) return true else return false end end You can get help by a group of devs on here:https://discord.gg/bFWwmwx thank you so much! i will try it [03-21 16:53:10]resource/script/MisSdk/scriptsdk.lua:1283: attempt to index field `?' (a nil value) [03-21 16:53:10]resource/script/MisSdk/scriptsdk.lua:1283: attempt to index field `?' (a nil value) Edited March 21, 2017 by blazi10 Quote Share this post Link to post Share on other sites
Shako 97 Report post Posted March 22, 2017 @blazi10 dont just paste the error, paste the lines in scriptsdk.lua that is in the range about 1283 also >.< Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
blazi10 36 Report post Posted March 22, 2017 39 minutes ago, Shako said: @blazi10 dont just paste the error, paste the lines in scriptsdk.lua that is in the range about 1283 also >.< Already fixed thank you, now is working Quote Share this post Link to post Share on other sites
Shako 97 Report post Posted March 22, 2017 Great! =) @blazi10 1 Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
dragontechi 36 Report post Posted January 22 Sorry I have the same problem what was the solution or do you have a more detailed guide gameserver 0 errror Quote Share this post Link to post Share on other sites
dragontechi 36 Report post Posted January 22 Sorry I have the same problem what was the solution or do you have a more detailed guide gameserver 0 errror [01-22 16:56:15]./resource/script/MisSdk/MissionSdk.lua:2567: attempt to call global `CheckTeam1' (a nil value) [01-22 16:56:17]./resource/script/MisSdk/MissionSdk.lua:2567: attempt to call global `CheckTeam1' (a nil value) Quote Share this post Link to post Share on other sites
dragontechi 36 Report post Posted January 23 I was able to make it work using this guide but there is a problem when I reset the server the mission is put back Quote Share this post Link to post Share on other sites
Angelix 337 Report post Posted February 5 On 1/22/2022 at 5:11 PM, dragontechi said: I was able to make it work using this guide but there is a problem when I reset the server the mission is put back Yes, they are saved on variables which removed upon server closing. You must find a way to keep those variables permanently or store all of that information within SQL (or alternatively in text files, but not recommended I guess). Quote Link to a lonely Facebook page on what could be an interesting upcoming server. Share this post Link to post Share on other sites