Premium Syreldar 1886 Posted March 17, 2023 Premium Share Posted March 17, 2023 (edited) Quote With the version 17.3, GameForge implemented new immunity conditions where he gains full damage immunity (MISS) as long as there's even just one of his 4 different Metinstones alive. The Stones still keep their effect, and this makes the Metin of the Mountain (8031) basically useless since it used to increment his damage resistance by 25%. The update 21.3 increased the number of Metinstones in the map to 8, it was 4 previously. [Respawn time: 2.5 minutes per stone] I'll include the change in the regen for that. It also changed the dungeon's entry conditions, but since everyone's got different quests for the dungeon, I don't think it's worth putting it here. Location: char_battle.cpp -> bool CHARACTER::Damage: Below: if (!GetSectree() || GetSectree()->IsAttr(GetX(), GetY(), ATTR_BANPK)) return false; Add: This is the hidden content, please Sign In or Sign Up I've also linked the code to a game eventflag, so you can freely disable it by typing the following: Quote /e ignore_dragonlair_new_immune 1 And in the regen [data/dungeon/dragon_lair.txt]: r 170 160 15 15 0 0 150s 5000 1 8001 r 190 180 15 15 0 0 150s 5000 1 8001 r 170 160 15 15 0 0 150s 5000 1 8001 r 190 180 15 15 0 0 150s 5000 1 8001 r 170 160 15 15 0 0 150s 5000 1 8001 r 190 180 15 15 0 0 150s 5000 1 8001 r 170 160 15 15 0 0 150s 5000 1 8001 r 190 180 15 15 0 0 150s 5000 1 8001 HF. Edited March 17, 2023 by Syreldar 99 2 1 1 13 2 24 "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Forum Moderator Gurgarath 2523 Posted March 17, 2023 Forum Moderator Share Posted March 17, 2023 Absolute chad move, thank you very much, I knew it changed but I was always unable to find anyone able to explain what it exactly was. Also, do you have screenshots or information of the entry conditions and stuff? For the scrubs like me who uses official locale_quest? 1 Gurgarath coming soon Link to comment Share on other sites More sharing options...
Premium Syreldar 1886 Posted March 17, 2023 Author Premium Share Posted March 17, 2023 (edited) 12 minutes ago, Gurgarath said: Absolute chad move, thank you very much, I knew it changed but I was always unable to find anyone able to explain what it exactly was. Also, do you have screenshots or information of the entry conditions and stuff? For the scrubs like me who uses official locale_quest? Sure, basically they made it so the dragon is no longer exclusive to one group per hour, but free-access (meaning it's not a global room anymore, but an instanced dungeon), and people can enter up to 6 times per day following these criteria: Minimum level: 75 (unchanged) Each member of the party needs to have: - 5x Spiral Key (vnum 30179). +If it's the first time they enter for that day: 5x Spiral Key (vnum 30179). +If it's not, they can enter up to 5 additional times that day by giving 70x Dragon's Temple Entry (vnum 71122) to the Spirit of a Sura NPC each time they enter. Meaning a total of 350 units if they wanna enter all 5 additional times for that day. It's really easy to code via quest. Edited March 17, 2023 by Syreldar 1 "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Honorable Member Mali 42304 Posted March 17, 2023 Honorable Member Share Posted March 17, 2023 @ Gurgarath 21.3: https://board.en.metin2.gameforge.com/index.php?thread/98925-the-update-is-bringing-many-improvements/ 1 Link to comment Share on other sites More sharing options...
Honorable Member martysama0134 7198 Posted March 18, 2023 Honorable Member Share Posted March 18, 2023 (edited) I did a small refactory, but I haven't tested it yet: diff --git a/s3ll_server/Srcs/Server/game/src/BlueDragon.cpp b/s3ll_server/Srcs/Server/game/src/BlueDragon.cpp index f8bfd0f5..7995fc09 100644 --- a/s3ll_server/Srcs/Server/game/src/BlueDragon.cpp +++ b/s3ll_server/Srcs/Server/game/src/BlueDragon.cpp @@ -135,9 +135,22 @@ int BlueDragon_Damage (LPCHARACTER me, LPCHARACTER pAttacker, int dam) if (nullptr == me || nullptr == pAttacker) return dam; - if (true == pAttacker->IsMonster() && 2493 == pAttacker->GetMobTable().dwVnum) + #ifdef ENABLE_BLUEDRAGON_RENEWAL + if (pAttacker->IsMonster() && BlueDragon::BossVnum == pAttacker->GetMobTable().dwVnum) { - for (int i=1 ; i <= 4 ; ++i) + for (int i=1; i <= BlueDragon::StoneCount; ++i) + { + const auto dwDragonStoneID = BlueDragon_GetIndexFactor("DragonStone", i, "vnum"); + const auto cnt = SECTREE_MANAGER::instance().GetMonsterCountInMap( me->GetMapIndex(), dwDragonStoneID); + if (cnt > 0) + return 0; + } + } + #endif + + if (pAttacker->IsMonster() && BlueDragon::BossVnum == pAttacker->GetMobTable().dwVnum) + { + for (int i=1; i <= BlueDragon::StoneCount; ++i) { if (ATK_BONUS == BlueDragon_GetIndexFactor("DragonStone", i, "effect_type")) { @@ -152,9 +165,9 @@ int BlueDragon_Damage (LPCHARACTER me, LPCHARACTER pAttacker, int dam) } } - if (true == me->IsMonster() && 2493 == me->GetMobTable().dwVnum) + if (me->IsMonster() && BlueDragon::BossVnum == me->GetMobTable().dwVnum) { - for (int i=1 ; i <= 4 ; ++i) + for (int i=1; i <= BlueDragon::StoneCount; ++i) { if (DEF_BONUS == BlueDragon_GetIndexFactor("DragonStone", i, "effect_type")) { @@ -172,9 +185,9 @@ int BlueDragon_Damage (LPCHARACTER me, LPCHARACTER pAttacker, int dam) } } - if (true == me->IsStone() && 0 != pAttacker->GetMountVnum()) + if (me->IsStone() && 0 != pAttacker->GetMountVnum()) { - for (int i=1 ; i <= 4 ; ++i) + for (int i=1; i <= BlueDragon::StoneCount; ++i) { if (me->GetMobTable().dwVnum == BlueDragon_GetIndexFactor("DragonStone", i, "vnum")) { diff --git a/s3ll_server/Srcs/Server/game/src/BlueDragon.h b/s3ll_server/Srcs/Server/game/src/BlueDragon.h index 25b7d5b4..d1a44149 100644 --- a/s3ll_server/Srcs/Server/game/src/BlueDragon.h +++ b/s3ll_server/Srcs/Server/game/src/BlueDragon.h @@ -1,5 +1,16 @@ +#ifndef BLUE_DRAGON_H +#define BLUE_DRAGON_H +#pragma once + +#define ENABLE_BLUEDRAGON_RENEWAL + +namespace BlueDragon { + constexpr int BossVnum = 2493; + constexpr int StoneCount = 4; +} extern int BlueDragon_StateBattle (LPCHARACTER); extern time_t UseBlueDragonSkill (LPCHARACTER, unsigned int); extern int BlueDragon_Damage (LPCHARACTER me, LPCHARACTER attacker, int dam); +#endif // BLUE_DRAGON_H diff --git a/s3ll_server/Srcs/Server/game/src/char.cpp b/s3ll_server/Srcs/Server/game/src/char.cpp index 9f564ea6..50692f6e 100644 --- a/s3ll_server/Srcs/Server/game/src/char.cpp +++ b/s3ll_server/Srcs/Server/game/src/char.cpp @@ -53,6 +53,7 @@ #include "BlueDragon_Binder.h" #include "skill_power.h" #include "buff_on_attributes.h" +#include "BlueDragon.h" #ifdef __PET_SYSTEM__ #include "PetSystem.h" @@ -2349,12 +2350,12 @@ EVENTFUNC(recovery_event) if (ch->IsAffectFlag(AFF_BLEEDING)) return PASSES_PER_SEC(MAX(1, ch->GetMobTable().bRegenCycle)); #endif - if (2493 == ch->GetMobTable().dwVnum) + if (BlueDragon::BossVnum == ch->GetMobTable().dwVnum) { int regenPct = BlueDragon_GetRangeFactor("hp_regen", ch->GetHPPct()); regenPct += ch->GetMobTable().bRegenPercent; - for (int i=1 ; i <= 4 ; ++i) + for (int i=1; i <= BlueDragon::StoneCount; ++i) { if (REGEN_PECT_BONUS == BlueDragon_GetIndexFactor("DragonStone", i, "effect_type")) { @@ -2382,9 +2383,9 @@ EVENTFUNC(recovery_event) return 0; } - if (2493 == ch->GetMobTable().dwVnum) + if (BlueDragon::BossVnum == ch->GetMobTable().dwVnum) { - for (int i=1 ; i <= 4 ; ++i) + for (int i=1; i <= BlueDragon::StoneCount; ++i) { if (REGEN_TIME_BONUS == BlueDragon_GetIndexFactor("DragonStone", i, "effect_type")) { diff --git a/s3ll_server/Srcs/Server/game/src/char_battle.cpp b/s3ll_server/Srcs/Server/game/src/char_battle.cpp index c71e535a..7fdc24b9 100644 --- a/s3ll_server/Srcs/Server/game/src/char_battle.cpp +++ b/s3ll_server/Srcs/Server/game/src/char_battle.cpp @@ -1472,7 +1472,7 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) CloseMyShop(); CloseSafebox(); - if (IsMonster() && 2493 == GetMobTable().dwVnum) + if (IsMonster() && BlueDragon::BossVnum == GetMobTable().dwVnum) { if (pkKiller && pkKiller->GetGuild()) CDragonLairManager::instance().OnDragonDead(this, pkKiller->GetGuild()->GetID()); @@ -2092,6 +2092,13 @@ bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) // retu } dam = BlueDragon_Damage(this, pAttacker, dam); + #ifdef ENABLE_BLUEDRAGON_RENEWAL + if (!dam) + { + SendDamagePacket(pAttacker, 0, DAMAGE_BLOCK); + return false; + } + #endif BYTE damageFlag = 0; diff --git a/s3ll_server/Srcs/Server/game/src/char_state.cpp b/s3ll_server/Srcs/Server/game/src/char_state.cpp index dc5b44ae..aae5dfc9 100644 --- a/s3ll_server/Srcs/Server/game/src/char_state.cpp +++ b/s3ll_server/Srcs/Server/game/src/char_state.cpp @@ -1008,7 +1008,7 @@ void CHARACTER::StateBattle() if (m_pkParty) m_pkParty->SendMessage(this, PM_ATTACKED_BY, 0, 0); - if (2493 == m_pkMobData->m_table.dwVnum) + if (BlueDragon::BossVnum == m_pkMobData->m_table.dwVnum) { m_dwStateDuration = BlueDragon_StateBattle(this); return; To display the changes side by side, paste it in https://diffy.org/ like this: @ ASIKOOIt would be great if you could enable the DIFF patch syntax for code blocks. Edit: if you're using very old src, edit this: namespace BlueDragon { enum eBlueDragon { BossVnum = 2493, StoneCount = 4, }; } Edited March 18, 2023 by Metin2 Dev International Core X - External 2 Internal 2 1 1 Check out my GitHub Link to comment Share on other sites More sharing options...
Honorable Member martysama0134 7198 Posted March 18, 2023 Honorable Member Share Posted March 18, 2023 (edited) If you want to calculate the size of the stone array automatically, you can use this function unsigned int BlueDragon_GetDragonStoneCount() { lua_State* L = quest::CQuestManager::instance().GetLuaState(); const int stack_top = lua_gettop(L); lua_getglobal(L, "BlueDragonSetting"); if (false == lua_istable(L, -1)) { lua_settop(L, stack_top); return 0; } lua_pushstring(L, "DragonStone"); lua_gettable(L, -2); if (false == lua_istable(L, -1)) { lua_settop(L, stack_top); sys_err("BlueDragon: no required table DragonStone"); return 0; } const unsigned int count = static_cast<unsigned int>(luaL_getn(L, -1)); lua_settop(L, stack_top); return count; } ty chatgpt for Edited March 18, 2023 by Metin2 Dev International Core X - External 2 Internal 3 1 1 2 Check out my GitHub Link to comment Share on other sites More sharing options...
Recommended Posts