mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
Change item effects to int32
Check range on AEDuration spells
This commit is contained in:
parent
cfd7e9f4d3
commit
36be32f36f
@ -332,7 +332,7 @@ namespace EQEmu
|
||||
};
|
||||
|
||||
struct ItemEffect_Struct {
|
||||
int16 Effect;
|
||||
int32 Effect;
|
||||
uint8 Type;
|
||||
uint8 Level;
|
||||
uint8 Level2;
|
||||
|
||||
@ -2140,6 +2140,27 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
|
||||
|
||||
spell_target->CalcSpellPowerDistanceMod(spell_id, dist2);
|
||||
}
|
||||
//AE Duration spells were ignoring distance check from item clickies
|
||||
if(ae_center != nullptr && ae_center != this) {
|
||||
//casting a spell on somebody but ourself, make sure they are in range
|
||||
float dist2 = DistanceSquared(m_Position, ae_center->GetPosition());
|
||||
float range2 = range * range;
|
||||
float min_range2 = spells[spell_id].min_range * spells[spell_id].min_range;
|
||||
if(dist2 > range2) {
|
||||
//target is out of range.
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2);
|
||||
Message_StringID(13, TARGET_OUT_OF_RANGE);
|
||||
return(false);
|
||||
}
|
||||
else if (dist2 < min_range2){
|
||||
//target is too close range.
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2);
|
||||
Message_StringID(13, TARGET_TOO_CLOSE);
|
||||
return(false);
|
||||
}
|
||||
|
||||
ae_center->CalcSpellPowerDistanceMod(spell_id, dist2);
|
||||
}
|
||||
|
||||
//
|
||||
// Switch #2 - execute the spell
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user