mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-21 02:18:26 +00:00
AddNPCTintID
Add NPCTintID to spawn logic
This commit is contained in:
@@ -7087,6 +7087,18 @@ CREATE INDEX `idx_expire_at` ON `instance_list` (`expire_at`);
|
||||
)",
|
||||
.content_schema_update = false
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9322,
|
||||
.description = "2025_04_24_add_npc_tint_id.sql",
|
||||
.check = "SHOW COLUMNS FROM `npc_types` LIKE 'npc_tint_id'",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
ALTER TABLE `npc_types`
|
||||
ADD COLUMN `npc_tint_id` SMALLINT UNSIGNED NULL DEFAULT '0' AFTER `multiquest_enabled`;
|
||||
)",
|
||||
.content_schema_update = true
|
||||
}
|
||||
// -- template; copy/paste this when you need to create a new entry
|
||||
// ManifestEntry{
|
||||
// .version = 9228,
|
||||
|
||||
@@ -325,6 +325,7 @@ union
|
||||
bool trader;
|
||||
bool buyer;
|
||||
bool untargetable;
|
||||
uint32 npc_tint_id;
|
||||
};
|
||||
|
||||
struct PlayerState_Struct {
|
||||
|
||||
@@ -4839,13 +4839,13 @@ namespace RoF2
|
||||
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->petOwnerId);
|
||||
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // FindBits MQ2 name
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // FindBits MQ2 name
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->PlayerState);
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // NpcTintIndex
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // PrimaryTintIndex
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // SecondaryTintIndex
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0xffffffff); // These do something with OP_WeaponEquip1
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0xffffffff); // ^
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->npc_tint_id); // NpcTintIndex
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // PrimaryTintIndex
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // SecondaryTintIndex
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0xffffffff); // These do something with OP_WeaponEquip1
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0xffffffff); // ^
|
||||
|
||||
if ((emu->NPC == 0) || (emu->race <= Race::Gnome) || (emu->race == Race::Iksar) ||
|
||||
(emu->race == Race::VahShir) || (emu->race == Race::Froglok2) || (emu->race == Race::Drakkin)
|
||||
|
||||
@@ -66,8 +66,8 @@ public:
|
||||
uint8_t armortint_red;
|
||||
uint8_t armortint_green;
|
||||
uint8_t armortint_blue;
|
||||
uint32_t d_melee_texture1;
|
||||
uint32_t d_melee_texture2;
|
||||
int32_t d_melee_texture1;
|
||||
int32_t d_melee_texture2;
|
||||
std::string ammo_idfile;
|
||||
uint8_t prim_melee_type;
|
||||
uint8_t sec_melee_type;
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
int8_t legtexture;
|
||||
int8_t feettexture;
|
||||
int8_t light;
|
||||
float walkspeed;
|
||||
int8_t walkspeed;
|
||||
int32_t peqid;
|
||||
int8_t unique_;
|
||||
int8_t fixed;
|
||||
@@ -149,6 +149,7 @@ public:
|
||||
uint8_t keeps_sold_items;
|
||||
uint8_t is_parcel_merchant;
|
||||
uint8_t multiquest_enabled;
|
||||
uint16_t npc_tint_id;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
@@ -289,6 +290,7 @@ public:
|
||||
"keeps_sold_items",
|
||||
"is_parcel_merchant",
|
||||
"multiquest_enabled",
|
||||
"npc_tint_id",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -425,6 +427,7 @@ public:
|
||||
"keeps_sold_items",
|
||||
"is_parcel_merchant",
|
||||
"multiquest_enabled",
|
||||
"npc_tint_id",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -595,6 +598,7 @@ public:
|
||||
e.keeps_sold_items = 1;
|
||||
e.is_parcel_merchant = 0;
|
||||
e.multiquest_enabled = 0;
|
||||
e.npc_tint_id = 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -678,8 +682,8 @@ public:
|
||||
e.armortint_red = row[44] ? static_cast<uint8_t>(strtoul(row[44], nullptr, 10)) : 0;
|
||||
e.armortint_green = row[45] ? static_cast<uint8_t>(strtoul(row[45], nullptr, 10)) : 0;
|
||||
e.armortint_blue = row[46] ? static_cast<uint8_t>(strtoul(row[46], nullptr, 10)) : 0;
|
||||
e.d_melee_texture1 = row[47] ? static_cast<uint32_t>(strtoul(row[47], nullptr, 10)) : 0;
|
||||
e.d_melee_texture2 = row[48] ? static_cast<uint32_t>(strtoul(row[48], nullptr, 10)) : 0;
|
||||
e.d_melee_texture1 = row[47] ? static_cast<int32_t>(atoi(row[47])) : 0;
|
||||
e.d_melee_texture2 = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0;
|
||||
e.ammo_idfile = row[49] ? row[49] : "IT10";
|
||||
e.prim_melee_type = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 28;
|
||||
e.sec_melee_type = row[51] ? static_cast<uint8_t>(strtoul(row[51], nullptr, 10)) : 28;
|
||||
@@ -735,7 +739,7 @@ public:
|
||||
e.legtexture = row[101] ? static_cast<int8_t>(atoi(row[101])) : 0;
|
||||
e.feettexture = row[102] ? static_cast<int8_t>(atoi(row[102])) : 0;
|
||||
e.light = row[103] ? static_cast<int8_t>(atoi(row[103])) : 0;
|
||||
e.walkspeed = row[104] ? strtof(row[104], nullptr) : 0;
|
||||
e.walkspeed = row[104] ? static_cast<int8_t>(atoi(row[104])) : 0;
|
||||
e.peqid = row[105] ? static_cast<int32_t>(atoi(row[105])) : 0;
|
||||
e.unique_ = row[106] ? static_cast<int8_t>(atoi(row[106])) : 0;
|
||||
e.fixed = row[107] ? static_cast<int8_t>(atoi(row[107])) : 0;
|
||||
@@ -761,6 +765,7 @@ public:
|
||||
e.keeps_sold_items = row[127] ? static_cast<uint8_t>(strtoul(row[127], nullptr, 10)) : 1;
|
||||
e.is_parcel_merchant = row[128] ? static_cast<uint8_t>(strtoul(row[128], nullptr, 10)) : 0;
|
||||
e.multiquest_enabled = row[129] ? static_cast<uint8_t>(strtoul(row[129], nullptr, 10)) : 0;
|
||||
e.npc_tint_id = row[130] ? static_cast<uint16_t>(strtoul(row[130], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -923,6 +928,7 @@ public:
|
||||
v.push_back(columns[127] + " = " + std::to_string(e.keeps_sold_items));
|
||||
v.push_back(columns[128] + " = " + std::to_string(e.is_parcel_merchant));
|
||||
v.push_back(columns[129] + " = " + std::to_string(e.multiquest_enabled));
|
||||
v.push_back(columns[130] + " = " + std::to_string(e.npc_tint_id));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -1074,6 +1080,7 @@ public:
|
||||
v.push_back(std::to_string(e.keeps_sold_items));
|
||||
v.push_back(std::to_string(e.is_parcel_merchant));
|
||||
v.push_back(std::to_string(e.multiquest_enabled));
|
||||
v.push_back(std::to_string(e.npc_tint_id));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -1233,6 +1240,7 @@ public:
|
||||
v.push_back(std::to_string(e.keeps_sold_items));
|
||||
v.push_back(std::to_string(e.is_parcel_merchant));
|
||||
v.push_back(std::to_string(e.multiquest_enabled));
|
||||
v.push_back(std::to_string(e.npc_tint_id));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -1313,8 +1321,8 @@ public:
|
||||
e.armortint_red = row[44] ? static_cast<uint8_t>(strtoul(row[44], nullptr, 10)) : 0;
|
||||
e.armortint_green = row[45] ? static_cast<uint8_t>(strtoul(row[45], nullptr, 10)) : 0;
|
||||
e.armortint_blue = row[46] ? static_cast<uint8_t>(strtoul(row[46], nullptr, 10)) : 0;
|
||||
e.d_melee_texture1 = row[47] ? static_cast<uint32_t>(strtoul(row[47], nullptr, 10)) : 0;
|
||||
e.d_melee_texture2 = row[48] ? static_cast<uint32_t>(strtoul(row[48], nullptr, 10)) : 0;
|
||||
e.d_melee_texture1 = row[47] ? static_cast<int32_t>(atoi(row[47])) : 0;
|
||||
e.d_melee_texture2 = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0;
|
||||
e.ammo_idfile = row[49] ? row[49] : "IT10";
|
||||
e.prim_melee_type = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 28;
|
||||
e.sec_melee_type = row[51] ? static_cast<uint8_t>(strtoul(row[51], nullptr, 10)) : 28;
|
||||
@@ -1370,7 +1378,7 @@ public:
|
||||
e.legtexture = row[101] ? static_cast<int8_t>(atoi(row[101])) : 0;
|
||||
e.feettexture = row[102] ? static_cast<int8_t>(atoi(row[102])) : 0;
|
||||
e.light = row[103] ? static_cast<int8_t>(atoi(row[103])) : 0;
|
||||
e.walkspeed = row[104] ? strtof(row[104], nullptr) : 0;
|
||||
e.walkspeed = row[104] ? static_cast<int8_t>(atoi(row[104])) : 0;
|
||||
e.peqid = row[105] ? static_cast<int32_t>(atoi(row[105])) : 0;
|
||||
e.unique_ = row[106] ? static_cast<int8_t>(atoi(row[106])) : 0;
|
||||
e.fixed = row[107] ? static_cast<int8_t>(atoi(row[107])) : 0;
|
||||
@@ -1396,6 +1404,7 @@ public:
|
||||
e.keeps_sold_items = row[127] ? static_cast<uint8_t>(strtoul(row[127], nullptr, 10)) : 1;
|
||||
e.is_parcel_merchant = row[128] ? static_cast<uint8_t>(strtoul(row[128], nullptr, 10)) : 0;
|
||||
e.multiquest_enabled = row[129] ? static_cast<uint8_t>(strtoul(row[129], nullptr, 10)) : 0;
|
||||
e.npc_tint_id = row[130] ? static_cast<uint16_t>(strtoul(row[130], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -1467,8 +1476,8 @@ public:
|
||||
e.armortint_red = row[44] ? static_cast<uint8_t>(strtoul(row[44], nullptr, 10)) : 0;
|
||||
e.armortint_green = row[45] ? static_cast<uint8_t>(strtoul(row[45], nullptr, 10)) : 0;
|
||||
e.armortint_blue = row[46] ? static_cast<uint8_t>(strtoul(row[46], nullptr, 10)) : 0;
|
||||
e.d_melee_texture1 = row[47] ? static_cast<uint32_t>(strtoul(row[47], nullptr, 10)) : 0;
|
||||
e.d_melee_texture2 = row[48] ? static_cast<uint32_t>(strtoul(row[48], nullptr, 10)) : 0;
|
||||
e.d_melee_texture1 = row[47] ? static_cast<int32_t>(atoi(row[47])) : 0;
|
||||
e.d_melee_texture2 = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0;
|
||||
e.ammo_idfile = row[49] ? row[49] : "IT10";
|
||||
e.prim_melee_type = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 28;
|
||||
e.sec_melee_type = row[51] ? static_cast<uint8_t>(strtoul(row[51], nullptr, 10)) : 28;
|
||||
@@ -1524,7 +1533,7 @@ public:
|
||||
e.legtexture = row[101] ? static_cast<int8_t>(atoi(row[101])) : 0;
|
||||
e.feettexture = row[102] ? static_cast<int8_t>(atoi(row[102])) : 0;
|
||||
e.light = row[103] ? static_cast<int8_t>(atoi(row[103])) : 0;
|
||||
e.walkspeed = row[104] ? strtof(row[104], nullptr) : 0;
|
||||
e.walkspeed = row[104] ? static_cast<int8_t>(atoi(row[104])) : 0;
|
||||
e.peqid = row[105] ? static_cast<int32_t>(atoi(row[105])) : 0;
|
||||
e.unique_ = row[106] ? static_cast<int8_t>(atoi(row[106])) : 0;
|
||||
e.fixed = row[107] ? static_cast<int8_t>(atoi(row[107])) : 0;
|
||||
@@ -1550,6 +1559,7 @@ public:
|
||||
e.keeps_sold_items = row[127] ? static_cast<uint8_t>(strtoul(row[127], nullptr, 10)) : 1;
|
||||
e.is_parcel_merchant = row[128] ? static_cast<uint8_t>(strtoul(row[128], nullptr, 10)) : 0;
|
||||
e.multiquest_enabled = row[129] ? static_cast<uint8_t>(strtoul(row[129], nullptr, 10)) : 0;
|
||||
e.npc_tint_id = row[130] ? static_cast<uint16_t>(strtoul(row[130], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -1754,6 +1764,7 @@ public:
|
||||
v.push_back(std::to_string(e.keeps_sold_items));
|
||||
v.push_back(std::to_string(e.is_parcel_merchant));
|
||||
v.push_back(std::to_string(e.multiquest_enabled));
|
||||
v.push_back(std::to_string(e.npc_tint_id));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -1906,6 +1917,7 @@ public:
|
||||
v.push_back(std::to_string(e.keeps_sold_items));
|
||||
v.push_back(std::to_string(e.is_parcel_merchant));
|
||||
v.push_back(std::to_string(e.multiquest_enabled));
|
||||
v.push_back(std::to_string(e.npc_tint_id));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user