Jump to content

[ Dead Download Link ] [Release]Gift system(Updated: 3.july.2014) [ We Need You ]


Recommended Posts

 

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

 

nfZSObP.png

 

I works, but not hide after click ... :(

Add function to client or give me syserr & quest in PM.

Edited by Metin2 Dev
Core X - External 2 Internal

Thanks for the quest I like it :D

 

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
  • Love 1

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

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..

 

  • Love 1

 

I follow the guide, it works but look what happens to me:

25h1ycn.jpg

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 by Metin2 Dev
Core X - External 2 Internal

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

 

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 :)

  • Love 1

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!

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

 

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 ^

  • Premium

I try your quest and I get this error

https://metin2.download/picture/xQJVn97VQr3vjB0X38DwdSE9d84ncjQh/.png

Edited by Metin2 Dev
Core X - External 2 Internal

Show the quest that you tried

Edited by Metin2 Dev
Core X - External 2 Internal
  • Premium
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

 

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 :D from giverandomitem()

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  :D

  • Love 2

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

 

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)
  • Love 1

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.