potinho
Advanced OT User
Hello guys,
It's been a few days since I started to experience slight crashes in the game and, occasionally, I receive messages about invalid packages. Could you help me find the problem? My last changes was in the function bellow, adding Life and Mana Leech:
I'm receiving this error in client:
ERROR: ProtocolGame parse message exception (836 bytes, 711 unread, last opcode is 0x4e (78), prev opcode is 0x83 (131)): unhandled opcode 78
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 772)
I used ChatGPT to try to translate hex, he give me back a spell name, a character name and a exhausted message.
It's been a few days since I started to experience slight crashes in the game and, occasionally, I receive messages about invalid packages. Could you help me find the problem? My last changes was in the function bellow, adding Life and Mana Leech:
C++:
bool Combat::CombatHealthFunc(Creature* caster, Creature* target, const CombatParams& params, void* data)
{
int32_t change = 0;
if(Combat2Var* var = (Combat2Var*)data)
{
change = var->change;
if(!change)
change = random_range(var->minChange, var->maxChange, DISTRO_NORMAL);
}
if(g_game.combatBlockHit(params.combatType, caster, target, change, params.blockedByShield, params.blockedByArmor, params.itemId != 0))
return false;
CombatParams _params = params;
if(_params.element.damage && _params.element.type != COMBAT_NONE)
g_game.combatBlockHit(_params.element.type, caster, target, _params.element.damage, params.blockedByShield, params.blockedByArmor, params.itemId != 0, true);
if(caster && caster->getPlayer() && target->getPlayer())
{
_params.element.damage /= 2;
if(change < 0)
change /= 2;
}
Monster* mCaster = NULL;
Player* pCaster = NULL;
if(caster)
{
pCaster = caster->getPlayer();
mCaster = caster->getMonster();
}
if(pCaster && params.combatType != COMBAT_HEALING)
{
std::string value;
pCaster->getStorage("794750", value);
int32_t intValue = (int32_t)(atoi(value.c_str()));
int32_t chance = static_cast<int32_t>(intValue * 0.2);
if(random_range(1, 100) <= chance)
{
int32_t critdamage = pCaster->getCriticalDamage();
if(critdamage > 0)
change = static_cast<int32_t>(change + ((change * critdamage) / 100));
g_game.addMagicEffect(target->getPosition(), MAGIC_EFFECT_STUN); // change here ***
g_game.addAnimatedText(target->getPosition(), 144, "CRITICAL!");
}
}
if (pCaster && params.combatType != COMBAT_HEALING)
{
int32_t Lifeleech = 25;
int32_t Lifeleechchance = pCaster->getLifeLeechChance() * 0.2;
int32_t amount = std::abs((int32_t)std::floor((change * (Lifeleech / 100.))));
if (amount > 0 && random_range(1, 100) <= Lifeleechchance)
{
g_game.combatChangeHealth(COMBAT_HEALING, pCaster, pCaster, amount);
g_game.addMagicEffect(pCaster->getPosition(), MAGIC_EFFECT_WRAPS_RED);
}
}
if (pCaster && params.combatType != COMBAT_HEALING)
{
int32_t Manaleech = 10;
int32_t Manaleechchance = pCaster->getManaLeechChance() * 0.2;
int32_t amount = std::abs((int32_t)std::floor((change * (Manaleech / 100.))));
if (amount > 0 && random_range(1, 100) <= Manaleechchance)
{
g_game.combatChangeMana(pCaster, pCaster, amount);
g_game.addMagicEffect(pCaster->getPosition(), MAGIC_EFFECT_WRAPS_BLUE);
g_game.addAnimatedText(pCaster->getPosition(), 11, "+" + std::to_string(amount));
}
}
if(!g_game.combatChangeHealth(_params, caster, target, change, false))
return false;
CombatConditionFunc(caster, target, params, NULL);
CombatDispelFunc(caster, target, params, NULL);
return true;
}
I'm receiving this error in client:
ERROR: ProtocolGame parse message exception (836 bytes, 711 unread, last opcode is 0x4e (78), prev opcode is 0x83 (131)): unhandled opcode 78
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 772)
I used ChatGPT to try to translate hex, he give me back a spell name, a character name and a exhausted message.
ProtocolGame parse message exception (836 bytes, 711 unread, last opcode is 0x4e (78), prev opcode is 0x83 (131), proto: 772): unhandled opcode 78
48 03 40 03 b4 17 12 00 59 6f 75 20 61 72 65 20 65 78 68 61 75 73 74 65 64 2e 83 86 03 a6 05 07 03 83 86 03 a1 05 07 12 83 84 03 a2 05 07 12 83 85 03 a2 05 07 12 83 86 03 a2 05 07 12 83 87 03 a2 05 07 12 83 88 03 a2 05 07 12 83 83 03 a3 05 07 12 83 84 03 a3 05 07 12 83 85 03 a3 05 07 12 83 86 03 a3 05 07 12 83 87 03 a3 05 07 12 83 88 03 a3 05 07 12
83 89 03 a3 05 4e 28
4e a8 95 f5 8e 9e 12 83 83 03 a4 05 07 12 83 84 03 a4 05 07 12 83 85 03 a4 05 07 12 83 86 03 a4 05 07 12 83 87 03 a4 05 07 12 83 88 03 a4 05 07 12 83 89 03 a4 05 07 12 83 8a 03 a4 05 07 12 83 82 03 a5 05 07 12 83 83 03 a5 05 07 12 83 84 03 a5 05 07 12 83 85 18 4c 9b 84 19 4d ce d1 a5 05 07 12 83 87 03 a5 05 07 12 83 88 03 a5 05 07 12 83 89 03 a5 05 07 12 83 8a 03 a5 05 07 12 83 81 03 a6 05 07 12 83 82 03 a6 05 07 12 83 83 03 a6 05 07 12 83 84 03 a6 05 07 12 8c 15 00 00 10 64 a0 1a 18 1a 18 55 25 93 bc 2c 36 05 00 00 00 51 04 1e d0 75 b1 80 8a 5e c8 84 86 03 a6 05 07 12 05 00 2b 31 30 30 39 83 86 03 a6 05 07 0e a0 1a 18 1a 18 55 25 93 bc 2c 36 05 00 00 00 51 04 1e 64 77 b1 80 8a 5e c8 83 86 03 a6 05 07 0d 84 86 03 a6 05 07 0b 04 00 2b 34 30 34 8c e1 01 01 40 3c 8c e1 01 01 40 3c 83 85 03 a6 05 07 01 84 85 03 a6 05 07 6c 04 00 34 30 33 33 83 85 03 a6 05 07 12 83 86 03 a6 05 07 12 83 87 03 a6 05 07 12 83 88 03 a6 05 07 12 83 89 03 a6 05 07 12 83 8a 03 a6 05 07 12 83 8b 03 a6 05 07 12 83 82 03 a7 05 07 12 83 83 03 a7 05 07 12 83 84 03 a7 05 07 12 8c e5 01 01 40 27 8c e5 01 01 40 27 83 85 03 a7 05 07 01 84 85 03 a7 05 07 6c 04 00 34 37 30 35 83 85 03 a7 05 07 12 8c 8f 02 01 40 00 8c 8f 02 01 40 00 83 86 03 a7 05 07 01 84 86 03 a7 05 07 6c 04 00 33 37 37 39 83 86 03 a7 05 07 12 83 87 03 a7 05 07 12 83 88 03 a7 05 07 12 83 89 03 a7 05 07 12 83 8a 03 a7 05 07 12 83 82 03 a8 05 07 12 83 83 03 a8 05 07 12 83 84 03 a8 05 07 12 83 85 03 a8 05 07 12 83 86 03 a8 05 07 12 83 87 03 a8 05 07 12 83 88 03 a8 05 07 12 83 89 03 a8 05 07 12 83 8a 03 a8 05 07 12 83 83 03 a9 05 07 12 83 84 03 a9 05 07 12 83 85 03 a9 05 07 12 8c 90 02 01 40 2a 8c 90 02 01 40 2a 83 86 03 a9 05 07 01 84 86 03 a9 05 07 6c 05 00 31 31 31 30 31 83 86 03 a9 05 07 12 83 87 03 a9 05 07 12 83 88 03 a9 05 07 12 83 89 03 a9 05 07 12 83 84 03 aa 05 07 12 83 85 03 aa 05 07 12 83 86 03 aa 05 07 12 83 87 03 aa 05 07 12 83 88 03 aa 05 07 12 83 86 03 ab 05 07 12 a0 1a 18 1a 18 55 25 93 bc 2c 36 05 00 00 00 51 04 1e b4 72 b1 80 8a 5e c8 aa 00 00 00 00 07 00 43 6e 70 6a 6f 74 6f 10 86 03 a6 05 07 13 00 65 78 65 76 6f 20 67 72 61 6e 20 6d 61 73 20 6d 6f 72 74
48 03 40 03 b4 17 12 00 59 6f 75 20 61 72 65 20 65 78 68 61 75 73 74 65 64 2e 83 86 03 a6 05 07 03 83 86 03 a1 05 07 12 83 84 03 a2 05 07 12 83 85 03 a2 05 07 12 83 86 03 a2 05 07 12 83 87 03 a2 05 07 12 83 88 03 a2 05 07 12 83 83 03 a3 05 07 12 83 84 03 a3 05 07 12 83 85 03 a3 05 07 12 83 86 03 a3 05 07 12 83 87 03 a3 05 07 12 83 88 03 a3 05 07 12
83 89 03 a3 05 4e 28
4e a8 95 f5 8e 9e 12 83 83 03 a4 05 07 12 83 84 03 a4 05 07 12 83 85 03 a4 05 07 12 83 86 03 a4 05 07 12 83 87 03 a4 05 07 12 83 88 03 a4 05 07 12 83 89 03 a4 05 07 12 83 8a 03 a4 05 07 12 83 82 03 a5 05 07 12 83 83 03 a5 05 07 12 83 84 03 a5 05 07 12 83 85 18 4c 9b 84 19 4d ce d1 a5 05 07 12 83 87 03 a5 05 07 12 83 88 03 a5 05 07 12 83 89 03 a5 05 07 12 83 8a 03 a5 05 07 12 83 81 03 a6 05 07 12 83 82 03 a6 05 07 12 83 83 03 a6 05 07 12 83 84 03 a6 05 07 12 8c 15 00 00 10 64 a0 1a 18 1a 18 55 25 93 bc 2c 36 05 00 00 00 51 04 1e d0 75 b1 80 8a 5e c8 84 86 03 a6 05 07 12 05 00 2b 31 30 30 39 83 86 03 a6 05 07 0e a0 1a 18 1a 18 55 25 93 bc 2c 36 05 00 00 00 51 04 1e 64 77 b1 80 8a 5e c8 83 86 03 a6 05 07 0d 84 86 03 a6 05 07 0b 04 00 2b 34 30 34 8c e1 01 01 40 3c 8c e1 01 01 40 3c 83 85 03 a6 05 07 01 84 85 03 a6 05 07 6c 04 00 34 30 33 33 83 85 03 a6 05 07 12 83 86 03 a6 05 07 12 83 87 03 a6 05 07 12 83 88 03 a6 05 07 12 83 89 03 a6 05 07 12 83 8a 03 a6 05 07 12 83 8b 03 a6 05 07 12 83 82 03 a7 05 07 12 83 83 03 a7 05 07 12 83 84 03 a7 05 07 12 8c e5 01 01 40 27 8c e5 01 01 40 27 83 85 03 a7 05 07 01 84 85 03 a7 05 07 6c 04 00 34 37 30 35 83 85 03 a7 05 07 12 8c 8f 02 01 40 00 8c 8f 02 01 40 00 83 86 03 a7 05 07 01 84 86 03 a7 05 07 6c 04 00 33 37 37 39 83 86 03 a7 05 07 12 83 87 03 a7 05 07 12 83 88 03 a7 05 07 12 83 89 03 a7 05 07 12 83 8a 03 a7 05 07 12 83 82 03 a8 05 07 12 83 83 03 a8 05 07 12 83 84 03 a8 05 07 12 83 85 03 a8 05 07 12 83 86 03 a8 05 07 12 83 87 03 a8 05 07 12 83 88 03 a8 05 07 12 83 89 03 a8 05 07 12 83 8a 03 a8 05 07 12 83 83 03 a9 05 07 12 83 84 03 a9 05 07 12 83 85 03 a9 05 07 12 8c 90 02 01 40 2a 8c 90 02 01 40 2a 83 86 03 a9 05 07 01 84 86 03 a9 05 07 6c 05 00 31 31 31 30 31 83 86 03 a9 05 07 12 83 87 03 a9 05 07 12 83 88 03 a9 05 07 12 83 89 03 a9 05 07 12 83 84 03 aa 05 07 12 83 85 03 aa 05 07 12 83 86 03 aa 05 07 12 83 87 03 aa 05 07 12 83 88 03 aa 05 07 12 83 86 03 ab 05 07 12 a0 1a 18 1a 18 55 25 93 bc 2c 36 05 00 00 00 51 04 1e b4 72 b1 80 8a 5e c8 aa 00 00 00 00 07 00 43 6e 70 6a 6f 74 6f 10 86 03 a6 05 07 13 00 65 78 65 76 6f 20 67 72 61 6e 20 6d 61 73 20 6d 6f 72 74
Last edited: