Zetsu 78 Posted May 9, 2014 Author Share Posted May 9, 2014 (edited) mysql is useless. quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local random_nr = number(1,5) chat("Trwa losowanie przedmiotu...") -- Opening if random_nr==1 then pc.give_item2(53001, 1) elseif random_nr==2 then pc.give_item2(53002, 1) elseif random_nr==3 then pc.give_item2(53003, 1) elseif random_nr==4 then pc.give_item2(53005, 1) elseif random_nr==5 then pc.give_item2(53006, 1) end pc.setqf("giftsystemuse", get_time()+60*60*12) -- 12 HRS pc.change_gold(-1000000) cmdchat("giftsyshide") end when button or info begin if pc.get_money() < 1000000 then chat("Nie posiadasz 1.000000 Yang") return end end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else chat("Ponowne użycie będzie możliwe po upływie 12H...") end end end end as i said.,. you didn't know how to modify :/ Take this: quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local random_nr = number(1,5) chat("Trwa losowanie przedmiotu...") -- Opening if random_nr==1 then pc.give_item2(53001, 1) elseif random_nr==2 then pc.give_item2(53002, 1) elseif random_nr==3 then pc.give_item2(53003, 1) elseif random_nr==4 then pc.give_item2(53005, 1) elseif random_nr==5 then pc.give_item2(53006, 1) end pc.setqf("giftsystemuse", get_time()+60*60*12) -- 12 HRS pc.change_gold(-1000000) cmdchat("giftsyshide") end when button or info begin if pc.getqf("giftsystemuse") <= get_time() and pc.get_money() > 1000000 then then thsgiftdev.giverandomitem() elseif pc.get_money() < 1000000 then chat("Nie posiadasz 1.000000 Yang") else chat("Ponowne uzycie bedzie mozliwe po uplywie 12H...") end end end end I works, but not hide after click ... Add function to client or give me syserr & quest in PM. Edited August 15, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Denis 1474 Posted May 9, 2014 Share Posted May 9, 2014 Thanks for the quest I like it Here is the quest without mysql and with inventory size check and without many 'if': quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local ids = number(1,5) local items = { -- number_id vnum count size [1] = {279,1,2}, [2] = {19,1,2}, [3] = {299,1,2}, [4] = {169,1,2}, [5] = {159,1,2}, } if pc.get_empty_inventory_count() >= items[ids][3] then pc.give_item2(items[ids][1],items[ids][2]) pc.setqf("giftsystemuse", get_time()+60*60*12) cmdchat("giftsyshide") else syschat("You don't have enough space.") end end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else syschat("You can open the box every 12 hours,please be patient.") end end end end 1 Link to comment Share on other sites More sharing options...
HA MeCa 11 Posted May 9, 2014 Share Posted May 9, 2014 My quest is better you need to open 1000000 yang because everyone would create new character. BAD ENGLISH XD quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local random_nr = number(1,5) chat("Trwa losowanie przedmiotu...") -- Opening if random_nr==1 then pc.give_item2(53001, 1) elseif random_nr==2 then pc.give_item2(53002, 1) elseif random_nr==3 then pc.give_item2(53003, 1) elseif random_nr==4 then pc.give_item2(53005, 1) elseif random_nr==5 then pc.give_item2(53006, 1) end pc.setqf("giftsystemuse", get_time()+60*60*12) -- 12 HRS pc.change_gold(-1000000) cmdchat("giftsyshide") end when button or info begin if pc.get_money() < 1000000 then chat("Nie posiadasz 1.000000 Yang") return end end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else chat("Ponowne użycie będzie możliwe po upływie 12H...") end end end end Link to comment Share on other sites More sharing options...
Denis 1474 Posted May 9, 2014 Share Posted May 9, 2014 Your quest didn't check for available space in the inventory so if the inventory will be full the quest will say that you received the item but you don't have the enough space in the inventory for it.So you'll need to wait another 12 hours.About the money I think it's useless because you can create and give yang etc.. 1 Link to comment Share on other sites More sharing options...
Happy 0 Posted May 9, 2014 Share Posted May 9, 2014 (edited) I follow the guide, it works but look what happens to me: For everybody who got errors: Read everything i said Now, you invented a new error That's not from me.. Yes, is my mistake, this sistem works 100% nice Edited August 15, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
RatCatcher 77 Posted May 9, 2014 Share Posted May 9, 2014 This system is already implemented by YMIR. You just need to put items in player.item_award table and do some other thins, but it works Enough is enough Link to comment Share on other sites More sharing options...
HA MeCa 11 Posted May 10, 2014 Share Posted May 10, 2014 check my quest, tested and everything works: quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local random_nr = number(1,5) chat("<Informacja> Trwa losowanie przedmiotu...") if random_nr==1 then pc.give_item2(53001, 1) elseif random_nr==2 then pc.give_item2(53002, 1) elseif random_nr==3 then pc.give_item2(53003, 1) elseif random_nr==4 then pc.give_item2(53005, 1) elseif random_nr==5 then pc.give_item2(53006, 1) end pc.setqf("giftsystemuse", get_time()+60*60*12) pc.change_gold(-1000000) cmdchat("giftsyshide") end when button or info begin if pc.get_money() < 1000000 then chat("<Informacja> Nie posiadasz 1.000000 Yang.") -- need 1kk return end end when button or info begin if pc.get_level() < 30 then chat("<Informacja> Musisz posiadać 30 poziom.") -- need 30 lvl return end end when button or info begin if pc.get_empty_inventory_count() <= 1 then chat("<Informacja> Masz za mało miejsca w ekwipunku.") -- if full invetory return end end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else chat("<Informacja> Ponowne użycie będzie możliwe po upływie 12H.") end end end end Link to comment Share on other sites More sharing options...
Tacticus 73 Posted May 10, 2014 Share Posted May 10, 2014 check my quest, tested and everything works: quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local random_nr = number(1,5) chat("<Informacja> Trwa losowanie przedmiotu...") if random_nr==1 then pc.give_item2(53001, 1) elseif random_nr==2 then pc.give_item2(53002, 1) elseif random_nr==3 then pc.give_item2(53003, 1) elseif random_nr==4 then pc.give_item2(53005, 1) elseif random_nr==5 then pc.give_item2(53006, 1) end pc.setqf("giftsystemuse", get_time()+60*60*12) pc.change_gold(-1000000) cmdchat("giftsyshide") end when button or info begin if pc.get_money() < 1000000 then chat("<Informacja> Nie posiadasz 1.000000 Yang.") -- need 1kk return end end when button or info begin if pc.get_level() < 30 then chat("<Informacja> Musisz posiadać 30 poziom.") -- need 30 lvl return end end when button or info begin if pc.get_empty_inventory_count() <= 1 then chat("<Informacja> Masz za mało miejsca w ekwipunku.") -- if full invetory return end end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else chat("<Informacja> Ponowne użycie będzie możliwe po upływie 12H.") end end end end thx this quest is better 1 Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 10, 2014 Author Share Posted May 10, 2014 Your quest didn't check for available space in the inventory so if the inventory will be full the quest will say that you received the item but you don't have the enough space in the inventory for it.So you'll need to wait another 12 hours.About the money I think it's useless because you can create and give yang etc.. That guy added money request... I've better add an item req. This system is already implemented by YMIR. You just need to put items in player.item_award table and do some other thins, but it works This is mine. Ymir created another system which you can give a gift to another player. check my quest, tested and everything works: quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local random_nr = number(1,5) chat("<Informacja> Trwa losowanie przedmiotu...") if random_nr==1 then pc.give_item2(53001, 1) elseif random_nr==2 then pc.give_item2(53002, 1) elseif random_nr==3 then pc.give_item2(53003, 1) elseif random_nr==4 then pc.give_item2(53005, 1) elseif random_nr==5 then pc.give_item2(53006, 1) end pc.setqf("giftsystemuse", get_time()+60*60*12) pc.change_gold(-1000000) cmdchat("giftsyshide") end when button or info begin if pc.get_money() < 1000000 then chat("<Informacja> Nie posiadasz 1.000000 Yang.") -- need 1kk return end end when button or info begin if pc.get_level() < 30 then chat("<Informacja> Musisz posiadać 30 poziom.") -- need 30 lvl return end end when button or info begin if pc.get_empty_inventory_count() <= 1 then chat("<Informacja> Masz za mało miejsca w ekwipunku.") -- if full invetory return end end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else chat("<Informacja> Ponowne użycie będzie możliwe po upływie 12H.") end end end end You just crashed the quest. Why did you added multiple "when button or info begin" functions??? That can create another bugs... Here, take this: quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local random_nr = number(1,5) chat("<Informacja> Trwa losowanie przedmiotu...") if random_nr==1 then pc.give_item2(53001, 1) elseif random_nr==2 then pc.give_item2(53002, 1) elseif random_nr==3 then pc.give_item2(53003, 1) elseif random_nr==4 then pc.give_item2(53005, 1) elseif random_nr==5 then pc.give_item2(53006, 1) end pc.setqf("giftsystemuse", get_time()+60*60*12) pc.change_gold(-1000000) cmdchat("giftsyshide") end when button or info begin if pc.get_money() < 1000000 then chat("<Informacja> Nie posiadasz 1.000000 Yang.") -- need 1kk elseif pc.get_level() < 30 then chat("<Informacja> Musisz posiadac 30 poziom.") -- need 30 lvl elseif pc.get_empty_inventory_count() <= 1 then chat("<Informacja> Masz za malo miejsca w ekwipunku.") -- if full invetory elseif pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else chat("<Informacja> Ponowne uzycie bedzie mozliwe po uplywie 12H.") end end end end If somebody wants to add new conditions to quest, first ask me in pm, then post here. Probably some people would think that it's my mistake... Kind regards! Link to comment Share on other sites More sharing options...
Denis 1474 Posted May 10, 2014 Share Posted May 10, 2014 Instead of this: when button or info begin if pc.get_money() < 1000000 then chat("<Informacja> Nie posiadasz 1.000000 Yang.") -- need 1kk return end end when button or info begin if pc.get_level() < 30 then chat("<Informacja> Musisz posiadać 30 poziom.") -- need 30 lvl return end end when button or info begin if pc.get_empty_inventory_count() <= 1 then chat("<Informacja> Masz za mało miejsca w ekwipunku.") -- if full invetory return end end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else chat("<Informacja> Ponowne użycie będzie możliwe po upływie 12H.") end end do this: when button or info begin if pc.get_money() < 1000000 then chat("<Informacja> Nie posiadasz 1.000000 Yang.") -- need 1kk return elseif pc.get_level() < 30 then chat("<Informacja> Musisz posiadać 30 poziom.") -- need 30 lvl return elseif pc.get_empty_inventory_count() <= 1 then chat("<Informacja> Masz za mało miejsca w ekwipunku.") -- if full invetory return end if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else chat("<Informacja> Ponowne użycie będzie możliwe po upływie 12H.") end end Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 10, 2014 Author Share Posted May 10, 2014 do this: when button or info begin if pc.get_money() < 1000000 then chat("<Informacja> Nie posiadasz 1.000000 Yang.") -- need 1kk return elseif pc.get_level() < 30 then chat("<Informacja> Musisz posiadać 30 poziom.") -- need 30 lvl return elseif pc.get_empty_inventory_count() <= 1 then chat("<Informacja> Masz za mało miejsca w ekwipunku.") -- if full invetory return end if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else chat("<Informacja> Ponowne użycie będzie możliwe po upływie 12H.") end end That i said Up ^ Link to comment Share on other sites More sharing options...
Denis 1474 Posted May 10, 2014 Share Posted May 10, 2014 I didn't see it ^^ 2 Link to comment Share on other sites More sharing options...
Premium KingTsunamy 24 Posted May 11, 2014 Premium Share Posted May 11, 2014 (edited) https://metin2.download/picture/pUlkYblSDP4fL7rD0B6ReJdiaNwxdZ1D/.png Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Denis 1474 Posted May 11, 2014 Share Posted May 11, 2014 You don't have mysql_query lib.Download it here Link to comment Share on other sites More sharing options...
Premium KingTsunamy 24 Posted May 11, 2014 Premium Share Posted May 11, 2014 (edited) I try your quest and I get this error https://metin2.download/picture/xQJVn97VQr3vjB0X38DwdSE9d84ncjQh/.png Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Frozen 189 Posted May 11, 2014 Share Posted May 11, 2014 (edited) I try your quest and I get this error https://metin2.download/picture/xQJVn97VQr3vjB0X38DwdSE9d84ncjQh/.png Show the quest that you tried Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium KingTsunamy 24 Posted May 11, 2014 Premium Share Posted May 11, 2014 quest thsgiftdev begin state start beginsou when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local ids = number(1,5) local items = { -- number_id vnum count size [1] = {279,1,2}, [2] = {19,1,2}, [3] = {299,1,2}, [4] = {169,1,2}, [5] = {159,1,2}, } if pc.get_empty_inventory_count() >= items[ids][3] then pc.give_item2(items[ids][1],items[ids][2]) pc.setqf("giftsystemuse", get_time()+60*60*12) cmdchat("giftsyshide") else syschat("You don't have enough space.") end end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else syschat("You can open the box every 12 hours,please be patient.") end end end end Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 11, 2014 Author Share Posted May 11, 2014 quest thsgiftdev begin state start beginsou when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local ids = number(1,5) local items = { -- number_id vnum count size [1] = {279,1,2}, [2] = {19,1,2}, [3] = {299,1,2}, [4] = {169,1,2}, [5] = {159,1,2}, } if pc.get_empty_inventory_count() >= items[ids][3] then pc.give_item2(items[ids][1],items[ids][2]) pc.setqf("giftsystemuse", get_time()+60*60*12) cmdchat("giftsyshide") else syschat("You don't have enough space.") end end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else syschat("You can open the box every 12 hours,please be patient.") end end end end what is that "beginsou" on line 2? Use this: quest thsgiftdev begin state start begin when login begin cmdchat("zetsugfsys "..q.getcurrentquestindex()) end function giverandomitem() local ids = number(1,5) local items = { -- number_id vnum count size [1] = {279,1,2}, [2] = {19,1,2}, [3] = {299,1,2}, [4] = {169,1,2}, [5] = {159,1,2}, } if pc.get_empty_inventory_count() >= items[ids][3] then pc.give_item2(items[ids][1],items[ids][2]) pc.setqf("giftsystemuse", get_time()+60*60*12) cmdchat("giftsyshide") else syschat("You don't have enough space.") end end when button or info begin if pc.getqf("giftsystemuse") <= get_time() then thsgiftdev.giverandomitem() else syschat("You can open the box every 12 hours,please be patient.") end end end end I like your methode from giverandomitem() Link to comment Share on other sites More sharing options...
Premium KingTsunamy 24 Posted May 11, 2014 Premium Share Posted May 11, 2014 (edited) https://metin2.download/picture/LhVCoL36QAgl0M44sdNdTv00lZyG6Tqz/.png Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Frozen 189 Posted May 11, 2014 Share Posted May 11, 2014 You dont have this function: pc.get_empty_inventory_count() Try to see in your functions list if that function is there. Link to comment Share on other sites More sharing options...
Premium KingTsunamy 24 Posted May 11, 2014 Premium Share Posted May 11, 2014 I put pc.get_empty_inventory_count() in quest functions and now it works Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 12, 2014 Author Share Posted May 12, 2014 DO NOT rename the quest. You must install it with name: thsgiftdev.quest or it doesn't work. If you renamed it i'll not help you. Good luck! Maybe some of you will understand what's written with red color 2 Link to comment Share on other sites More sharing options...
Avertus 1 Posted May 12, 2014 Share Posted May 12, 2014 I have problem. Syserr 0512 18:34:43667 :: File "networkModule.py", line 239, in SetGamePhase 0512 18:34:43667 :: File "game.py", line 104, in __init__ 0512 18:34:43667 :: AttributeError 0512 18:34:43667 :: : 0512 18:34:43667 :: 'GameWindow' object has no attribute 'ZetsuGiftSystem__deff__' 0512 18:34:43667 :: Game.py http://wklej.to/q0Igp Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 12, 2014 Author Share Posted May 12, 2014 I have problem. Syserr 0512 18:34:43667 :: File "networkModule.py", line 239, in SetGamePhase 0512 18:34:43667 :: File "game.py", line 104, in __init__ 0512 18:34:43667 :: AttributeError 0512 18:34:43667 :: : 0512 18:34:43667 :: 'GameWindow' object has no attribute 'ZetsuGiftSystem__deff__' 0512 18:34:43667 :: Game.py http://wklej.to/q0Igp Move def ZetsuGiftSystem__init__(self, index): constInfo.GIFTSYS = index def ZetsuGiftSystem__deff__(self): import event event.QuestButtonClick(int(constInfo.GIFTSYS)) def ZetsuGiftSystem__show__(self): self.GiftBox.Show() def ZetsuGiftSystem__hide__(self): self.GiftBox.Hide() Under def __del__(self): player.SetGameWindow(0) net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self) ui.ScriptWindow.__del__(self) 1 Link to comment Share on other sites More sharing options...
Zetsu 78 Posted May 15, 2014 Author Share Posted May 15, 2014 Up? ... Please follow my instructions! Do not change anything without asking. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now