Jump to content

Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( Internal )

Hallo

 

Will I Don't Know What I Have To Say :D , Just This System Made By Saud bin abdullah & MrLibya

 

Note : You Have To Add mysql_direct_query functon [ Credit to : lollo_9_1 // epvp ]

Note2 : First Quest Have Arabic Pet Names , Change It To You Lang

Note3: The System Is Read Normal Pet Names From The Quest , But When You Use The Tool You Will Have To Put Your New Pet Name ,And That Is What You Pet Will Be

Note4 : Well This Is Import :) For Who Want Too Look As Gunis ;) If You Shorten The Quest somehow Don't Share It Here Let It To You Salf :angry: If You Want To Look like the Best Quest Writer Then Why You did'nt you Make The Quest By You Self

Note4 : Sorry For My Bed Eng :D  :D  :D 

 

Quest Was Tested And Work 100% :lol:

 

pet_system :

-- Pet Name System
-- By Saud bin abdullah & MrLibya
-- www.Arab-Dev.Org
quest pet_system begin
    state start begin
        function get_pet_info(itemVnum)
            pet_info_map = {
            --  [ITEM VNUM] MOB_VNUM, DEFAULT NAME, buff_idx, spawn_effect_idx
                [53001]     = { 34001, " عنقاء النار ", 0},
                [53002]     = { 34002, " صغير الرنة ", 0},
                [53003]     = { 34003, " عنقاء الثلج ", 0},
                [53004]     = { 34001, " عنقاء النار ", 0},
                [53005]     = { 34004, " صغير فرعائيل ", 1},
                [53006]     = { 34009, " صغير فرعائيل ", 0},    -- Baby Azrael (gold)
                [53007]     = { 34010, " بامبي ", 0},
                [53008]     = { 34011, " كنود ", 0},            -- Knuud
                [53009]     = { 34012, " باو باو ", 0},        -- Bao Bao
                [53010]     = { 34008, " ليوندس ", 0},
                [53011]     = { 34007, " خان ", 0},
                [53012]     = { 34005, " بوركي ", 0},
                [53013]     = { 34006, " ريوفوس ", 0},    
                [53016]     = { 34015, " العظمي ", 0},
                [53017]     = { 34016, " عنقاء الغابة ", 0},
                [71171]     = { 34013, " Redthief young", 0},
                [71172]     = { 34014, " Redthief young", 0},
            }

            itemVnum = tonumber(itemVnum)

            return pet_info_map[itemVnum]
        end
        function get_spawn_effect_file(idx)
            effect_table = {
                [0] = nil,
                [1] = "d:ymir workeffectetcappear_dienpc2_appear.mse",
            }
            return effect_table [idx]
        end
        when 53001.use or 53002.use or 53003.use or    53004.use or 53005.use or 53006.use or 53007.use or 53008.use or 53009.use or 53010.use or 53011.use or 53012.use or 53013.use or 53016.use or 53017.use or 71171.use or 71172.use begin
            local pet_info = pet_system.get_pet_info(item.vnum)
            local name = pc.get_name()
            
            if null != pet_info then
                if game.get_event_flag(""..name.."pet") == 1 then

                
                local res1, Pname = mysql_direct_query("select * from player.pet_system where id = "..pc.get_player_id().." limit 1;")
                local mobVnum = pet_info[1]
                local petName = Pname[1].pet_name
                local petNameO = pet_info[2]
                local spawn_effect_file_name = pet_system.get_spawn_effect_file(pet_info[3])

                if true == pet.is_summon(mobVnum) then
                    if spawn_effect_file_name != nil then
                        pet.spawn_effect (mobVnum, spawn_effect_file_name)
                    end
                    pet.unsummon(mobVnum)
                else
                    if pet.count_summoned() < 1 then
                            pet.summon(mobVnum, "'s - "..petName, false)
                    else
                        syschat("You already summoned a pet.")
                    end
                    if spawn_effect_file_name != nil then
                        pet.spawn_effect(mobVnum, spawn_effect_file_name)
                    end
                end -- if pet.is_summon
            else
                local mobVnum = pet_info[1]
                local petName = pet_info[2]
                local spawn_effect_file_name = pet_system.get_spawn_effect_file(pet_info[3])

                if true == pet.is_summon(mobVnum) then
                    if spawn_effect_file_name != nil then
                        pet.spawn_effect (mobVnum, spawn_effect_file_name)
                    end
                    pet.unsummon(mobVnum)
                else
                    if pet.count_summoned() < 1 then
                            pet.summon(mobVnum, petName, false)
                    else
                        syschat("You already summoned a pet.")
                    end
                    if spawn_effect_file_name != nil then
                        pet.spawn_effect(mobVnum, spawn_effect_file_name)
                        end
                    end
                end -- if pet.is_summon
            end  -- if null != pet_info
        end -- when
    end -- state
end -- quest

Pet Name:

-- Pet Name System
-- By Saud bin abdullah & MrLibya
-- www.Arab-Dev.Org
quest pet_system_name begin
    state start begin        
        when 71055.use begin
             say_title(" Pet Name ")
             say(" You  Want Change Your Pet Name ?  ")
             local s = select(" Yes "," No ")
             if s == 2 then return end
             say_title(" Pet Name ")
             say(" Write New Name ")
             local NewPetNm = input()
             if NewPetNm == "" then
             say_title(" Pet Name ")
             say("")
             say_reward(" Write Some Thing ")
             say("")
    return
end
             if string.len(NewPetNm) < 1 or string.len(NewPetNm) > 20 then
             say_title(" Pet Name ")
             say("")
             say_reward(" It's Too Long ")
             say("")
        return
end  
                say_title(" Pet Name ")
                say(" Your New Pet Name Set OK  ")
            if pc.getqf ("pet_name_new") == 0 then
             local name = pc.get_name()
            mysql_direct_query("select * from player.pet_system;")
            mysql_direct_query("INSERT INTO `pet_system` (`id`, `pet_name`) VALUES ('"..pc.get_player_id().."', '"..NewPetNm.."');")
             game.set_event_flag(""..name.."pet", 1)
             pc.setqf("pet_name_new", 1)
             syschat(" Your New Pet Name Set OK ")
            
             else
             local name = pc.get_name()
             local res1, res2 = mysql_direct_query("select * from player.pet_system;")
             mysql_direct_query("UPDATE `pet_system` SET `pet_name`='"..NewPetNm.."' WHERE id='"..pc.get_player_id().."';")
             game.set_event_flag(""..name.."pet", 1)
             syschat("Your Pet Name Has Been Update ")
             end -- when
        end
    end -- state
end -- quest

Sql : Put It In Player

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for `pet_system`
-- ----------------------------
DROP TABLE IF EXISTS `pet_system`;
CREATE TABLE `pet_system` (
  `id` int(11) NOT NULL,
  `pet_name` varchar(12) NOT NULL DEFAULT 'NONAME',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  • Metin2 Dev 5
  • Dislove 1
  • Not Good 1
  • Scream 2
  • Good 3
  • Love 13

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/
Share on other sites

  • Premium
mysql_direct_query("select * from player.pet_system;")

Why?

 

 

Becous I Write :

mysql_direct_query("INSERT INTO `pet_system` (`id`, `pet_name`) VALUES ('"..pc.get_player_id().."', '"..NewPetNm.."');")

But Where Is Pet_system ? Here :

mysql_direct_query("select * from player.pet_system;")

And I Don't Understand New Function Too Much ! 2 Days And I am Working On IT . Every Time Test By New Way , Untill It's Work

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-24850
Share on other sites

  • Premium

 

Note4 : Will This Is Import :) For Who Want Too Look As Gunis ;) If You Short The Quest By SomeWhy Don't Share It Here Let It To You Salf :angry: If You Want To Look As Best Quest Writer Then Why You Didn't Make The Quest By You Salf

 

  • Love 1

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-24853
Share on other sites

  • Developer

lol he's trying to help you by teaching you how to write better quests without using useless code n shit, and you're answering bullshit. That's bad, really bad.

In this case, teaching you how to write queries.

  • Love 1

when you return 0 and server doesn't boot:

unknown.png

Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-24854
Share on other sites

  • Premium

lol he's trying to help you by teaching you how to write better quests without using useless code n shit, and you're answering bullshit. That's bad, really bad.

In this case, teaching you how to write queries.

I Didn't Ask For It + He Can PM And Make Good Replay , + If You Didn't Like It Don't Use It

  • Love 1

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-24856
Share on other sites

  • Premium
On 11/15/2014 at 10:41 PM, Minion said:

my pet system name :)

 

OMG How Did You Do This ?

Bro Add Level TO My Quest And Have Fun

+ Thanks For The Topice Not Very Bed :P

  • Metin2 Dev 1

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-24860
Share on other sites

looool he's really teaching you i think you shod have some Lassen from MrLibya he is good with teaching he can give you a free quest and helping you no one complete but at list he share some off what he make and fix .

When you are giving a lesson you should do it right.

I just gave him a tip.

Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-24861
Share on other sites

On 11/15/2014 at 10:45 PM, MrLibya said:

 

my pet system name :)

 

OMG How Did You Do This ?

Bro Add Level TO My Quest And Have Fun

+ Thanks For The Topice Not Very Bed :P

 

My system name is done through the kernel, and if you have not noticed, the name of my pet more than 24 characters

  • Love 1
Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-24864
Share on other sites

  • Premium

 

looool he's really teaching you i think you shod have some Lassen from MrLibya he is good with teaching he can give you a free quest and helping you no one complete but at list he share some off what he make and fix .

When you are giving a lesson you should do it right.

I just gave him a tip.

 

 

And Think You For THe Tip , But You Was Can Give It In PM , Topice Only For Bug + Thanks :)  For That I Write Note4

 

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-24865
Share on other sites

  • Premium
On 11/15/2014 at 10:49 PM, Minion said:

 

 

my pet system name :)

 

OMG How Did You Do This ?

Bro Add Level TO My Quest And Have Fun

+ Thanks For The Topice Not Very Bed :P

 

My system name is done through the kernel, and if you have not noticed, the name of my pet more than 24 characters

 

Ahaa . Good For You Bro

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-24866
Share on other sites

Just passing by to point out this is most likely vulnerable to SQL injection (depends on the implementation of the query function).

 mysql_direct_query("INSERT INTO `pet_system` (`id`, `pet_name`) VALUES ('"..pc.get_player_id().."', '"..NewPetNm.."');")

19 chars is all it takes.

';DROP TABLE item--
Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-25232
Share on other sites

  • 1 year later...

Hi.

You can not be solved somehow to save the mob_id
As in all and you can pet?

mysql_direct_query("select * from player.pet_system;")

mysql_direct_query("INSERT INTO `pet_system` (`id`, `mob_vnum`, `pet_name`) VALUES ('"..pc.get_player_id().."', '..mob_vnum()..', '"..NewPetNm.."');")

Please help.

Thanx.

Link to comment
https://metin2.dev/topic/3833-pet-name-system-full/#findComment-76482
Share on other sites

  • 5 months later...

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.