Jump to content

Charm effects on players


debilvul
 Share

Recommended Posts

Charming effects aren't working on players, it only modifies their faction

So i suggest that we add a new function in Unit

something like this:

void Unit::SetPlayerCharmed(bool apply, uint64 casterGUID, uint32 spellID)
{
   ((Player*)this)->SetClientControl(this, !apply);
   if(apply)
       if(Unit* caster = ObjectAccessor::GetObjectInWorld(casterGUID, (Unit*)NULL))
           GetMotionMaster()->MoveChase(caster->getVictim());
}

and in Aura::HandleModCharm

if(m_target->GetTypeId() == TYPEID_PLAYER) 
   m_target->SetPlayerCharmed(apply, GetCasterGUID(), GetId());

the thing is that i'd add for the charmed player for melee attack his target if ready but i don't know there to put this code

if(isAttackReady())
{
   //If we are within range melee the target
   if (IsWithinDistInMap(getVictim(), ATTACK_DISTANCE))
   {
       AttackerStateUpdate(getVictim());
       resetAttackTimer();
   }
}

anyone can help?

Link to comment
Share on other sites

 Share

×
×
  • 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