Jump to content

Quests - Give Item | First Login | NPC Sell UPItems


Juice

Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( Internal )

Hello dear Community,

 

i want to share my quests which i was writing with you guys.

Because a "Small Release" section doesnt exist here, i had to open a new topic.

All my quests and following quests will be listed here in the future.

 

Im happy if some of them are usefull for you.

Of course many people here can write their own quests by themselves,

but there are also a lot of people who are not able to write quests like this.

 

I will add new quests and basic quests so everyone can understand and use them.

So much talk, here are the quests:

 

 

Buy Uppitems from Npc:

 

Spoiler

quest npc_sell_uppitems begin
    state start begin
        when 20080.take begin
            
			local vnum = item.get_vnum()
			local upp_items = mysql_query("SELECT * FROM player.refine_proto WHERE id = (SELECT refine_set FROM player.item_proto WHERE vnum = "..vnum..");")
			
            if upp_items.vnum0 == nil then
                syschat('This Item cannot be improved.')
                return
            elseif upp_items.vnum0[1] == 0 then
                syschat('This Item does not need any Items for developing.')
                return
            end
            
            local settings_price = 100000 --- The Price for an Uppitemset
            local forbidden_items = {27992,27993,27994,71129,71123,30050,0} -- The Forbidden Items which the Npc will not sell
            local item_vnum, item_count = {}, {}
            local item = {upp_items.vnum0[1],upp_items.vnum1[1],upp_items.vnum2[1]}
            local count = {upp_items.count0[1],upp_items.count1[1],upp_items.count2[1]}
            
            for a = 1, 3 do
                if item[a] > 0 and in_table(item[a], forbidden_items) == false then
                    table.insert(item_vnum, a, item[a])
                    table.insert(item_count, a, count[a])
                end
            end
            
            
            if in_table(item[1], forbidden_items) == true and in_table(item[2], forbidden_items) == true and in_table(item[3], forbidden_items) == true then
                syschat('I cant sell you the required items.')
                return
            end
            
            say_size(300,350)
            setdelay(0)
            say_title(string.format("%s:", mob_name(string.format("%d", npc.get_race()))))
            say()
            say('You want to buy the required')
            say('items for this item?')
            say()
            say()
            say_item(item_name(vnum), vnum, "")
            say()
            say()
            say()
            say()
            
            if select('Yes','Cancel') == 2 then return end
            
            setdelay(0)
            say_size(300,400)
            say_title(string.format("%s:", mob_name(string.format("%d", npc.get_race()))))
            say()
            say('My Informations are saying that')
            say('you need those items:')
            say()
            for b = 1, table.getn(item_vnum) do
                say_item(item_name(item_vnum[b]), item_vnum[b], item_count[b].."x")
            end
            say_reward('How often do you want to buy them?')
            say()
            local number = math.abs(tonumber(input()) or 0) if number <= 0 then setskin(NOWINDOW) syschat('You have to buy at least one item!') return end
            
            setdelay(0)
            say_title(string.format("%s:", mob_name(string.format("%d", npc.get_race()))))
            say()
            say('If you want to buy all of the following items,')
            say('it would cost '..numtomoney(settings_price*number)..' Yang.')
            say()
            say_reward('(I cant sell Rare Items like Pearls or Dragonscales,)')
            say_reward('(to you without any permission.)')
            say()
            
            if select('Buy Items','Cancel') == 2 then return end if pc.get_gold() < settings_price*number then syschat('Im sorry, you need '..numtomoney(settings_price)..' Yang for those Items.') return end
            
            setdelay(0)
            pc.change_gold(- settings_price*number)
            say_size(300,350)
            say_title(string.format("%s:", mob_name(string.format("%d", npc.get_race()))))
            say()
            say('Thank you for buying!')
            say()
            say_reward('You purchase was succesfull:')
            say()
            for c = 1, table.getn(item_vnum) do
                if item_vnum[c] ~= 0 then
                    pc.give_item2(item_vnum[c], item_count[c]*number)
                    say_item(item_name(item_vnum[c]), item_vnum[c], item_count[c]*number.."x")
                end
            end
        end
    end
end





 

Gives items depending on your Kingdom:

 

Spoiler

quest give_item begin
    state start begin
        when VNUM.use begin --- Replace "VNUM" with your item Vnum.
            
            local give_items = {
                [1] = {
                    {11299}, --- Items for Shinsoo
                    {1}, --- How many of this item
                }, 
                [2] = {
                    {11499}, --- Items for Chunjo
                    {1}, --- How many of this item
                }, 
                [3] = {
                    {11699}, --- Items for Jinno
                    {1}, --- How many of this item
                },
                
            }
            
            for a = 1, table.getn(give_items[pc.get_empire()][1]) do
                pc.give_item2(give_items[pc.get_empire][1][a], give_items[pc.get_empire][2][a])
            end
        end
    end
end

 

Gives items depending on your race (First login):

Spoiler

quest first_login begin
    state start begin
        when login with pc.getqf('first_login') != 1 begin
            
            local job_items = {
                [0] = {
                    {11299}, --- Items for Warrior
                    {1}, --- How many of this item
                },
                [1] = {
                    {11499}, --- Items for Ninja
                    {1}, --- How many of this item
                },
                [2] = {
                    {11699}, --- Items for Sura
                    {1}, --- How many of this item
                },
            },
            [3] = {
                {11899}, --- Items for Shaman
                {1}, --- How many of this item
            },
        }
        
        local all_items = {
            [1] = {
                {19}, --- Items which everyone will get
                {1}, --- How many of this item
            },
        }
        
        for a = 1, table.getn(job_items[pc.get_job()][1]) do
            pc.give_item2(job_items[pc.get_job][1][a], job_items[pc.get_job][2][a])
        end
        for b = 1, table.getn(all_items[1][2]) do
            pc.give_item2(all_items[1][1][b], give_items[1][2][b])

        pc.setqf('first_login', 1)
        end
    end
end
end
 

 

If you need any new quests, just write me a message.

  • Metin2 Dev 15
  • Dislove 2
  • Good 2
  • Love 1
  • Love 11
Link to comment
Share on other sites

  • 1 month later...

Announcements



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