mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-25 02:08:23 +00:00
Added two rules to toggle ornamentations on/off or specify the augtype value
This commit is contained in:
+5
-2
@@ -24,6 +24,7 @@
|
|||||||
#include "races.h"
|
#include "races.h"
|
||||||
#include "shareddb.h"
|
#include "shareddb.h"
|
||||||
#include "classes.h"
|
#include "classes.h"
|
||||||
|
#include "../common/rulesys.h"
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
@@ -402,13 +403,14 @@ void ItemInst::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
|
|||||||
|
|
||||||
bool ItemInst::HasOrnamentation() const
|
bool ItemInst::HasOrnamentation() const
|
||||||
{
|
{
|
||||||
|
if(!RuleB(Inventory,UseAugOrnamentations)) return false;
|
||||||
const ItemInst *item;
|
const ItemInst *item;
|
||||||
for (int i = 0; i < MAX_AUGMENT_SLOTS; ++i)
|
for (int i = 0; i < MAX_AUGMENT_SLOTS; ++i)
|
||||||
{
|
{
|
||||||
uint32 id = 0;
|
uint32 id = 0;
|
||||||
if ((item = GetItem(i)) != nullptr)
|
if ((item = GetItem(i)) != nullptr)
|
||||||
{
|
{
|
||||||
if (item->GetItem()->AugType == 524288)return true;
|
if (item->GetItem()->AugType == RuleI(Inventory,AugOrnamentationType))return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -416,12 +418,13 @@ bool ItemInst::HasOrnamentation() const
|
|||||||
|
|
||||||
ItemInst* ItemInst::GetOrnamentation() const
|
ItemInst* ItemInst::GetOrnamentation() const
|
||||||
{
|
{
|
||||||
|
if(!RuleB(Inventory,UseAugOrnamentations)) return nullptr;
|
||||||
if (m_item->ItemClass == ItemClassCommon)
|
if (m_item->ItemClass == ItemClassCommon)
|
||||||
{
|
{
|
||||||
ItemInst *item;
|
ItemInst *item;
|
||||||
for (int i = 0; i < MAX_AUGMENT_SLOTS; ++i)
|
for (int i = 0; i < MAX_AUGMENT_SLOTS; ++i)
|
||||||
{
|
{
|
||||||
if ((item = GetItem(i)) != nullptr && item->GetItem()->AugType == 524288) return item;
|
if ((item = GetItem(i)) != nullptr && item->GetItem()->AugType == RuleI(Inventory,AugOrnamentationType)) return item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -4928,7 +4928,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
|
|||||||
|
|
||||||
// Moofta: if the item has an aug of type 20 (ornamentation) then we use the ID file of that when serializing.
|
// Moofta: if the item has an aug of type 20 (ornamentation) then we use the ID file of that when serializing.
|
||||||
// the only thing we should probably worry about is generating a wear change packet to all cl;ients in zone if someone adds a type 20 aug.
|
// the only thing we should probably worry about is generating a wear change packet to all cl;ients in zone if someone adds a type 20 aug.
|
||||||
if (inst && inst->HasOrnamentation()) //instance is not null and does have an ornament aug (slot 20)
|
if (RuleB(Inventory,UseAugOrnamentations) && inst && inst->HasOrnamentation()) //instance is not null and does have an ornament aug (slot 20)
|
||||||
{
|
{
|
||||||
ItemInst* ornamentation = inst->GetOrnamentation();
|
ItemInst* ornamentation = inst->GetOrnamentation();
|
||||||
if (ornamentation) //paranoid!
|
if (ornamentation) //paranoid!
|
||||||
|
|||||||
@@ -3121,7 +3121,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
|
|||||||
|
|
||||||
// Moofta: if the item has an aug of type 20 (ornamentation) then we use the ID file of that when serializing.
|
// Moofta: if the item has an aug of type 20 (ornamentation) then we use the ID file of that when serializing.
|
||||||
// the only thing we should probably worry about is generating a wear change packet to all cl;ients in zone if someone adds a type 20 aug.
|
// the only thing we should probably worry about is generating a wear change packet to all cl;ients in zone if someone adds a type 20 aug.
|
||||||
if (inst && inst->HasOrnamentation()) //instance is not null and does have an ornament aug (slot 20)
|
if (RuleB(Inventory,UseAugOrnamentations) && inst && inst->HasOrnamentation()) //instance is not null and does have an ornament aug (slot 20)
|
||||||
{
|
{
|
||||||
ItemInst* ornamentation = inst->GetOrnamentation();
|
ItemInst* ornamentation = inst->GetOrnamentation();
|
||||||
if (ornamentation) //paranoid!
|
if (ornamentation) //paranoid!
|
||||||
|
|||||||
@@ -2439,7 +2439,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
|
|||||||
|
|
||||||
// Moofta: if the item has an aug of type 20/524288 (ornamentation) then we use the ID file of that when serializing.
|
// Moofta: if the item has an aug of type 20/524288 (ornamentation) then we use the ID file of that when serializing.
|
||||||
// the only thing we should probably worry about is generating a wear change packet to all cl;ients in zone if someone adds a type 20 aug.
|
// the only thing we should probably worry about is generating a wear change packet to all cl;ients in zone if someone adds a type 20 aug.
|
||||||
if (inst && inst->HasOrnamentation()) //instance is not null and does have an ornament aug (slot 20)
|
if (RuleB(Inventory,UseAugOrnamentations) && inst && inst->HasOrnamentation()) //instance is not null and does have an ornament aug (slot 20)
|
||||||
{
|
{
|
||||||
ItemInst* ornamentation = inst->GetOrnamentation();
|
ItemInst* ornamentation = inst->GetOrnamentation();
|
||||||
if (ornamentation) //paranoid!
|
if (ornamentation) //paranoid!
|
||||||
|
|||||||
@@ -3532,7 +3532,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint
|
|||||||
|
|
||||||
// Moofta: if the item has an aug of type 20 (ornamentation) then we use the ID file of that when serializing.
|
// Moofta: if the item has an aug of type 20 (ornamentation) then we use the ID file of that when serializing.
|
||||||
// the only thing we should probably worry about is generating a wear change packet to all clients in zone if someone adds a type 20 aug.
|
// the only thing we should probably worry about is generating a wear change packet to all clients in zone if someone adds a type 20 aug.
|
||||||
if (inst && inst->HasOrnamentation()) //instance is not null and does have an ornament aug (slot 20)
|
if (RuleB(Inventory,UseAugOrnamentations) && inst && inst->HasOrnamentation()) //instance is not null and does have an ornament aug (slot 20)
|
||||||
{
|
{
|
||||||
ItemInst* ornamentation = inst->GetOrnamentation();
|
ItemInst* ornamentation = inst->GetOrnamentation();
|
||||||
if (ornamentation) //paranoid!
|
if (ornamentation) //paranoid!
|
||||||
|
|||||||
@@ -551,6 +551,8 @@ RULE_CATEGORY( Inventory )
|
|||||||
RULE_BOOL ( Inventory, EnforceAugmentRestriction, true) // Forces augment slot restrictions
|
RULE_BOOL ( Inventory, EnforceAugmentRestriction, true) // Forces augment slot restrictions
|
||||||
RULE_BOOL ( Inventory, EnforceAugmentUsability, true) // Forces augmented item usability
|
RULE_BOOL ( Inventory, EnforceAugmentUsability, true) // Forces augmented item usability
|
||||||
RULE_BOOL ( Inventory, EnforceAugmentWear, true) // Forces augment wear slot validation
|
RULE_BOOL ( Inventory, EnforceAugmentWear, true) // Forces augment wear slot validation
|
||||||
|
RULE_BOOL ( Inventory, UseAugOrnamentations, true) // Allows use of augment ornamentations
|
||||||
|
RULE_INT(Inventory,AugOrnamentationType,524288) // Custom servers can override default value (slot 20/524288)
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
#undef RULE_CATEGORY
|
#undef RULE_CATEGORY
|
||||||
|
|||||||
+1
-1
@@ -202,7 +202,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct*
|
|||||||
if (strlen(item->GetItem()->IDFile) > 2)
|
if (strlen(item->GetItem()->IDFile) > 2)
|
||||||
{
|
{
|
||||||
uint32 idfile = 0;
|
uint32 idfile = 0;
|
||||||
if (item->HasOrnamentation())
|
if (RuleB(Inventory,UseAugOrnamentations) && item->HasOrnamentation())
|
||||||
{
|
{
|
||||||
ItemInst* ornament = item->GetOrnamentation();
|
ItemInst* ornament = item->GetOrnamentation();
|
||||||
if (strlen(ornament->GetItem()->IDFile) > 2)
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
|
|||||||
+3
-3
@@ -4578,7 +4578,7 @@ int32 Bot::GetEquipmentMaterial(uint8 material_slot) const
|
|||||||
const ItemInst* inst = m_inv.GetItem(inventorySlot);
|
const ItemInst* inst = m_inv.GetItem(inventorySlot);
|
||||||
if (inst != nullptr)
|
if (inst != nullptr)
|
||||||
{
|
{
|
||||||
if (inst->HasOrnamentation())
|
if (RuleB(Inventory,UseAugOrnamentations) && inst->HasOrnamentation())
|
||||||
{
|
{
|
||||||
const ItemInst* ornament = inst->GetOrnamentation();
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
if (strlen(ornament->GetItem()->IDFile) > 2)
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
@@ -4714,7 +4714,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
|||||||
item = inst->GetItem();
|
item = inst->GetItem();
|
||||||
if(item)
|
if(item)
|
||||||
{
|
{
|
||||||
if (inst->HasOrnamentation())
|
if (RuleB(Inventory,UseAugOrnamentations) && inst->HasOrnamentation())
|
||||||
{
|
{
|
||||||
const ItemInst* ornament = inst->GetOrnamentation();
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
if (strlen(ornament->GetItem()->IDFile) > 2)
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
@@ -4738,7 +4738,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
|||||||
item = inst->GetItem();
|
item = inst->GetItem();
|
||||||
if(item)
|
if(item)
|
||||||
{
|
{
|
||||||
if (inst->HasOrnamentation())
|
if (RuleB(Inventory,UseAugOrnamentations) && inst->HasOrnamentation())
|
||||||
{
|
{
|
||||||
const ItemInst* ornament = inst->GetOrnamentation();
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
if (strlen(ornament->GetItem()->IDFile) > 2)
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
|
|||||||
+2
-2
@@ -1907,7 +1907,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
|||||||
ns->spawn.colors[MaterialFeet].color = GetEquipmentColor(MaterialFeet);
|
ns->spawn.colors[MaterialFeet].color = GetEquipmentColor(MaterialFeet);
|
||||||
}
|
}
|
||||||
if ((inst = m_inv[SLOT_PRIMARY]) && inst->IsType(ItemClassCommon)) {
|
if ((inst = m_inv[SLOT_PRIMARY]) && inst->IsType(ItemClassCommon)) {
|
||||||
if (inst->HasOrnamentation())
|
if (RuleB(Inventory,UseAugOrnamentations) && inst->HasOrnamentation())
|
||||||
{
|
{
|
||||||
const ItemInst* ornament = inst->GetOrnamentation();
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
if (strlen(ornament->GetItem()->IDFile) > 2)
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
@@ -1923,7 +1923,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 (RuleB(Inventory,UseAugOrnamentations) && inst->HasOrnamentation())
|
||||||
{
|
{
|
||||||
const ItemInst* ornament = inst->GetOrnamentation();
|
const ItemInst* ornament = inst->GetOrnamentation();
|
||||||
if (strlen(ornament->GetItem()->IDFile) > 2)
|
if (strlen(ornament->GetItem()->IDFile) > 2)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -4707,7 +4707,7 @@ 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);
|
||||||
if(inst->HasOrnamentation())
|
if(RuleB(Inventory,UseAugOrnamentations) && 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);
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user