mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-02 12:36:36 +00:00
Merge remote-tracking branch 'remotes/origin/master' into logging_changes
Conflicts: world/client.cpp world/worlddb.cpp zone/aggro.cpp zone/bot.cpp zone/client.cpp zone/client_packet.cpp zone/client_process.cpp zone/doors.cpp zone/entity.cpp zone/inventory.cpp zone/mob_ai.cpp zone/perl_client.cpp zone/spells.cpp zone/waypoints.cpp zone/zone.cpp zone/zonedb.cpp zone/zoning.cpp
This commit is contained in:
+24
-53
@@ -40,17 +40,15 @@
|
||||
extern EntityList entity_list;
|
||||
extern WorldServer worldserver;
|
||||
|
||||
Doors::Doors(const Door* door)
|
||||
: close_timer(5000)
|
||||
Doors::Doors(const Door* door) :
|
||||
close_timer(5000),
|
||||
m_Position(door->pos_x, door->pos_y, door->pos_z, door->heading),
|
||||
m_Destination(door->dest_x, door->dest_y, door->dest_z, door->dest_heading)
|
||||
{
|
||||
db_id = door->db_id;
|
||||
door_id = door->door_id;
|
||||
strn0cpy(zone_name,door->zone_name,32);
|
||||
strn0cpy(door_name,door->door_name,32);
|
||||
pos_x = door->pos_x;
|
||||
pos_y = door->pos_y;
|
||||
pos_z = door->pos_z;
|
||||
heading = door->heading;
|
||||
incline = door->incline;
|
||||
opentype = door->opentype;
|
||||
guild_id = door->guild_id;
|
||||
@@ -67,28 +65,22 @@ Doors::Doors(const Door* door)
|
||||
|
||||
close_timer.Disable();
|
||||
|
||||
strn0cpy(dest_zone,door->dest_zone,32);
|
||||
strn0cpy(dest_zone,door->dest_zone,16);
|
||||
dest_instance_id = door->dest_instance_id;
|
||||
dest_x = door->dest_x;
|
||||
dest_y = door->dest_y;
|
||||
dest_z = door->dest_z;
|
||||
dest_heading = door->dest_heading;
|
||||
|
||||
is_ldon_door = door->is_ldon_door;
|
||||
client_version_mask = door->client_version_mask;
|
||||
}
|
||||
|
||||
Doors::Doors(const char *dmodel, float dx, float dy, float dz, float dheading, uint8 dopentype, uint16 dsize)
|
||||
: close_timer(5000)
|
||||
Doors::Doors(const char *dmodel, const xyz_heading& position, uint8 dopentype, uint16 dsize) :
|
||||
close_timer(5000),
|
||||
m_Position(position),
|
||||
m_Destination(xyz_heading::Origin())
|
||||
{
|
||||
db_id = database.GetDoorsCountPlusOne(zone->GetShortName(), zone->GetInstanceVersion());
|
||||
door_id = database.GetDoorsDBCountPlusOne(zone->GetShortName(), zone->GetInstanceVersion());
|
||||
strn0cpy(zone_name,zone->GetShortName(),32);
|
||||
strn0cpy(door_name,dmodel,32);
|
||||
pos_x = dx;
|
||||
pos_y = dy;
|
||||
pos_z = dz;
|
||||
heading = dheading;
|
||||
incline = 0;
|
||||
opentype = dopentype;
|
||||
guild_id = 0;
|
||||
@@ -107,10 +99,6 @@ Doors::Doors(const char *dmodel, float dx, float dy, float dz, float dheading, u
|
||||
|
||||
strn0cpy(dest_zone,"NONE",32);
|
||||
dest_instance_id = 0;
|
||||
dest_x = 0;
|
||||
dest_y = 0;
|
||||
dest_z = 0;
|
||||
dest_heading = 0;
|
||||
|
||||
is_ldon_door = 0;
|
||||
client_version_mask = 4294967295u;
|
||||
@@ -145,9 +133,9 @@ bool Doors::Process()
|
||||
void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
{
|
||||
//door debugging info dump
|
||||
Log.Out(Logs::Detail, Logs::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading);
|
||||
Log.Out(Logs::Detail, Logs::Doors, "%s clicked door %s (dbid %d, eqid %d) at %s", sender->GetName(), door_name, db_id, door_id, to_string(m_Position).c_str());
|
||||
Log.Out(Logs::Detail, Logs::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param);
|
||||
Log.Out(Logs::Detail, Logs::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading);
|
||||
Log.Out(Logs::Detail, Logs::Doors, " size %d, invert %d, dest: %s %s", size, invert_state, dest_zone, to_string(m_Destination).c_str());
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
|
||||
MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer;
|
||||
@@ -423,7 +411,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
{
|
||||
sender->KeyRingAdd(playerkey);
|
||||
}
|
||||
sender->MovePC(zone->GetZoneID(), zone->GetInstanceID(), dest_x, dest_y, dest_z, dest_heading);
|
||||
sender->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_Destination.m_X, m_Destination.m_Y, m_Destination.m_Z, m_Destination.m_Heading);
|
||||
}
|
||||
else if (( !IsDoorOpen() || opentype == 58 ) && (keyneeded && ((keyneeded == playerkey) || sender->GetGM())))
|
||||
{
|
||||
@@ -433,22 +421,22 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
}
|
||||
if(database.GetZoneID(dest_zone) == zone->GetZoneID())
|
||||
{
|
||||
sender->MovePC(zone->GetZoneID(), zone->GetInstanceID(), dest_x, dest_y, dest_z, dest_heading);
|
||||
sender->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_Destination.m_X, m_Destination.m_Y, m_Destination.m_Z, m_Destination.m_Heading);
|
||||
}
|
||||
else
|
||||
{
|
||||
sender->MovePC(database.GetZoneID(dest_zone), dest_instance_id, dest_x, dest_y, dest_z, dest_heading);
|
||||
sender->MovePC(database.GetZoneID(dest_zone), dest_instance_id, m_Destination.m_X, m_Destination.m_Y, m_Destination.m_Z, m_Destination.m_Heading);
|
||||
}
|
||||
}
|
||||
if (( !IsDoorOpen() || opentype == 58 ) && (!keyneeded))
|
||||
{
|
||||
if(database.GetZoneID(dest_zone) == zone->GetZoneID())
|
||||
{
|
||||
sender->MovePC(zone->GetZoneID(), zone->GetInstanceID(), dest_x, dest_y, dest_z, dest_heading);
|
||||
sender->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_Destination.m_X, m_Destination.m_Y, m_Destination.m_Z, m_Destination.m_Heading);
|
||||
}
|
||||
else
|
||||
{
|
||||
sender->MovePC(database.GetZoneID(dest_zone), dest_instance_id, dest_x, dest_y, dest_z, dest_heading);
|
||||
sender->MovePC(database.GetZoneID(dest_zone), dest_instance_id, m_Destination.m_X, m_Destination.m_Y, m_Destination.m_Z, m_Destination.m_Heading);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -561,14 +549,14 @@ void Doors::ToggleState(Mob *sender)
|
||||
|
||||
void Doors::DumpDoor(){
|
||||
Log.Out(Logs::General, Logs::None,
|
||||
"db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f",
|
||||
db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading);
|
||||
"db_id:%i door_id:%i zone_name:%s door_name:%s %s",
|
||||
db_id, door_id, zone_name, door_name, to_string(m_Position).c_str());
|
||||
Log.Out(Logs::General, Logs::None,
|
||||
"opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s",
|
||||
opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed");
|
||||
Log.Out(Logs::General, Logs::None,
|
||||
"dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f",
|
||||
dest_zone, dest_x, dest_y, dest_z, dest_heading);
|
||||
"dest_zone:%s destination:%s ",
|
||||
dest_zone, to_string(m_Destination).c_str());
|
||||
}
|
||||
|
||||
int32 ZoneDatabase::GetDoorsCount(uint32* oMaxID, const char *zone_name, int16 version) {
|
||||
@@ -706,30 +694,13 @@ bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name
|
||||
void Doors::SetLocation(float x, float y, float z)
|
||||
{
|
||||
entity_list.DespawnAllDoors();
|
||||
pos_x = x;
|
||||
pos_y = y;
|
||||
pos_z = z;
|
||||
m_Position = xyz_location(x, y, z);
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
|
||||
void Doors::SetX(float in) {
|
||||
void Doors::SetPosition(const xyz_heading& position) {
|
||||
entity_list.DespawnAllDoors();
|
||||
pos_x = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
void Doors::SetY(float in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
pos_y = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
void Doors::SetZ(float in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
pos_z = in;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
void Doors::SetHeading(float in) {
|
||||
entity_list.DespawnAllDoors();
|
||||
heading = in;
|
||||
m_Position = position;
|
||||
entity_list.RespawnAllDoors();
|
||||
}
|
||||
|
||||
@@ -764,6 +735,6 @@ void Doors::CreateDatabaseEntry()
|
||||
{
|
||||
return;
|
||||
}
|
||||
database.InsertDoor(GetDoorDBID(), GetDoorID(), GetDoorName(), GetX(), GetY(), GetZ(), GetHeading(), GetOpenType(), GetGuildID(), GetLockpick(), GetKeyItem(), GetDoorParam(), GetInvertState(), GetIncline(), GetSize());
|
||||
database.InsertDoor(GetDoorDBID(), GetDoorID(), GetDoorName(), m_Position, GetOpenType(), GetGuildID(), GetLockpick(), GetKeyItem(), GetDoorParam(), GetInvertState(), GetIncline(), GetSize());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user