mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Added 'disable_timer' to door objects (used for click once doors)
This commit is contained in:
parent
d36f1159fb
commit
58e1d9501d
@ -30,7 +30,7 @@
|
|||||||
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CURRENT_BINARY_DATABASE_VERSION 9108
|
#define CURRENT_BINARY_DATABASE_VERSION 9109
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9017
|
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9017
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -362,6 +362,7 @@
|
|||||||
9106|2017_02_26_npc_spells_update_for_bots.sql|SELECT * FROM `npc_spells` WHERE `id` = '701' AND `name` = 'Cleric Bot'|not_empty|
|
9106|2017_02_26_npc_spells_update_for_bots.sql|SELECT * FROM `npc_spells` WHERE `id` = '701' AND `name` = 'Cleric Bot'|not_empty|
|
||||||
9107|2017_03_09_inventory_version.sql|SHOW TABLES LIKE 'inventory_version'|empty|
|
9107|2017_03_09_inventory_version.sql|SHOW TABLES LIKE 'inventory_version'|empty|
|
||||||
9108|2017_04_07_ignore_despawn.sql|SHOW COLUMNS FROM `npc_types` LIKE 'ignore_despawn'|empty|
|
9108|2017_04_07_ignore_despawn.sql|SHOW COLUMNS FROM `npc_types` LIKE 'ignore_despawn'|empty|
|
||||||
|
9109|2017_04_08_doors_disable_timer.sql|SHOW COLUMNS FROM `doors` LIKE 'disable_timer'|empty|
|
||||||
|
|
||||||
# Upgrade conditions:
|
# Upgrade conditions:
|
||||||
# This won't be needed after this system is implemented, but it is used database that are not
|
# This won't be needed after this system is implemented, but it is used database that are not
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE `doors` ADD COLUMN `disable_timer` TINYINT(2) NOT NULL DEFAULT '0' AFTER `triggertype`;
|
||||||
@ -162,6 +162,7 @@ SET(zone_headers
|
|||||||
lua_bit.h
|
lua_bit.h
|
||||||
lua_client.h
|
lua_client.h
|
||||||
lua_corpse.h
|
lua_corpse.h
|
||||||
|
lua_door.h
|
||||||
lua_encounter.h
|
lua_encounter.h
|
||||||
lua_entity.h
|
lua_entity.h
|
||||||
lua_entity_list.h
|
lua_entity_list.h
|
||||||
|
|||||||
@ -135,7 +135,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
|||||||
//door debugging info dump
|
//door debugging info dump
|
||||||
Log(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(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(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(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(Logs::Detail, Logs::Doors, " size %d, invert %d, dest: %s %s", size, invert_state, dest_zone, to_string(m_Destination).c_str());
|
Log(Logs::Detail, Logs::Doors, " disable_timer '%s',size %d, invert %d, dest: %s %s", (disable_timer?"true":"false"), size, invert_state, dest_zone, to_string(m_Destination).c_str());
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
|
auto outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
|
||||||
MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer;
|
MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer;
|
||||||
@ -354,13 +354,15 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
|||||||
entity_list.QueueClients(sender, outapp, false);
|
entity_list.QueueClients(sender, outapp, false);
|
||||||
if(!IsDoorOpen() || (opentype == 58))
|
if(!IsDoorOpen() || (opentype == 58))
|
||||||
{
|
{
|
||||||
close_timer.Start();
|
if (!disable_timer)
|
||||||
|
close_timer.Start();
|
||||||
SetOpenState(true);
|
SetOpenState(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
close_timer.Disable();
|
close_timer.Disable();
|
||||||
SetOpenState(false);
|
if (!disable_timer)
|
||||||
|
SetOpenState(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//everything past this point assumes we opened the door
|
//everything past this point assumes we opened the door
|
||||||
@ -636,7 +638,7 @@ bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name
|
|||||||
std::string query = StringFormat("SELECT id, doorid, zone, name, pos_x, pos_y, pos_z, heading, "
|
std::string query = StringFormat("SELECT id, doorid, zone, name, pos_x, pos_y, pos_z, heading, "
|
||||||
"opentype, guild, lockpick, keyitem, nokeyring, triggerdoor, triggertype, "
|
"opentype, guild, lockpick, keyitem, nokeyring, triggerdoor, triggertype, "
|
||||||
"dest_zone, dest_instance, dest_x, dest_y, dest_z, dest_heading, "
|
"dest_zone, dest_instance, dest_x, dest_y, dest_z, dest_heading, "
|
||||||
"door_param, invert_state, incline, size, is_ldon_door, client_version_mask "
|
"door_param, invert_state, incline, size, is_ldon_door, client_version_mask, disable_timer "
|
||||||
"FROM doors WHERE zone = '%s' AND (version = %u OR version = -1) "
|
"FROM doors WHERE zone = '%s' AND (version = %u OR version = -1) "
|
||||||
"ORDER BY doorid asc", zone_name, version);
|
"ORDER BY doorid asc", zone_name, version);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
@ -686,6 +688,7 @@ bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name
|
|||||||
into[rowIndex].size=atoi(row[24]);
|
into[rowIndex].size=atoi(row[24]);
|
||||||
into[rowIndex].is_ldon_door=atoi(row[25]);
|
into[rowIndex].is_ldon_door=atoi(row[25]);
|
||||||
into[rowIndex].client_version_mask = (uint32)strtoul(row[26], nullptr, 10);
|
into[rowIndex].client_version_mask = (uint32)strtoul(row[26], nullptr, 10);
|
||||||
|
into[rowIndex].disable_timer = (atoi(row[27]) ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -730,6 +733,10 @@ void Doors::SetSize(uint16 in) {
|
|||||||
entity_list.RespawnAllDoors();
|
entity_list.RespawnAllDoors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Doors::SetDisableTimer(bool flag) {
|
||||||
|
disable_timer = flag;
|
||||||
|
}
|
||||||
|
|
||||||
void Doors::CreateDatabaseEntry()
|
void Doors::CreateDatabaseEntry()
|
||||||
{
|
{
|
||||||
if(database.GetDoorsDBCountPlusOne(zone->GetShortName(), zone->GetInstanceVersion()) - 1 >= 255)
|
if(database.GetDoorsDBCountPlusOne(zone->GetShortName(), zone->GetInstanceVersion()) - 1 >= 255)
|
||||||
|
|||||||
@ -67,6 +67,10 @@ public:
|
|||||||
void SetDoorName(const char* name);
|
void SetDoorName(const char* name);
|
||||||
void SetOpenType(uint8 in);
|
void SetOpenType(uint8 in);
|
||||||
void SetSize(uint16 size);
|
void SetSize(uint16 size);
|
||||||
|
|
||||||
|
void SetDisableTimer(bool flag);
|
||||||
|
bool GetDisableTimer() { return disable_timer; }
|
||||||
|
|
||||||
void CreateDatabaseEntry();
|
void CreateDatabaseEntry();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -88,6 +92,7 @@ private:
|
|||||||
uint16 size;
|
uint16 size;
|
||||||
int invert_state;
|
int invert_state;
|
||||||
uint32 entity_id;
|
uint32 entity_id;
|
||||||
|
bool disable_timer;
|
||||||
bool isopen;
|
bool isopen;
|
||||||
Timer close_timer;
|
Timer close_timer;
|
||||||
//Timer trigger_timer;
|
//Timer trigger_timer;
|
||||||
|
|||||||
@ -111,6 +111,16 @@ uint32 Lua_Door::GetOpenType() {
|
|||||||
return self->GetOpenType();
|
return self->GetOpenType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Lua_Door::SetDisableTimer(bool flag) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->SetDisableTimer(flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Door::GetDisableTimer() {
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->GetDisableTimer();
|
||||||
|
}
|
||||||
|
|
||||||
void Lua_Door::SetLockPick(uint32 pick) {
|
void Lua_Door::SetLockPick(uint32 pick) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->SetLockpick(pick);
|
self->SetLockpick(pick);
|
||||||
|
|||||||
@ -49,6 +49,8 @@ public:
|
|||||||
uint32 GetIncline();
|
uint32 GetIncline();
|
||||||
void SetOpenType(uint32 type);
|
void SetOpenType(uint32 type);
|
||||||
uint32 GetOpenType();
|
uint32 GetOpenType();
|
||||||
|
void SetDisableTimer(bool flag);
|
||||||
|
bool GetDisableTimer();
|
||||||
void SetLockPick(uint32 pick);
|
void SetLockPick(uint32 pick);
|
||||||
uint32 GetLockPick();
|
uint32 GetLockPick();
|
||||||
void SetKeyItem(uint32 key);
|
void SetKeyItem(uint32 key);
|
||||||
|
|||||||
@ -2989,16 +2989,16 @@ void ZoneDatabase::QGlobalPurge()
|
|||||||
database.QueryDatabase(query);
|
database.QueryDatabase(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneDatabase::InsertDoor(uint32 ddoordbid, uint16 ddoorid, const char* ddoor_name, const glm::vec4& position, uint8 dopentype, uint16 dguildid, uint32 dlockpick, uint32 dkeyitem, uint8 ddoor_param, uint8 dinvert, int dincline, uint16 dsize){
|
void ZoneDatabase::InsertDoor(uint32 ddoordbid, uint16 ddoorid, const char* ddoor_name, const glm::vec4& position, uint8 dopentype, uint16 dguildid, uint32 dlockpick, uint32 dkeyitem, uint8 ddoor_param, uint8 dinvert, int dincline, uint16 dsize, bool ddisabletimer){
|
||||||
|
|
||||||
std::string query = StringFormat("REPLACE INTO doors (id, doorid, zone, version, name, "
|
std::string query = StringFormat("REPLACE INTO doors (id, doorid, zone, version, name, "
|
||||||
"pos_x, pos_y, pos_z, heading, opentype, guild, lockpick, "
|
"pos_x, pos_y, pos_z, heading, opentype, guild, lockpick, "
|
||||||
"keyitem, door_param, invert_state, incline, size) "
|
"keyitem, disable_timer, door_param, invert_state, incline, size) "
|
||||||
"VALUES('%i', '%i', '%s', '%i', '%s', '%f', '%f', "
|
"VALUES('%i', '%i', '%s', '%i', '%s', '%f', '%f', "
|
||||||
"'%f', '%f', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i')",
|
"'%f', '%f', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i')",
|
||||||
ddoordbid, ddoorid, zone->GetShortName(), zone->GetInstanceVersion(),
|
ddoordbid, ddoorid, zone->GetShortName(), zone->GetInstanceVersion(),
|
||||||
ddoor_name, position.x, position.y, position.z, position.w,
|
ddoor_name, position.x, position.y, position.z, position.w,
|
||||||
dopentype, dguildid, dlockpick, dkeyitem, ddoor_param, dinvert, dincline, dsize);
|
dopentype, dguildid, dlockpick, dkeyitem, (ddisabletimer ? 1 : 0), ddoor_param, dinvert, dincline, dsize);
|
||||||
QueryDatabase(query);
|
QueryDatabase(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -454,7 +454,7 @@ public:
|
|||||||
int32 GetDoorsCount(uint32* oMaxID, const char *zone_name, int16 version);
|
int32 GetDoorsCount(uint32* oMaxID, const char *zone_name, int16 version);
|
||||||
int32 GetDoorsCountPlusOne(const char *zone_name, int16 version);
|
int32 GetDoorsCountPlusOne(const char *zone_name, int16 version);
|
||||||
int32 GetDoorsDBCountPlusOne(const char *zone_name, int16 version);
|
int32 GetDoorsDBCountPlusOne(const char *zone_name, int16 version);
|
||||||
void InsertDoor(uint32 did, uint16 ddoorid, const char* ddoor_name, const glm::vec4& position, uint8 dopentype, uint16 dguildid, uint32 dlockpick, uint32 dkeyitem, uint8 ddoor_param, uint8 dinvert, int dincline, uint16 dsize);
|
void InsertDoor(uint32 did, uint16 ddoorid, const char* ddoor_name, const glm::vec4& position, uint8 dopentype, uint16 dguildid, uint32 dlockpick, uint32 dkeyitem, uint8 ddoor_param, uint8 dinvert, int dincline, uint16 dsize, bool ddisabletimer = false);
|
||||||
|
|
||||||
/* Blocked Spells */
|
/* Blocked Spells */
|
||||||
int32 GetBlockedSpellsCount(uint32 zoneid);
|
int32 GetBlockedSpellsCount(uint32 zoneid);
|
||||||
|
|||||||
@ -202,6 +202,7 @@ struct Door {
|
|||||||
uint8 nokeyring;
|
uint8 nokeyring;
|
||||||
uint8 trigger_door;
|
uint8 trigger_door;
|
||||||
uint8 trigger_type;
|
uint8 trigger_type;
|
||||||
|
bool disable_timer;
|
||||||
uint32 door_param;
|
uint32 door_param;
|
||||||
int invert_state;
|
int invert_state;
|
||||||
uint16 size;
|
uint16 size;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user