mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-08 04:02:25 +00:00
Reload scaling data on repop
This commit is contained in:
parent
df68ad6358
commit
4ba5ef9170
@ -1408,25 +1408,39 @@ uint8 Database::GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16
|
|||||||
return base_cap;
|
return base_cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Database::GetCharacterInfo(const char* iName, uint32* oAccID, uint32* oZoneID, uint32* oInstanceID, float* oX, float* oY, float* oZ) {
|
uint32 Database::GetCharacterInfo(
|
||||||
std::string query = StringFormat("SELECT `id`, `account_id`, `zone_id`, `zone_instance`, `x`, `y`, `z` FROM `character_data` WHERE `name` = '%s'", iName);
|
const char *iName,
|
||||||
|
uint32 *oAccID,
|
||||||
|
uint32 *oZoneID,
|
||||||
|
uint32 *oInstanceID,
|
||||||
|
float *oX,
|
||||||
|
float *oY,
|
||||||
|
float *oZ
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::string query = StringFormat(
|
||||||
|
"SELECT `id`, `account_id`, `zone_id`, `zone_instance`, `x`, `y`, `z` FROM `character_data` WHERE `name` = '%s'",
|
||||||
|
EscapeString(iName).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() != 1)
|
if (results.RowCount() != 1) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
uint32 charid = atoi(row[0]);
|
uint32 charid = atoi(row[0]);
|
||||||
if (oAccID){ *oAccID = atoi(row[1]); }
|
if (oAccID) { *oAccID = atoi(row[1]); }
|
||||||
if (oZoneID){ *oZoneID = atoi(row[2]); }
|
if (oZoneID) { *oZoneID = atoi(row[2]); }
|
||||||
if (oInstanceID){ *oInstanceID = atoi(row[3]); }
|
if (oInstanceID) { *oInstanceID = atoi(row[3]); }
|
||||||
if (oX){ *oX = atof(row[4]); }
|
if (oX) { *oX = atof(row[4]); }
|
||||||
if (oY){ *oY = atof(row[5]); }
|
if (oY) { *oY = atof(row[5]); }
|
||||||
if (oZ){ *oZ = atof(row[6]); }
|
if (oZ) { *oZ = atof(row[6]); }
|
||||||
|
|
||||||
return charid;
|
return charid;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,6 +54,7 @@
|
|||||||
#include "zone.h"
|
#include "zone.h"
|
||||||
#include "zone_config.h"
|
#include "zone_config.h"
|
||||||
#include "mob_movement_manager.h"
|
#include "mob_movement_manager.h"
|
||||||
|
#include "npc_scale_manager.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
@ -65,8 +66,6 @@
|
|||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern bool staticzone;
|
extern bool staticzone;
|
||||||
extern NetConnection net;
|
extern NetConnection net;
|
||||||
extern PetitionList petition_list;
|
extern PetitionList petition_list;
|
||||||
@ -74,6 +73,7 @@ extern QuestParserCollection* parse;
|
|||||||
extern uint32 numclients;
|
extern uint32 numclients;
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
|
extern NpcScaleManager* npc_scale_manager;
|
||||||
|
|
||||||
Mutex MZoneShutdown;
|
Mutex MZoneShutdown;
|
||||||
|
|
||||||
@ -1509,18 +1509,22 @@ void Zone::RepopClose(const glm::vec4& client_position, uint32 repop_distance)
|
|||||||
mod_repop();
|
mod_repop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Zone::Repop(uint32 delay) {
|
void Zone::Repop(uint32 delay)
|
||||||
|
{
|
||||||
|
|
||||||
if(!Depop())
|
if (!Depop()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LinkedListIterator<Spawn2*> iterator(spawn2_list);
|
LinkedListIterator<Spawn2 *> iterator(spawn2_list);
|
||||||
|
|
||||||
iterator.Reset();
|
iterator.Reset();
|
||||||
while (iterator.MoreElements()) {
|
while (iterator.MoreElements()) {
|
||||||
iterator.RemoveCurrent();
|
iterator.RemoveCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
npc_scale_manager->LoadScaleData();
|
||||||
|
|
||||||
entity_list.ClearTrapPointers();
|
entity_list.ClearTrapPointers();
|
||||||
|
|
||||||
quest_manager.ClearAllTimers();
|
quest_manager.ClearAllTimers();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user