feat(parity): replicate skill execution, affect sync, packet send methods, and monster color oracle (pass34)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"reference": "upstream/ava2-client/UserInterface/Packet.h preprocessed with AVA2 Windows feature headers",
|
||||
"checked": 240,
|
||||
"checked": 243,
|
||||
"mismatches": [],
|
||||
"unmatched": []
|
||||
}
|
||||
|
||||
@@ -282,7 +282,9 @@
|
||||
"port_file": "src/python_native_modules.cpp",
|
||||
"windows_methods": 24,
|
||||
"missing": [],
|
||||
"extra": [],
|
||||
"extra": [
|
||||
"GetMonsterColor"
|
||||
],
|
||||
"placeholder": []
|
||||
},
|
||||
{
|
||||
|
||||
@@ -755,5 +755,33 @@ Validation: macOS build and Android arm64 libmain.so pass. Five targeted CTests
|
||||
- Checked packet constants: **240**, 0 mismatches, 0 unmatched.
|
||||
- `python3 tools/audit_windows_parity.py`: **0 placeholder bindings**.
|
||||
- `python3 tools/audit_ava2_python_interfaces.py`: **46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods**.
|
||||
## 2026-10-08 pass34 — Skill execution & affect sync, packet constants & send methods, monster color oracle parity
|
||||
- **Packet Constants & Structs Parity (`src/eter_net/Packet.h`)**:
|
||||
- Added `HEADER_CG_DIRECT_ENTER = 9`, `HEADER_CG_SHOOT = 54`, `HEADER_CG_STATE_CHECKER = 94` to packet constants, bringing checked constants up to **243/243 (100% parity)**.
|
||||
- Defined upstream wire structs: `TPacketCGUseSkill`, `TPacketCGPosition`, `TPacketCGTarget`, `TPacketCGShoot`, and `TPacketCGSyncPositionElement`.
|
||||
- **PythonNetworkStream Send Methods Parity (`src/eter_net/PythonNetworkStream.h` & `.cpp`)**:
|
||||
- Implemented `SendUseSkillPacket(uint32_t skillIndex, uint32_t targetVID = 0)`.
|
||||
- Implemented `SendAddFlyTargetingPacket(uint32_t targetVID, int32_t x, int32_t y)`.
|
||||
- Implemented `SendTargetPacket(uint32_t vid)`.
|
||||
- Implemented `SendShootPacket(uint32_t uSkill)`.
|
||||
- Implemented `SendCharacterPositionPacket(uint8_t iPosition)`.
|
||||
- Implemented `SendSyncPositionElementPacket(uint32_t victimVID, int32_t victimX, int32_t victimY)`.
|
||||
- **NonPlayer Monster Color Oracle & Native Binding Parity (`src/nonplayer_data.h`, `.cpp`, `src/python_native_modules.cpp`)**:
|
||||
- Added `monsterColor` field to `MobRecord` extracted from wire offset `217 + prefixShift + resistShift` across all 5 mob table revisions (`r235`, `r255`, `r256`, `r262`, `r263`).
|
||||
- Added `GetMonsterColor(vnum)` to `NonPlayerData` and exported native binding `nonplayer.GetMonsterColor(vnum)`.
|
||||
- Corrected `nonplayer.GetRaceNumByVID` to return `-1` when actor/mob is null (matching upstream `CPythonNonPlayer::GetTable` nullptr fallback).
|
||||
- Added oracle test assertions verifying `dwMonsterColor` wire parsing across revisions.
|
||||
- **Skill Execution, Combo & Affect Synchronization Parity (`src/python_gameplay_modules.h`, `.cpp`, `NetworkActorManager.h`, `.cpp`)**:
|
||||
- Implemented `ClickSkillSlot(skillSlot)` with full upstream checks (guild skills, combo toggle, toggle off, cooltime with `CTimer::Instance().GetCurrentSecond()`, target requirement, and casting speed formula) calling `SendUseSkillPacket` and `RunUseSkillEvent`.
|
||||
- Implemented `UseGuildSkill(skillSlot)` with guild war validation (`IsDoingGuildWar`) and cooldown tracking.
|
||||
- Implemented `SetPlayerAffect(affect)` and `ResetPlayerAffect(affect)` dispatching toggle skill activation/deactivation (`ActivateSkillSlot`/`DeactivateSkillSlot`) and notifying Python game window.
|
||||
- Added `SetAffectChangeHandler` callback mechanism in `NetworkActorManager` to sync main player affects from `AppendActor`, `UpdateActor`, and `RemoveActor` without creating circular dependencies.
|
||||
- Added `ActorInstance::SetComboType(uint16_t)` and updated `/combo` network command handler to call `SetComboSkillFlag` matching upstream `PythonNetworkStreamCommand.cpp`.
|
||||
- Updated `player_window_call` to use `PyCallClassMemberFunc` with safe `PyErr_Clear()`.
|
||||
- **Results**:
|
||||
- Checked packet constants: **243/243 (100%)**, 0 mismatches, 0 unmatched.
|
||||
- `python3 tools/audit_windows_parity.py`: **0 placeholder bindings**.
|
||||
- `python3 tools/audit_ava2_python_interfaces.py`: **46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods**.
|
||||
- CTest suite: **41/41 tests passed (100%)**.
|
||||
- Android arm64 `libmain.so` and macOS arm64 `ava2_client` build cleanly.
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ bool (*s_isPartyMemberByVID)(uint32_t) = nullptr;
|
||||
int (*s_getNPCWear)(uint32_t, uint8_t) = nullptr;
|
||||
bool (*s_getItemScale)(uint32_t, uint32_t, float[3], float[3]) = nullptr;
|
||||
bool (*s_getItemData)(uint32_t, SItemModelData*) = nullptr;
|
||||
void (*s_onSetPlayerAffect)(unsigned) = nullptr;
|
||||
void (*s_onResetPlayerAffect)(unsigned) = nullptr;
|
||||
bool s_hairColorEnable = false; // InstanceBase.cpp HAIR_COLOR_ENABLE=FALSE until app.SetHairColorEnable
|
||||
bool s_armorSpecular = false; // USE_ARMOR_SPECULAR=FALSE until app.SetArmorSpecularEnable
|
||||
|
||||
@@ -231,6 +233,10 @@ bool NetworkActorManager::IsPartyMember(uint32_t vid) { return s_isPartyMemberBy
|
||||
void NetworkActorManager::SetNPCWearQuery(int (*query)(uint32_t, uint8_t)) { s_getNPCWear = query; }
|
||||
void NetworkActorManager::SetItemScaleQuery(bool (*query)(uint32_t, uint32_t, float[3], float[3])) { s_getItemScale = query; }
|
||||
void NetworkActorManager::SetItemDataQuery(bool (*query)(uint32_t, SItemModelData*)) { s_getItemData = query; }
|
||||
void NetworkActorManager::SetAffectChangeHandler(void (*onSet)(unsigned), void (*onReset)(unsigned)) {
|
||||
s_onSetPlayerAffect = onSet;
|
||||
s_onResetPlayerAffect = onReset;
|
||||
}
|
||||
void NetworkActorManager::SetHairColorEnable(bool enable) { s_hairColorEnable = enable; }
|
||||
void NetworkActorManager::SetArmorSpecularEnable(bool enable) { s_armorSpecular = enable; }
|
||||
|
||||
@@ -497,6 +503,15 @@ void NetworkActorManager::AppendActor(const SNetworkActorData& data) {
|
||||
|
||||
RefreshTextTail(data.m_dwVID);
|
||||
|
||||
for (unsigned i = 0; i < 64; ++i) {
|
||||
if ((data.m_affectFlags[i / 32] & (1u << (i % 32))) != 0) {
|
||||
SCRIPT_SetAffect(data.m_dwVID, i, true);
|
||||
if (IsMainActorVID(data.m_dwVID)) {
|
||||
if (s_onSetPlayerAffect) s_onSetPlayerAffect(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (IsMainActorVID(data.m_dwVID)) {
|
||||
m_mainPosX = data.m_lCurX;
|
||||
m_mainPosY = data.m_lCurY;
|
||||
@@ -506,6 +521,13 @@ void NetworkActorManager::AppendActor(const SNetworkActorData& data) {
|
||||
void NetworkActorManager::RemoveActor(uint32_t vid) {
|
||||
auto it = m_actors.find(vid);
|
||||
if (it != m_actors.end()) {
|
||||
if (IsMainActorVID(vid)) {
|
||||
for (unsigned i = 0; i < 64; ++i) {
|
||||
if ((it->second.m_affectFlags[i / 32] & (1u << (i % 32))) != 0) {
|
||||
if (s_onResetPlayerAffect) s_onResetPlayerAffect(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
DestroyAttachedEffects(it->second);
|
||||
m_actors.erase(it);
|
||||
// CPythonCharacterManager::DeleteInstance drops m_pkInstBind / m_pkInstPick (and
|
||||
@@ -521,6 +543,9 @@ void NetworkActorManager::UpdateActor(const SNetworkUpdateActorData& data) {
|
||||
if (it == m_actors.end()) return;
|
||||
|
||||
auto& actorData = it->second;
|
||||
uint32_t oldAffectFlags[2];
|
||||
std::copy_n(actorData.m_affectFlags, 2, oldAffectFlags);
|
||||
|
||||
actorData.m_dwArrowType = data.m_dwArrowType;
|
||||
actorData.m_dwConquerorLevel = data.m_dwConquerorLevel;
|
||||
actorData.m_dwStateFlags = data.m_dwStateFlags;
|
||||
@@ -547,6 +572,21 @@ void NetworkActorManager::UpdateActor(const SNetworkUpdateActorData& data) {
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < 64; ++i) {
|
||||
bool isOldSet = (oldAffectFlags[i / 32] & (1u << (i % 32))) != 0;
|
||||
bool isNewSet = (data.m_affectFlags[i / 32] & (1u << (i % 32))) != 0;
|
||||
if (isOldSet != isNewSet) {
|
||||
SCRIPT_SetAffect(data.m_dwVID, i, isNewSet);
|
||||
if (IsMainActorVID(data.m_dwVID)) {
|
||||
if (isNewSet) {
|
||||
if (s_onSetPlayerAffect) s_onSetPlayerAffect(i);
|
||||
} else {
|
||||
if (s_onResetPlayerAffect) s_onResetPlayerAffect(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ChangeSash(data.m_dwVID, data.m_dwSash);
|
||||
if (data.m_dwConquerorLevel > 0) {
|
||||
TextTailManager::Instance().AttachConquerorLevel(data.m_dwVID, "Lv " + std::to_string(data.m_dwConquerorLevel));
|
||||
|
||||
@@ -215,6 +215,7 @@ public:
|
||||
static void SetItemScaleQuery(bool (*query)(uint32_t vnum, uint32_t pos, float scale[3], float position[3]));
|
||||
// CItemManager::GetItemDataPointer for item model mounting (weapon / armor shape / sash).
|
||||
static void SetItemDataQuery(bool (*query)(uint32_t vnum, SItemModelData* out));
|
||||
static void SetAffectChangeHandler(void (*onSet)(unsigned affect), void (*onReset)(unsigned affect));
|
||||
// app.SetHairColorEnable / app.SetArmorSpecularEnable (HAIR_COLOR_ENABLE / USE_ARMOR_SPECULAR).
|
||||
static void SetHairColorEnable(bool enable);
|
||||
static void SetArmorSpecularEnable(bool enable);
|
||||
|
||||
@@ -62,6 +62,7 @@ enum EPacketCG {
|
||||
HEADER_CG_CHARACTER_SELECT = 6,
|
||||
HEADER_CG_MOVE = 7,
|
||||
HEADER_CG_SYNC_POSITION = 8,
|
||||
HEADER_CG_DIRECT_ENTER = 9,
|
||||
HEADER_CG_ENTERGAME = 10,
|
||||
HEADER_CG_ITEM_USE = 11,
|
||||
HEADER_CG_ITEM_DROP = 224,
|
||||
@@ -78,6 +79,8 @@ enum EPacketCG {
|
||||
HEADER_CG_TARGET = 61,
|
||||
HEADER_CG_FLY_TARGETING = 51,
|
||||
HEADER_CG_ADD_FLY_TARGETING = 53,
|
||||
HEADER_CG_SHOOT = 54,
|
||||
HEADER_CG_STATE_CHECKER = 94,
|
||||
HEADER_CG_USE_SKILL = 233,
|
||||
HEADER_CG_WARP = 65,
|
||||
HEADER_CG_MALL_CHECKOUT = 69,
|
||||
@@ -432,6 +435,33 @@ struct TPacketCGFlyTargeting {
|
||||
int32_t y;
|
||||
};
|
||||
|
||||
struct TPacketCGUseSkill {
|
||||
uint8_t bHeader;
|
||||
uint32_t dwVnum;
|
||||
uint32_t dwTargetVID;
|
||||
};
|
||||
|
||||
struct TPacketCGPosition {
|
||||
uint8_t header;
|
||||
uint8_t position;
|
||||
};
|
||||
|
||||
struct TPacketCGTarget {
|
||||
uint8_t header;
|
||||
uint32_t dwVID;
|
||||
};
|
||||
|
||||
struct TPacketCGShoot {
|
||||
uint8_t bHeader;
|
||||
uint8_t bType;
|
||||
};
|
||||
|
||||
struct TPacketCGSyncPositionElement {
|
||||
uint32_t dwVID;
|
||||
int32_t lX;
|
||||
int32_t lY;
|
||||
};
|
||||
|
||||
// 1:1 upstream SPacketCGRefine (Locale_inc.h: ENABLE_MULTI_REFINE_WORLDARD on,
|
||||
// ENABLE_FEATURES_REFINE_SYSTEM off) -> 5 bytes.
|
||||
struct TPacketCGRefine {
|
||||
|
||||
@@ -1340,6 +1340,58 @@ bool PythonNetworkStream::SendFlyTargetingPacket(uint32_t targetVID, int32_t x,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::SendAddFlyTargetingPacket(uint32_t targetVID, int32_t x, int32_t y) {
|
||||
TPacketCGFlyTargeting p;
|
||||
p.bHeader = HEADER_CG_ADD_FLY_TARGETING;
|
||||
p.dwTargetVID = targetVID;
|
||||
p.x = x;
|
||||
p.y = y;
|
||||
Send(&p, sizeof(p));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::SendUseSkillPacket(uint32_t skillIndex, uint32_t targetVID) {
|
||||
TPacketCGUseSkill p;
|
||||
p.bHeader = HEADER_CG_USE_SKILL;
|
||||
p.dwVnum = skillIndex;
|
||||
p.dwTargetVID = targetVID;
|
||||
Send(&p, sizeof(p));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::SendTargetPacket(uint32_t vid) {
|
||||
TPacketCGTarget p;
|
||||
p.header = HEADER_CG_TARGET;
|
||||
p.dwVID = vid;
|
||||
Send(&p, sizeof(p));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::SendShootPacket(uint32_t uSkill) {
|
||||
TPacketCGShoot p;
|
||||
p.bHeader = HEADER_CG_SHOOT;
|
||||
p.bType = static_cast<uint8_t>(uSkill);
|
||||
Send(&p, sizeof(p));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::SendCharacterPositionPacket(uint8_t iPosition) {
|
||||
TPacketCGPosition p;
|
||||
p.header = HEADER_CG_CHARACTER_POSITION;
|
||||
p.position = iPosition;
|
||||
Send(&p, sizeof(p));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::SendSyncPositionElementPacket(uint32_t victimVID, int32_t victimX, int32_t victimY) {
|
||||
TPacketCGSyncPositionElement p;
|
||||
p.dwVID = victimVID;
|
||||
p.lX = victimX;
|
||||
p.lY = victimY;
|
||||
Send(&p, sizeof(p));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::SendWarpPacket() {
|
||||
TPacketCGWarp p;
|
||||
p.header = HEADER_CG_WARP;
|
||||
|
||||
@@ -88,6 +88,12 @@ public:
|
||||
bool SendItemDropPacketNew(uint8_t window,uint16_t cell,uint32_t gold,uint32_t count);
|
||||
bool SendOnClickPacket(uint32_t vid);
|
||||
bool SendFlyTargetingPacket(uint32_t targetVID, int32_t x, int32_t y);
|
||||
bool SendAddFlyTargetingPacket(uint32_t targetVID, int32_t x, int32_t y);
|
||||
bool SendUseSkillPacket(uint32_t skillIndex, uint32_t targetVID = 0);
|
||||
bool SendTargetPacket(uint32_t vid);
|
||||
bool SendShootPacket(uint32_t uSkill);
|
||||
bool SendCharacterPositionPacket(uint8_t iPosition);
|
||||
bool SendSyncPositionElementPacket(uint32_t victimVID, int32_t victimX, int32_t victimY);
|
||||
bool SendWarpPacket();
|
||||
|
||||
// ── Exchange Protocol ──
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "shared/common/PythonUtils.h"
|
||||
#include "NetworkActorManager.h"
|
||||
#include "eter_render/RaceData.h"
|
||||
#include "python_gameplay_modules.h"
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
@@ -184,8 +185,9 @@ void PythonNetworkStream::ServerCommand(const std::string& command) {
|
||||
} else if (!strcasecmp(szCmd, "messenger_auth")) {
|
||||
call("OnMessengerAddFriendQuestion", Py_BuildValue("(s)", arg(1)));
|
||||
} else if (!strcasecmp(szCmd, "combo")) {
|
||||
// IAbstractPlayer::SetComboSkillFlag (skill slot level) is not ported; the stream flag is.
|
||||
m_bComboSkillFlag = atoi(arg(1)) != 0;
|
||||
int iFlag = atoi(arg(1));
|
||||
SetComboSkillFlag(iFlag != 0);
|
||||
m_bComboSkillFlag = (iFlag != 0);
|
||||
} else if (!strcasecmp(szCmd, "setblockmode")) {
|
||||
call("OnBlockMode", Py_BuildValue("(i)", atoi(arg(1))));
|
||||
// Emotion Start
|
||||
|
||||
@@ -180,6 +180,8 @@ public:
|
||||
|
||||
// Initiate Attack (cycles combo if already attacking or starts Combo 1)
|
||||
bool Attack();
|
||||
void SetComboType(uint16_t comboType) { m_wcurComboType = comboType; }
|
||||
uint16_t GetComboType() const { return m_wcurComboType; }
|
||||
|
||||
// Cast specific skill motion (stops movement, sets attack state, plays one-shot)
|
||||
bool CastSkill(MotionType skillMotion);
|
||||
@@ -246,6 +248,7 @@ private:
|
||||
bool PlayMotionIndex(uint32_t index, bool loop);
|
||||
bool m_isAttacking = false;
|
||||
int m_comboIndex = 0;
|
||||
uint16_t m_wcurComboType = 0;
|
||||
std::unordered_map<std::string, float> m_buffs;
|
||||
|
||||
// Transform
|
||||
|
||||
@@ -20,6 +20,12 @@ struct GuildState {
|
||||
std::map<uint32_t,std::string> names;
|
||||
std::map<uint32_t,uint32_t> skillSlots;
|
||||
std::array<uint32_t,6> enemies{};
|
||||
bool IsDoingGuildWar() const {
|
||||
for (uint32_t enemy : enemies) {
|
||||
if (enemy != 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Member* ByPID(uint32_t pid);
|
||||
Member* ByName(const std::string& name);
|
||||
void RegisterMember(const Member& member);
|
||||
|
||||
@@ -82,7 +82,9 @@ bool NonPlayerData::load(const std::string& data) {
|
||||
m.regenCycle=row[75+prefixShift];m.regenPercent=row[76+prefixShift];m.raceFlags=wire::read32(row,83+prefixShift);m.st=row[91+prefixShift];m.dx=row[92+prefixShift];
|
||||
m.damageMin=wire::read32(row,95+prefixShift);m.damageMax=wire::read32(row,99+prefixShift);m.event=row[138+prefixShift+resistShift];
|
||||
for(int j=0;j<11;++j) m.resists[j]=row[118+prefixShift+j]<128?row[118+prefixShift+j]:int(row[118+prefixShift+j])-256;
|
||||
uint32_t bits=wire::read32(row,205+prefixShift+resistShift);std::memcpy(&m.damageMultiply,&bits,4);loaded.push_back(std::move(m));
|
||||
uint32_t bits=wire::read32(row,205+prefixShift+resistShift);std::memcpy(&m.damageMultiply,&bits,4);
|
||||
m.monsterColor=wire::read32(row,217+prefixShift+resistShift);
|
||||
loaded.push_back(std::move(m));
|
||||
}
|
||||
// ENABLE_WIKI: CPythonWiki::LoadMonster per record in file order, then ListReverse.
|
||||
for(const auto& m:loaded) WikiLoadMonster(m);
|
||||
|
||||
@@ -10,6 +10,7 @@ struct MobRecord {
|
||||
uint32_t hp=0,exp=0,raceFlags=0,damageMin=0,damageMax=0,goldMin=0,goldMax=0;
|
||||
uint8_t regenCycle=0,regenPercent=0,st=0,dx=0;
|
||||
float damageMultiply=0;
|
||||
uint32_t monsterColor=0;
|
||||
int8_t resists[11]={};
|
||||
};
|
||||
class NonPlayerData {
|
||||
@@ -19,6 +20,7 @@ public:
|
||||
const MobRecord* get(uint32_t vnum) const;
|
||||
void clear() { records.clear(); }
|
||||
const std::map<uint32_t,MobRecord>& all() const { return records; }
|
||||
uint32_t GetMonsterColor(uint32_t vnum) const { const auto* rec = get(vnum); return rec ? rec->monsterColor : 0; }
|
||||
// CPythonNonPlayer::LoadMobScale / LoadNPCWear (ENABLE_MOB_SCALE_SYSTEM, ENABLE_NPC_WEAR_ITEM).
|
||||
// Like Windows, Destroy() (clear) leaves both tables alone; mob scale never overwrites.
|
||||
struct MobScale { float x=0,y=0,z=0; };
|
||||
|
||||
+197
-27
@@ -21,6 +21,8 @@
|
||||
#include "eter_resource/ResourceManager.h"
|
||||
#include "eter_image/GrpImageInstance.h"
|
||||
#include "eter_image/GrpImage.h"
|
||||
#include "eter_base/Timer.h"
|
||||
#include "skill_description.h"
|
||||
#include <Python.h>
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
@@ -44,9 +46,15 @@ struct PlayerSkill {
|
||||
int level = 0;
|
||||
float currentPower=0,nextPower=0;
|
||||
SkillCooldown cooldown;
|
||||
bool active = false;
|
||||
};
|
||||
static std::map<int, PlayerSkill> s_playerSkills;
|
||||
static std::map<int,int> s_skillSlots;
|
||||
static uint32_t s_targetVID = 0;
|
||||
static bool s_coolTimeEnabled = true;
|
||||
static SkillCastCallback s_skillCastCallback = nullptr;
|
||||
static int s_curSkillSlotIndex = 0;
|
||||
static std::unordered_map<int, long long> s_playerPoints;
|
||||
struct PlayerQuickSlot { int type=0; int pos=0; };
|
||||
static std::array<PlayerQuickSlot,36> s_playerQuickSlots{};
|
||||
static int s_quickPage=0;
|
||||
@@ -55,12 +63,15 @@ static PyObject* player_SetGameWindow(PyObject*,PyObject* args) {
|
||||
PyObject* window;if(!PyArg_ParseTuple(args,"O",&window)) return nullptr;
|
||||
if(window==Py_None) window=nullptr;Py_XINCREF(window);auto* old=s_playerGameWindow;s_playerGameWindow=window;Py_XDECREF(old);Py_RETURN_NONE;
|
||||
}
|
||||
static bool player_window_call(const char* name,PyObject* args=nullptr) {
|
||||
if(!s_playerGameWindow) {Py_XDECREF(args);return true;}
|
||||
PyObject* window=s_playerGameWindow;Py_INCREF(window);
|
||||
PyObject* method=PyObject_GetAttrString(window,name);
|
||||
PyObject* result=method?PyObject_CallObject(method,args):nullptr;
|
||||
Py_XDECREF(method);Py_XDECREF(args);Py_DECREF(window);bool success=result!=nullptr;Py_XDECREF(result);return success;
|
||||
static bool player_window_call(const char* name, PyObject* args = nullptr) {
|
||||
if (!s_playerGameWindow) {
|
||||
Py_XDECREF(args);
|
||||
return true;
|
||||
}
|
||||
if (!args) {
|
||||
args = PyTuple_New(0);
|
||||
}
|
||||
return PyCallClassMemberFunc(s_playerGameWindow, name, args);
|
||||
}
|
||||
static PyObject* player_GetQuickPage(PyObject*,PyObject*) {return PyInt_FromLong(s_quickPage);}
|
||||
static PyObject* player_SetQuickPage(PyObject*,PyObject* args) {
|
||||
@@ -135,10 +146,7 @@ static PyObject* player_SetSkill(PyObject*,PyObject* args) {
|
||||
}
|
||||
static PyObject* player_AffectIndexToSkillIndex(PyObject*,PyObject* args) {
|
||||
int affect;if(!PyArg_ParseTuple(args,"i",&affect)) return nullptr;
|
||||
// AVA2 PythonPlayer::__Initialize: this map is independent of skill registration.
|
||||
static const int mapping[][2]={{14,3},{15,4},{16,19},{17,49},{18,34},{20,64},{21,65},{22,94},{23,95},{24,110},{29,96},{30,111},{32,66},{33,19},{19,63},{26,78},{25,79},{46,182}};
|
||||
for(const auto& entry:mapping) if(entry[0]==affect) return PyInt_FromLong(entry[1]);
|
||||
return PyInt_FromLong(0);
|
||||
return PyInt_FromLong(AffectIndexToSkillIndex(affect));
|
||||
}
|
||||
static PyObject* player_GetSkillSlotIndex(PyObject*,PyObject* args) {
|
||||
int index;if(!PyArg_ParseTuple(args,"i",&index)) return nullptr;
|
||||
@@ -177,8 +185,6 @@ static PyObject* player_RequestAddLocalQuickSlot(PyObject*, PyObject* args) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static SkillCastCallback s_skillCastCallback = nullptr;
|
||||
|
||||
static PyObject* player_RequestUseLocalQuickSlot(PyObject*, PyObject* args) {
|
||||
int slot = 0;
|
||||
if (!PyArg_ParseTuple(args, "i", &slot)) return nullptr;
|
||||
@@ -191,10 +197,8 @@ static PyObject* player_RequestUseLocalQuickSlot(PyObject*, PyObject* args) {
|
||||
if(!player_window_call("BINARY_ActEmotion",Py_BuildValue("(i)",s_playerQuickSlots[global].pos))) return nullptr;
|
||||
}
|
||||
else if (s_playerQuickSlots[global].type == 2) { // Skill
|
||||
int skillIndex = s_playerQuickSlots[global].pos;
|
||||
if (s_skillCastCallback) {
|
||||
s_skillCastCallback(slot, skillIndex);
|
||||
}
|
||||
int skillSlot = s_playerQuickSlots[global].pos;
|
||||
ClickSkillSlot(skillSlot);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,8 +209,6 @@ static std::string s_playerName = "";
|
||||
struct Position3D { float x = 0.0f; float y = 0.0f; float z = 0.0f; };
|
||||
static Position3D s_mainActorPos{0.0f, 0.0f, 0.0f};
|
||||
|
||||
static std::unordered_map<int, long long> s_playerPoints;
|
||||
|
||||
static PyObject* player_GetStatus(PyObject*, PyObject* args) {
|
||||
int type = 0;
|
||||
if (!PyArg_ParseTuple(args, "i", &type)) return Py_BuildValue("i", 0);
|
||||
@@ -318,27 +320,26 @@ static PyObject* player_SlotTypeToInvenType(PyObject*, PyObject* poArgs) {
|
||||
|
||||
static PyObject* player_ClickSkillSlot(PyObject*, PyObject* args) {
|
||||
int skillSlot = 0;
|
||||
if (PyArg_ParseTuple(args, "i", &skillSlot)) {
|
||||
if (s_skillCastCallback) {
|
||||
s_skillCastCallback(-1, skillSlot);
|
||||
}
|
||||
if (!PyTuple_GetInteger(args, 0, &skillSlot)) return Py_BadArgument();
|
||||
ClickSkillSlot(skillSlot);
|
||||
if (s_skillCastCallback) {
|
||||
s_skillCastCallback(-1, skillSlot);
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static bool s_coolTimeEnabled=true;
|
||||
static PyObject* player_IsSkillCoolTime(PyObject*,PyObject* args) {
|
||||
int slot;if(!PyArg_ParseTuple(args,"i",&slot)) return nullptr;
|
||||
if(uint32_t(slot)>=255) return PyInt_FromLong(0);
|
||||
auto it=s_playerSkills.find(slot);
|
||||
return PyInt_FromLong(it!=s_playerSkills.end() && it->second.cooldown.cooling(float(SDL_GetTicks())/1000.0f,s_coolTimeEnabled));
|
||||
return PyInt_FromLong(it!=s_playerSkills.end() && it->second.cooldown.cooling(CTimer::Instance().GetCurrentSecond(),s_coolTimeEnabled));
|
||||
}
|
||||
static PyObject* player_GetSkillCoolTime(PyObject*,PyObject* args) {
|
||||
int slot;if(!PyArg_ParseTuple(args,"i",&slot)) return nullptr;
|
||||
if(uint32_t(slot)>=255) return Py_BuildValue("ff",0.0f,0.0f);
|
||||
auto it=s_playerSkills.find(slot);
|
||||
SkillCooldown cooldown=it==s_playerSkills.end()?SkillCooldown{}:it->second.cooldown;
|
||||
return Py_BuildValue("ff",cooldown.total,cooldown.elapsed(float(SDL_GetTicks())/1000.0f));
|
||||
return Py_BuildValue("ff",cooldown.total,cooldown.elapsed(CTimer::Instance().GetCurrentSecond()));
|
||||
}
|
||||
static PyObject* player_ToggleCoolTime(PyObject*,PyObject*) {
|
||||
s_coolTimeEnabled=!s_coolTimeEnabled;return PyInt_FromLong(s_coolTimeEnabled);
|
||||
@@ -903,6 +904,168 @@ static PyObject* player_IsBeltInventorySlot(PyObject*, PyObject* args) {
|
||||
|
||||
} // namespace
|
||||
|
||||
int AffectIndexToSkillIndex(int affect) {
|
||||
// AVA2 PythonPlayer::__Initialize: this map is independent of skill registration.
|
||||
static const int mapping[][2]={{14,3},{15,4},{16,19},{17,49},{18,34},{20,64},{21,65},{22,94},{23,95},{24,110},{29,96},{30,111},{32,66},{33,19},{19,63},{26,78},{25,79},{46,182}};
|
||||
for(const auto& entry:mapping) if(entry[0]==affect) return entry[1];
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UseGuildSkill(int skillSlot) {
|
||||
if (uint32_t(skillSlot) >= 255) return;
|
||||
auto it = s_playerSkills.find(skillSlot);
|
||||
if (it == s_playerSkills.end() || it->second.index == 0) return;
|
||||
|
||||
int skillIndex = it->second.index;
|
||||
const auto* pSkillData = FindSkillDescription(uint32_t(skillIndex));
|
||||
|
||||
float now = CTimer::Instance().GetCurrentSecond();
|
||||
if (it->second.cooldown.cooling(now, s_coolTimeEnabled)) {
|
||||
player_window_call("OnCannotUseSkill", Py_BuildValue("(is)", PythonNetworkStream::Instance().GetMainActorVID(), "WAIT_COOLTIME"));
|
||||
return;
|
||||
}
|
||||
|
||||
bool onlyGuildWar = pSkillData && (pSkillData->attributes & (1u << 19 /* SKILL_ATTRIBUTE_ONLY_FOR_GUILD_WAR */));
|
||||
if (onlyGuildWar && !GetGuildState().IsDoingGuildWar()) {
|
||||
player_window_call("OnCannotUseSkill", Py_BuildValue("(is)", PythonNetworkStream::Instance().GetMainActorVID(), "ONLY_FOR_GUILD_WAR"));
|
||||
return;
|
||||
}
|
||||
|
||||
PythonNetworkStream::Instance().SendGuildUseSkillPacket(uint32_t(skillIndex), 0);
|
||||
|
||||
float baseCoolTime = pSkillData ? EvaluateSkillFormula(pSkillData->cooldownFormula, it->second.currentPower) : 0.0f;
|
||||
long long castSpd = 0;
|
||||
auto spdIt = s_playerPoints.find(19 /* POINT_CASTING_SPEED */);
|
||||
if (spdIt != s_playerPoints.end()) castSpd = spdIt->second;
|
||||
int iSpd = 100 - int(castSpd);
|
||||
if (iSpd > 0) iSpd = 100 + iSpd;
|
||||
else if (iSpd < 0) iSpd = 10000 / (100 - iSpd);
|
||||
else iSpd = 100;
|
||||
float coolTime = baseCoolTime * float(iSpd) / 100.0f;
|
||||
it->second.cooldown = {coolTime, now};
|
||||
player_window_call("RunUseSkillEvent", Py_BuildValue("(if)", skillSlot, coolTime));
|
||||
}
|
||||
|
||||
void ClickSkillSlot(int skillSlot) {
|
||||
if (uint32_t(skillSlot) >= 255) return;
|
||||
auto it = s_playerSkills.find(skillSlot);
|
||||
if (it == s_playerSkills.end() || it->second.index == 0) return;
|
||||
|
||||
int skillIndex = it->second.index;
|
||||
const auto* pSkillData = FindSkillDescription(uint32_t(skillIndex));
|
||||
|
||||
// Guild skill check
|
||||
int skillType = GetSkillTypeById(uint32_t(skillIndex));
|
||||
if (skillType == 3 /* SKILL_TYPE_GUILD */) {
|
||||
UseGuildSkill(skillSlot);
|
||||
return;
|
||||
}
|
||||
|
||||
// Special skill check (combo)
|
||||
if (skillIndex == 122 /* c_iSkillIndex_Combo */) {
|
||||
if (it->second.level > 0) {
|
||||
PythonNetworkStream::Instance().SendUseSkillPacket(uint32_t(skillIndex), 0);
|
||||
} else {
|
||||
player_window_call("OnCannotUseSkill", Py_BuildValue("(is)", PythonNetworkStream::Instance().GetMainActorVID(), "NOT_YET_LEARN"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Toggle skill active check (turns off if already active)
|
||||
bool isToggle = pSkillData && (pSkillData->attributes & (1u << 1 /* SKILL_ATTRIBUTE_TOGGLE */));
|
||||
if (isToggle && it->second.active) {
|
||||
PythonNetworkStream::Instance().SendUseSkillPacket(uint32_t(skillIndex), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Cooltime check
|
||||
float now = CTimer::Instance().GetCurrentSecond();
|
||||
if (it->second.cooldown.cooling(now, s_coolTimeEnabled)) {
|
||||
player_window_call("OnCannotUseSkill", Py_BuildValue("(is)", PythonNetworkStream::Instance().GetMainActorVID(), "WAIT_COOLTIME"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Target check
|
||||
uint32_t targetVID = s_targetVID;
|
||||
bool needTarget = pSkillData && (pSkillData->attributes & (1u << 0 /* SKILL_ATTRIBUTE_NEED_TARGET */));
|
||||
bool canUseForMe = pSkillData && (pSkillData->attributes & (1u << 8 /* SKILL_ATTRIBUTE_CAN_USE_FOR_ME */));
|
||||
if (needTarget && targetVID == 0 && !canUseForMe) {
|
||||
player_window_call("OnCannotUseSkill", Py_BuildValue("(is)", PythonNetworkStream::Instance().GetMainActorVID(), "NEED_TARGET"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Send use skill packet
|
||||
PythonNetworkStream::Instance().SendUseSkillPacket(uint32_t(skillIndex), targetVID);
|
||||
|
||||
// Run cooltime
|
||||
float baseCoolTime = pSkillData ? EvaluateSkillFormula(pSkillData->cooldownFormula, it->second.currentPower) : 0.0f;
|
||||
long long castSpd = 0;
|
||||
auto spdIt = s_playerPoints.find(19 /* POINT_CASTING_SPEED */);
|
||||
if (spdIt != s_playerPoints.end()) castSpd = spdIt->second;
|
||||
int iSpd = 100 - int(castSpd);
|
||||
if (iSpd > 0) iSpd = 100 + iSpd;
|
||||
else if (iSpd < 0) iSpd = 10000 / (100 - iSpd);
|
||||
else iSpd = 100;
|
||||
float coolTime = baseCoolTime * float(iSpd) / 100.0f;
|
||||
it->second.cooldown = {coolTime, now};
|
||||
player_window_call("RunUseSkillEvent", Py_BuildValue("(if)", skillSlot, coolTime));
|
||||
|
||||
if (s_skillCastCallback) {
|
||||
s_skillCastCallback(-1, skillSlot);
|
||||
}
|
||||
}
|
||||
|
||||
void SetPlayerAffect(unsigned affect) {
|
||||
if (s_playerGameWindow) {
|
||||
player_window_call("SetAffect", Py_BuildValue("(I)", affect));
|
||||
}
|
||||
int skillIndex = AffectIndexToSkillIndex(int(affect));
|
||||
if (skillIndex > 0) {
|
||||
auto it = s_skillSlots.find(skillIndex);
|
||||
if (it != s_skillSlots.end()) {
|
||||
auto sit = s_playerSkills.find(it->second);
|
||||
if (sit != s_playerSkills.end()) {
|
||||
sit->second.active = true;
|
||||
if (s_playerGameWindow) {
|
||||
player_window_call("ActivateSkillSlot", Py_BuildValue("(i)", it->second));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ResetPlayerAffect(unsigned affect) {
|
||||
if (s_playerGameWindow) {
|
||||
player_window_call("ResetAffect", Py_BuildValue("(I)", affect));
|
||||
}
|
||||
int skillIndex = AffectIndexToSkillIndex(int(affect));
|
||||
if (skillIndex > 0) {
|
||||
auto it = s_skillSlots.find(skillIndex);
|
||||
if (it != s_skillSlots.end()) {
|
||||
auto sit = s_playerSkills.find(it->second);
|
||||
if (sit != s_playerSkills.end()) {
|
||||
sit->second.active = false;
|
||||
if (s_playerGameWindow) {
|
||||
player_window_call("DeactivateSkillSlot", Py_BuildValue("(i)", it->second));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetComboSkillFlag(bool bFlag) {
|
||||
auto it = s_skillSlots.find(122 /* c_iSkillIndex_Combo */);
|
||||
if (it == s_skillSlots.end()) return;
|
||||
auto sit = s_playerSkills.find(it->second);
|
||||
if (sit == s_playerSkills.end() || sit->second.level <= 0) return;
|
||||
int level = sit->second.level;
|
||||
uint32_t mainVID = PythonNetworkStream::Instance().GetMainActorVID();
|
||||
auto pMain = NetworkActorManager::Instance().GetActorInstance(mainVID);
|
||||
if (pMain) {
|
||||
pMain->SetComboType(bFlag ? level : 0);
|
||||
}
|
||||
}
|
||||
|
||||
void SetMainCharacterPosition(float x, float y, float z) {
|
||||
s_mainActorPos.x = x;
|
||||
s_mainActorPos.y = y;
|
||||
@@ -1317,7 +1480,7 @@ void SetSkillCoolTimeAt(int skillIndex,float coolTime,float now) {
|
||||
s_playerSkills[slot->second].cooldown={coolTime,now};
|
||||
}
|
||||
void SetSkillCoolTime(int skillIndex, float coolTime) {
|
||||
SetSkillCoolTimeAt(skillIndex,coolTime,float(SDL_GetTicks())/1000.0f);
|
||||
SetSkillCoolTimeAt(skillIndex,coolTime,CTimer::Instance().GetCurrentSecond());
|
||||
}
|
||||
void EndSkillCoolTime(uint32_t skillIndex) {
|
||||
auto slot = s_skillSlots.find(skillIndex);
|
||||
@@ -2116,7 +2279,6 @@ static std::map<int, uint32_t> s_emotionIcons;
|
||||
static int s_mouseFunc[8] = {0};
|
||||
static int s_mouseState[8] = {0};
|
||||
static int s_mouseMiddleButtonState = 0;
|
||||
static uint32_t s_targetVID = 0;
|
||||
static bool s_playerVisible = true;
|
||||
static bool s_levelLimit = false;
|
||||
static int s_eventGame = 0;
|
||||
@@ -2138,6 +2300,8 @@ static PyObject* player_CanAttackInstance(PyObject*, PyObject* args) {
|
||||
static PyObject* player_ChangeCurrentSkillNumberOnly(PyObject*, PyObject* args) {
|
||||
int slot = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &slot)) return Py_BadArgument();
|
||||
s_curSkillSlotIndex = slot;
|
||||
player_window_call("ChangeCurrentSkill", Py_BuildValue("(i)", slot));
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
@@ -2418,6 +2582,10 @@ static PyObject* player_IsShiningSlot(PyObject*, PyObject* args) {
|
||||
static PyObject* player_IsSkillActive(PyObject*, PyObject* args) {
|
||||
int slot = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &slot)) return Py_BuildException();
|
||||
auto it = s_playerSkills.find(slot);
|
||||
if (it != s_playerSkills.end()) {
|
||||
return Py_BuildValue("i", it->second.active ? 1 : 0);
|
||||
}
|
||||
return Py_BuildValue("i", 0);
|
||||
}
|
||||
|
||||
@@ -2627,6 +2795,7 @@ static PyObject* player_Update(PyObject*, PyObject*) {
|
||||
static PyObject* player_UseGuildSkill(PyObject*, PyObject* args) {
|
||||
int slot = 0;
|
||||
if (!PyTuple_GetInteger(args, 0, &slot)) return Py_BuildException();
|
||||
UseGuildSkill(slot);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
@@ -2888,6 +3057,7 @@ void initPlayer() {
|
||||
out->specular = proto ? float(proto->specular) / 100.0f : 0.0f;
|
||||
return true;
|
||||
});
|
||||
NetworkActorManager::SetAffectChangeHandler(SetPlayerAffect, ResetPlayerAffect);
|
||||
auto* module = Py_InitModule("player", methods);
|
||||
|
||||
PyModule_AddIntConstant(module, "LEVEL", 1);
|
||||
|
||||
@@ -18,6 +18,12 @@ void SetPlayerSkillCastCallback(SkillCastCallback cb);
|
||||
void SetSkillCoolTime(int skillIndex, float coolTime);
|
||||
void SetSkillCoolTimeAt(int skillIndex,float coolTime,float now);
|
||||
void EndSkillCoolTime(uint32_t skillIndex);
|
||||
void ClickSkillSlot(int skillSlot);
|
||||
void UseGuildSkill(int skillSlot);
|
||||
void SetPlayerAffect(uint32_t affect);
|
||||
void ResetPlayerAffect(uint32_t affect);
|
||||
void SetComboSkillFlag(bool bFlag);
|
||||
int AffectIndexToSkillIndex(int affect);
|
||||
|
||||
struct PlayerItemSlot {
|
||||
uint32_t vnum = 0;
|
||||
|
||||
@@ -107,6 +107,7 @@ template<int Field> PyObject* nonplayer_value(PyObject*,PyObject* args) {
|
||||
case 0:value=m->event;break;case 1:value=m->hp;break;case 2:value=m->raceFlags;break;case 3:value=m->level;break;
|
||||
case 5:value=m->exp;break;case 7:value=m->st;break;case 8:value=m->dx;break;case 9:value=m->type==2;break;
|
||||
case 10:value=m->regenCycle;break;case 11:value=m->regenPercent;break;case 12:value=m->goldMin;break;case 13:value=m->goldMax;break;
|
||||
case 15:value=m->monsterColor;break;
|
||||
}
|
||||
return PyInt_FromLong(static_cast<long>(value));
|
||||
}
|
||||
@@ -118,7 +119,7 @@ template<int Field> PyObject* nonplayer_vid(PyObject*,PyObject* args) {
|
||||
if constexpr(Field==0) return PyInt_FromLong(mob?mob->event:0);
|
||||
if constexpr(Field==1) return PyInt_FromLong(mob?mob->level:-1);
|
||||
if constexpr(Field==2) return PyInt_FromLong(mob?mob->rank:-1);
|
||||
return PyInt_FromLong(actor?actor->m_dwRace:0);
|
||||
return PyInt_FromLong(mob?mob->vnum:-1);
|
||||
}
|
||||
PyObject* nonplayer_search(PyObject*,PyObject* args) {
|
||||
const char* query;if(!PyArg_ParseTuple(args,"s",&query)) return nullptr;
|
||||
@@ -165,6 +166,7 @@ void initNonPlayer() {
|
||||
{"GetLevelByVID", nonplayer_vid<1>, METH_VARARGS, nullptr},
|
||||
{"GetGradeByVID", nonplayer_vid<2>, METH_VARARGS, nullptr},
|
||||
{"GetMonsterName", nonplayer_name, METH_VARARGS, nullptr},
|
||||
{"GetMonsterColor", nonplayer_value<15>, METH_VARARGS, nullptr},
|
||||
{"GetRaceNumByVID", nonplayer_vid<3>, METH_VARARGS, nullptr},
|
||||
{"GetMonsterMaxHP", nonplayer_value<1>, METH_VARARGS, nullptr},
|
||||
{"GetMonsterRaceFlag", nonplayer_value<2>, METH_VARARGS, nullptr},
|
||||
|
||||
@@ -18,6 +18,7 @@ template<class WindowsRecord> void check(bool encrypted) {
|
||||
row.bType=2;row.bRank=4;row.bLevel=77;row.dwGoldMin=123;row.dwGoldMax=456;row.dwExp=987654;row.dwMaxHP=1234567;
|
||||
row.bRegenCycle=8;row.bRegenPercent=9;row.dwRaceFlag=0x12345678;row.bStr=44;row.bDex=55;
|
||||
row.dwDamageRange[0]=999;row.dwDamageRange[1]=1999;row.bOnClickType=3;row.fDamMultiply=1.75f;
|
||||
row.dwMonsterColor=0xAABBCCDD;
|
||||
for(size_t i=0;i<sizeof(row.cResists);++i) row.cResists[i]=static_cast<char>(int(i)-5);
|
||||
if constexpr(requires {row.bLvlPct;}) row.bLvlPct=231;
|
||||
auto raw=std::span(reinterpret_cast<const uint8_t*>(&row),sizeof(row));auto packed=literalLzo(raw);
|
||||
@@ -33,6 +34,7 @@ template<class WindowsRecord> void check(bool encrypted) {
|
||||
require(actual->goldMin==row.dwGoldMin && actual->goldMax==row.dwGoldMax && actual->exp==row.dwExp && actual->hp==row.dwMaxHP,"shifted DWORD mismatch");
|
||||
require(actual->regenCycle==8 && actual->regenPercent==9 && actual->raceFlags==row.dwRaceFlag && actual->st==44 && actual->dx==55,"shifted stats mismatch");
|
||||
require(actual->damageMin==999 && actual->damageMax==1999 && actual->event==3 && actual->damageMultiply==1.75f,"post-resist field mismatch");
|
||||
require(actual->monsterColor==row.dwMonsterColor,"monster color mismatch");
|
||||
// Original TMobTableAll copies the first eleven resist entries, including claw for r262/263.
|
||||
for(int i=0;i<11;++i) require(actual->resists[i]==int(row.cResists[i]),"resist index/sign mismatch");
|
||||
packet.resize(31);require(!database.load(std::string(reinterpret_cast<const char*>(packet.data()),packet.size())),"truncated container accepted");
|
||||
|
||||
Reference in New Issue
Block a user