Jump to content

Recommended Posts

Hey, i've been sorting out a quest so that when you've got an item in your inventory you'll gain a bonus without the need to use, in this instance it's mounts. I've got it to work bug free but i can't figure out the remaining values.

 

the code below is what detects the item and then apples a mount_bonus value in this instance it applies 5,000 HP when the item is in your inventory.

 

any value other than "1" <-- for hp doesn't work. here's a list of the possible values for all bonuses. if anyone has done this and got it working with things such as monster damage and other bonuses i'd greatly appreciate you showing me how you got it.

quest mountbonus begin
    state start begin
        when login or enter with pc.getqf("mount_bonus") != 1 begin
            if pc.count_item(52001)>=1 then
                pc.mount_bonus(1, 5000, 60*60*24*365)
                pc.setqf("mount_bonus", 1)
            end
        end
        when logout or disconnect with pc.getqf("mount_bonus") == 1 begin
		pc.setqf("mount_bonus", 0)
		pc.mount_bonus(1, -5000, 60*60*24*365)
        end
		
   end
end

apply = {
	["MAX_HP"]		= 1,
	["MAX_SP"]		= 2,
	["CON"]			= 3,
	["INT"]			= 4,
	["STR"]			= 5,
	["DEX"]			= 6,
	["ATT_SPEED"]		= 7,
	["MOV_SPEED"]		= 8,
	["CAST_SPEED"]		= 9,
	["HP_REGEN"]		= 10,
	["SP_REGEN"]		= 11,
	["POISON_PCT"]		= 12,
	["STUN_PCT"]		= 13,
	["SLOW_PCT"]		= 14,
	["CRITICAL_PCT"]	= 15,
	["PENETRATE_PCT"]	= 16,
	["ATTBONUS_HUMAN"]	= 17,
	["ATTBONUS_ANIMAL"]	= 18,
	["ATTBONUS_ORC"]	= 19,
	["ATTBONUS_MILGYO"]	= 20,
	["ATTBONUS_UNDEAD"]	= 21,
	["ATTBONUS_DEVIL"]	= 22,
	["STEAL_HP"]		= 23,
	["STEAL_SP"]		= 24,
	["MANA_BURN_PCT"]	= 25,
	["DAMAGE_SP_RECOVER"]	= 26,
	["BLOCK"]		= 27,
	["DODGE"]		= 28,
	["RESIST_SWORD"]	= 29,
	["RESIST_TWOHAND"]	= 30,
	["RESIST_DAGGER"]	= 31,
	["RESIST_BELL"]		= 32,
	["RESIST_FAN"]		= 33,
	["RESIST_BOW"]		= 34,
	["RESIST_FIRE"]		= 35,
	["RESIST_ELEC"]		= 36,
	["RESIST_MAGIC"]	= 37,
	["RESIST_WIND"]		= 38,
	["REFLECT_MELEE"]	= 39,
	["REFLECT_CURSE"]	= 40,
	["POISON_REDUCE"]	= 41,
	["KILL_SP_RECOVER"]	= 42,
	["EXP_DOUBLE_BONUS"]	= 43,
	["GOLD_DOUBLE_BONUS"]	= 44,
	["ITEM_DROP_BONUS"]	= 45,
	["POTION_BONUS"]	= 46,
	["KILL_HP_RECOVER"]	= 47,
	["IMMUNE_STUN"]		= 48,
	["IMMUNE_SLOW"]		= 49,
	["IMMUNE_FALL"]		= 50,
	["SKILL"]		= 51,
	["BOW_DISTANCE"]	= 52,
	["ATT_GRADE_BONUS"]	= 53,
	["DEF_GRADE_BONUS"]	= 54,
	["MAGIC_ATT_GRADE"]	= 55,
	["MAGIC_DEF_GRADE"]	= 56,
	["CURSE_PCT"]		= 57,
	["MAX_STAMINA"]		= 58,
	["ATTBONUS_WARRIOR"]	= 59,
	["ATTBONUS_ASSASSIN"]	= 60,
	["ATTBONUS_SURA"]	= 61,
	["ATTBONUS_SHAMAN"]	= 62,
	["ATTBONUS_MONSTER"]	= 63,
}
  • Love 1
pc.mount_bonus(1, 5000, 60*60*24*365)
pc.mount_bonus(1, -5000, 60*60*24*365)

replace to 

pc.mount_bonus(apply.MAX_HP, 5000, 31536000) -- For 1 Years
pc.mount_bonus(apply.MAX_HP, -5000, 31536000) -- For 1 Years

test it again

 

Kind Regards

HaveBeen

  • Love 1

Plain logic saves lives.

  • 4 years later...
    state start begin
        when login begin
            if pc.count_item(40016)==1 then
                affect.add_collect(apply.ATTBONUS_MONSTER, 12, 60*60*24*365*60)
            else
                affect.remove_collect(apply.ATTBONUS_MONSTER, 12, 60*60*24*365*60)
            end
        end
        when logout or disconnect begin
            if pc.getqf("40016") == 1 then
                affect.remove_collect(apply.ATTBONUS_MONSTER, 12, 60*60*24*365*60)
            end
        end
        when 40016.use begin
            if pc.is_polymorphed() then
                say("You polymorphedi!")
                elseif pc.is_mount() then
                say("Unmount!")
            else
                pc.mount(20976, 3600)
            end
        end
    end
end

 

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.