mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-26 19:47:16 +00:00
Other clients can now see your ornaments as soon as they zone in
This commit is contained in:
@@ -421,8 +421,6 @@ ItemInst* ItemInst::GetOrnamentation() const
|
|||||||
ItemInst *item;
|
ItemInst *item;
|
||||||
for (int i = 0; i < MAX_AUGMENT_SLOTS; ++i)
|
for (int i = 0; i < MAX_AUGMENT_SLOTS; ++i)
|
||||||
{
|
{
|
||||||
|
|
||||||
uint32 id = 0;
|
|
||||||
if ((item = GetItem(i)) != nullptr && item->GetItem()->AugType == 524288) return item;
|
if ((item = GetItem(i)) != nullptr && item->GetItem()->AugType == 524288) return item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+76
-5
@@ -4565,6 +4565,50 @@ void Bot::SetLevel(uint8 in_level, bool command) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32 Bot::GetEquipmentMaterial(uint8 material_slot) const
|
||||||
|
{
|
||||||
|
// Moofta: Only supporting primary and secondary. next stage is heros forge. which could be any!
|
||||||
|
if // for primary and secondary we need the model, not the material
|
||||||
|
(
|
||||||
|
material_slot == MaterialPrimary ||
|
||||||
|
material_slot == MaterialSecondary
|
||||||
|
)
|
||||||
|
{
|
||||||
|
uint8 inventorySlot = Inventory::CalcSlotFromMaterial(material_slot);
|
||||||
|
const ItemInst* inst = m_inv.GetItem(inventorySlot);
|
||||||
|
if (inst != nullptr)
|
||||||
|
{
|
||||||
|
if (inst->HasOrnamentation())
|
||||||
|
{
|
||||||
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
|
{
|
||||||
|
return atoi(&ornament->GetItem()->IDFile[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (strlen(inst->GetItem()->IDFile) > 2)
|
||||||
|
{
|
||||||
|
return atoi(&inst->GetItem()->IDFile[2]);
|
||||||
|
}
|
||||||
|
else //may as well try this, since were going to 0 anyways
|
||||||
|
{
|
||||||
|
return inst->GetItem()->Material;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const Item_Struct *item = database.GetItem(GetEquipment(material_slot));
|
||||||
|
if (item!=nullptr) return item->Material;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||||
if(ns) {
|
if(ns) {
|
||||||
Mob::FillSpawnStruct(ns, ForWho);
|
Mob::FillSpawnStruct(ns, ForWho);
|
||||||
@@ -4665,24 +4709,51 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
|||||||
ns->spawn.colors[MaterialFeet].color = GetEquipmentColor(MaterialFeet);
|
ns->spawn.colors[MaterialFeet].color = GetEquipmentColor(MaterialFeet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inst = GetBotItem(SLOT_PRIMARY);
|
inst = GetBotItem(SLOT_PRIMARY);
|
||||||
if(inst) {
|
if(inst) {
|
||||||
item = inst->GetItem();
|
item = inst->GetItem();
|
||||||
if(item) {
|
if(item)
|
||||||
if(strlen(item->IDFile) > 2)
|
{
|
||||||
|
if (inst->HasOrnamentation())
|
||||||
|
{
|
||||||
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
|
{
|
||||||
|
ns->spawn.equipment[MaterialPrimary]= atoi(&ornament->GetItem()->IDFile[2]);
|
||||||
|
ns->spawn.colors[MaterialPrimary].color = GetEquipmentColor(MaterialPrimary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item = inst->GetItem();
|
||||||
|
if (strlen(item->IDFile) > 2)
|
||||||
ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]);
|
ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]);
|
||||||
ns->spawn.colors[MaterialPrimary].color = GetEquipmentColor(MaterialPrimary);
|
ns->spawn.colors[MaterialPrimary].color = GetEquipmentColor(MaterialPrimary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inst = GetBotItem(SLOT_SECONDARY);
|
inst = GetBotItem(SLOT_SECONDARY);
|
||||||
if(inst) {
|
if(inst) {
|
||||||
item = inst->GetItem();
|
item = inst->GetItem();
|
||||||
if(item) {
|
if(item)
|
||||||
if(strlen(item->IDFile) > 2)
|
{
|
||||||
|
if (inst->HasOrnamentation())
|
||||||
|
{
|
||||||
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
|
{
|
||||||
|
ns->spawn.equipment[MaterialSecondary]= atoi(&ornament->GetItem()->IDFile[2]);
|
||||||
|
ns->spawn.colors[MaterialSecondary].color = GetEquipmentColor(MaterialSecondary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item = inst->GetItem();
|
||||||
|
if (strlen(item->IDFile) > 2)
|
||||||
ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]);
|
ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]);
|
||||||
ns->spawn.colors[MaterialSecondary].color = GetEquipmentColor(MaterialSecondary);
|
ns->spawn.colors[MaterialSecondary].color = GetEquipmentColor(MaterialSecondary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -332,6 +332,7 @@ public:
|
|||||||
void EquipBot(std::string* errorMessage);
|
void EquipBot(std::string* errorMessage);
|
||||||
bool CheckLoreConflict(const Item_Struct* item);
|
bool CheckLoreConflict(const Item_Struct* item);
|
||||||
uint32 GetEquipmentColor(uint8 material_slot) const;
|
uint32 GetEquipmentColor(uint8 material_slot) const;
|
||||||
|
int32 GetEquipmentMaterial(uint8 material_slot) const;
|
||||||
|
|
||||||
// Static Class Methods
|
// Static Class Methods
|
||||||
static void SaveBotGroup(Group* botGroup, std::string botGroupName, std::string* errorMessage);
|
static void SaveBotGroup(Group* botGroup, std::string botGroupName, std::string* errorMessage);
|
||||||
|
|||||||
+2
-2
@@ -1909,7 +1909,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
|||||||
if ((inst = m_inv[SLOT_PRIMARY]) && inst->IsType(ItemClassCommon)) {
|
if ((inst = m_inv[SLOT_PRIMARY]) && inst->IsType(ItemClassCommon)) {
|
||||||
if (inst->HasOrnamentation())
|
if (inst->HasOrnamentation())
|
||||||
{
|
{
|
||||||
ItemInst* ornament = inst->GetOrnamentation();
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
if (strlen(ornament->GetItem()->IDFile) > 2)
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
{
|
{
|
||||||
ns->spawn.equipment[MaterialPrimary]= atoi(&ornament->GetItem()->IDFile[2]);
|
ns->spawn.equipment[MaterialPrimary]= atoi(&ornament->GetItem()->IDFile[2]);
|
||||||
@@ -1925,7 +1925,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
|||||||
if ((inst = m_inv[SLOT_SECONDARY]) && inst->IsType(ItemClassCommon)) {
|
if ((inst = m_inv[SLOT_SECONDARY]) && inst->IsType(ItemClassCommon)) {
|
||||||
if (inst->HasOrnamentation())
|
if (inst->HasOrnamentation())
|
||||||
{
|
{
|
||||||
ItemInst* ornament = inst->GetOrnamentation();
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
if (strlen(ornament->GetItem()->IDFile) > 2)
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
{
|
{
|
||||||
ns->spawn.equipment[MaterialPrimary]= atoi(&ornament->GetItem()->IDFile[2]);
|
ns->spawn.equipment[MaterialPrimary]= atoi(&ornament->GetItem()->IDFile[2]);
|
||||||
|
|||||||
+9
-1
@@ -4707,7 +4707,15 @@ void command_iteminfo(Client *c, const Seperator *sep)
|
|||||||
const Item_Struct* item = inst->GetItem();
|
const Item_Struct* item = inst->GetItem();
|
||||||
c->Message(0, "ID: %i Name: %s", item->ID, item->Name);
|
c->Message(0, "ID: %i Name: %s", item->ID, item->Name);
|
||||||
c->Message(0, " Lore: %s ND: %i NS: %i Type: %i", (item->LoreFlag) ? "true":"false", item->NoDrop, item->NoRent, item->ItemClass);
|
c->Message(0, " Lore: %s ND: %i NS: %i Type: %i", (item->LoreFlag) ? "true":"false", item->NoDrop, item->NoRent, item->ItemClass);
|
||||||
c->Message(0, " IDF: %s Size: %i Weight: %i icon_id: %i Price: %i", item->IDFile, item->Size, item->Weight, item->Icon, item->Price);
|
if(inst->HasOrnamentation())
|
||||||
|
{
|
||||||
|
c->Message(0, " IDF: %s Size: %i Weight: %i icon_id: %i Price: %i", inst->GetOrnamentation()->GetItem()->IDFile, item->Size, item->Weight, item->Icon, item->Price);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
c->Message(0, " IDF: %s Size: %i Weight: %i icon_id: %i Price: %i", item->IDFile, item->Size, item->Weight, item->Icon, item->Price);
|
||||||
|
}
|
||||||
|
|
||||||
if (c->Admin() >= 200)
|
if (c->Admin() >= 200)
|
||||||
c->Message(0, "MinStatus: %i", item->MinStatus);
|
c->Message(0, "MinStatus: %i", item->MinStatus);
|
||||||
if (item->ItemClass==ItemClassBook)
|
if (item->ItemClass==ItemClassBook)
|
||||||
|
|||||||
+2
-1
@@ -1886,6 +1886,7 @@ void Client::DyeArmor(DyeStruct* dye){
|
|||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32 Client::GetEquipmentMaterial(uint8 material_slot) const
|
int32 Client::GetEquipmentMaterial(uint8 material_slot) const
|
||||||
{
|
{
|
||||||
// Moofta: Only supporting primary and secondary. next stage is heros forge. which could be any!
|
// Moofta: Only supporting primary and secondary. next stage is heros forge. which could be any!
|
||||||
@@ -1901,7 +1902,7 @@ int32 Client::GetEquipmentMaterial(uint8 material_slot) const
|
|||||||
{
|
{
|
||||||
if (inst->HasOrnamentation())
|
if (inst->HasOrnamentation())
|
||||||
{
|
{
|
||||||
ItemInst* ornament = inst->GetOrnamentation();
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
if (strlen(ornament->GetItem()->IDFile) > 2)
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
{
|
{
|
||||||
return atoi(&ornament->GetItem()->IDFile[2]);
|
return atoi(&ornament->GetItem()->IDFile[2]);
|
||||||
|
|||||||
Reference in New Issue
Block a user