Jump to content

Charm effects on players


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(Unit* caster = ObjectAccessor::GetObjectInWorld(casterGUID, (Unit*)NULL))

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 we are within range melee the target
   if (IsWithinDistInMap(getVictim(), ATTACK_DISTANCE))

anyone can help?

Link to comment
Share on other sites


  • 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