/* EQEmu: EQEmulator Copyright (C) 2001-2026 EQEmu Development Team 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 3 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, see . */ #pragma once #include "common/timer.h" #include "common/types.h" #include "zone/mob.h" #include "zone/npc.h" #include #include class Group; class Raid; class Mob; struct NPCType; enum class AuraType { OnAllFriendlies, // AE PC/Pet basically (ex. Circle of Power) OnAllGroupMembers, // Normal buffing aura (ex. Champion's Aura) OnGroupMembersPets, // Hits just pets (ex. Rathe's Strength) Totem, // Starts pulsing on a timer when an enemy enters (ex. Idol of Malos) EnterTrap, // Casts once when an enemy enters (ex. Fire Rune) ExitTrap, // Casts when they start to flee (ex. Poison Spikes Trap) FullyScripted, // We just call script function not a predefined Max }; enum class AuraSpawns { GroupMembers, // most auras use this Everyone, // this is like traps and clickies who cast on everyone Noone, // custom! Max }; enum class AuraMovement { Follow, // follows caster Stationary, Pathing, // some sorted pathing TODO: implement Max }; class Aura : public NPC { // NOTE: We may have to override more virtual functions if they're causing issues public: Aura(NPCType *type_data, Mob *owner, AuraRecord &record); ~Aura() { }; bool IsAura() const { return true; } bool Process(); void Depop(bool skip_strip = false); Mob *GetOwner(); void ProcessOnAllFriendlies(Mob *owner); void ProcessOnAllGroupMembers(Mob *owner); void ProcessOnGroupMembersPets(Mob *owner); void ProcessTotem(Mob *owner); void ProcessEnterTrap(Mob *owner); void ProcessExitTrap(Mob *owner); void ProcessSpawns(); // we only save auras that follow you, and player casted inline bool AuraZones() { return movement_type == AuraMovement::Follow && aura_id > -1; } inline int GetSpellID() { return spell_id; } inline int GetAuraID() { return aura_id; } inline void SetAuraID(int in) { aura_id = in; } bool ShouldISpawnFor(Client *c); // so when we join a group, we need to spawn not already spawned auras // This is only possible when spawn type is GroupMembers inline bool JoinGroupSpawnCheck() { return spawn_type == AuraSpawns::GroupMembers; } private: int m_owner; int aura_id; // spell ID of the aura spell -1 if aura isn't from a casted spell int spell_id; // spell we cast float distance; // distance we remove Timer remove_timer; // when we depop Timer process_timer; // rate limit process calls Timer cast_timer; // some auras pulse Timer movement_timer; // rate limit movement updates AuraType type; AuraSpawns spawn_type; AuraMovement movement_type; std::function process_func; std::set casted_on; // we keep track of the other entities we've casted on std::set spawned_for; };