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 Events
45 {
47 {
48 public:
49 SetAggresiveStateEvent(Creature* owner, bool startCombat = true, ObjectGuid summonerGUID = ObjectGuid::Empty, StartCombatArgs const& combatArgs = { });
50
51 bool Execute(uint64 /*time*/, uint32 /*diff*/) override;
52
53 private:
55 bool const _startCombat;
58 };
59 }
60 }
61}
62
63#endif //TRINITY_COMMONHELPERS_H
#define TC_GAME_API
Definition Define.h:129
uint64_t uint64
Definition Define.h:153
uint32_t uint32
Definition Define.h:154
static ObjectGuid const Empty
Definition ObjectGuid.h:314
StartCombatArgs & SetDistance(float value)
StartCombatArgs & SetTargetPlayers(bool value)
StartCombatArgs & SetAvoidTargetVictim(bool value)