View Single Post
  #3  
Old 09-08-2009, 12:09 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

The hitbox is calculated via Mob::CombatRange():

Code:
bool Mob::CombatRange(Mob* other)
{
        if(!other)
                return(false);

        float size_mod = GetSize();
        float other_size_mod = other->GetSize();

        if(GetRace() == 49 || GetRace() == 158 || GetRace() == 196) //For races with a fixed size
                size_mod = 60.0f;
        else if (size_mod < 6.0)
                size_mod = 8.0f;

        if(other->GetRace() == 49 || other->GetRace() == 158 || other->GetRace() == 196) //For races with a fixed size
                other_size_mod = 60.0f;
        else if (other_size_mod < 6.0)
                other_size_mod = 8.0f;

        if (other_size_mod > size_mod)
        {
                size_mod = other_size_mod;
        }

        // this could still use some work, but for now it's an improvement....

        if (size_mod > 29)
                size_mod *= size_mod;
        else if (size_mod > 19)
                size_mod *= size_mod * 2;
        else
                size_mod *= size_mod * 4;


        // prevention of ridiculously sized hit boxes
        if (size_mod > 10000)
                size_mod = size_mod / 7;
        
        if (DistNoRoot(*other) <= size_mod)
        {
                return true;
        }
        return false;
}
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote