Jump to content

Recommended Posts

  • 40 years later...
Posted

rev 10057 but its been happening for a long time on older revs

when you summon a pet sometimes they just start walking away? if you move they come running back

Posted

so something is wrong in here?

    int32 duration = GetSpellDuration(m_spellInfo);
   if(Player* modOwner = m_caster->GetSpellModOwner())
       modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);

   if (m_caster->GetTypeId()==TYPEID_PLAYER && spawnCreature->LoadPetFromDB((Player*)m_caster,pet_entry))
   {
       // Summon in dest location
       float x, y, z;
       if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
       {
           x = m_targets.m_destX;
           y = m_targets.m_destY;
           z = m_targets.m_destZ;
           spawnCreature->Relocate(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, -m_caster->GetOrientation());
       }

       // set timer for unsummon
       if (duration > 0)
           spawnCreature->SetDuration(duration);

       return;
   }

   Map *map = m_caster->GetMap();
   uint32 pet_number = sObjectMgr.GeneratePetNumber();
   if (!spawnCreature->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(),
       m_spellInfo->EffectMiscValue[eff_idx], pet_number))
   {
       sLog.outErrorDb("Spell::EffectSummon: no such creature entry %u",m_spellInfo->EffectMiscValue[eff_idx]);
       delete spawnCreature;
       return;
   }

   // Summon in dest location
   float x, y, z;
   if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
   {
       x = m_targets.m_destX;
       y = m_targets.m_destY;
       z = m_targets.m_destZ;
   }
   else
       m_caster->GetClosePoint(x, y, z, spawnCreature->GetObjectSize());

   spawnCreature->Relocate(x, y, z, -m_caster->GetOrientation());
   spawnCreature->SetSummonPoint(x, y, z, -m_caster->GetOrientation());

   if (!spawnCreature->IsPositionValid())
   {
       sLog.outError("Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)",
           spawnCreature->GetGUIDLow(), spawnCreature->GetEntry(), spawnCreature->GetPositionX(), spawnCreature->GetPositionY());
       delete spawnCreature;
       return;

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use