mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-20 01:58:27 +00:00
merge upstream
This commit is contained in:
+39
-42
@@ -253,8 +253,10 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, const xyz_heading& position, int
|
||||
if(!IsMerc())
|
||||
AI_Start();
|
||||
|
||||
d_meele_texture1 = d->d_meele_texture1;
|
||||
d_meele_texture2 = d->d_meele_texture2;
|
||||
d_melee_texture1 = d->d_melee_texture1;
|
||||
d_melee_texture2 = d->d_melee_texture2;
|
||||
herosforgemodel = d->herosforgemodel;
|
||||
|
||||
ammo_idfile = d->ammo_idfile;
|
||||
memset(equipment, 0, sizeof(equipment));
|
||||
prim_melee_type = d->prim_melee_type;
|
||||
@@ -262,9 +264,9 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, const xyz_heading& position, int
|
||||
ranged_type = d->ranged_type;
|
||||
|
||||
// If Melee Textures are not set, set attack type to Hand to Hand as default
|
||||
if(!d_meele_texture1)
|
||||
if(!d_melee_texture1)
|
||||
prim_melee_type = 28;
|
||||
if(!d_meele_texture2)
|
||||
if(!d_melee_texture2)
|
||||
sec_melee_type = 28;
|
||||
|
||||
//give NPCs skill values...
|
||||
@@ -486,32 +488,27 @@ void NPC::ClearItemList() {
|
||||
itemlist.clear();
|
||||
}
|
||||
|
||||
void NPC::QueryLoot(Client* to) {
|
||||
int x = 0;
|
||||
void NPC::QueryLoot(Client* to)
|
||||
{
|
||||
to->Message(0, "Coin: %ip %ig %is %ic", platinum, gold, silver, copper);
|
||||
|
||||
ItemList::iterator cur,end;
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
for(; cur != end; ++cur) {
|
||||
int x = 0;
|
||||
for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) {
|
||||
const Item_Struct* item = database.GetItem((*cur)->item_id);
|
||||
if (item)
|
||||
if (to->GetClientVersion() >= EQClientRoF)
|
||||
{
|
||||
to->Message(0, "minlvl: %i maxlvl: %i %i: %c%06X0000000000000000000000000000000000000000000000000%s%c",(*cur)->min_level, (*cur)->max_level, (int) item->ID,0x12, item->ID, item->Name, 0x12);
|
||||
}
|
||||
else if (to->GetClientVersion() >= EQClientSoF)
|
||||
{
|
||||
to->Message(0, "minlvl: %i maxlvl: %i %i: %c%06X00000000000000000000000000000000000000000000%s%c",(*cur)->min_level, (*cur)->max_level, (int) item->ID,0x12, item->ID, item->Name, 0x12);
|
||||
}
|
||||
else
|
||||
{
|
||||
to->Message(0, "minlvl: %i maxlvl: %i %i: %c%06X000000000000000000000000000000000000000%s%c",(*cur)->min_level, (*cur)->max_level, (int) item->ID,0x12, item->ID, item->Name, 0x12);
|
||||
}
|
||||
else
|
||||
LogFile->write(EQEMuLog::Error, "Database error, invalid item");
|
||||
x++;
|
||||
if (item == nullptr) {
|
||||
LogFile->write(EQEmuLog::Error, "Database error, invalid item");
|
||||
continue;
|
||||
}
|
||||
|
||||
Client::TextLink linker;
|
||||
linker.SetLinkType(linker.linkItemData);
|
||||
linker.SetItemData(item);
|
||||
|
||||
auto item_link = linker.GenerateLink();
|
||||
|
||||
to->Message(0, "%s, ID: %u, Level: (min: %u, max: %u)", item_link.c_str(), item->ID, (*cur)->min_level, (*cur)->max_level);
|
||||
}
|
||||
|
||||
to->Message(0, "%i items on %s.", x, GetName());
|
||||
}
|
||||
|
||||
@@ -912,8 +909,8 @@ NPC* NPC::SpawnNPC(const char* spawncommand, const xyz_heading& position, Client
|
||||
npc_type->texture = atoi(sep.arg[3]);
|
||||
npc_type->light = 0;
|
||||
npc_type->runspeed = 1.25;
|
||||
npc_type->d_meele_texture1 = atoi(sep.arg[7]);
|
||||
npc_type->d_meele_texture2 = atoi(sep.arg[8]);
|
||||
npc_type->d_melee_texture1 = atoi(sep.arg[7]);
|
||||
npc_type->d_melee_texture2 = atoi(sep.arg[8]);
|
||||
npc_type->merchanttype = atoi(sep.arg[9]);
|
||||
npc_type->bodytype = atoi(sep.arg[10]);
|
||||
|
||||
@@ -945,7 +942,7 @@ NPC* NPC::SpawnNPC(const char* spawncommand, const xyz_heading& position, Client
|
||||
client->Message(0, "Current/Max HP: %i", npc->max_hp);
|
||||
client->Message(0, "Gender: %u", npc->gender);
|
||||
client->Message(0, "Class: %u", npc->class_);
|
||||
client->Message(0, "Weapon Item Number: %u/%u", npc->d_meele_texture1, npc->d_meele_texture2);
|
||||
client->Message(0, "Weapon Item Number: %u/%u", npc->d_melee_texture1, npc->d_melee_texture2);
|
||||
client->Message(0, "MerchantID: %u", npc->MerchantType);
|
||||
client->Message(0, "Bodytype: %u", npc->bodytype);
|
||||
}
|
||||
@@ -995,7 +992,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
|
||||
spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
LogFile->write(EQEmuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
npc_type_id = results.LastInsertedID();
|
||||
@@ -1012,7 +1009,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
|
||||
spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
LogFile->write(EQEmuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
npc_type_id = results.LastInsertedID();
|
||||
@@ -1024,7 +1021,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
|
||||
query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName());
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
LogFile->write(EQEmuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
uint32 spawngroupid = results.LastInsertedID();
|
||||
@@ -1038,7 +1035,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
|
||||
spawn->GetHeading(), spawngroupid);
|
||||
results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
LogFile->write(EQEmuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1049,7 +1046,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
|
||||
spawngroupid, npc_type_id, 100);
|
||||
results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
LogFile->write(EQEmuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1066,7 +1063,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve
|
||||
zone, spawn->GetName(), Timer::GetCurrentTime());
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
LogFile->write(EQEmuLog::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return 0;
|
||||
}
|
||||
last_insert_id = results.LastInsertedID();
|
||||
@@ -1089,7 +1086,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve
|
||||
spawn->GetHeading(), last_insert_id);
|
||||
results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
LogFile->write(EQEmuLog::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return 0;
|
||||
}
|
||||
spawnid = results.LastInsertedID();
|
||||
@@ -1101,7 +1098,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve
|
||||
last_insert_id, spawn->GetNPCTypeID(), 100);
|
||||
results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogFile->write(EQEMuLog::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
LogFile->write(EQEmuLog::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1323,9 +1320,9 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
|
||||
case MaterialChest:
|
||||
return texture;
|
||||
case MaterialPrimary:
|
||||
return d_meele_texture1;
|
||||
return d_melee_texture1;
|
||||
case MaterialSecondary:
|
||||
return d_meele_texture2;
|
||||
return d_melee_texture2;
|
||||
default:
|
||||
//they have nothing in the slot, and its not a special slot... they get nothing.
|
||||
return(0);
|
||||
@@ -1663,7 +1660,7 @@ void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool rem
|
||||
{
|
||||
if(database.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse))
|
||||
{
|
||||
LogFile->write(EQEMuLog::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse);
|
||||
LogFile->write(EQEmuLog::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2124,10 +2121,10 @@ uint32 NPC::GetSpawnPointID() const
|
||||
void NPC::NPCSlotTexture(uint8 slot, uint16 texture)
|
||||
{
|
||||
if (slot == 7) {
|
||||
d_meele_texture1 = texture;
|
||||
d_melee_texture1 = texture;
|
||||
}
|
||||
else if (slot == 8) {
|
||||
d_meele_texture2 = texture;
|
||||
d_melee_texture2 = texture;
|
||||
}
|
||||
else if (slot < 6) {
|
||||
// Reserved for texturing individual armor slots
|
||||
|
||||
Reference in New Issue
Block a user