*Merge.
--HG-- branch : trunk
This commit is contained in:
@@ -796,6 +796,11 @@ bool Creature::isCanTrainingAndResetTalentsOf(Player* pPlayer) const
|
|||||||
|
|
||||||
void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
|
void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
|
||||||
{
|
{
|
||||||
|
//Prevent gossip from NPCs that are possessed.
|
||||||
|
Unit* Charmed = Unit::GetCharmer();
|
||||||
|
if (Charmed)
|
||||||
|
return;
|
||||||
|
|
||||||
PlayerMenu* pm=pPlayer->PlayerTalkClass;
|
PlayerMenu* pm=pPlayer->PlayerTalkClass;
|
||||||
pm->ClearMenus();
|
pm->ClearMenus();
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,20 @@ void CreatureAI::MoveInLineOfSight(Unit *who)
|
|||||||
{
|
{
|
||||||
if(!me->getVictim() && me->canStartAttack(who))
|
if(!me->getVictim() && me->canStartAttack(who))
|
||||||
AttackStart(who);
|
AttackStart(who);
|
||||||
|
|
||||||
|
if (who->isInCombat() && who->getVictim() && me->GetCreatureType()==CREATURE_TYPE_HUMANOID && me->IsFriendlyTo(who))
|
||||||
|
{
|
||||||
|
if (me->GetDistanceZ(who) <= 2 && me->IsWithinLOSInMap(who))
|
||||||
|
{
|
||||||
|
float attackRadius = (me->GetAttackDistance(who) *0.5);
|
||||||
|
if (me->IsWithinDistInMap(who, attackRadius))
|
||||||
|
{
|
||||||
|
Unit* target = NULL;
|
||||||
|
target = who->getVictim();
|
||||||
|
AttackStart(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CreatureAI::UpdateVictim()
|
bool CreatureAI::UpdateVictim()
|
||||||
|
|||||||
Reference in New Issue
Block a user