mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 01:01:30 +00:00
Added column triggered_number. If this is set, then the trap will despawn after it has been triggered this number of times. If 0, the trap will never despawn on its own. Added group column. This allows developers to group traps together in a similar way as spawngroups for NPCs. When a trap that is grouped is despawned in anyway, a random trap in the group will take its place. Grouped traps do not have to be at the same coords or have the same type. This can allow for some spawning diversity if so required. If set to 0, the trap is not grouped and will always respawn. Added column despawn_when_triggered. If set to 1, then a trap will despawn when a player triggers it. If 0, then there will be a 5 second reset time and then the same trap will again be active. (Assuming triggered_number has not been reached.) The player that triggered the trap will not re-trigger it until they have left and re-enetered the trap's radius. Traps will no longer trigger on players that are currently zoning. This fixes some weirdness and at least one crash. The trap can trigger however after the connection is been completed. If a player camped out in a trap radius they can potentially still be hit. Alarm type traps were not using effectvalue2 to determine who should be aggroed. This is now fixed. Traps will no longer be broken by #repop, #depopzone, or #reloadworld. All 3 commands will now have the same effect on traps as they do for NPCs. Added command #reloadtraps. This reloads all of the traps in the zone. Added command #trapinfo. This gives some information about the traps currently spawned in the zone. Added Traps logsys category Required SQL: utils/sql/git/required/2017_10_26_traps.sql
88 lines
2.7 KiB
C++
88 lines
2.7 KiB
C++
/* EQEMu: Everquest Server Emulator
|
|
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
|
|
|
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; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
are required to give you total support for your newly bought product;
|
|
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 _TRAP_H
|
|
#define _TRAP_H
|
|
|
|
#include "entity.h"
|
|
|
|
class Mob;
|
|
class NPC;
|
|
|
|
//ID of the NPC type to spawn when a trap is set off, to do the damage
|
|
#define TRAP_NPC_TYPE 1586
|
|
|
|
enum TrapTypes
|
|
{
|
|
trapTypeDebuff = 0,
|
|
trapTypeAlarm = 1,
|
|
trapTypeMysticSpawn = 2,
|
|
trapTypeBanditSpawn = 3,
|
|
trapTypeDamage = 4,
|
|
};
|
|
|
|
class Trap: public Entity
|
|
{
|
|
public:
|
|
Trap();
|
|
virtual ~Trap();
|
|
virtual bool Process();
|
|
virtual bool IsTrap() const { return true; }
|
|
void Trigger(Mob* trigger);
|
|
|
|
void SpellOnTarget(Mob* trigger, uint32 spell_id);
|
|
|
|
NPC * GetHiddenTrigger() { return hiddenTrigger; }
|
|
void SetHiddenTrigger(NPC* n) { hiddenTrigger = n; }
|
|
void CreateHiddenTrigger();
|
|
void DestroyHiddenTrigger() { hiddenTrigger = nullptr; }
|
|
void SetTrapData();
|
|
void UpdateTrap(bool respawn = true, bool repopnow = false);
|
|
//Trap data, leave this unprotected
|
|
Timer respawn_timer; //Respawn Time when Trap's been disarmed
|
|
Timer chkarea_timer;
|
|
Timer reset_timer; //How long a trap takes to reset before triggering again.
|
|
uint32 trap_id; //Original ID of the trap from DB. This value never changes.
|
|
uint32 db_id; //The DB ID of the trap that currently is spawned.
|
|
glm::vec3 m_Position;
|
|
float maxzdiff; //maximum z diff to be triggerable
|
|
float radius; //radius around trap to be triggerable
|
|
uint8 chance; //%chance that the trap is triggered each 'tick'
|
|
uint8 effect; //Effect ID
|
|
int32 effectvalue; //Value of Effect
|
|
int32 effectvalue2; //Value of Effect
|
|
uint8 skill; //Skill to detect/disarm with rogue.
|
|
uint8 level;
|
|
bool detected;
|
|
bool disarmed;
|
|
uint32 respawn_time;
|
|
uint32 respawn_var;
|
|
uint8 triggered_number;
|
|
uint8 times_triggered;
|
|
uint8 group;
|
|
bool despawn_when_triggered;
|
|
uint32 charid; //ID of character that triggered trap. This is cleared when the trap despawns are resets.
|
|
|
|
std::string message;
|
|
protected:
|
|
NPC *hiddenTrigger;
|
|
bool ownHiddenTrigger;
|
|
};
|
|
|
|
#endif
|
|
|