diff --git a/docs/FEATURE-LEVEL-120.md b/docs/FEATURE-LEVEL-120.md index 40fe2647..15580dd0 100644 --- a/docs/FEATURE-LEVEL-120.md +++ b/docs/FEATURE-LEVEL-120.md @@ -42,3 +42,8 @@ Later, below 105 or separate systems: summer maps `a1/c1_summer`, `metin2_12zi_s - Client fix found on the way: after `/warp`, a timer chat (`/bio status`, `/server_bonuses`) sent between the new socket coming online and the core's GC_PHASE reached the core's handshake phase and got the connection closed ("Handshake phase does not handle packet 3"). The client now leaves the "Game" phase on GC_WARP and drops chat outside it. - L5 on sbtest (2026-10-17): 99 drop groups appended (107 generated, the 8 existing kept). A kill test on plechito (`/m` + `/weaken all` + auto hunt) dropped the tier items, the lv115 armor, and the flame/hydra boss materials. - L4 on sbtest (2026-10-17): AVA2's snow / ship defence / Meley quests ported as `snow_dungeon`, `ShipDefense`, `MeleyDungeon` by the client repo's `tools/server/ava2-dungeons` (`make_quests.py` + `install.sh`, see its README). Server side: `port_ava2_dungeon.cpp` (the `d.*` / `npc.*` functions AVA2's quests call), `QUEST_ATTACK_EVENT` (`.attack`, Meley's HP phases), the Meley and hydra HP helpers. `d.track_update`, `game.check_event` and the battle pass calls were dropped from the quests instead of ported. The game build is installed only as sbtest's `game.switchbot` (previous one kept as `game.switchbot.pre-l4`). Entry test on the Mac client (key + `/warp` to the NPC + quest dialog → solo → yes): all three dungeons warp in (352, 355, 212), the key is used, the dungeon timers and mob spawns start, and syserr shows no quest errors. Meley full run (2026-10-17, solo GM at level 120 with a temporary sbtest-only damage/HP buff quest, since removed): all 9 floors, the floor-10 chest, and the exit warp back to map 62 (5986,6573) in 837 s; the 3 h cooldown flag is written. Fixes found on the way: `char_battle.cpp` never lets a hit take a dragon statue (6230) below 1 HP, so only the quest's `npc.dead_by_vnum` kills it (AVA2 has the same stuck-lair bug on floor 8); the client's autohunt now skips a target that is hit but takes no damage for 4 s (it stays skipped for 60 s). The client's `mt_dungeon_timer` shows the AVA2 dungeon timer (boss portrait, floor/wave, countdown) in place of the minimap, plus the hydra mast HP bar. Not yet played through: the snow floors, the hydra waves, party entry. +- Snow / ship / party runs (2026-10-17), with the fixes they needed: + - QUEST_INFO desync: `SendQuestInfoPakcet` sent the header before the optional fields were added, so `qi.size` was short and the client read the rest as a new packet ("Unknown packet header: 212"). The fields are now built first. The client also takes the full size from the flags. + - Hydra 6812 (KING, MAGIC) never took damage. The deck stops a player about 620 from its centre, and `battle_melee_attack` allowed only 300 (AVA2 600, still short of 620), so the server dropped every hit as VICTIM_FAR. For a non-PC victim of rank BOSS or higher the limit is now 800. The client gives a boss the 500 centre test of a huge race, like AVA2's `IsBoss()`. + - Client autohunt: large targets (defending reach as body size, walk straight at a body in reach when the planner finds no path), escalating skip for a target it keeps stalling on, a new anchor after a teleport (snow floor changes move the player more than 2000), and the immune skip only counts an explicit 0-damage packet. + - The snow driver used GM `/purge all` on floors 1/3/4 when a floor was still open after 300 s. This is a test accelerator for floors with 100+ mobs, not autohunt. diff --git a/src/server/game/src/battle.cpp b/src/server/game/src/battle.cpp index e3f36941..d5a98742 100755 --- a/src/server/game/src/battle.cpp +++ b/src/server/game/src/battle.cpp @@ -138,6 +138,12 @@ int battle_melee_attack(LPCHARACTER ch, LPCHARACTER victim) // PCÀÏ °æ¿ì »ó´ë°¡ melee ¸÷ÀÏ °æ¿ì ¸÷ÀÇ °ø°Ý °Å¸®°¡ ÃÖ´ë °ø°Ý °Å¸® if (false == victim->IsPC() && BATTLE_TYPE_MELEE == victim->GetMobBattleType()) max = MAX(300, (int) (victim->GetMobAttackRange() * 1.15f)); + + // A boss body can be far wider than 300 (the hydra 6812 is out on the water and the deck + // stops a player about 620 from its centre). The client already allows 500 from a boss + // centre on its odd x/z test, so the server allows 800 for a boss. + if (false == victim->IsPC() && victim->GetMobRank() >= MOB_RANK_BOSS) + max = MAX(max, 800); } if (distance > max) diff --git a/src/server/game/src/questpc.cpp b/src/server/game/src/questpc.cpp index f55551dc..aee676d9 100755 --- a/src/server/game/src/questpc.cpp +++ b/src/server/game/src/questpc.cpp @@ -241,8 +241,8 @@ namespace quest qi.index = m_RunningQuestState->iIndex; qi.flag = m_iSendToClient; + // The optional fields go into buf first so qi.size is final before the header is sent. TEMP_BUFFER buf; - buf.write(&qi, sizeof(qi)); if (m_iSendToClient & QUEST_SEND_ISBEGIN) { @@ -299,7 +299,14 @@ namespace quest sys_log(1, "QUEST Icon File %s", m_RunningQuestState->_icon_file.c_str()); } - CQuestManager::instance().GetCurrentCharacterPtr()->GetDesc()->Packet(buf.read_peek(),buf.size()); + LPDESC d = CQuestManager::instance().GetCurrentCharacterPtr()->GetDesc(); + if (buf.size()) + { + d->BufferedPacket(&qi, sizeof(qi)); + d->Packet(buf.read_peek(), buf.size()); + } + else + d->Packet(&qi, sizeof(qi)); m_iSendToClient = 0;