fix spell_failed_other not working

This commit is contained in:
avitasia
2026-02-03 08:17:33 -08:00
parent 5d5c530517
commit 5629c869d4
5 changed files with 7131 additions and 7139 deletions
+7123 -7121
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -127,7 +127,7 @@ namespace Nampower {
std::unique_ptr<hadesmem::PatchDetour<PacketHandlerT> > gSpellCooldownDetour;
std::unique_ptr<hadesmem::PatchDetour<PacketHandlerT> > gSpellDelayedDetour;
std::unique_ptr<hadesmem::PatchDetour<PacketHandlerT> > gCastResultHandlerDetour;
std::unique_ptr<hadesmem::PatchDetour<PacketHandlerT> > gSpellFailedHandlerDetour;
std::unique_ptr<hadesmem::PatchDetour<PacketHandlerT> > gSpellFailedOtherHandlerDetour;
std::unique_ptr<hadesmem::PatchDetour<PacketHandlerT> > gSpellChannelStartHandlerDetour;
std::unique_ptr<hadesmem::PatchDetour<PacketHandlerT> > gSpellChannelUpdateHandlerDetour;
std::unique_ptr<hadesmem::PatchDetour<PacketHandlerT> > gPlaySpellVisualHandlerDetour;
@@ -1349,6 +1349,8 @@ namespace Nampower {
&SpellHealingLogHandlerHook);
gSpellEnergizeLogHandlerDetour = createHook<PacketHandlerT>(process, Offsets::SpellEnergizeLogHandler,
&SpellEnergizeLogHandlerHook);
gSpellFailedOtherHandlerDetour = createHook<PacketHandlerT>(process, Offsets::SpellFailedOtherHandler,
&SpellFailedOtherHandlerHook);
gSpellFailedDetour = createHook<Spell_C_SpellFailedT>(process, Offsets::Spell_C_SpellFailed,
&Spell_C_SpellFailedHook);
gSpellGoDetour = createHook<SpellGoT>(process, Offsets::SpellGo, &SpellGoHook);
+1 -11
View File
@@ -4,18 +4,8 @@
#pragma once
#include <hadesmem/process.hpp>
#include <hadesmem/patcher.hpp>
#include <Windows.h>
#include <cstdint>
#include <memory>
#include <atomic>
#include <chrono>
#include <thread>
#include <iostream>
#include <fstream>
#include "game.hpp"
@@ -36,7 +26,7 @@ namespace Nampower {
constexpr uint32_t MAJOR_VERSION = 2;
constexpr uint32_t MINOR_VERSION = 27;
constexpr uint32_t PATCH_VERSION = 1;
constexpr uint32_t PATCH_VERSION = 2;
constexpr int32_t LUA_REGISTRYINDEX = -10000;
constexpr int32_t LUA_GLOBALSINDEX = -10001;
+3 -5
View File
@@ -580,8 +580,8 @@ namespace Nampower {
return castResultHandler(opCode, packet);
}
int SpellFailedHandlerHook(hadesmem::PatchDetourBase *detour, uint32_t *opCode, CDataStore *packet) {
auto const spellFailedHandler = detour->GetTrampolineT<PacketHandlerT>();
int SpellFailedOtherHandlerHook(hadesmem::PatchDetourBase *detour, uint32_t *opCode, CDataStore *packet) {
auto const spellFailedOtherHandler = detour->GetTrampolineT<PacketHandlerT>();
auto const rpos = packet->m_read;
@@ -593,11 +593,9 @@ namespace Nampower {
packet->m_read = rpos;
DEBUG_LOG("Spell failed opcode:" << opCode << " for " << game::GetSpellName(spellId) << " guid " << guid);
TriggerSpellFailedOtherEvent(guid, spellId);
return spellFailedHandler(opCode, packet);
return spellFailedOtherHandler(opCode, packet);
}
bool doesSpellApplyAura(const game::SpellRec *spell) {
+1 -1
View File
@@ -18,7 +18,7 @@ namespace Nampower {
int CastResultHandlerHook(hadesmem::PatchDetourBase *detour, uint32_t *opCode, CDataStore *packet);
int SpellFailedHandlerHook(hadesmem::PatchDetourBase *detour, uint32_t *opCode, CDataStore *packet);
int SpellFailedOtherHandlerHook(hadesmem::PatchDetourBase *detour, uint32_t *opCode, CDataStore *packet);
int SpellStartHandlerHook(hadesmem::PatchDetourBase *detour, uint32_t unk, uint32_t opCode, uint32_t unk2,
CDataStore *packet);