mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Merge branch 'master' into eqemu_config_json
This commit is contained in:
+9
-1
@@ -886,9 +886,17 @@ void Mob::RemoveAura(int spawn_id, bool skip_strip, bool expired)
|
||||
if (aura.spawn_id == spawn_id) {
|
||||
if (aura.aura)
|
||||
aura.aura->Depop(skip_strip);
|
||||
if (expired && IsClient())
|
||||
if (expired && IsClient()) {
|
||||
CastToClient()->SendColoredText(
|
||||
CC_Yellow, StringFormat("%s has expired.", aura.name)); // TODO: verify color
|
||||
// need to update client UI too
|
||||
auto app = new EQApplicationPacket(OP_UpdateAura, sizeof(AuraDestory_Struct));
|
||||
auto ads = (AuraDestory_Struct *)app->pBuffer;
|
||||
ads->action = 1; // delete
|
||||
ads->entity_id = spawn_id;
|
||||
CastToClient()->QueuePacket(app);
|
||||
safe_delete(app);
|
||||
}
|
||||
while (aura_mgr.count - 1 > i) {
|
||||
i++;
|
||||
aura.spawn_id = aura_mgr.auras[i].spawn_id;
|
||||
|
||||
@@ -2929,6 +2929,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
|
||||
ns->spawn.helm = helmtexture; //(GetShowHelm() ? helmtexture : 0); //0xFF;
|
||||
ns->spawn.equip_chest2 = texture; //0xFF;
|
||||
ns->spawn.show_name = true;
|
||||
const EQEmu::ItemData* item = nullptr;
|
||||
const EQEmu::ItemInstance* inst = nullptr;
|
||||
uint32 spawnedbotid = 0;
|
||||
|
||||
+12
-1
@@ -11805,7 +11805,17 @@ void Client::Handle_OP_RemoveTrap(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
auto id = app->ReadUInt32(0);
|
||||
RemoveAura(id);
|
||||
bool good = false;
|
||||
for (int i = 0; i < trap_mgr.count; ++i) {
|
||||
if (trap_mgr.auras[i].spawn_id == id) {
|
||||
good = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (good)
|
||||
RemoveAura(id);
|
||||
else
|
||||
Message_StringID(MT_SpellFailure, NOT_YOUR_TRAP); // pretty sure this was red
|
||||
}
|
||||
|
||||
void Client::Handle_OP_Report(const EQApplicationPacket *app)
|
||||
@@ -14340,6 +14350,7 @@ void Client::Handle_OP_UpdateAura(const EQApplicationPacket *app)
|
||||
return; // could log I guess, but should only ever get this action
|
||||
|
||||
RemoveAura(aura->entity_id);
|
||||
QueuePacket(app); // if we don't resend this, the client gets confused
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+10
-2
@@ -3895,6 +3895,8 @@ void command_depopzone(Client *c, const Seperator *sep)
|
||||
void command_repop(Client *c, const Seperator *sep)
|
||||
{
|
||||
int timearg = 1;
|
||||
int delay = 0;
|
||||
|
||||
if (sep->arg[1] && strcasecmp(sep->arg[1], "force") == 0) {
|
||||
timearg++;
|
||||
|
||||
@@ -3913,13 +3915,19 @@ void command_repop(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if (!sep->IsNumber(timearg)) {
|
||||
c->Message(0, "Zone depoped. Repoping now.");
|
||||
c->Message(0, "Zone depopped - repopping now.");
|
||||
|
||||
zone->Repop();
|
||||
|
||||
/* Force a spawn2 timer trigger so we don't delay actually spawning the NPC's */
|
||||
zone->spawn2_timer.Trigger();
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(0, "Zone depoped. Repop in %i seconds", atoi(sep->arg[timearg]));
|
||||
zone->Repop(atoi(sep->arg[timearg])*1000);
|
||||
zone->Repop(atoi(sep->arg[timearg]) * 1000);
|
||||
|
||||
zone->spawn2_timer.Trigger();
|
||||
}
|
||||
|
||||
void command_repopclose(Client *c, const Seperator *sep)
|
||||
|
||||
@@ -207,6 +207,16 @@ typedef enum { //fear states
|
||||
|
||||
enum { FlyMode0 = 0, FlyMode1 = 1, Flymode2 = 2, FlyMode3 = 3 };
|
||||
|
||||
// This is actually FlyMode, from MQ2
|
||||
enum GravityBehavior {
|
||||
Ground,
|
||||
Flying,
|
||||
Levitating,
|
||||
Water,
|
||||
Floating, // boat
|
||||
LevitateWhileRunning
|
||||
};
|
||||
|
||||
struct TradeEntity;
|
||||
class Trade;
|
||||
enum TradeState {
|
||||
|
||||
@@ -648,6 +648,8 @@ void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
|
||||
|
||||
parse->EventNPC(EVENT_SPAWN, npc, nullptr, "", 0);
|
||||
|
||||
npc->FixZ();
|
||||
|
||||
uint16 emoteid = npc->GetEmoteID();
|
||||
if (emoteid != 0)
|
||||
npc->DoNPCEmote(ONSPAWN, emoteid);
|
||||
|
||||
@@ -1211,6 +1211,7 @@ void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
ns->spawn.flymode = 0;
|
||||
ns->spawn.NPC = 1; // 0=player,1=npc,2=pc corpse,3=npc corpse
|
||||
ns->spawn.IsMercenary = 1;
|
||||
ns->spawn.show_name = true;
|
||||
|
||||
UpdateActiveLight();
|
||||
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
|
||||
|
||||
+1
-1
@@ -1126,7 +1126,7 @@ protected:
|
||||
int _GetWalkSpeed() const;
|
||||
int _GetRunSpeed() const;
|
||||
int _GetFearSpeed() const;
|
||||
virtual bool MakeNewPositionAndSendUpdate(float x, float y, float z, int speed, bool checkZ);
|
||||
virtual bool MakeNewPositionAndSendUpdate(float x, float y, float z, int speed);
|
||||
|
||||
virtual bool AI_EngagedCastCheck() { return(false); }
|
||||
virtual bool AI_PursueCastCheck() { return(false); }
|
||||
|
||||
+5
-1
@@ -1536,7 +1536,11 @@ void NPC::AI_DoMovement() {
|
||||
|
||||
Log(Logs::Detail, Logs::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)",
|
||||
roambox_distance, roambox_min_x, roambox_max_x, roambox_min_y, roambox_max_y, roambox_movingto_x, roambox_movingto_y);
|
||||
if (!CalculateNewPosition2(roambox_movingto_x, roambox_movingto_y, GetZ(), walksp, true))
|
||||
|
||||
float new_z = this->FindGroundZ(m_Position.x, m_Position.y, 5);
|
||||
new_z += (this->GetSize() / 1.55);
|
||||
|
||||
if (!CalculateNewPosition2(roambox_movingto_x, roambox_movingto_y, new_z, walksp, true))
|
||||
{
|
||||
roambox_movingto_x = roambox_max_x + 1; // force update
|
||||
pLastFightingDelayMoving = Timer::GetCurrentTime() + RandomTimer(roambox_min_delay, roambox_delay);
|
||||
|
||||
@@ -5963,7 +5963,8 @@ bool Mob::TryDeathSave() {
|
||||
|
||||
bool Mob::AffectedBySpellExcludingSlot(int slot, int effect)
|
||||
{
|
||||
for (int i = 0; i <= EFFECT_COUNT; i++)
|
||||
int buff_count = GetMaxTotalSlots();
|
||||
for (int i = 0; i < buff_count; i++)
|
||||
{
|
||||
if (i == slot)
|
||||
continue;
|
||||
|
||||
@@ -286,6 +286,7 @@
|
||||
#define TRADESKILL_LEARN_RECIPE 3457 //You have learned the recipe %1!
|
||||
#define EXPEDITION_MIN_REMAIN 3551 //You only have %1 minutes remaining before this expedition comes to an end.
|
||||
#define LOOT_NOT_ALLOWED 3562 //You are not allowed to loot the item: %1.
|
||||
#define NOT_YOUR_TRAP 3671 //You cannot remove this, you are only allowed to remove traps you have set.
|
||||
#define NO_CAST_ON_PET 4045 //You cannot cast this spell on your pet.
|
||||
#define REWIND_WAIT 4059 //You must wait a bit longer before using the rewind command again.
|
||||
#define CORPSEDRAG_LIMIT 4061 //You are already dragging as much as you can!
|
||||
|
||||
+2
-2
@@ -451,7 +451,7 @@ float Mob::CalculateHeadingToTarget(float in_x, float in_y) {
|
||||
return (256 * (360 - angle) / 360.0f);
|
||||
}
|
||||
|
||||
bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, int speed, bool checkZ) {
|
||||
bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, int speed) {
|
||||
if (GetID() == 0)
|
||||
return true;
|
||||
|
||||
@@ -627,7 +627,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, int speed, boo
|
||||
}
|
||||
|
||||
bool Mob::CalculateNewPosition2(float x, float y, float z, int speed, bool checkZ, bool calcHeading) {
|
||||
return MakeNewPositionAndSendUpdate(x, y, z, speed, checkZ);
|
||||
return MakeNewPositionAndSendUpdate(x, y, z, speed);
|
||||
}
|
||||
|
||||
bool Mob::CalculateNewPosition(float x, float y, float z, int speed, bool checkZ, bool calcHeading) {
|
||||
|
||||
+5
-2
@@ -1168,10 +1168,13 @@ bool Zone::Process() {
|
||||
spawn_conditions.Process();
|
||||
|
||||
if(spawn2_timer.Check()) {
|
||||
|
||||
LinkedListIterator<Spawn2*> iterator(spawn2_list);
|
||||
|
||||
EQEmu::InventoryProfile::CleanDirty();
|
||||
|
||||
Log(Logs::Detail, Logs::Spawns, "Running Zone::Process -> Spawn2::Process");
|
||||
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements()) {
|
||||
if (iterator.GetData()->Process()) {
|
||||
@@ -1181,10 +1184,10 @@ bool Zone::Process() {
|
||||
iterator.RemoveCurrent();
|
||||
}
|
||||
}
|
||||
|
||||
if(adv_data && !did_adventure_actions)
|
||||
{
|
||||
DoAdventureActions();
|
||||
}
|
||||
|
||||
}
|
||||
if(initgrids_timer.Check()) {
|
||||
//delayed grid loading stuff.
|
||||
|
||||
+1
-1
@@ -106,6 +106,7 @@ public:
|
||||
inline const uint8 GetZoneType() const { return zone_type; }
|
||||
|
||||
inline Timer* GetInstanceTimer() { return Instance_Timer; }
|
||||
Timer spawn2_timer;
|
||||
|
||||
inline glm::vec3 GetSafePoint() { return m_SafePoint; }
|
||||
inline const uint32& graveyard_zoneid() { return pgraveyard_zoneid; }
|
||||
@@ -336,7 +337,6 @@ private:
|
||||
|
||||
Timer autoshutdown_timer;
|
||||
Timer clientauth_timer;
|
||||
Timer spawn2_timer;
|
||||
Timer qglobal_purge_timer;
|
||||
Timer* Weather_Timer;
|
||||
Timer* Instance_Timer;
|
||||
|
||||
Reference in New Issue
Block a user