mirror of
https://github.com/brues-code/nampower.git
synced 2026-10-09 23:20:01 +00:00
include spellId in UPDATE_DURATION events to indicate refreshes
fix guid in GetCastInfo
This commit is contained in:
+11
-3
@@ -147,13 +147,21 @@ namespace Nampower {
|
||||
bool isBuff = auraSlot < 32;
|
||||
game::Events eventToTrigger = isBuff ? game::BUFF_UPDATE_DURATION_SELF : game::DEBUFF_UPDATE_DURATION_SELF;
|
||||
|
||||
static char format[] = "%d%d%d";
|
||||
((int (__cdecl *)(int, char *, uint32_t, int, uint32_t)) Offsets::SignalEventParam)(
|
||||
auto playerUnit = game::GetObjectPtr(game::ClntObjMgrGetActivePlayerGuid());
|
||||
uint32_t spellId = 0;
|
||||
if (playerUnit) {
|
||||
auto *unitFields = *reinterpret_cast<game::UnitFields **>(playerUnit + 68);
|
||||
spellId = unitFields->aura[auraSlot];
|
||||
}
|
||||
|
||||
static char format[] = "%d%d%d%d";
|
||||
((int (__cdecl *)(int, char *, uint32_t, int, uint32_t, uint32_t)) Offsets::SignalEventParam)(
|
||||
eventToTrigger,
|
||||
format,
|
||||
auraSlot,
|
||||
durationMs,
|
||||
expirationTime);
|
||||
expirationTime,
|
||||
spellId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ namespace Nampower {
|
||||
constexpr uint32_t DISENCHANT_QUALITY_PURPLE = 0x04; // Epic
|
||||
|
||||
constexpr uint32_t MAJOR_VERSION = 2;
|
||||
constexpr uint32_t MINOR_VERSION = 32;
|
||||
constexpr uint32_t MINOR_VERSION = 33;
|
||||
constexpr uint32_t PATCH_VERSION = 0;
|
||||
|
||||
constexpr int32_t LUA_REGISTRYINDEX = -10000;
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace Nampower {
|
||||
// Add fields to table
|
||||
PushTableValue(luaState, LuaFields::castId, castParams->castId);
|
||||
PushTableValue(luaState, LuaFields::spellId, castParams->spellId);
|
||||
PushTableValue(luaState, LuaFields::guid, castParams->guid);
|
||||
PushTableValue(luaState, LuaFields::guid, ConvertGuidToString(castParams->guid));
|
||||
PushTableValue(luaState, LuaFields::castType, static_cast<uint32_t>(castParams->castType));
|
||||
PushTableValue(luaState, LuaFields::castStartS, castStartTimeWow);
|
||||
PushTableValue(luaState, LuaFields::castEndS, castEndTimeWow);
|
||||
|
||||
@@ -496,6 +496,7 @@ namespace Nampower {
|
||||
}
|
||||
|
||||
auto const currentTargetGuid = game::GetCurrentTargetGuid();
|
||||
auto const guidForHistory = (guid != 0) ? guid : currentTargetGuid;
|
||||
|
||||
if (spellIsChanneling) {
|
||||
auto casterGuid = game::UnitGetGuid(casterUnit);
|
||||
@@ -554,7 +555,7 @@ namespace Nampower {
|
||||
currentTime, ON_SWING, 0);
|
||||
|
||||
gCastHistory.pushFront({
|
||||
gNextCastId, casterUnit, spellId, item, guid,
|
||||
gNextCastId, casterUnit, spellId, item, guidForHistory,
|
||||
spell->StartRecoveryCategory,
|
||||
castTime,
|
||||
currentTime,
|
||||
@@ -824,7 +825,7 @@ namespace Nampower {
|
||||
}
|
||||
|
||||
gCastHistory.pushFront({
|
||||
gNextCastId, casterUnit, spellId, item, guid,
|
||||
gNextCastId, casterUnit, spellId, item, guidForHistory,
|
||||
spell->StartRecoveryCategory,
|
||||
castTime,
|
||||
currentTime,
|
||||
|
||||
Reference in New Issue
Block a user