From adb817565445e1a3d5bb30fe4edec02f7524830e Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Sun, 26 Oct 2014 02:05:36 -0400 Subject: [PATCH] Support for spells_new field 'viral_range' --- zone/entity.cpp | 7 +++++-- zone/entity.h | 2 +- zone/mob.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 0ce530419..fbccd1baa 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -4612,9 +4612,12 @@ Client *EntityList::FindCorpseDragger(uint16 CorpseID) return nullptr; } -Mob *EntityList::GetTargetForVirus(Mob *spreader) +Mob *EntityList::GetTargetForVirus(Mob *spreader, int range) { - int max_spread_range = RuleI(Spells, VirusSpreadDistance); + int max_spread_range = RuleI(Spells, VirusSpreadDistance); + + if (range) + max_spread_range = range; std::vector TargetsInRange; diff --git a/zone/entity.h b/zone/entity.h index 5776ed936..ad5de09bf 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -134,7 +134,7 @@ public: Mob *GetMob(const char* name); Mob *GetMobByNpcTypeID(uint32 get_id); bool IsMobSpawnedByNpcTypeID(uint32 get_id); - Mob *GetTargetForVirus(Mob* spreader); + Mob *GetTargetForVirus(Mob* spreader, int range); inline NPC *GetNPCByID(uint16 id) { return npc_list.count(id) ? npc_list.at(id) : nullptr; } NPC *GetNPCByNPCTypeID(uint32 npc_id); diff --git a/zone/mob.cpp b/zone/mob.cpp index 8d53d50ef..9fb113392 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -4349,7 +4349,7 @@ void Mob::SpreadVirus(uint16 spell_id, uint16 casterID) // Only spread in zones without perm buffs if(!zone->BuffTimersSuspended()) { for(int i = 0; i < num_targs; i++) { - target = entity_list.GetTargetForVirus(this); + target = entity_list.GetTargetForVirus(this, spells[spell_id].viral_range); if(target) { // Only spreads to the uninfected if(!target->FindBuff(spell_id)) {