fix IsSpellInRange for more targets, add more icds

This commit is contained in:
avitasia
2026-04-03 12:22:09 -07:00
parent 0abf6be5e7
commit 5560036cdc
3 changed files with 14951 additions and 15053 deletions
+14932 -15048
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -26,8 +26,8 @@ namespace Nampower {
constexpr uint32_t DISENCHANT_QUALITY_PURPLE = 0x04; // Epic
constexpr uint32_t MAJOR_VERSION = 4;
constexpr uint32_t MINOR_VERSION = 4;
constexpr uint32_t PATCH_VERSION = 0;
constexpr uint32_t MINOR_VERSION = 3;
constexpr uint32_t PATCH_VERSION = 1;
constexpr int32_t LUA_REGISTRYINDEX = -10000;
constexpr int32_t LUA_GLOBALSINDEX = -10001;
+17 -3
View File
@@ -150,9 +150,23 @@ namespace Nampower {
auto spell = game::GetSpellInfo(spellId);
if (spell) {
std::set<uint32_t> validTargetTypes = {5, 6, 21, 25};
if (sizeof spell->EffectImplicitTargetA == 0 ||
validTargetTypes.count(spell->EffectImplicitTargetA[0]) == 0) {
std::set<uint32_t> validTargetTypes = {
game::TARGET_UNIT_CASTER,
game::TARGET_UNIT_CASTER_PET,
game::TARGET_UNIT_ENEMY,
game::TARGET_UNIT_FRIEND,
game::TARGET_GAMEOBJECT,
game::TARGET_UNIT,
game::TARGET_LOCKED,
game::TARGET_UNIT_PARTY,
game::TARGET_UNIT_FRIEND_CHAIN_HEAL,
game::TARGET_LOCATION_CASTER_TARGET_POSITION,
game::TARGET_UNIT_RAID,
game::TARGET_UNIT_RAID_AND_CLASS,
game::TARGET_LOCATION_UNIT_POSITION};
if (validTargetTypes.count(spell->EffectImplicitTargetA[0]) == 0) {
DEBUG_LOG("Invalid target type " << spell->EffectImplicitTargetA[0] << " for IsSpellInRange spellId:" << spellId);
lua_pushnumber(luaState, -1.0);
return 1;
}