mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 20:51:29 +00:00
Fix Distance Mod scaling
The client clamps the distance between the min/max
This commit is contained in:
parent
8396f19e85
commit
527ee56fb2
@ -24,6 +24,7 @@
|
|||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/skills.h"
|
#include "../common/skills.h"
|
||||||
#include "../common/spdat.h"
|
#include "../common/spdat.h"
|
||||||
|
#include "../common/data_verification.h"
|
||||||
|
|
||||||
#include "quest_parser_collection.h"
|
#include "quest_parser_collection.h"
|
||||||
#include "string_ids.h"
|
#include "string_ids.h"
|
||||||
@ -6731,9 +6732,11 @@ void Mob::CalcSpellPowerDistanceMod(uint16 spell_id, float range, Mob* caster)
|
|||||||
else
|
else
|
||||||
distance = sqrt(range);
|
distance = sqrt(range);
|
||||||
|
|
||||||
|
distance = EQEmu::Clamp(distance, spells[spell_id].min_dist, spells[spell_id].max_dist);
|
||||||
|
|
||||||
float dm_range = spells[spell_id].max_dist - spells[spell_id].min_dist;
|
float dm_range = spells[spell_id].max_dist - spells[spell_id].min_dist;
|
||||||
float dm_mod_interval = spells[spell_id].max_dist_mod - spells[spell_id].min_dist_mod;
|
float dm_mod_interval = spells[spell_id].max_dist_mod - spells[spell_id].min_dist_mod;
|
||||||
float dist_from_min = distance - spells[spell_id].min_dist;
|
float dist_from_min = distance - spells[spell_id].min_dist;
|
||||||
float mod = spells[spell_id].min_dist_mod + (dist_from_min * (dm_mod_interval/dm_range));
|
float mod = spells[spell_id].min_dist_mod + (dist_from_min * (dm_mod_interval/dm_range));
|
||||||
mod *= 100.0f;
|
mod *= 100.0f;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user