server/src/game/NullCreatureAI.h
VladimirMangos d85e95295d [7668] Cleanup In CreatureAI function descriptions and AttackStart/AttackedBy use.
* Use AI::AttackStart calls only in case explicit request creature attack from core or AI code "attack it if can".
  Like taunt, pet handler attack command.
* Use AI::AttackedBy for reaction at hostile action "do something at hostile action"
  Like non-dot damage, swing, negative spell landing, or fade fear/etc.
  And provided by default call AttackStart if no current target.

This fix some problems, like:
* Civilian will react propertly at attack by another creature (not pet or player).
* Will not cases (at least triggred by core) when attack target start run to attacker before any real hostile action apply.
2009-04-14 10:14:10 +04:00

41 lines
1.3 KiB
C++

/*
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANGOS_NULLCREATUREAI_H
#define MANGOS_NULLCREATUREAI_H
#include "CreatureAI.h"
class MANGOS_DLL_DECL NullCreatureAI : public CreatureAI
{
public:
explicit NullCreatureAI(Creature* c) : CreatureAI(c) {}
~NullCreatureAI();
void MoveInLineOfSight(Unit *) {}
void AttackStart(Unit *) {}
void AttackedBy( Unit *) {}
void EnterEvadeMode() {}
bool IsVisible(Unit *) const { return false; }
void UpdateAI(const uint32) {}
static int Permissible(const Creature *) { return PERMIT_BASE_IDLE; }
};
#endif