*Update Sapphiron script.
--HG-- branch : trunk
This commit is contained in:
+17
-1
@@ -1309,6 +1309,21 @@ bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const
|
||||
return (( angle >= lborder ) && ( angle <= rborder ));
|
||||
}
|
||||
|
||||
bool WorldObject::IsInBetween(const WorldObject *obj1, const WorldObject *obj2, float size) const
|
||||
{
|
||||
if(GetPositionX() > std::max(obj1->GetPositionX(), obj2->GetPositionX())
|
||||
|| GetPositionX() < std::min(obj1->GetPositionX(), obj2->GetPositionX())
|
||||
|| GetPositionY() > std::max(obj1->GetPositionY(), obj2->GetPositionY())
|
||||
|| GetPositionY() < std::min(obj1->GetPositionY(), obj2->GetPositionY()))
|
||||
return false;
|
||||
|
||||
if(!size)
|
||||
size = GetObjectSize() / 2;
|
||||
|
||||
float angle = obj1->GetAngle(this) - obj1->GetAngle(obj2);
|
||||
return abs(sin(angle)) * GetExactDistance2d(obj1->GetPositionX(), obj1->GetPositionY()) < size;
|
||||
}
|
||||
|
||||
void WorldObject::GetRandomPoint( float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z) const
|
||||
{
|
||||
if(distance==0)
|
||||
@@ -1658,6 +1673,8 @@ TempSummon *Map::SummonCreature(uint32 entry, float x, float y, float z, float a
|
||||
return NULL;
|
||||
}
|
||||
|
||||
summon->SetHomePosition(x, y, z, angle);
|
||||
|
||||
summon->InitStats(duration);
|
||||
Add((Creature*)summon);
|
||||
summon->InitSummon();
|
||||
@@ -1680,7 +1697,6 @@ TempSummon* WorldObject::SummonCreature(uint32 entry, float x, float y, float z,
|
||||
if(!pCreature)
|
||||
return NULL;
|
||||
|
||||
pCreature->SetHomePosition(x, y, z, ang);
|
||||
pCreature->SetTempSummonType(spwtype);
|
||||
|
||||
return pCreature;
|
||||
|
||||
@@ -480,6 +480,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object
|
||||
float GetAngle( const float x, const float y ) const;
|
||||
void GetSinCos(const float x, const float y, float &vsin, float &vcos);
|
||||
bool HasInArc( const float arcangle, const WorldObject* obj ) const;
|
||||
bool IsInBetween(const WorldObject *obj1, const WorldObject *obj2, float size = 0) const;
|
||||
|
||||
virtual void SendMessageToSet(WorldPacket *data, bool self, bool to_possessor = true);
|
||||
virtual void SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool to_possessor = true);
|
||||
|
||||
Reference in New Issue
Block a user