Level 120 (L1-L5): AVA2 maps, drops, dungeons, dungeon timer UI

- tools/server/level-120: sbtest install of the 120 exp table and the
  unsigned exp column.
- tools/server/ava2-maps: the 10 AVA2 maps (pack, map data, regen, designed
  drops) for sbtest; Ava2MapsScript.inc, gr2 texture and mob_proto tests.
- tools/server/ava2-dungeons: snow / ship defence / Meley quests ported from
  AVA2 (make_quests.py + install.sh).
- mt_dungeon_timer (DungeonTimerScript.inc): AVA2 dungeon timer in place of
  the minimap (RefreshDungeonTimer) and the hydra mast HP bar (gethydrahp).
- Autohunt skips a target that is hit but takes no damage for 4 s (blocked
  Meley statues) and keeps it skipped for 60 s; FindCloseTarget now honours
  the skip list.

Meley full run passed on sbtest with the Mac client. Not deployed live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-17 08:13:32 +09:00
co-authored by Claude Opus 5.5
parent 657e49e52a
commit a1e7da68a4
28 changed files with 1671 additions and 6 deletions
@@ -283,6 +283,23 @@ void CPythonBackground::__CreateProperty()
m_PropertyManager.Initialize(candidates.front().c_str());
}
}
// PORT: 40250 registers only the property pack's own index. Patch packs that bring new maps
// (tools/server/ava2-maps) list their extra property files here, one pack path per line.
CMappedFile kList;
LPCVOID pvList;
if (CEterPackManager::Instance().Get(kList, "property/mt_extra_list.txt", &pvList))
{
const char* text = static_cast<const char*>(pvList);
std::string line;
for (size_t i = 0; i <= kList.Size(); ++i)
{
const char c = i < kList.Size() ? text[i] : '\n';
if (c != '\n' && c != '\r') { line += c; continue; }
if (!line.empty()) m_PropertyManager.Register(line.c_str());
line.clear();
}
}
}
//////////////////////////////////////////////////////////////////////
@@ -937,6 +937,9 @@ bool CPythonNetworkStream::RecvWarpPacket()
__DirectEnterMode_Set(m_dwSelectedCharacterIndex);
// PORT: the phase stays "Game" until the new core's GC_PHASE arrives, and a chat sent once the new socket
// was online but before that reached the core's handshake phase; leave "Game" now so PORT_IsGamePhase drops it.
m_strPhase = "Warp";
CNetworkStream::Connect((DWORD)kWarpPacket.lAddr, kWarpPacket.wPort);
return true;
@@ -1180,6 +1183,9 @@ bool CPythonNetworkStream::SendChatPacket(const char * c_szChat, BYTE byType)
if (strlen(c_szChat) >= 512)
return true;
if (!PORT_IsGamePhase()) // PORT: timers (e.g. /bio status) kept firing during the warp handshake.
return false;
if (c_szChat[0] == '/')
{
if (1 == strlen(c_szChat))
@@ -2424,6 +2430,8 @@ bool CPythonNetworkStream::RecvDamageInfoPacket()
{
if(DamageInfoPacket.damage >= 0)
pInstTarget->AddDamageEffect(DamageInfoPacket.damage,DamageInfoPacket.flag,bSelf,bTarget);
if (!bSelf)
CPythonPlayer::Instance().AutoHunt_OnDamage(DamageInfoPacket.dwVID, DamageInfoPacket.damage); // PORT
else
TraceError("Damage is equal or below 0.");
}
+2
View File
@@ -1796,6 +1796,8 @@ CPythonPlayer::CPythonPlayer(void)
m_dwAutoHuntTargetVID = 0;
m_fAutoHuntStateTime = 0.0f;
m_fAutoHuntProgressTime = 0.0f;
m_fAutoHuntFirstHitTime = 0.0f;
m_fAutoHuntDamageTime = 0.0f;
m_fAutoHuntBestDistance = 0.0f;
m_fAutoHuntNextActionTime = 0.0f;
m_fAutoHuntNextSkillTime = 0.0f;
+3
View File
@@ -740,6 +740,7 @@ class CPythonPlayer : public CSingleton<CPythonPlayer>, public IAbstractPlayer
void AutoHunt_SetSkills(const std::vector<DWORD>& indices);
void AutoHunt_OnDeath();
void AutoHunt_OnHit(DWORD victim); // PORT: actual collision hit, not attack animation
void AutoHunt_OnDamage(DWORD victim, int damage); // PORT: GC_DAMAGE_INFO of our own attack
int AutoHunt_GetMountState() const { return m_iAutoHuntMountState; }
const SAutoHuntConfig& AutoHunt_GetConfig();
void AutoHunt_SetConfig(const SAutoHuntConfig& c_rkConfig);
@@ -796,6 +797,8 @@ class CPythonPlayer : public CSingleton<CPythonPlayer>, public IAbstractPlayer
DWORD m_dwAutoHuntTargetVID;
float m_fAutoHuntStateTime; // when the current target / item / state began
float m_fAutoHuntProgressTime; // last time the target got closer or was hit
float m_fAutoHuntFirstHitTime; // first hit on the target, 0 before it
float m_fAutoHuntDamageTime; // last hit on the target that did damage
float m_fAutoHuntBestDistance;
float m_fAutoHuntNextActionTime;
float m_fAutoHuntNextSkillTime;
@@ -37,6 +37,8 @@ const float c_fAutoHuntResumeDelay = 3.0f; // after the player's own input
const float c_fAutoHuntNoProgressTime = 4.0f; // neither closer to the target nor hitting it
const float c_fAutoHuntTargetTimeout = 60.0f;
const float c_fAutoHuntSkipTime = 30.0f; // an unreachable target is left alone this long
const float c_fAutoHuntNoDamageTime = 4.0f; // hitting a target that takes no damage (Meley's stone statues)
const float c_fAutoHuntImmuneSkipTime = 60.0f; // such a target stays immune until the stage moves on
const float c_fAutoHuntLootDelay = 0.6f; // drops land a moment after the kill
const float c_fAutoHuntLootTimeout = 15.0f;
const float c_fAutoHuntItemTimeout = 5.0f; // one ground item (someone else's, blocked path)
@@ -326,6 +328,7 @@ void CPythonPlayer::__AutoHunt_Engage(DWORD dwVID, float fNow)
m_eAutoHuntState = AUTO_HUNT_ENGAGE;
m_fAutoHuntStateTime = fNow;
m_fAutoHuntProgressTime = fNow;
m_fAutoHuntFirstHitTime = m_fAutoHuntDamageTime = 0.0f;
m_fAutoHuntBestDistance = 1e9f;
m_fAutoHuntNextActionTime = fNow + 0.5f;
@@ -349,8 +352,18 @@ bool CPythonPlayer::__AutoHunt_IsTargetAllowed(CInstanceBase& main, CInstanceBas
// PORT: local combat can interrupt loot/blocked pursuit without changing manual input.
void CPythonPlayer::AutoHunt_OnHit(DWORD victim)
{
if (AutoHunt_IsEnabled() && m_eAutoHuntState == AUTO_HUNT_ENGAGE && victim == m_dwAutoHuntTargetVID)
if (AutoHunt_IsEnabled() && m_eAutoHuntState == AUTO_HUNT_ENGAGE && victim == m_dwAutoHuntTargetVID) {
m_fAutoHuntProgressTime = CTimer::Instance().GetCurrentSecond();
if (!m_fAutoHuntFirstHitTime) m_fAutoHuntFirstHitTime = m_fAutoHuntProgressTime;
}
}
// PORT: a blocked hit (the server's DAMAGE_BLOCK, damage 0) keeps the collision progress going but hurts nothing.
void CPythonPlayer::AutoHunt_OnDamage(DWORD victim, int damage)
{
if (!AutoHunt_IsEnabled() || victim != m_dwAutoHuntTargetVID) return;
AutoHuntTrace("damage %d on target %u", damage, unsigned(victim));
if (damage > 0) m_fAutoHuntDamageTime = CTimer::Instance().GetCurrentSecond();
}
bool CPythonPlayer::__AutoHunt_CanAttackHere(CInstanceBase& main, CInstanceBase& target)
@@ -364,12 +377,15 @@ bool CPythonPlayer::__AutoHunt_CanAttackHere(CInstanceBase& main, CInstanceBase&
DWORD CPythonPlayer::__AutoHunt_FindCloseTarget(CInstanceBase& main, int* count)
{
DWORD best = 0; float distance = 1e9f; int nearby = 0;
const float now = CTimer::Instance().GetCurrentSecond();
auto& manager = CPythonCharacterManager::Instance();
for (auto i = manager.CharacterInstanceBegin(); i != manager.CharacterInstanceEnd(); ++i) {
auto* actor = *i;
if (!actor || !__AutoHunt_IsTargetAllowed(main, *actor) || actor->IsStone() ||
main.GetDistance(actor) > c_fAutoHuntSkillDistance ||
!main.NEW_IsClickableDistanceDestInstance(*actor)) continue;
const auto skip = m_kMap_dwAutoHuntSkipVID.find(actor->GetVirtualID());
if (skip != m_kMap_dwAutoHuntSkipVID.end() && now < skip->second) continue; // PORT: immune / unreachable
if (!__AutoHunt_CanAttackHere(main, *actor)) continue;
++nearby;
if (actor->GetVirtualID() == m_dwAutoHuntTargetVID) best = actor->GetVirtualID();
@@ -945,10 +961,13 @@ void CPythonPlayer::__Update_AutoHunt()
// Blocked path, a target out of reach, or a safe zone that refuses the attack.
const bool isBlockedBySafeZone = rkInstMain.IsInSafe() && rkInstMain.NEW_IsClickableDistanceDestInstance(*pkInstVictim);
if (isBlockedBySafeZone || fNow - m_fAutoHuntProgressTime > c_fAutoHuntNoProgressTime ||
const bool isImmune = m_fAutoHuntFirstHitTime &&
fNow - std::max(m_fAutoHuntFirstHitTime, m_fAutoHuntDamageTime) > c_fAutoHuntNoDamageTime;
if (isBlockedBySafeZone || isImmune || fNow - m_fAutoHuntProgressTime > c_fAutoHuntNoProgressTime ||
fNow - m_fAutoHuntStateTime > c_fAutoHuntTargetTimeout)
{
m_kMap_dwAutoHuntSkipVID[m_dwAutoHuntTargetVID] = fNow + 3.f;
if (isImmune) AutoHuntTrace("target %u takes no damage; skipped", unsigned(m_dwAutoHuntTargetVID));
m_kMap_dwAutoHuntSkipVID[m_dwAutoHuntTargetVID] = fNow + (isImmune ? c_fAutoHuntImmuneSkipTime : 3.f);
m_fAutoHuntCrowdUntil = fNow + 3.f;
__ClearAutoAttackTargetActorID();
__ClearReservedAction(); __AutoHunt_ResetMovement(); rkInstMain.NEW_Stop();