pet_miss.patch.txt
上传用户:guanshen
上传日期:2021-02-27
资源大小:1k
文件大小:2k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. Index: AIInterface.cpp
  2. ===================================================================
  3. --- AIInterface.cpp (revision 1021)
  4. +++ AIInterface.cpp (working copy)
  5.  -567,18 +567,19 @@
  6.   }
  7.  
  8.  
  9. - //Pet Dismiss after a certian ditance away
  10. - /*if(m_AIType == AITYPE_PET && m_PetOwner != NULL)
  11. + //Pet Dismiss after a certain distance away
  12. + if(m_AIType == AITYPE_PET && m_PetOwner != NULL)
  13.   {
  14.   float dist = (m_Unit->GetInstanceID() == m_PetOwner->GetInstanceID()) ? 
  15.   m_Unit->GetDistanceSq(m_PetOwner) : 99999.0f;
  16.  
  17.   if(dist > 8100.0f) //90 yard away we Dismissed
  18.   {
  19. - DismissPet();
  20. + ((Player*)m_PetOwner)->GetSummon()->Remove(true, true, true);
  21. + sLog.outString("Pet dismissed; dist. > 90 yards");
  22.   return;
  23.   }
  24. - }*/
  25. + }
  26.  }
  27.  
  28.  void AIInterface::_UpdateTimer(uint32 p_time)
  29.  -1005,41 +1006,6 @@
  30.   }
  31.  }
  32.  
  33. -void AIInterface::DismissPet()
  34. -{
  35. - /*
  36. - if(m_AIType != AITYPE_PET)
  37. - return;
  38. -
  39. - if(!m_PetOwner)
  40. - return;
  41. -
  42. - if(m_PetOwner->GetTypeId() != TYPEID_PLAYER)
  43. - return;
  44. -
  45. - if(m_Unit->GetUInt32Value(UNIT_CREATED_BY_SPELL) == 0)
  46. - ((Player*)m_PetOwner)->SetFreePetNo(false, (int)m_Unit->GetUInt32Value(UNIT_FIELD_PETNUMBER));
  47. - ((Player*)m_PetOwner)->SetPet(NULL);
  48. - ((Player*)m_PetOwner)->SetPetName("");
  49. -
  50. - //FIXME:Check hunter pet or not
  51. - //FIXME:Check enslaved creature
  52. - m_PetOwner->SetUInt64Value(UNIT_FIELD_SUMMON, 0);
  53. -
  54. - WorldPacket data;
  55. - data.Initialize(SMSG_PET_SPELLS);
  56. - data << (uint64)0;
  57. - ((Player*)m_PetOwner)->GetSession()->SendPacket(&data);
  58. -
  59. - sEventMgr.RemoveEvents(((Creature*)m_Unit));
  60. - if(m_Unit->IsInWorld())
  61. - {
  62. - m_Unit->RemoveFromWorld();
  63. - }
  64. - //setup an event to delete the Creature
  65. - sEventMgr.AddEvent(((Creature*)this->m_Unit), &Creature::DeleteMe, EVENT_DELETE_TIMER, 1, 1);*/
  66. -}
  67. -
  68.  void AIInterface::AttackReaction(Unit* pUnit, uint32 damage_dealt, uint32 spellId)
  69.  {
  70.   if(m_AIState == STATE_EVADE || m_fleeTimer != 0 || !pUnit 
  71.  
  72. Index: AIInterface.h
  73. ===================================================================
  74. --- AIInterface.h (revision 1021)
  75. +++ AIInterface.h (working copy)
  76.  -174,7 +174,6 @@
  77.   void Init(Unit *un, AIType at, MovementType mt, Unit *owner); // used for pets
  78.   Unit *GetUnit() { return m_Unit; }
  79.   Unit *GetPetOwner() { return m_PetOwner; }
  80. - void DismissPet();
  81.   void SetUnitToFollow(Unit* un) { UnitToFollow = un; };
  82.   void SetUnitToFear(Unit* un)  { UnitToFear = un; };
  83.   void SetFollowDistance(float dist) { FollowDistance = dist; };