mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
Add a #push command, only works on NPCs for now
This commit is contained in:
parent
5e963c05af
commit
339e921f17
@ -67,10 +67,12 @@
|
||||
#include "titles.h"
|
||||
#include "water_map.h"
|
||||
#include "worldserver.h"
|
||||
#include "fastmath.h"
|
||||
|
||||
extern QueryServ* QServ;
|
||||
extern WorldServer worldserver;
|
||||
extern TaskManager *taskmanager;
|
||||
extern FastMath g_Math;
|
||||
void CatchSignal(int sig_num);
|
||||
|
||||
|
||||
@ -306,6 +308,7 @@ int command_init(void)
|
||||
command_add("profilereset", "- Reset profiling info", 250, command_profilereset) ||
|
||||
#endif
|
||||
|
||||
command_add("push", "Lets you do spell push", 150, command_push) ||
|
||||
command_add("pvp", "[on/off] - Set your or your player target's PVP status", 100, command_pvp) ||
|
||||
command_add("qglobal", "[on/off/view] - Toggles qglobal functionality on an NPC", 100, command_qglobal) ||
|
||||
command_add("questerrors", "Shows quest errors.", 100, command_questerrors) ||
|
||||
@ -4052,6 +4055,33 @@ void command_unfreeze(Client *c, const Seperator *sep)
|
||||
c->Message(0, "ERROR: Unfreeze requires a target.");
|
||||
}
|
||||
|
||||
void command_push(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob *t = c;
|
||||
if (c->GetTarget() != nullptr)
|
||||
t = c->GetTarget();
|
||||
|
||||
if (!sep->arg[1] || !sep->IsNumber(1)) {
|
||||
c->Message(0, "ERROR: Must provide at least a push back.");
|
||||
return;
|
||||
}
|
||||
|
||||
float back = atof(sep->arg[1]);
|
||||
float up = 0.0f;
|
||||
|
||||
if (sep->arg[2] && sep->IsNumber(2))
|
||||
up = atof(sep->arg[2]);
|
||||
|
||||
if (t->IsNPC()) {
|
||||
t->IncDeltaX(back * g_Math.FastSin(c->GetHeading()));
|
||||
t->IncDeltaY(back * g_Math.FastCos(c->GetHeading()));
|
||||
t->IncDeltaZ(up);
|
||||
t->SetForcedMovement(6);
|
||||
} else if (t->IsClient()) {
|
||||
// TODO: send packet to push
|
||||
}
|
||||
}
|
||||
|
||||
void command_pvp(Client *c, const Seperator *sep)
|
||||
{
|
||||
bool state=atobool(sep->arg[1]);
|
||||
|
||||
@ -211,6 +211,7 @@ void command_profiledump(Client *c, const Seperator *sep);
|
||||
void command_profilereset(Client *c, const Seperator *sep);
|
||||
#endif
|
||||
|
||||
void command_push(Client *c, const Seperator *sep);
|
||||
void command_pvp(Client *c, const Seperator *sep);
|
||||
void command_qglobal(Client *c, const Seperator *sep);
|
||||
void command_qtest(Client *c, const Seperator *sep);
|
||||
|
||||
@ -582,6 +582,10 @@ public:
|
||||
m_Position.z = NewPosition.z; };
|
||||
void TryMoveAlong(float distance, float angle, bool send = true);
|
||||
void ProcessForcedMovement();
|
||||
inline void IncDeltaX(float in) { m_Delta.x += in; }
|
||||
inline void IncDeltaY(float in) { m_Delta.y += in; }
|
||||
inline void IncDeltaZ(float in) { m_Delta.z += in; }
|
||||
inline void SetForcedMovement(int in) { ForcedMovement = in; }
|
||||
|
||||
//AI
|
||||
static uint32 GetLevelCon(uint8 mylevel, uint8 iOtherLevel);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user