From 2f558184b94d5020cf78b6784918fdfd72a22247 Mon Sep 17 00:00:00 2001 From: Emagi Date: Sun, 10 Aug 2025 17:15:33 -0400 Subject: [PATCH] added proc type 20 (physical attack damage attempt) and type 21 (magical attack damage attempt) -- these will serve as attempts to hit, not requiring a successful hit --- source/WorldServer/Combat.cpp | 7 +++++++ source/WorldServer/Entity.h | 2 ++ source/WorldServer/LuaFunctions.cpp | 2 ++ 3 files changed, 11 insertions(+) diff --git a/source/WorldServer/Combat.cpp b/source/WorldServer/Combat.cpp index f76b1d3..f5f7ad2 100644 --- a/source/WorldServer/Combat.cpp +++ b/source/WorldServer/Combat.cpp @@ -279,6 +279,8 @@ void Entity::MeleeAttack(Spawn* victim, float distance, bool primary, bool multi CheckEncounterState((Entity*)victim); } + CheckProcs(PROC_TYPE_PHYSICAL_ATTEMPT, victim); + if(hit_result == DAMAGE_PACKET_RESULT_SUCCESSFUL){ /*if(GetAdventureClass() == MONK){ max_damage*=3; @@ -359,6 +361,8 @@ bool Entity::RangeAttack(Spawn* victim, float distance, Item* weapon, Item* ammo if(!victim) return false; + CheckProcs(PROC_TYPE_PHYSICAL_ATTEMPT, victim); + bool item_deleted = false; if(weapon && weapon->IsRanged() && ammo && ammo->IsAmmo() && ammo->IsThrown()) { if(weapon->ranged_info->range_low <= distance && (weapon->ranged_info->range_high + ammo->thrown_info->range) >= distance) { @@ -495,6 +499,9 @@ bool Entity::SpellAttack(Spawn* victim, float distance, LuaSpell* luaspell, int8 if(victim->IsEntity()) { CheckEncounterState((Entity*)victim); } + + CheckProcs(PROC_TYPE_MAGICAL_ATTEMPT, victim); + bool successful_hit = true; if(hit_result == DAMAGE_PACKET_RESULT_SUCCESSFUL) { luaspell->last_spellattack_hit = true; diff --git a/source/WorldServer/Entity.h b/source/WorldServer/Entity.h index ca39bf4..a68b505 100644 --- a/source/WorldServer/Entity.h +++ b/source/WorldServer/Entity.h @@ -1367,6 +1367,8 @@ struct Proc { #define PROC_TYPE_DAMAGED_MAGIC 17 #define PROC_TYPE_RANGED_ATTACK 18 #define PROC_TYPE_RANGED_DEFENSE 19 +#define PROC_TYPE_PHYSICAL_ATTEMPT 20 +#define PROC_TYPE_MAGICAL_ATTEMPT 21 struct ThreatTransfer { int32 Target; diff --git a/source/WorldServer/LuaFunctions.cpp b/source/WorldServer/LuaFunctions.cpp index a03ce19..b10f3f6 100644 --- a/source/WorldServer/LuaFunctions.cpp +++ b/source/WorldServer/LuaFunctions.cpp @@ -6602,6 +6602,8 @@ int EQ2Emu_lua_AddWard(lua_State* state) { if (wardType == WARD_TYPE_MAGICAL) ward->DamageType = damageTypes; + else + ward->DamageType = 0; // doesn't get used, but default set it anyway ward->DeleteWard = false; // Add the ward to the entity