mirror of
https://github.com/brues-code/nampower.git
synced 2026-09-29 02:06:02 +00:00
fix IsSpellInRange for more targets, add more icds
This commit is contained in:
+14932
-15048
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user