TrinityCore
Loading...
Searching...
No Matches
CommonHelpers.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITY_COMMONHELPERS_H
19#define TRINITY_COMMONHELPERS_H
20
21#include "EventProcessor.h"
22#include "Define.h"
23#include "ObjectGuid.h"
24
25class Creature;
26class Player;
27
29{
31 StartCombatArgs& SetAvoidTargetVictim(bool value) { AvoidTargetVictim = value; return *this; }
32 StartCombatArgs& SetTargetPlayers(bool value) { TargetPlayers = value; return *this; }
33 StartCombatArgs& SetDistance(float value) { Distance = value; return *this; }
34
35 bool AvoidTargetVictim = false;
36 bool TargetPlayers = true;
37 float Distance = 0.f;
38};
39
40namespace Trinity
41{
42 namespace Helpers
43 {
44 namespace Entity
45 {
46 // Return values range from 0 (left-most spec) to 2 (right-most spec). If two specs have the same number of talent points, the left-most of those specs is returned.
48 TC_GAME_API bool IsPlayerHealer(Player const* who);
49 bool IsPlayerRangedAttacker(Player const* who);
50 }
51 namespace Events
52 {
54 {
55 public:
56 SetAggresiveStateEvent(Creature* owner, bool startCombat = true, ObjectGuid summonerGUID = ObjectGuid::Empty, StartCombatArgs const& combatArgs = { });
57
58 bool Execute(uint64 /*time*/, uint32 /*diff*/) override;
59
60 private:
62 bool const _startCombat;
65 };
66 }
67 }
68}
69
70#endif //TRINITY_COMMONHELPERS_H
#define TC_GAME_API
Definition Define.h:114
uint8_t uint8
Definition Define.h:135
uint64_t uint64
Definition Define.h:132
uint32_t uint32
Definition Define.h:133
static ObjectGuid const Empty
Definition ObjectGuid.h:140
TC_GAME_API uint8 GetPlayerSpecialization(Player const *who)
bool IsPlayerRangedAttacker(Player const *who)
TC_GAME_API bool IsPlayerHealer(Player const *who)
StartCombatArgs & SetDistance(float value)
StartCombatArgs & SetTargetPlayers(bool value)
StartCombatArgs & SetAvoidTargetVictim(bool value)