root/trunk/src/game/PossessedAI.h @ 252

Revision 174, 1.8 kB (checked in by yumileroy, 17 years ago)

[svn] Implemented player on player and player on creature possession:
* Implemented packet and vision forwarding through possessed units
* Added new OnPossess? script call alerting scripts on when possession is applied/removed
* Moved fall damage and fall under map calculations into the Player class
* Added new PossessedAI that is applied only while possession on creature is active
* Implemented summon possessed spell effect
* Fixed Eyes of the Beast

Original author: gvcoman
Date: 2008-11-05 20:51:05-06:00

Line 
1/*
2 * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
3 *
4 * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef MANGOS_POSSESSEDAI_H
22#define MANGOS_POSSESSEDAI_H
23
24#include "CreatureAI.h"
25
26class Creature;
27
28class TRINITY_DLL_DECL PossessedAI : public CreatureAI
29{
30    public:
31        PossessedAI(Creature &c) : i_pet(c), i_victimGuid(0) {}
32
33        // Possessed creatures shouldn't aggro by themselves
34        void MoveInLineOfSight(Unit *) {}
35        void AttackStart(Unit *);
36        void EnterEvadeMode() {}
37        void JustDied(Unit*);
38        void KilledUnit(Unit* victim);
39        void AttackedBy(Unit*) {}
40        bool IsVisible(Unit * u) const { return _isVisible(u); }
41
42        void UpdateAI(const uint32);
43        // Never permit this to be used, it must always be initialized with Creature::InitPossessedAI()
44        static int Permissible(const Creature *) { return PERMIT_BASE_NO; }
45
46    private:
47        bool _isVisible(Unit *) const;
48        bool _needToStop(void) const;
49        void _stopAttack(void);
50
51        Creature &i_pet;
52        uint64 i_victimGuid;
53};
54#endif
Note: See TracBrowser for help on using the browser.