From 1c2e1ea228a04f18b1528fd6ac37b04650486b5d Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Mon, 13 Dec 2021 18:49:53 -0500 Subject: [PATCH] rampage updates (#1882) --- common/spdat.h | 2 +- zone/client_process.cpp | 2 +- zone/effects.cpp | 18 +++++++++++------- zone/entity.h | 3 ++- zone/spell_effects.cpp | 13 ++++++++++--- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/common/spdat.h b/common/spdat.h index 1841ae624..ddf5d4f39 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -912,7 +912,7 @@ typedef enum { #define SE_IllusionOther 202 // implemented - Project Illusion #define SE_MassGroupBuff 203 // implemented #define SE_GroupFearImmunity 204 // implemented - (Does not use bonus) -#define SE_Rampage 205 // implemented +#define SE_Rampage 205 // implemented, @Combat Instant, Perform a primary slot combat rounds on all creatures within a 40 foot radius, base: number of attack rounds, limit: max entities hit per round, max: none, Note: AE range is 40 by default. Custom: Set field 'aoe_range' to override default. Adding additional attacks and hit count limit. #define SE_AETaunt 206 // implemented #define SE_FleshToBone 207 // implemented //#define SE_PurgePoison 208 // not used diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 0134ce3f4..deadb2cbb 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -405,7 +405,7 @@ bool Client::Process() { } if (CheckAATimer(aaTimerRampage)) { - entity_list.AEAttack(this, 30); + entity_list.AEAttack(this, 40); } } } diff --git a/zone/effects.cpp b/zone/effects.cpp index 32f836919..a074615e5 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -1264,7 +1264,8 @@ void EntityList::AEAttack( float distance, int Hand, int count, - bool is_from_spell) + bool is_from_spell, + int attack_rounds) { Mob *current_mob = nullptr; float distance_squared = distance * distance; @@ -1276,15 +1277,18 @@ void EntityList::AEAttack( if (current_mob->IsNPC() && current_mob != attacker //this is not needed unless NPCs can use this && (attacker->IsAttackAllowed(current_mob)) - && current_mob->GetRace() != 216 && current_mob->GetRace() != 472 /* dont attack horses */ + && !current_mob->IsHorse() /* dont attack mounts */ && (DistanceSquared(current_mob->GetPosition(), attacker->GetPosition()) <= distance_squared) ) { - if (!attacker->IsClient() || attacker->GetClass() == MONK || attacker->GetClass() == RANGER) { - attacker->Attack(current_mob, Hand, false, false, is_from_spell); - } - else { - attacker->CastToClient()->DoAttackRounds(current_mob, Hand, is_from_spell); + for (int i = 0; i < attack_rounds; i++) { + + if (!attacker->IsClient() || attacker->GetClass() == MONK || attacker->GetClass() == RANGER) { + attacker->Attack(current_mob, Hand, false, false, is_from_spell); + } + else { + attacker->CastToClient()->DoAttackRounds(current_mob, Hand, is_from_spell); + } } hit_count++; diff --git a/zone/entity.h b/zone/entity.h index 9c437ae09..0984932fe 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -407,7 +407,8 @@ public: float distance, int Hand = EQ::invslot::slotPrimary, int count = 0, - bool is_from_spell = false + bool is_from_spell = false, + int attack_rounds = 1 ); void AETaunt(Client *caster, float range = 0, int32 bonus_hate = 0); void AESpell( diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 0394570e0..efefec421 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -2209,9 +2209,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #ifdef SPELL_EFFECT_SPAM snprintf(effect_desc, _EDLEN, "Rampage"); #endif - if(caster) - entity_list.AEAttack(caster, 30, EQ::invslot::slotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal - + //defulat live range is 40, with 1 attack per round, no hit count limit + float rampage_range = 40; + if (spells[spell_id].aoe_range) { + rampage_range = spells[spell_id].aoe_range; //added for expanded functionality + } + int attack_count = spells[spell_id].base_value[i]; //added for expanded functionality + int hit_count = spells[spell_id].limit_value[i]; //added for expanded functionality + if (caster) { + entity_list.AEAttack(caster, rampage_range, EQ::invslot::slotPrimary, hit_count, true, attack_count); // on live wars dont get a duration ramp, its a one shot deal + } break; }