Eliminated the nested class design of recent EQEmu work; Some more inv2 convergence work

This commit is contained in:
Uleat
2016-04-19 04:02:53 -04:00
parent 53c7abf16e
commit 8edb6e9595
65 changed files with 1196 additions and 1186 deletions
+1 -1
View File
@@ -418,7 +418,7 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration)
//gear stuff, need to make sure there's
//no situation where this stuff can be duped
for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::EQUIPMENT_END; x++) // (< 21) added MainAmmo
for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++) // (< 21) added MainAmmo
{
uint32 sitem = 0;
sitem = CorpseToUse->GetWornItem(x);
+1 -1
View File
@@ -3642,7 +3642,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
proced = false;
if (!proced && inst) {
for (int r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) {
for (int r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
const ItemInst *aug_i = inst->GetAugment(r);
if (!aug_i) // no aug, try next slot!
continue;
+19 -19
View File
@@ -171,8 +171,8 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
}
//tribute items
for (i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++) {
const ItemInst* inst = m_inv[EQEmu::Constants::TRIBUTE_BEGIN + i];
for (i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++) {
const ItemInst* inst = m_inv[EQEmu::constants::TRIBUTE_BEGIN + i];
if(inst == 0)
continue;
AddItemBonuses(inst, newbon, false, true);
@@ -526,7 +526,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
}
if (!isAug) {
for (int i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++)
for (int i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++)
AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item);
}
}
@@ -564,7 +564,7 @@ void Client::AdditiveWornBonuses(const ItemInst *inst, StatBonuses* newbon, bool
if (!isAug)
{
int i;
for (i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
AdditiveWornBonuses(inst->GetAugment(i),newbon,true);
}
}
@@ -575,7 +575,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
bool food = false;
bool drink = false;
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_BEGIN; i++)
for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_BEGIN; i++)
{
if (food && drink)
break;
@@ -591,7 +591,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
AddItemBonuses(inst, newbon);
}
}
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_END; i++)
for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_END; i++)
{
if (food && drink)
break;
@@ -3200,7 +3200,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon)
{
if(newbon){
for (int i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++){
for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]);
if(cur){
//basic stats
@@ -3278,18 +3278,18 @@ void Client::CalcItemScale() {
bool changed = false;
// MainAmmo excluded in helper function below
if (CalcItemScale(EQEmu::Constants::EQUIPMENT_BEGIN, EQEmu::Constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
if (CalcItemScale(EQEmu::constants::EQUIPMENT_BEGIN, EQEmu::constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
changed = true;
if (CalcItemScale(EQEmu::Constants::GENERAL_BEGIN, EQEmu::Constants::GENERAL_END)) // original coding excluded MainCursor (< 30)
if (CalcItemScale(EQEmu::constants::GENERAL_BEGIN, EQEmu::constants::GENERAL_END)) // original coding excluded MainCursor (< 30)
changed = true;
// I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END
// and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be...
if (CalcItemScale(EQEmu::Constants::GENERAL_BAGS_BEGIN, EQEmu::Constants::GENERAL_BAGS_END)) // (< 341)
if (CalcItemScale(EQEmu::constants::GENERAL_BAGS_BEGIN, EQEmu::constants::GENERAL_BAGS_END)) // (< 341)
changed = true;
if (CalcItemScale(EQEmu::Constants::TRIBUTE_BEGIN, EQEmu::Constants::TRIBUTE_END)) // (< 405)
if (CalcItemScale(EQEmu::constants::TRIBUTE_BEGIN, EQEmu::constants::TRIBUTE_END)) // (< 405)
changed = true;
//Power Source Slot
@@ -3320,7 +3320,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
// TEST CODE: test for bazaar trader crashing with charm items
if (Trader)
if (i >= EQEmu::Constants::GENERAL_BAGS_BEGIN && i <= EQEmu::Constants::GENERAL_BAGS_END) {
if (i >= EQEmu::constants::GENERAL_BAGS_BEGIN && i <= EQEmu::constants::GENERAL_BAGS_END) {
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue;
@@ -3340,7 +3340,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
}
//iterate all augments
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
{
ItemInst * a_inst = inst->GetAugment(x);
if(!a_inst)
@@ -3372,18 +3372,18 @@ void Client::DoItemEnterZone() {
bool changed = false;
// MainAmmo excluded in helper function below
if (DoItemEnterZone(EQEmu::Constants::EQUIPMENT_BEGIN, EQEmu::Constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
if (DoItemEnterZone(EQEmu::constants::EQUIPMENT_BEGIN, EQEmu::constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
changed = true;
if (DoItemEnterZone(EQEmu::Constants::GENERAL_BEGIN, EQEmu::Constants::GENERAL_END)) // original coding excluded MainCursor (< 30)
if (DoItemEnterZone(EQEmu::constants::GENERAL_BEGIN, EQEmu::constants::GENERAL_END)) // original coding excluded MainCursor (< 30)
changed = true;
// I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END
// and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be...
if (DoItemEnterZone(EQEmu::Constants::GENERAL_BAGS_BEGIN, EQEmu::Constants::GENERAL_BAGS_END)) // (< 341)
if (DoItemEnterZone(EQEmu::constants::GENERAL_BAGS_BEGIN, EQEmu::constants::GENERAL_BAGS_END)) // (< 341)
changed = true;
if (DoItemEnterZone(EQEmu::Constants::TRIBUTE_BEGIN, EQEmu::Constants::TRIBUTE_END)) // (< 405)
if (DoItemEnterZone(EQEmu::constants::TRIBUTE_BEGIN, EQEmu::constants::TRIBUTE_END)) // (< 405)
changed = true;
//Power Source Slot
@@ -3413,7 +3413,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
// TEST CODE: test for bazaar trader crashing with charm items
if (Trader)
if (i >= EQEmu::Constants::GENERAL_BAGS_BEGIN && i <= EQEmu::Constants::GENERAL_BAGS_END) {
if (i >= EQEmu::constants::GENERAL_BAGS_BEGIN && i <= EQEmu::constants::GENERAL_BAGS_END) {
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue;
@@ -3443,7 +3443,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
}
//iterate all augments
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
{
ItemInst *a_inst = inst->GetAugment(x);
if(!a_inst)
+25 -25
View File
@@ -93,7 +93,7 @@ Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, nullptr, glm
timers[i] = 0;
strcpy(this->name, this->GetCleanName());
memset(&m_Light, 0, sizeof(EQEmu::LightSource::impl));
memset(&m_Light, 0, sizeof(EQEmu::lightsource::LightSourceProfile));
memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct));
}
@@ -1722,8 +1722,8 @@ bool Bot::LoadPet()
if (!botdb.LoadPetBuffs(GetBotID(), pet_buffs))
bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetBuffs(), GetCleanName());
uint32 pet_items[EQEmu::Constants::EQUIPMENT_SIZE];
memset(pet_items, 0, (sizeof(uint32) * EQEmu::Constants::EQUIPMENT_SIZE));
uint32 pet_items[EQEmu::constants::EQUIPMENT_SIZE];
memset(pet_items, 0, (sizeof(uint32) * EQEmu::constants::EQUIPMENT_SIZE));
if (!botdb.LoadPetItems(GetBotID(), pet_items))
bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetItems(), GetCleanName());
@@ -1750,11 +1750,11 @@ bool Bot::SavePet()
char* pet_name = new char[64];
SpellBuff_Struct pet_buffs[BUFF_COUNT];
uint32 pet_items[EQEmu::Constants::EQUIPMENT_SIZE];
uint32 pet_items[EQEmu::constants::EQUIPMENT_SIZE];
memset(pet_name, 0, 64);
memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * BUFF_COUNT));
memset(pet_items, 0, (sizeof(uint32) * EQEmu::Constants::EQUIPMENT_SIZE));
memset(pet_items, 0, (sizeof(uint32) * EQEmu::constants::EQUIPMENT_SIZE));
pet_inst->GetPetState(pet_buffs, pet_items, pet_name);
@@ -2121,7 +2121,7 @@ void Bot::ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg)
break;
}
if (item_slot >= EQEmu::Constants::EQUIPMENT_BEGIN){
if (item_slot >= EQEmu::constants::EQUIPMENT_BEGIN){
const ItemInst* inst = GetBotItem(item_slot);
const Item_Struct* botweapon = 0;
if(inst)
@@ -2878,7 +2878,7 @@ void Bot::Spawn(Client* botCharacterOwner) {
// I re-enabled this until I can sort it out
uint32 itemID = 0;
uint8 materialFromSlot = 0xFF;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) {
for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) {
itemID = GetBotItemBySlot(i);
if(itemID != 0) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
@@ -3361,7 +3361,7 @@ void Bot::FinishTrade(Client* client, BotTradeType tradeType) {
if(tradeType == BotTradeClientNormal) {
// Items being traded are found in the normal trade window used to trade between a Client and a Client or NPC
// Items in this mode are found in slot ids 3000 thru 3003 - thought bots used the full 8-slot window..?
PerformTradeWithClient(EQEmu::Constants::TRADE_BEGIN, EQEmu::Constants::TRADE_END, client); // {3000..3007}
PerformTradeWithClient(EQEmu::constants::TRADE_BEGIN, EQEmu::constants::TRADE_END, client); // {3000..3007}
}
else if(tradeType == BotTradeClientNoDropNoTrade) {
// Items being traded are found on the Client's cursor slot, slot id 30. This item can be either a single item or it can be a bag.
@@ -3378,7 +3378,7 @@ void Bot::FinishTrade(Client* client, BotTradeType tradeType) {
void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* client) {
if(client) {
// TODO: Figure out what the actual max slot id is
const int MAX_SLOT_ID = EQEmu::Constants::TRADE_BAGS_END; // was the old incorrect 3179..
const int MAX_SLOT_ID = EQEmu::constants::TRADE_BAGS_END; // was the old incorrect 3179..
uint32 items[MAX_SLOT_ID] = {0};
uint8 charges[MAX_SLOT_ID] = {0};
bool botCanWear[MAX_SLOT_ID] = {0};
@@ -3403,7 +3403,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
std::string TempErrorMessage;
const Item_Struct* mWeaponItem = inst->GetItem();
bool failedLoreCheck = false;
for (int m = AUG_BEGIN; m < EQEmu::Constants::ITEM_COMMON_SIZE; ++m) {
for (int m = AUG_INDEX_BEGIN; m < EQEmu::constants::ITEM_COMMON_SIZE; ++m) {
ItemInst *itm = inst->GetAugment(m);
if(itm)
{
@@ -3423,12 +3423,12 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
botCanWear[i] = BotCanWear;
ItemInst* swap_item = nullptr;
const char* equipped[EQEmu::Constants::EQUIPMENT_SIZE + 1] = { "Charm", "Left Ear", "Head", "Face", "Right Ear", "Neck", "Shoulders", "Arms", "Back",
const char* equipped[EQEmu::constants::EQUIPMENT_SIZE + 1] = { "Charm", "Left Ear", "Head", "Face", "Right Ear", "Neck", "Shoulders", "Arms", "Back",
"Left Wrist", "Right Wrist", "Range", "Hands", "Primary Hand", "Secondary Hand",
"Left Finger", "Right Finger", "Chest", "Legs", "Feet", "Waist", "Ammo", "Powersource" };
bool success = false;
int how_many_slots = 0;
for (int j = EQEmu::Constants::EQUIPMENT_BEGIN; j <= (EQEmu::Constants::EQUIPMENT_END + 1); ++j) {
for (int j = EQEmu::constants::EQUIPMENT_BEGIN; j <= (EQEmu::constants::EQUIPMENT_END + 1); ++j) {
if((mWeaponItem->Slots & (1 << j))) {
if (j == 22)
j = 9999;
@@ -3489,14 +3489,14 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
}
}
if(!success) {
for (int j = EQEmu::Constants::EQUIPMENT_BEGIN; j <= (EQEmu::Constants::EQUIPMENT_END + 1); ++j) {
for (int j = EQEmu::constants::EQUIPMENT_BEGIN; j <= (EQEmu::constants::EQUIPMENT_END + 1); ++j) {
if((mWeaponItem->Slots & (1 << j))) {
if (j == 22)
j = 9999;
swap_item = GetBotItem(j);
failedLoreCheck = false;
for (int k = AUG_BEGIN; k < EQEmu::Constants::ITEM_COMMON_SIZE; ++k) {
for (int k = AUG_INDEX_BEGIN; k < EQEmu::constants::ITEM_COMMON_SIZE; ++k) {
ItemInst *itm = swap_item->GetAugment(k);
if(itm)
{
@@ -4294,7 +4294,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
int32 focus_max = 0;
int32 focus_max_real = 0;
//item focus
for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::EQUIPMENT_END; x++) {
for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++) {
TempItem = nullptr;
ItemInst* ins = GetBotItem(x);
if (!ins)
@@ -4319,7 +4319,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
}
}
for (int y = AUG_BEGIN; y < EQEmu::Constants::ITEM_COMMON_SIZE; ++y) {
for (int y = AUG_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y) {
ItemInst *aug = nullptr;
aug = ins->GetAugment(y);
if(aug) {
@@ -4999,7 +4999,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
if(botweaponInst) {
primaryweapondamage = GetWeaponDamage(other, botweaponInst);
backstab_dmg = botweaponInst->GetItem()->BackstabDmg;
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; ++i) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) {
ItemInst *aug = botweaponInst->GetAugment(i);
if(aug)
backstab_dmg += aug->GetItem()->BackstabDmg;
@@ -5374,7 +5374,7 @@ void Bot::EquipBot(std::string* errorMessage) {
GetBotItems(m_inv, errorMessage);
const ItemInst* inst = 0;
const Item_Struct* item = 0;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) {
for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) {
inst = GetBotItem(i);
if(inst) {
item = inst->GetItem();
@@ -7192,7 +7192,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
// Modded to display power source items (will only show up on SoF+ client inspect windows though.)
// I don't think bots are currently coded to use them..but, you'll have to use '#bot inventory list'
// to see them on a Titanium client when/if they are activated.
for (int16 L = EQEmu::Constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) {
for (int16 L = EQEmu::constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) {
inst = inspectedBot->GetBotItem(L);
if(inst) {
@@ -7240,7 +7240,7 @@ void Bot::CalcItemBonuses(StatBonuses* newbon)
{
const Item_Struct* itemtmp = 0;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= (EQEmu::Constants::EQUIPMENT_END + 1); ++i) {
for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= (EQEmu::constants::EQUIPMENT_END + 1); ++i) {
const ItemInst* item = GetBotItem((i == 22 ? 9999 : i));
if(item) {
AddItemBonuses(item, newbon);
@@ -7553,7 +7553,7 @@ void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug,
if (!isAug)
{
for (int i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++)
for (int i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++)
AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level);
}
@@ -8047,7 +8047,7 @@ int Bot::GetRawACNoShield(int &shield_ac) {
if(inst->GetItem()->ItemType == ItemTypeShield) {
ac -= inst->GetItem()->AC;
shield_ac = inst->GetItem()->AC;
for (uint8 i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if(inst->GetAugment(i)) {
ac -= inst->GetAugment(i)->GetItem()->AC;
shield_ac += inst->GetAugment(i)->GetItem()->AC;
@@ -8062,7 +8062,7 @@ uint32 Bot::CalcCurrentWeight() {
const Item_Struct* TempItem = 0;
ItemInst* inst;
uint32 Total = 0;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) {
for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) {
inst = GetBotItem(i);
if(inst) {
TempItem = inst->GetItem();
@@ -8469,8 +8469,8 @@ std::string Bot::CreateSayLink(Client* c, const char* message, const char* name)
uint32 saylink_id = database.LoadSaylinkID(escaped_string);
safe_delete_array(escaped_string);
EQEmu::SayLink::impl linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemData);
linker.SetProxyItemID(SAYLINK_ITEM_ID);
linker.SetProxyAugment1ID(saylink_id);
linker.SetProxyText(name);
+3 -3
View File
@@ -77,9 +77,9 @@ static const std::string bot_stance_name[BOT_STANCE_COUNT] = {
static const char* GetBotStanceName(int stance_id) { return bot_stance_name[VALIDBOTSTANCE(stance_id)].c_str(); }
#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::Constants::EQUIPMENT_BEGIN && x <= EQEmu::Constants::EQUIPMENT_END) ? (x) : ((x == SlotPowerSource) ? (22) : (23)))
#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::constants::EQUIPMENT_BEGIN && x <= EQEmu::constants::EQUIPMENT_END) ? (x) : ((x == SlotPowerSource) ? (22) : (23)))
static std::string bot_equip_slot_name[EQEmu::Constants::EQUIPMENT_SIZE + 2] =
static std::string bot_equip_slot_name[EQEmu::constants::EQUIPMENT_SIZE + 2] =
{
"Charm", // MainCharm
"Left Ear", // MainEar1
@@ -386,7 +386,7 @@ public:
void BotTradeAddItem(uint32 id, const ItemInst* inst, int16 charges, uint32 equipableSlots, uint16 lootSlot, std::string* errorMessage, bool addToDb = true);
void EquipBot(std::string* errorMessage);
bool CheckLoreConflict(const Item_Struct* item);
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); }
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment); }
// Static Class Methods
//static void DestroyBotRaidObjects(Client* client); // Can be removed after bot raids are dumped
+7 -7
View File
@@ -2400,7 +2400,7 @@ namespace ActionableBots
continue;
mod_skill_value = base_skill_value;
for (int16 index = EQEmu::Constants::EQUIPMENT_BEGIN; index <= EQEmu::Constants::EQUIPMENT_END; ++index) {
for (int16 index = EQEmu::constants::EQUIPMENT_BEGIN; index <= EQEmu::constants::EQUIPMENT_END; ++index) {
const ItemInst* indexed_item = bot_iter->GetBotItem(index);
if (indexed_item && indexed_item->GetItem()->SkillModType == skill_type)
mod_skill_value += (base_skill_value * (((float)indexed_item->GetItem()->SkillModValue) / 100.0f));
@@ -7066,11 +7066,11 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
bool is2Hweapon = false;
std::string item_link;
EQEmu::SayLink::impl linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemInst);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemInst);
uint32 inventory_count = 0;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= (EQEmu::Constants::EQUIPMENT_END + 1); ++i) {
for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= (EQEmu::constants::EQUIPMENT_END + 1); ++i) {
if ((i == SlotSecondary) && is2Hweapon)
continue;
@@ -7126,7 +7126,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
}
int slotId = atoi(sep->arg[1]);
if (!sep->IsNumber(1) || ((slotId > EQEmu::Constants::EQUIPMENT_END || slotId < EQEmu::Constants::EQUIPMENT_BEGIN) && slotId != SlotPowerSource)) {
if (!sep->IsNumber(1) || ((slotId > EQEmu::constants::EQUIPMENT_END || slotId < EQEmu::constants::EQUIPMENT_BEGIN) && slotId != SlotPowerSource)) {
c->Message(m_fail, "Valid slots are 0-21 or 9999");
return;
}
@@ -7141,7 +7141,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
return;
}
for (int m = AUG_BEGIN; m < EQEmu::Constants::ITEM_COMMON_SIZE; ++m) {
for (int m = AUG_INDEX_BEGIN; m < EQEmu::constants::ITEM_COMMON_SIZE; ++m) {
if (!itminst)
break;
@@ -7233,7 +7233,7 @@ void bot_subcommand_inventory_window(Client *c, const Seperator *sep)
//Client::TextLink linker;
//linker.SetLinkType(linker.linkItemInst);
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= (EQEmu::Constants::EQUIPMENT_END + 1); ++i) {
for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= (EQEmu::constants::EQUIPMENT_END + 1); ++i) {
const Item_Struct* item = nullptr;
const ItemInst* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? SlotPowerSource : i);
if (inst)
+9 -9
View File
@@ -1058,7 +1058,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, Inventory& inventory_inst)
for (auto row = results.begin(); row != results.end(); ++row) {
int16 slot_id = atoi(row[0]);
if ((slot_id < EQEmu::Constants::EQUIPMENT_BEGIN || slot_id > EQEmu::Constants::EQUIPMENT_END) && slot_id != SlotPowerSource)
if ((slot_id < EQEmu::constants::EQUIPMENT_BEGIN || slot_id > EQEmu::constants::EQUIPMENT_END) && slot_id != SlotPowerSource)
continue;
uint32 item_id = atoi(row[1]);
@@ -1091,7 +1091,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, Inventory& inventory_inst)
if (item_inst->GetItem()->Attuneable) {
if (atoi(row[4]))
item_inst->SetAttuned(true);
else if (((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::Constants::EQUIPMENT_END) || slot_id == SlotPowerSource))
else if (((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::constants::EQUIPMENT_END) || slot_id == SlotPowerSource))
item_inst->SetAttuned(true);
}
@@ -1159,7 +1159,7 @@ bool BotDatabase::LoadItemBySlot(Bot* bot_inst)
bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint32& item_id)
{
if (!bot_id || (slot_id > EQEmu::Constants::EQUIPMENT_END && slot_id != SlotPowerSource))
if (!bot_id || (slot_id > EQEmu::constants::EQUIPMENT_END && slot_id != SlotPowerSource))
return false;
query = StringFormat("SELECT `item_id` FROM `bot_inventories` WHERE `bot_id` = '%i' AND `slot_id` = '%i' LIMIT 1", bot_id, slot_id);
@@ -1177,7 +1177,7 @@ bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint
bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const ItemInst* item_inst)
{
if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::Constants::EQUIPMENT_END && slot_id != SlotPowerSource))
if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::constants::EQUIPMENT_END && slot_id != SlotPowerSource))
return false;
if (!DeleteItemBySlot(bot_inst->GetBotID(), slot_id))
@@ -1187,7 +1187,7 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const Item
return true;
uint32 augment_id[] = { 0, 0, 0, 0, 0, 0 };
for (int augment_iter = 0; augment_iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++augment_iter)
for (int augment_iter = 0; augment_iter < EQEmu::constants::ITEM_COMMON_SIZE; ++augment_iter)
augment_id[augment_iter] = item_inst->GetAugmentItemID(augment_iter);
query = StringFormat(
@@ -1255,7 +1255,7 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const Item
bool BotDatabase::DeleteItemBySlot(const uint32 bot_id, const uint32 slot_id)
{
if (!bot_id || (slot_id > EQEmu::Constants::EQUIPMENT_END && slot_id != SlotPowerSource))
if (!bot_id || (slot_id > EQEmu::constants::EQUIPMENT_END && slot_id != SlotPowerSource))
return false;
query = StringFormat("DELETE FROM `bot_inventories` WHERE `bot_id` = '%u' AND `slot_id` = '%u'", bot_id, slot_id);
@@ -1294,7 +1294,7 @@ bool BotDatabase::SaveEquipmentColor(const uint32 bot_id, const int16 slot_id, c
return false;
bool all_flag = (slot_id == -2);
if ((slot_id < EQEmu::Constants::EQUIPMENT_BEGIN || slot_id > EQEmu::Constants::EQUIPMENT_END) && slot_id != SlotPowerSource && !all_flag)
if ((slot_id < EQEmu::constants::EQUIPMENT_BEGIN || slot_id > EQEmu::constants::EQUIPMENT_END) && slot_id != SlotPowerSource && !all_flag)
return false;
std::string where_clause;
@@ -1571,7 +1571,7 @@ bool BotDatabase::LoadPetItems(const uint32 bot_id, uint32* pet_items)
return true;
int item_index = 0;
for (auto row = results.begin(); row != results.end() && item_index < EQEmu::Constants::EQUIPMENT_SIZE; ++row) {
for (auto row = results.begin(); row != results.end() && item_index < EQEmu::constants::EQUIPMENT_SIZE; ++row) {
pet_items[item_index] = atoi(row[0]);
++item_index;
}
@@ -1595,7 +1595,7 @@ bool BotDatabase::SavePetItems(const uint32 bot_id, const uint32* pet_items, boo
if (!saved_pet_index)
return true;
for (int item_index = 0; item_index < EQEmu::Constants::EQUIPMENT_SIZE; ++item_index) {
for (int item_index = 0; item_index < EQEmu::constants::EQUIPMENT_SIZE; ++item_index) {
if (!pet_items[item_index])
continue;
+16 -16
View File
@@ -5392,7 +5392,7 @@ bool Client::TryReward(uint32 claim_id)
// save
uint32 free_slot = 0xFFFFFFFF;
for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; ++i) {
for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; ++i) {
ItemInst *item = GetInv().GetItem(i);
if (!item) {
free_slot = i;
@@ -6307,7 +6307,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
made_npc->drakkin_details = GetDrakkinDetails();
made_npc->d_melee_texture1 = GetEquipmentMaterial(MaterialPrimary);
made_npc->d_melee_texture2 = GetEquipmentMaterial(MaterialSecondary);
for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_END; i++) {
for (int i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_END; i++) {
made_npc->armor_tint[i] = GetEquipmentColor(i);
}
made_npc->loottable_id = 0;
@@ -7583,7 +7583,7 @@ void Client::GarbleMessage(char *message, uint8 variance)
for (size_t i = 0; i < strlen(message); i++) {
// Client expects hex values inside of a text link body
if (message[i] == delimiter) {
if (!(delimiter_count & 1)) { i += EQEmu::Constants::TEXT_LINK_BODY_LENGTH; }
if (!(delimiter_count & 1)) { i += EQEmu::constants::TEXT_LINK_BODY_LENGTH; }
++delimiter_count;
continue;
}
@@ -8008,17 +8008,17 @@ void Client::TickItemCheck()
if(zone->tick_items.empty()) { return; }
//Scan equip slots for items
for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++)
for (i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; i++)
{
TryItemTick(i);
}
//Scan main inventory + cursor
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++)
for (i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++)
{
TryItemTick(i);
}
//Scan bags
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++)
for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++)
{
TryItemTick(i);
}
@@ -8034,7 +8034,7 @@ void Client::TryItemTick(int slot)
if(zone->tick_items.count(iid) > 0)
{
if (GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) && (zone->tick_items[iid].bagslot || slot <= EQEmu::Constants::EQUIPMENT_END))
if (GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) && (zone->tick_items[iid].bagslot || slot <= EQEmu::constants::EQUIPMENT_END))
{
ItemInst* e_inst = (ItemInst*)inst;
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
@@ -8042,9 +8042,9 @@ void Client::TryItemTick(int slot)
}
//Only look at augs in main inventory
if (slot > EQEmu::Constants::EQUIPMENT_END) { return; }
if (slot > EQEmu::constants::EQUIPMENT_END) { return; }
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
{
ItemInst * a_inst = inst->GetAugment(x);
if(!a_inst) { continue; }
@@ -8065,17 +8065,17 @@ void Client::TryItemTick(int slot)
void Client::ItemTimerCheck()
{
int i;
for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++)
for (i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; i++)
{
TryItemTimer(i);
}
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++)
for (i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++)
{
TryItemTimer(i);
}
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++)
for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++)
{
TryItemTimer(i);
}
@@ -8097,11 +8097,11 @@ void Client::TryItemTimer(int slot)
++it_iter;
}
if (slot > EQEmu::Constants::EQUIPMENT_END) {
if (slot > EQEmu::constants::EQUIPMENT_END) {
return;
}
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
{
ItemInst * a_inst = inst->GetAugment(x);
if(!a_inst) {
@@ -8389,12 +8389,12 @@ void Client::ShowNumHits()
int Client::GetQuiverHaste(int delay)
{
const ItemInst *pi = nullptr;
for (int r = EQEmu::Constants::GENERAL_BEGIN; r <= EQEmu::Constants::GENERAL_END; r++) {
for (int r = EQEmu::constants::GENERAL_BEGIN; r <= EQEmu::constants::GENERAL_END; r++) {
pi = GetInv().GetItem(r);
if (pi && pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver &&
pi->GetItem()->BagWR > 0)
break;
if (r == EQEmu::Constants::GENERAL_END)
if (r == EQEmu::constants::GENERAL_END)
// we will get here if we don't find a valid quiver
return 0;
}
+1 -1
View File
@@ -736,7 +736,7 @@ public:
#endif
uint32 GetEquipment(uint8 material_slot) const; // returns item id
uint32 GetEquipmentColor(uint8 material_slot) const;
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment); }
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment); }
inline bool AutoSplitEnabled() { return m_pp.autosplit != 0; }
+6 -6
View File
@@ -485,7 +485,7 @@ int32 Client::GetRawItemAC()
{
int32 Total = 0;
// this skips MainAmmo..add an '=' conditional if that slot is required (original behavior)
for (int16 slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id < EQEmu::Constants::EQUIPMENT_END; slot_id++) {
for (int16 slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id < EQEmu::constants::EQUIPMENT_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if (inst && inst->IsType(ItemClassCommon)) {
Total += inst->GetItem()->AC;
@@ -1306,7 +1306,7 @@ uint32 Client::CalcCurrentWeight()
ItemInst* ins;
uint32 Total = 0;
int x;
for (x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= SlotCursor; x++) { // include cursor or not?
for (x = EQEmu::constants::EQUIPMENT_BEGIN; x <= SlotCursor; x++) { // include cursor or not?
TempItem = 0;
ins = GetInv().GetItem(x);
if (ins) {
@@ -1316,7 +1316,7 @@ uint32 Client::CalcCurrentWeight()
Total += TempItem->Weight;
}
}
for (x = EQEmu::Constants::GENERAL_BAGS_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++) { // include cursor bags or not?
for (x = EQEmu::constants::GENERAL_BAGS_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++) { // include cursor bags or not?
int TmpWeight = 0;
TempItem = 0;
ins = GetInv().GetItem(x);
@@ -1331,7 +1331,7 @@ uint32 Client::CalcCurrentWeight()
// is this correct? or can we scan for the highest weight redux and use that? (need client verifications)
int bagslot = SlotGeneral1;
int reduction = 0;
for (int m = EQEmu::Constants::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::Constants::GENERAL_BAGS_END; m += 10) { // include cursor bags or not?
for (int m = EQEmu::constants::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::constants::GENERAL_BAGS_END; m += 10) { // include cursor bags or not?
if (x >= m) {
bagslot += 1;
}
@@ -1355,7 +1355,7 @@ uint32 Client::CalcCurrentWeight()
This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd.
*/
// SoD+ client has no weight for coin
if (EQEmu::Limits::CoinHasWeight(GetClientVersion())) {
if (EQEmu::limits::CoinHasWeight(GetClientVersion())) {
Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;
}
float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat;
@@ -2210,7 +2210,7 @@ int Client::GetRawACNoShield(int &shield_ac) const
if (inst->GetItem()->ItemType == ItemTypeShield) {
ac -= inst->GetItem()->AC;
shield_ac = inst->GetItem()->AC;
for (uint8 i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if (inst->GetAugment(i)) {
ac -= inst->GetAugment(i)->GetItem()->AC;
shield_ac += inst->GetAugment(i)->GetItem()->AC;
+8 -8
View File
@@ -1313,7 +1313,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
}
/* Set item material tint */
for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_END; i++)
for (int i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_END; i++)
{
if (m_pp.item_tint[i].RGB.UseTint == 1 || m_pp.item_tint[i].RGB.UseTint == 255)
{
@@ -7994,7 +7994,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
const Item_Struct* item = nullptr;
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
for (int16 L = EQEmu::Constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) {
for (int16 L = EQEmu::constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) {
const ItemInst* inst = GetInv().GetItem(L);
item = inst ? inst->GetItem() : nullptr;
@@ -8474,7 +8474,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
ItemInst* clickaug = 0;
Item_Struct* augitem = 0;
for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) {
for (r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
const ItemInst* aug_i = inst->GetAugment(r);
if (!aug_i)
continue;
@@ -9675,7 +9675,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
MoveItem_Struct* mi = (MoveItem_Struct*)app->pBuffer;
if (spellend_timer.Enabled() && casting_spell_id && !IsBardSong(casting_spell_id))
{
if (mi->from_slot != mi->to_slot && (mi->from_slot <= EQEmu::Constants::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot))
if (mi->from_slot != mi->to_slot && (mi->from_slot <= EQEmu::constants::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot))
{
char *detect = nullptr;
const ItemInst *itm_from = GetInv().GetItem(mi->from_slot);
@@ -9696,8 +9696,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
// Illegal bagslot usage checks. Currently, user only receives a message if this check is triggered.
bool mi_hack = false;
if (mi->from_slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::Constants::CURSOR_BAG_END) {
if (mi->from_slot >= EQEmu::Constants::CURSOR_BAG_BEGIN) { mi_hack = true; }
if (mi->from_slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::constants::CURSOR_BAG_END) {
if (mi->from_slot >= EQEmu::constants::CURSOR_BAG_BEGIN) { mi_hack = true; }
else {
int16 from_parent = m_inv.CalcSlotId(mi->from_slot);
if (!m_inv[from_parent]) { mi_hack = true; }
@@ -9706,8 +9706,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
}
}
if (mi->to_slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::Constants::CURSOR_BAG_END) {
if (mi->to_slot >= EQEmu::Constants::CURSOR_BAG_BEGIN) { mi_hack = true; }
if (mi->to_slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::constants::CURSOR_BAG_END) {
if (mi->to_slot >= EQEmu::constants::CURSOR_BAG_BEGIN) { mi_hack = true; }
else {
int16 to_parent = m_inv.CalcSlotId(mi->to_slot);
if (!m_inv[to_parent]) { mi_hack = true; }
+8 -8
View File
@@ -742,7 +742,7 @@ void Client::BulkSendInventoryItems() {
// LINKDEAD TRADE ITEMS
// Move trade slot items back into normal inventory..need them there now for the proceeding validity checks
for(slot_id = EQEmu::Constants::TRADE_BEGIN; slot_id <= EQEmu::Constants::TRADE_END; slot_id++) {
for(slot_id = EQEmu::constants::TRADE_BEGIN; slot_id <= EQEmu::constants::TRADE_END; slot_id++) {
ItemInst* inst = m_inv.PopItem(slot_id);
if(inst) {
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
@@ -790,7 +790,7 @@ void Client::BulkSendInventoryItems() {
std::map<uint16, std::string>::iterator itr;
//Inventory items
for(slot_id = SLOT_BEGIN; slot_id < EQEmu::Constants::TYPE_POSSESSIONS_SIZE; slot_id++) {
for(slot_id = SLOT_BEGIN; slot_id < EQEmu::constants::TYPE_POSSESSIONS_SIZE; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if(inst) {
std::string packet = inst->Serialize(slot_id);
@@ -810,7 +810,7 @@ void Client::BulkSendInventoryItems() {
}
// Bank items
for(slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; slot_id++) {
for(slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if(inst) {
std::string packet = inst->Serialize(slot_id);
@@ -820,7 +820,7 @@ void Client::BulkSendInventoryItems() {
}
// Shared Bank items
for(slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_END; slot_id++) {
for(slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if(inst) {
std::string packet = inst->Serialize(slot_id);
@@ -851,14 +851,14 @@ void Client::BulkSendInventoryItems()
if(deletenorent){//client was offline for more than 30 minutes, delete no rent items
RemoveNoRent();
}
for (slot_id=EQEmu::Constants::POSSESSIONS_BEGIN; slot_id<=EQEmu::Constants::POSSESSIONS_END; slot_id++) {
for (slot_id=EQEmu::constants::POSSESSIONS_BEGIN; slot_id<=EQEmu::constants::POSSESSIONS_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if (inst){
SendItemPacket(slot_id, inst, ItemPacketCharInventory);
}
}
// Bank items
for (slot_id=EQEmu::Constants::BANK_BEGIN; slot_id<=EQEmu::Constants::BANK_END; slot_id++) { // 2015...
for (slot_id=EQEmu::constants::BANK_BEGIN; slot_id<=EQEmu::constants::BANK_END; slot_id++) { // 2015...
const ItemInst* inst = m_inv[slot_id];
if (inst){
SendItemPacket(slot_id, inst, ItemPacketCharInventory);
@@ -866,7 +866,7 @@ void Client::BulkSendInventoryItems()
}
// Shared Bank items
for (slot_id=EQEmu::Constants::SHARED_BANK_BEGIN; slot_id<=EQEmu::Constants::SHARED_BANK_END; slot_id++) {
for (slot_id=EQEmu::constants::SHARED_BANK_BEGIN; slot_id<=EQEmu::constants::SHARED_BANK_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if (inst){
SendItemPacket(slot_id, inst, ItemPacketCharInventory);
@@ -876,7 +876,7 @@ void Client::BulkSendInventoryItems()
// LINKDEAD TRADE ITEMS
// If player went LD during a trade, they have items in the trade inventory
// slots. These items are now being put into their inventory (then queue up on cursor)
for (int16 trade_slot_id=EQEmu::Constants::TRADE_BEGIN; trade_slot_id<=EQEmu::Constants::TRADE_END; trade_slot_id++) {
for (int16 trade_slot_id=EQEmu::constants::TRADE_BEGIN; trade_slot_id<=EQEmu::constants::TRADE_END; trade_slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if (inst) {
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size);
+27 -27
View File
@@ -2413,14 +2413,14 @@ void command_texture(Client *c, const Seperator *sep)
// Player Races Wear Armor, so Wearchange is sent instead
int i;
if (!c->GetTarget())
for (i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_TINT_END; i++)
for (i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_TINT_END; i++)
{
c->SendTextureWC(i, texture);
}
else if ((c->GetTarget()->GetRace() > 0 && c->GetTarget()->GetRace() <= 12) ||
c->GetTarget()->GetRace() == 128 || c->GetTarget()->GetRace() == 130 ||
c->GetTarget()->GetRace() == 330 || c->GetTarget()->GetRace() == 522) {
for (i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_TINT_END; i++)
for (i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_TINT_END; i++)
{
c->GetTarget()->SendTextureWC(i, texture);
}
@@ -2545,13 +2545,13 @@ void command_peekinv(Client *c, const Seperator *sep)
const ItemInst* inst_sub = nullptr;
const Item_Struct* item_data = nullptr;
std::string item_link;
EQEmu::SayLink::impl linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemInst);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemInst);
c->Message(0, "Displaying inventory for %s...", targetClient->GetName());
// worn
for (int16 indexMain = EQEmu::Constants::EQUIPMENT_BEGIN; (scopeWhere & peekWorn) && (indexMain <= EQEmu::Constants::EQUIPMENT_END); ++indexMain) {
for (int16 indexMain = EQEmu::constants::EQUIPMENT_BEGIN; (scopeWhere & peekWorn) && (indexMain <= EQEmu::constants::EQUIPMENT_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
@@ -2574,7 +2574,7 @@ void command_peekinv(Client *c, const Seperator *sep)
}
// inv
for (int16 indexMain = EQEmu::Constants::GENERAL_BEGIN; (scopeWhere & peekInv) && (indexMain <= EQEmu::Constants::GENERAL_END); ++indexMain) {
for (int16 indexMain = EQEmu::constants::GENERAL_BEGIN; (scopeWhere & peekInv) && (indexMain <= EQEmu::constants::GENERAL_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
@@ -2584,7 +2584,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "InvSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2618,7 +2618,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "CursorSlot: %i, Depth: %i, Item: %i (%s), Charges: %i",
SlotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2633,7 +2633,7 @@ void command_peekinv(Client *c, const Seperator *sep)
}
// trib
for (int16 indexMain = EQEmu::Constants::TRIBUTE_BEGIN; (scopeWhere & peekTrib) && (indexMain <= EQEmu::Constants::TRIBUTE_END); ++indexMain) {
for (int16 indexMain = EQEmu::constants::TRIBUTE_BEGIN; (scopeWhere & peekTrib) && (indexMain <= EQEmu::constants::TRIBUTE_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
@@ -2645,7 +2645,7 @@ void command_peekinv(Client *c, const Seperator *sep)
}
// bank
for (int16 indexMain = EQEmu::Constants::BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::Constants::BANK_END); ++indexMain) {
for (int16 indexMain = EQEmu::constants::BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::constants::BANK_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
@@ -2655,7 +2655,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "BankSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2667,7 +2667,7 @@ void command_peekinv(Client *c, const Seperator *sep)
}
}
for (int16 indexMain = EQEmu::Constants::SHARED_BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::Constants::SHARED_BANK_END); ++indexMain) {
for (int16 indexMain = EQEmu::constants::SHARED_BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::constants::SHARED_BANK_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
@@ -2677,7 +2677,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "SharedBankSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2690,7 +2690,7 @@ void command_peekinv(Client *c, const Seperator *sep)
}
// trade
for (int16 indexMain = EQEmu::Constants::TRADE_BEGIN; (scopeWhere & peekTrade) && (indexMain <= EQEmu::Constants::TRADE_END); ++indexMain) {
for (int16 indexMain = EQEmu::constants::TRADE_BEGIN; (scopeWhere & peekTrade) && (indexMain <= EQEmu::constants::TRADE_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
@@ -2700,7 +2700,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "TradeSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2722,7 +2722,7 @@ void command_peekinv(Client *c, const Seperator *sep)
else {
c->Message(0, "[WorldObject DBID: %i (entityid: %i)]", objectTradeskill->GetDBID(), objectTradeskill->GetID());
for (int16 indexMain = SLOT_BEGIN; indexMain < EQEmu::Constants::TYPE_WORLD_SIZE; ++indexMain) {
for (int16 indexMain = SLOT_BEGIN; indexMain < EQEmu::constants::TYPE_WORLD_SIZE; ++indexMain) {
inst_main = objectTradeskill->GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
@@ -2730,9 +2730,9 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), "WorldSlot: %i, Item: %i (%s), Charges: %i",
(EQEmu::Constants::WORLD_BEGIN + indexMain), ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
(EQEmu::constants::WORLD_BEGIN + indexMain), ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -3140,7 +3140,7 @@ void command_listpetition(Client *c, const Seperator *sep)
void command_equipitem(Client *c, const Seperator *sep)
{
uint32 slot_id = atoi(sep->arg[1]);
if (sep->IsNumber(1) && ((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::Constants::EQUIPMENT_END) || (slot_id == SlotPowerSource))) {
if (sep->IsNumber(1) && ((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::constants::EQUIPMENT_END) || (slot_id == SlotPowerSource))) {
const ItemInst* from_inst = c->GetInv().GetItem(SlotCursor);
const ItemInst* to_inst = c->GetInv().GetItem(slot_id); // added (desync issue when forcing stack to stack)
bool partialmove = false;
@@ -4341,8 +4341,8 @@ void command_iteminfo(Client *c, const Seperator *sep)
c->Message(13, "Error: This item has no data reference");
}
EQEmu::SayLink::impl linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemInst);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemInst);
linker.SetItemInst(inst);
auto item_link = linker.GenerateLink();
@@ -5491,9 +5491,9 @@ void command_summonitem(Client *c, const Seperator *sep)
std::string cmd_msg = sep->msg;
size_t link_open = cmd_msg.find('\x12');
size_t link_close = cmd_msg.find_last_of('\x12');
if (link_open != link_close && (cmd_msg.length() - link_open) > EQEmu::Constants::TEXT_LINK_BODY_LENGTH) {
EQEmu::SayLink::SayLinkBody_Struct link_body;
EQEmu::SayLink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::Constants::TEXT_LINK_BODY_LENGTH));
if (link_open != link_close && (cmd_msg.length() - link_open) > EQEmu::constants::TEXT_LINK_BODY_LENGTH) {
EQEmu::saylink::SayLinkBody_Struct link_body;
EQEmu::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::constants::TEXT_LINK_BODY_LENGTH));
itemid = link_body.item_id;
}
else if (!sep->IsNumber(1)) {
@@ -5603,8 +5603,8 @@ void command_itemsearch(Client *c, const Seperator *sep)
const Item_Struct* item = nullptr;
std::string item_link;
EQEmu::SayLink::impl linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemData);
if (Seperator::IsNumber(search_criteria)) {
item = database.GetItem(atoi(search_criteria));
@@ -7114,7 +7114,7 @@ void command_path(Client *c, const Seperator *sep)
}
void Client::Undye() {
for (int cur_slot = EQEmu::Constants::MATERIAL_BEGIN; cur_slot <= EQEmu::Constants::MATERIAL_END; cur_slot++ ) {
for (int cur_slot = EQEmu::constants::MATERIAL_BEGIN; cur_slot <= EQEmu::constants::MATERIAL_END; cur_slot++ ) {
uint8 slot2=SlotConvert(cur_slot);
ItemInst* inst = m_inv.GetItem(slot2);
+23 -23
View File
@@ -328,7 +328,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
// to go into the regular slots on the player, out of bags
std::list<uint32> removed_list;
for(i = SLOT_BEGIN; i < EQEmu::Constants::TYPE_POSSESSIONS_SIZE; ++i) {
for(i = SLOT_BEGIN; i < EQEmu::constants::TYPE_POSSESSIONS_SIZE; ++i) {
if(i == SlotAmmo && client->GetClientVersion() >= ClientVersion::SoF) {
item = client->GetInv().GetItem(SlotPowerSource);
if (item != nullptr) {
@@ -410,9 +410,9 @@ void Corpse::MoveItemToCorpse(Client *client, ItemInst *inst, int16 equipSlot, s
while (true) {
if (!inst->IsType(ItemClassContainer)) { break; }
if (equipSlot < EQEmu::Constants::GENERAL_BEGIN || equipSlot > SlotCursor) { break; }
if (equipSlot < EQEmu::constants::GENERAL_BEGIN || equipSlot > SlotCursor) { break; }
for (auto sub_index = SUB_BEGIN; sub_index < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++sub_index) {
for (auto sub_index = SUB_INDEX_BEGIN; sub_index < EQEmu::constants::ITEM_CONTAINER_SIZE; ++sub_index) {
int16 real_bag_slot = Inventory::CalcSlotId(equipSlot, sub_index);
auto bag_inst = client->GetInv().GetItem(real_bag_slot);
if (bag_inst == nullptr) { continue; }
@@ -693,7 +693,7 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct**
}
if (sitem && bag_item_data && Inventory::SupportsContainers(sitem->equip_slot)) {
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, SUB_BEGIN);
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, SUB_INDEX_BEGIN);
cur = itemlist.begin();
end = itemlist.end();
@@ -985,7 +985,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
if(inst) {
if (item->RecastDelay)
inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0);
client->SendItemPacket(EQEmu::Constants::CORPSE_BEGIN, inst, ItemPacketLoot);
client->SendItemPacket(EQEmu::constants::CORPSE_BEGIN, inst, ItemPacketLoot);
safe_delete(inst);
}
else { client->Message(13, "Could not find item number %i to send!!", GetPlayerKillItem()); }
@@ -1000,7 +1000,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
cur = itemlist.begin();
end = itemlist.end();
int corpselootlimit = EQEmu::Limits::InventoryMapSize(TypeCorpse, client->GetClientVersion());
int corpselootlimit = EQEmu::limits::InventoryMapSize(TypeCorpse, client->GetClientVersion());
for(; cur != end; ++cur) {
ServerLootItem_Struct* item_data = *cur;
@@ -1019,7 +1019,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
if (item->RecastDelay)
inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0);
// SlotGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = SlotGeneral1 + SlotCursor
client->SendItemPacket(i + EQEmu::Constants::CORPSE_BEGIN, inst, ItemPacketLoot);
client->SendItemPacket(i + EQEmu::constants::CORPSE_BEGIN, inst, ItemPacketLoot);
safe_delete(inst);
}
@@ -1119,10 +1119,10 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
item = database.GetItem(GetPlayerKillItem());
}
else if (GetPlayerKillItem() == -1 || GetPlayerKillItem() == 1){
item_data = GetItem(lootitem->slot_id - EQEmu::Constants::CORPSE_BEGIN); //dont allow them to loot entire bags of items as pvp reward
item_data = GetItem(lootitem->slot_id - EQEmu::constants::CORPSE_BEGIN); //dont allow them to loot entire bags of items as pvp reward
}
else{
item_data = GetItem(lootitem->slot_id - EQEmu::Constants::CORPSE_BEGIN, bag_item_data);
item_data = GetItem(lootitem->slot_id - EQEmu::constants::CORPSE_BEGIN, bag_item_data);
}
if (GetPlayerKillItem()<=1 && item_data != 0) {
@@ -1148,7 +1148,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
}
if (inst->IsAugmented()) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
ItemInst *itm = inst->GetAugment(i);
if (itm) {
if (client->CheckLoreConflict(itm->GetItem())) {
@@ -1210,7 +1210,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
/* Remove Bag Contents */
if (item->ItemClass == ItemClassContainer && (GetPlayerKillItem() != -1 || GetPlayerKillItem() != 1)) {
for (int i = SUB_BEGIN; i < EQEmu::Constants::ITEM_CONTAINER_SIZE; i++) {
for (int i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) {
if (bag_item_data[i]) {
/* Delete needs to be before RemoveItem because its deletes the pointer for item_data/bag_item_data */
database.DeleteItemOffCharacterCorpse(this->corpse_db_id, bag_item_data[i]->equip_slot, bag_item_data[i]->item_id);
@@ -1225,8 +1225,8 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
}
/* Send message with item link to groups and such */
EQEmu::SayLink::impl linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemInst);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemInst);
linker.SetItemInst(inst);
auto item_link = linker.GenerateLink();
@@ -1294,13 +1294,13 @@ void Corpse::QueryLoot(Client* to) {
cur = itemlist.begin();
end = itemlist.end();
int corpselootlimit = EQEmu::Limits::InventoryMapSize(TypeCorpse, to->GetClientVersion());
int corpselootlimit = EQEmu::limits::InventoryMapSize(TypeCorpse, to->GetClientVersion());
for(; cur != end; ++cur) {
ServerLootItem_Struct* sitem = *cur;
if (IsPlayerCorpse()) {
if (sitem->equip_slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::Constants::CURSOR_BAG_END)
if (sitem->equip_slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::constants::CURSOR_BAG_END)
sitem->lootslot = 0xFFFF;
else
x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF;
@@ -1402,7 +1402,7 @@ void Corpse::Spawn() {
uint32 Corpse::GetEquipment(uint8 material_slot) const {
int16 invslot;
if(material_slot > EQEmu::Constants::MATERIAL_END) {
if(material_slot > EQEmu::constants::MATERIAL_END) {
return NO_ITEM;
}
@@ -1416,7 +1416,7 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const {
uint32 Corpse::GetEquipmentColor(uint8 material_slot) const {
const Item_Struct *item;
if(material_slot > EQEmu::Constants::MATERIAL_END) {
if(material_slot > EQEmu::constants::MATERIAL_END) {
return 0;
}
@@ -1436,19 +1436,19 @@ void Corpse::UpdateEquipmentLight()
m_Light.Level.Equipment = 0;
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
if (((*iter)->equip_slot < EQEmu::Constants::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::Constants::EQUIPMENT_END) && (*iter)->equip_slot != SlotPowerSource) { continue; }
if (((*iter)->equip_slot < EQEmu::constants::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::constants::EQUIPMENT_END) && (*iter)->equip_slot != SlotPowerSource) { continue; }
if ((*iter)->equip_slot == SlotAmmo) { continue; }
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
if (EQEmu::LightSource::IsLevelGreater(item->Light, m_Light.Type.Equipment))
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment))
m_Light.Type.Equipment = item->Light;
}
uint8 general_light_type = 0;
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
if ((*iter)->equip_slot < EQEmu::Constants::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::Constants::GENERAL_END) { continue; }
if ((*iter)->equip_slot < EQEmu::constants::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::constants::GENERAL_END) { continue; }
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
@@ -1456,14 +1456,14 @@ void Corpse::UpdateEquipmentLight()
if (item->ItemClass != ItemClassCommon) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (EQEmu::LightSource::TypeToLevel(item->Light))
if (EQEmu::lightsource::TypeToLevel(item->Light))
general_light_type = item->Light;
}
if (EQEmu::LightSource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
m_Light.Type.Equipment = general_light_type;
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
}
void Corpse::AddLooter(Mob* who) {
+1 -1
View File
@@ -258,7 +258,7 @@ void Client::GoFish()
Bait = m_inv.GetItem(bslot);
//if the bait isnt equipped, need to add its skill bonus
if (bslot >= EQEmu::Constants::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == SkillFishing) {
if (bslot >= EQEmu::constants::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == SkillFishing) {
fishing_skill += Bait->GetItem()->SkillModValue;
}
+106 -106
View File
@@ -35,7 +35,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
int i;
if(where_to_check & invWhereWorn) {
for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++) {
for (i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) {
@@ -75,7 +75,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
DeleteItemInInventory(SlotCursor, 0, true);
}
for (i = EQEmu::Constants::CURSOR_BAG_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++) {
for (i = EQEmu::constants::CURSOR_BAG_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) {
@@ -90,7 +90,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
}
if(where_to_check & invWherePersonal) {
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) {
for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) {
@@ -103,7 +103,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
}
}
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_END; i++) {
for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) {
@@ -118,7 +118,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
}
if(where_to_check & invWhereBank) {
for (i = EQEmu::Constants::BANK_BEGIN; i <= EQEmu::Constants::BANK_END; i++) {
for (i = EQEmu::constants::BANK_BEGIN; i <= EQEmu::constants::BANK_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) {
@@ -131,7 +131,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
}
}
for (i = EQEmu::Constants::BANK_BAGS_BEGIN; i <= EQEmu::Constants::BANK_BAGS_END; i++) {
for (i = EQEmu::constants::BANK_BAGS_BEGIN; i <= EQEmu::constants::BANK_BAGS_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) {
@@ -146,7 +146,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
}
if(where_to_check & invWhereSharedBank) {
for (i = EQEmu::Constants::SHARED_BANK_BEGIN; i <= EQEmu::Constants::SHARED_BANK_END; i++) {
for (i = EQEmu::constants::SHARED_BANK_BEGIN; i <= EQEmu::constants::SHARED_BANK_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) {
@@ -159,7 +159,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
}
}
for (i = EQEmu::Constants::SHARED_BANK_BAGS_BEGIN; i <= EQEmu::Constants::SHARED_BANK_BAGS_END; i++) {
for (i = EQEmu::constants::SHARED_BANK_BAGS_BEGIN; i <= EQEmu::constants::SHARED_BANK_BAGS_END; i++) {
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
cur = m_inv.GetItem(i);
if(cur && cur->GetItem()->Stackable) {
@@ -236,7 +236,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
}
*/
uint32 augments[EQEmu::Constants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 };
uint32 augments[EQEmu::constants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 };
uint32 classes = item->Classes;
uint32 races = item->Races;
@@ -246,7 +246,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
bool enforcerestr = RuleB(Inventory, EnforceAugmentRestriction);
bool enforceusable = RuleB(Inventory, EnforceAugmentUsability);
for (int iter = AUG_BEGIN; iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++iter) {
for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) {
const Item_Struct* augtest = database.GetItem(augments[iter]);
if(augtest == nullptr) {
@@ -540,7 +540,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
}
// add any validated augments
for (int iter = AUG_BEGIN; iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++iter) {
for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) {
if(augments[iter])
inst->PutAugment(&database, iter, augments[iter]);
}
@@ -583,7 +583,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
DiscoverItem(item_id);
/*
// Augments should have been discovered prior to being placed on an item.
for (int iter = AUG_BEGIN; iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++iter) {
for (int iter = AUG_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) {
if(augments[iter] && !IsDiscovered(augments[iter]))
DiscoverItem(augments[iter]);
}
@@ -761,7 +761,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
qsaudit->items[parent_offset].aug_5 = m_inv[slot_id]->GetAugmentItemID(5);
if(m_inv[slot_id]->IsType(ItemClassContainer)) {
for(uint8 bag_idx = SUB_BEGIN; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) {
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) {
ItemInst* bagitem = m_inv[slot_id]->GetItem(bag_idx);
if(bagitem) {
@@ -906,7 +906,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI
}
if (bag_item_data) {
for (int index = 0; index < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++index) {
for (int index = 0; index < EQEmu::constants::ITEM_CONTAINER_SIZE; ++index) {
if (bag_item_data[index] == nullptr)
continue;
@@ -951,7 +951,7 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur
return false;
int16 i;
uint32 item_id = item->GetItem()->ID;
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) {
for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
ItemInst* tmp_inst = m_inv.GetItem(i);
if(tmp_inst && tmp_inst->GetItem()->ID == item_id && tmp_inst->GetCharges() < tmp_inst->GetItem()->StackSize){
MoveItemCharges(*item, i, type);
@@ -962,8 +962,8 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur
return true;
}
}
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) {
for (uint8 j = SUB_BEGIN; j < EQEmu::Constants::ITEM_CONTAINER_SIZE; j++) {
for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) {
uint16 slotid = Inventory::CalcSlotId(i, j);
ItemInst* tmp_inst = m_inv.GetItem(slotid);
@@ -988,8 +988,8 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
// #1: Try to auto equip
if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel<=level && (!inst.GetItem()->Attuneable || inst.IsAttuned()) && inst.GetItem()->ItemType != ItemTypeAugmentation) {
// too messy as-is... <watch>
for (int16 i = EQEmu::Constants::EQUIPMENT_BEGIN; i < SlotPowerSource; i++) { // originally (i < 22)
if (i == EQEmu::Constants::GENERAL_BEGIN) {
for (int16 i = EQEmu::constants::EQUIPMENT_BEGIN; i < SlotPowerSource; i++) { // originally (i < 22)
if (i == EQEmu::constants::GENERAL_BEGIN) {
// added power source check for SoF+ clients
if (this->GetClientVersion() >= ClientVersion::SoF)
i = SlotPowerSource;
@@ -1318,15 +1318,15 @@ void Client::SendLootItemInPacket(const ItemInst* inst, int16 slot_id)
bool Client::IsValidSlot(uint32 slot) {
if ((slot == (uint32)INVALID_INDEX) ||
(slot >= SLOT_BEGIN && slot < EQEmu::Constants::TYPE_POSSESSIONS_SIZE) ||
(slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && slot <= EQEmu::Constants::CURSOR_BAG_END) ||
(slot >= EQEmu::Constants::TRIBUTE_BEGIN && slot <= EQEmu::Constants::TRIBUTE_END) ||
(slot >= EQEmu::Constants::BANK_BEGIN && slot <= EQEmu::Constants::BANK_END) ||
(slot >= EQEmu::Constants::BANK_BAGS_BEGIN && slot <= EQEmu::Constants::BANK_BAGS_END) ||
(slot >= EQEmu::Constants::SHARED_BANK_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_END) ||
(slot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_BAGS_END) ||
(slot >= EQEmu::Constants::TRADE_BEGIN && slot <= EQEmu::Constants::TRADE_END) ||
(slot >= EQEmu::Constants::WORLD_BEGIN && slot <= EQEmu::Constants::WORLD_END) ||
(slot >= SLOT_BEGIN && slot < EQEmu::constants::TYPE_POSSESSIONS_SIZE) ||
(slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && slot <= EQEmu::constants::CURSOR_BAG_END) ||
(slot >= EQEmu::constants::TRIBUTE_BEGIN && slot <= EQEmu::constants::TRIBUTE_END) ||
(slot >= EQEmu::constants::BANK_BEGIN && slot <= EQEmu::constants::BANK_END) ||
(slot >= EQEmu::constants::BANK_BAGS_BEGIN && slot <= EQEmu::constants::BANK_BAGS_END) ||
(slot >= EQEmu::constants::SHARED_BANK_BEGIN && slot <= EQEmu::constants::SHARED_BANK_END) ||
(slot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::constants::SHARED_BANK_BAGS_END) ||
(slot >= EQEmu::constants::TRADE_BEGIN && slot <= EQEmu::constants::TRADE_END) ||
(slot >= EQEmu::constants::WORLD_BEGIN && slot <= EQEmu::constants::WORLD_END) ||
(slot == SlotPowerSource)
) {
return true;
@@ -1338,10 +1338,10 @@ bool Client::IsValidSlot(uint32 slot) {
bool Client::IsBankSlot(uint32 slot)
{
if ((slot >= EQEmu::Constants::BANK_BEGIN && slot <= EQEmu::Constants::BANK_END) ||
(slot >= EQEmu::Constants::BANK_BAGS_BEGIN && slot <= EQEmu::Constants::BANK_BAGS_END) ||
(slot >= EQEmu::Constants::SHARED_BANK_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_END) ||
(slot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_BAGS_END))
if ((slot >= EQEmu::constants::BANK_BEGIN && slot <= EQEmu::constants::BANK_END) ||
(slot >= EQEmu::constants::BANK_BAGS_BEGIN && slot <= EQEmu::constants::BANK_BAGS_END) ||
(slot >= EQEmu::constants::SHARED_BANK_BEGIN && slot <= EQEmu::constants::SHARED_BANK_END) ||
(slot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::constants::SHARED_BANK_BAGS_END))
{
return true;
}
@@ -1475,13 +1475,13 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
uint32 dstbagid = 0;
//if (src_slot_id >= 250 && src_slot_id < 330) {
if (src_slot_id >= EQEmu::Constants::GENERAL_BAGS_BEGIN && src_slot_id <= EQEmu::Constants::GENERAL_BAGS_END) {
if (src_slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && src_slot_id <= EQEmu::constants::GENERAL_BAGS_END) {
srcbag = m_inv.GetItem(((int)(src_slot_id / 10)) - 3);
if (srcbag)
srcbagid = srcbag->GetItem()->ID;
}
//if (dst_slot_id >= 250 && dst_slot_id < 330) {
if (dst_slot_id >= EQEmu::Constants::GENERAL_BAGS_BEGIN && dst_slot_id <= EQEmu::Constants::GENERAL_BAGS_END) {
if (dst_slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && dst_slot_id <= EQEmu::constants::GENERAL_BAGS_END) {
dstbag = m_inv.GetItem(((int)(dst_slot_id / 10)) - 3);
if (dstbag)
dstbagid = dstbag->GetItem()->ID;
@@ -1494,7 +1494,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
// Step 2: Validate item in from_slot
// After this, we can assume src_inst is a valid ptr
if (!src_inst && (src_slot_id < EQEmu::Constants::WORLD_BEGIN || src_slot_id > EQEmu::Constants::WORLD_END)) {
if (!src_inst && (src_slot_id < EQEmu::constants::WORLD_BEGIN || src_slot_id > EQEmu::constants::WORLD_END)) {
if (dst_inst) {
// If there is no source item, but there is a destination item,
// move the slots around before deleting the invalid source slot item,
@@ -1508,14 +1508,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
return false;
}
//verify shared bank transactions in the database
if(src_inst && src_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END) {
if(src_inst && src_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) {
if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) {
Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name);
DeleteItemInInventory(dst_slot_id,0,true);
return(false);
}
if(src_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::Constants::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){
for (uint8 idx = SUB_BEGIN; idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) {
if(src_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::constants::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){
for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) {
const ItemInst* baginst = src_inst->GetItem(idx);
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(src_slot_id, idx), baginst)){
DeleteItemInInventory(Inventory::CalcSlotId(src_slot_id, idx),0,false);
@@ -1523,14 +1523,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
}
}
if(dst_inst && dst_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END) {
if(dst_inst && dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) {
if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) {
Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name);
DeleteItemInInventory(src_slot_id,0,true);
return(false);
}
if(dst_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::Constants::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){
for (uint8 idx = SUB_BEGIN; idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) {
if(dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){
for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) {
const ItemInst* baginst = dst_inst->GetItem(idx);
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(dst_slot_id, idx), baginst)){
DeleteItemInInventory(Inventory::CalcSlotId(dst_slot_id, idx),0,false);
@@ -1542,8 +1542,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
// Check for No Drop Hacks
Mob* with = trade->With();
if (((with && with->IsClient() && dst_slot_id >= EQEmu::Constants::TRADE_BEGIN && dst_slot_id <= EQEmu::Constants::TRADE_END) ||
(dst_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END))
if (((with && with->IsClient() && dst_slot_id >= EQEmu::constants::TRADE_BEGIN && dst_slot_id <= EQEmu::constants::TRADE_END) ||
(dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END))
&& GetInv().CheckNoDrop(src_slot_id)
&& RuleI(World, FVNoDropFlag) == 0 || RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2) {
auto ndh_inst = m_inv[src_slot_id];
@@ -1573,7 +1573,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
// Step 3: Check for interaction with World Container (tradeskills)
if(m_tradeskill_object != nullptr) {
if (src_slot_id >= EQEmu::Constants::WORLD_BEGIN && src_slot_id <= EQEmu::Constants::WORLD_END) {
if (src_slot_id >= EQEmu::constants::WORLD_BEGIN && src_slot_id <= EQEmu::constants::WORLD_END) {
// Picking up item from world container
ItemInst* inst = m_tradeskill_object->PopItem(Inventory::CalcBagIdx(src_slot_id));
if (inst) {
@@ -1585,7 +1585,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
return true;
}
else if (dst_slot_id >= EQEmu::Constants::WORLD_BEGIN && dst_slot_id <= EQEmu::Constants::WORLD_END) {
else if (dst_slot_id >= EQEmu::constants::WORLD_BEGIN && dst_slot_id <= EQEmu::constants::WORLD_END) {
// Putting item into world container, which may swap (or pile onto) with existing item
uint8 world_idx = Inventory::CalcBagIdx(dst_slot_id);
ItemInst* world_inst = m_tradeskill_object->PopItem(world_idx);
@@ -1658,7 +1658,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
// Step 4: Check for entity trade
if (dst_slot_id >= EQEmu::Constants::TRADE_BEGIN && dst_slot_id <= EQEmu::Constants::TRADE_END) {
if (dst_slot_id >= EQEmu::constants::TRADE_BEGIN && dst_slot_id <= EQEmu::constants::TRADE_END) {
if (src_slot_id != SlotCursor) {
Kick();
return false;
@@ -1751,12 +1751,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
else {
// Not dealing with charges - just do direct swap
if(src_inst && (dst_slot_id <= EQEmu::Constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) && dst_slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN) {
if(src_inst && (dst_slot_id <= EQEmu::constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) && dst_slot_id >= EQEmu::constants::EQUIPMENT_BEGIN) {
if (src_inst->GetItem()->Attuneable) {
src_inst->SetAttuned(true);
}
if (src_inst->IsAugmented()) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
if (src_inst->GetAugment(i)) {
if (src_inst->GetAugment(i)->GetItem()->Attuneable) {
src_inst->GetAugment(i)->SetAttuned(true);
@@ -1769,7 +1769,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; }
Log.Out(Logs::Detail, Logs::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id);
if(src_slot_id <= EQEmu::Constants::EQUIPMENT_END || src_slot_id == SlotPowerSource) {
if(src_slot_id <= EQEmu::constants::EQUIPMENT_END || src_slot_id == SlotPowerSource) {
if(src_inst) {
parse->EventItem(EVENT_UNEQUIP_ITEM, this, src_inst, nullptr, "", src_slot_id);
}
@@ -1779,7 +1779,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
}
if(dst_slot_id <= EQEmu::Constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) {
if(dst_slot_id <= EQEmu::constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) {
if(dst_inst) {
parse->EventItem(EVENT_UNEQUIP_ITEM, this, dst_inst, nullptr, "", dst_slot_id);
}
@@ -1791,7 +1791,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
int matslot = SlotConvert2(dst_slot_id);
if (dst_slot_id <= EQEmu::Constants::EQUIPMENT_END && matslot != MaterialHead) { // think this is to allow the client to update with /showhelm
if (dst_slot_id <= EQEmu::constants::EQUIPMENT_END && matslot != MaterialHead) { // think this is to allow the client to update with /showhelm
SendWearChange(matslot);
}
@@ -1833,7 +1833,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
Log.Out(Logs::Detail, Logs::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot);
Message(15, "Inventory Desyncronization detected: Resending slot data...");
if((move_slots->from_slot >= EQEmu::Constants::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::Constants::CURSOR_BAG_END) || move_slots->from_slot == SlotPowerSource) {
if((move_slots->from_slot >= EQEmu::constants::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::constants::CURSOR_BAG_END) || move_slots->from_slot == SlotPowerSource) {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : Inventory::CalcSlotId(move_slots->from_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
// This prevents the client from crashing when closing any 'phantom' bags
@@ -1876,7 +1876,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); }
}
if((move_slots->to_slot >= EQEmu::Constants::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::Constants::CURSOR_BAG_END) || move_slots->to_slot == SlotPowerSource) {
if((move_slots->to_slot >= EQEmu::constants::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::constants::CURSOR_BAG_END) || move_slots->to_slot == SlotPowerSource) {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : Inventory::CalcSlotId(move_slots->to_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
@@ -1957,7 +1957,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
qsaudit->items[move_count++].aug_5 = from_inst->GetAugmentItemID(5);
if(from_inst->IsType(ItemClassContainer)) {
for(uint8 bag_idx = SUB_BEGIN; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) {
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) {
const ItemInst* from_baginst = from_inst->GetItem(bag_idx);
if(from_baginst) {
@@ -1990,7 +1990,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
qsaudit->items[move_count++].aug_5 = to_inst->GetAugmentItemID(5);
if(to_inst->IsType(ItemClassContainer)) {
for(uint8 bag_idx = SUB_BEGIN; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) {
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) {
const ItemInst* to_baginst = to_inst->GetItem(bag_idx);
if(to_baginst) {
@@ -2019,7 +2019,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
void Client::DyeArmor(DyeStruct* dye){
int16 slot=0;
for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_TINT_END; i++) {
for (int i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_TINT_END; i++) {
if ((m_pp.item_tint[i].Color & 0x00FFFFFF) != (dye->dye[i].Color & 0x00FFFFFF)) {
slot = m_inv.HasItem(32557, 1, invWherePersonal);
if (slot != INVALID_INDEX){
@@ -2058,7 +2058,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) {
const Item_Struct* TempItem = 0;
ItemInst* ins;
int x;
for(x=EQEmu::Constants::POSSESSIONS_BEGIN; x <= EQEmu::Constants::POSSESSIONS_END; x++)
for(x=EQEmu::constants::POSSESSIONS_BEGIN; x <= EQEmu::constants::POSSESSIONS_END; x++)
{
TempItem = 0;
ins = GetInv().GetItem(x);
@@ -2080,7 +2080,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) {
return true;
}
}
for(x=EQEmu::Constants::GENERAL_BAGS_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++)
for(x=EQEmu::constants::GENERAL_BAGS_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++)
{
TempItem = 0;
ins = GetInv().GetItem(x);
@@ -2111,10 +2111,10 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
ItemInst* ins = nullptr;
int x;
int num = 0;
for(x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++)
for(x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++)
{
if (x == SlotCursor + 1)
x = EQEmu::Constants::GENERAL_BAGS_BEGIN;
x = EQEmu::constants::GENERAL_BAGS_BEGIN;
TempItem = nullptr;
ins = GetInv().GetItem(x);
if (ins)
@@ -2128,10 +2128,10 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
}
if (num < amt)
return false;
for(x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END?
for(x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END?
{
if (x == SlotCursor + 1)
x = EQEmu::Constants::GENERAL_BAGS_BEGIN;
x = EQEmu::constants::GENERAL_BAGS_BEGIN;
TempItem = nullptr;
ins = GetInv().GetItem(x);
if (ins)
@@ -2227,7 +2227,7 @@ static bool CopyBagContents(ItemInst* new_bag, const ItemInst* old_bag)
void Client::DisenchantSummonedBags(bool client_update)
{
for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) {
auto inst = m_inv[slot_id];
if (!inst) { continue; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
@@ -2248,7 +2248,7 @@ void Client::DisenchantSummonedBags(bool client_update)
safe_delete(new_inst);
}
for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) {
auto inst = m_inv[slot_id];
if (!inst) { continue; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
@@ -2269,7 +2269,7 @@ void Client::DisenchantSummonedBags(bool client_update)
safe_delete(new_inst);
}
for (auto slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; ++slot_id) {
auto inst = m_inv[slot_id];
if (!inst) { continue; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
@@ -2338,7 +2338,7 @@ void Client::DisenchantSummonedBags(bool client_update)
void Client::RemoveNoRent(bool client_update)
{
for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::EQUIPMENT_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) {
auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@@ -2346,7 +2346,7 @@ void Client::RemoveNoRent(bool client_update)
}
}
for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) {
auto inst = m_inv[slot_id];
if (inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@@ -2362,7 +2362,7 @@ void Client::RemoveNoRent(bool client_update)
}
}
for (auto slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::CURSOR_BAG_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::CURSOR_BAG_END; ++slot_id) {
auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@@ -2370,7 +2370,7 @@ void Client::RemoveNoRent(bool client_update)
}
}
for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) {
auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@@ -2378,7 +2378,7 @@ void Client::RemoveNoRent(bool client_update)
}
}
for (auto slot_id = EQEmu::Constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::BANK_BAGS_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::BANK_BAGS_END; ++slot_id) {
auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@@ -2386,7 +2386,7 @@ void Client::RemoveNoRent(bool client_update)
}
}
for (auto slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; ++slot_id) {
auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@@ -2394,7 +2394,7 @@ void Client::RemoveNoRent(bool client_update)
}
}
for (auto slot_id = EQEmu::Constants::SHARED_BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::SHARED_BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END; ++slot_id) {
auto inst = m_inv[slot_id];
if(inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
@@ -2432,7 +2432,7 @@ void Client::RemoveNoRent(bool client_update)
// Two new methods to alleviate perpetual login desyncs
void Client::RemoveDuplicateLore(bool client_update)
{
for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::EQUIPMENT_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) {
auto inst = m_inv.PopItem(slot_id);
if (inst == nullptr) { continue; }
if(CheckLoreConflict(inst->GetItem())) {
@@ -2445,7 +2445,7 @@ void Client::RemoveDuplicateLore(bool client_update)
safe_delete(inst);
}
for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) {
auto inst = m_inv.PopItem(slot_id);
if (inst == nullptr) { continue; }
if (CheckLoreConflict(inst->GetItem())) {
@@ -2472,7 +2472,7 @@ void Client::RemoveDuplicateLore(bool client_update)
}
}
for (auto slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::CURSOR_BAG_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::CURSOR_BAG_END; ++slot_id) {
auto inst = m_inv.PopItem(slot_id);
if (inst == nullptr) { continue; }
if(CheckLoreConflict(inst->GetItem())) {
@@ -2485,7 +2485,7 @@ void Client::RemoveDuplicateLore(bool client_update)
safe_delete(inst);
}
for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) {
auto inst = m_inv.PopItem(slot_id);
if (inst == nullptr) { continue; }
if(CheckLoreConflict(inst->GetItem())) {
@@ -2498,7 +2498,7 @@ void Client::RemoveDuplicateLore(bool client_update)
safe_delete(inst);
}
for (auto slot_id = EQEmu::Constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::BANK_BAGS_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::BANK_BAGS_END; ++slot_id) {
auto inst = m_inv.PopItem(slot_id);
if (inst == nullptr) { continue; }
if(CheckLoreConflict(inst->GetItem())) {
@@ -2559,7 +2559,7 @@ void Client::RemoveDuplicateLore(bool client_update)
void Client::MoveSlotNotAllowed(bool client_update)
{
for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::EQUIPMENT_END; ++slot_id) {
for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) {
if(m_inv[slot_id] && !m_inv[slot_id]->IsSlotAllowed(slot_id)) {
auto inst = m_inv.PopItem(slot_id);
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
@@ -2591,7 +2591,7 @@ uint32 Client::GetEquipment(uint8 material_slot) const
int16 invslot;
const ItemInst *item;
if(material_slot > EQEmu::Constants::MATERIAL_END)
if(material_slot > EQEmu::constants::MATERIAL_END)
{
return 0;
}
@@ -2629,7 +2629,7 @@ int32 Client::GetEquipmentMaterial(uint8 material_slot)
uint32 Client::GetEquipmentColor(uint8 material_slot) const
{
if (material_slot > EQEmu::Constants::MATERIAL_END)
if (material_slot > EQEmu::constants::MATERIAL_END)
return 0;
const Item_Struct *item = database.GetItem(GetEquipment(material_slot));
@@ -2780,7 +2780,7 @@ void Client::SetBandolier(const EQApplicationPacket *app)
slot = SlotCursor;
}
else if (m_inv.GetItem(SlotCursor)->GetItem()->ItemClass == 1) {
for(int16 CursorBagSlot = EQEmu::Constants::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::Constants::CURSOR_BAG_END; CursorBagSlot++) {
for(int16 CursorBagSlot = EQEmu::constants::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::constants::CURSOR_BAG_END; CursorBagSlot++) {
if (m_inv.GetItem(CursorBagSlot)) {
if (m_inv.GetItem(CursorBagSlot)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID &&
m_inv.GetItem(CursorBagSlot)->GetCharges() >= 1) { // ditto
@@ -2926,7 +2926,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
//
if(ItemToReturn->IsStackable()) {
for (int16 i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving.
for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving.
ItemInst* InvItem = m_inv.GetItem(i);
@@ -2952,12 +2952,12 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
//
if (InvItem && InvItem->IsType(ItemClassContainer)) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_BEGIN);
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
uint8 BagSize=InvItem->GetItem()->BagSlots;
uint8 BagSlot;
for (BagSlot = SUB_BEGIN; BagSlot < BagSize; BagSlot++) {
for (BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
InvItem = m_inv.GetItem(BaseSlotID + BagSlot);
if (InvItem && (InvItem->GetItem()->ID == ItemID) &&
(InvItem->GetCharges() < InvItem->GetItem()->StackSize)) {
@@ -2985,7 +2985,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
// We have tried stacking items, now just try and find an empty slot.
for (int16 i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor.
for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor.
ItemInst* InvItem = m_inv.GetItem(i);
@@ -3004,11 +3004,11 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
}
if(InvItem->IsType(ItemClassContainer) && Inventory::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_BEGIN);
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
uint8 BagSize=InvItem->GetItem()->BagSlots;
for (uint8 BagSlot = SUB_BEGIN; BagSlot < BagSize; BagSlot++) {
for (uint8 BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
InvItem = m_inv.GetItem(BaseSlotID + BagSlot);
@@ -3046,27 +3046,27 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
std::map<int16, const ItemInst*> instmap;
// build reference map
for (int16 index = SLOT_BEGIN; index < EQEmu::Constants::TYPE_POSSESSIONS_SIZE; ++index) {
for (int16 index = SLOT_BEGIN; index < EQEmu::constants::TYPE_POSSESSIONS_SIZE; ++index) {
auto inst = m_inv[index];
if (inst == nullptr) { continue; }
instmap[index] = inst;
}
for (int16 index = EQEmu::Constants::TRIBUTE_BEGIN; index <= EQEmu::Constants::TRIBUTE_END; ++index) {
for (int16 index = EQEmu::constants::TRIBUTE_BEGIN; index <= EQEmu::constants::TRIBUTE_END; ++index) {
auto inst = m_inv[index];
if (inst == nullptr) { continue; }
instmap[index] = inst;
}
for (int16 index = EQEmu::Constants::BANK_BEGIN; index <= EQEmu::Constants::BANK_END; ++index) {
for (int16 index = EQEmu::constants::BANK_BEGIN; index <= EQEmu::constants::BANK_END; ++index) {
auto inst = m_inv[index];
if (inst == nullptr) { continue; }
instmap[index] = inst;
}
for (int16 index = EQEmu::Constants::SHARED_BANK_BEGIN; index <= EQEmu::Constants::SHARED_BANK_END; ++index) {
for (int16 index = EQEmu::constants::SHARED_BANK_BEGIN; index <= EQEmu::constants::SHARED_BANK_END; ++index) {
auto inst = m_inv[index];
if (inst == nullptr) { continue; }
instmap[index] = inst;
}
for (int16 index = EQEmu::Constants::TRADE_BEGIN; index <= EQEmu::Constants::TRADE_END; ++index) {
for (int16 index = EQEmu::constants::TRADE_BEGIN; index <= EQEmu::constants::TRADE_END; ++index) {
auto inst = m_inv[index];
if (inst == nullptr) { continue; }
instmap[index] = inst;
@@ -3074,10 +3074,10 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
auto tsobject = GetTradeskillObject();
if (tsobject != nullptr) {
for (int16 index = SLOT_BEGIN; index < EQEmu::Constants::TYPE_WORLD_SIZE; ++index) {
for (int16 index = SLOT_BEGIN; index < EQEmu::constants::TYPE_WORLD_SIZE; ++index) {
auto inst = tsobject->GetItem(index);
if (inst == nullptr) { continue; }
instmap[EQEmu::Constants::WORLD_BEGIN + index] = inst;
instmap[EQEmu::constants::WORLD_BEGIN + index] = inst;
}
}
@@ -3149,7 +3149,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
}
else {
if (inst) {
for (int16 sub = SUB_BEGIN; (sub < EQEmu::Constants::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any ItemInst as having the max internal slots available
for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::constants::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any ItemInst as having the max internal slots available
if (inst->GetItem(sub))
InterrogateInventory_(true, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1);
}
@@ -3179,7 +3179,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
}
if (inst) {
for (int16 sub = SUB_BEGIN; (sub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++sub) {
for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++sub) {
if (inst->GetItem(sub))
InterrogateInventory_(false, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1);
}
@@ -3194,9 +3194,9 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
// very basic error checking - can be elaborated upon if more in-depth testing is needed...
if (
(head >= EQEmu::Constants::EQUIPMENT_BEGIN && head <= EQEmu::Constants::EQUIPMENT_END) ||
(head >= EQEmu::Constants::TRIBUTE_BEGIN && head <= EQEmu::Constants::TRIBUTE_END) ||
(head >= EQEmu::Constants::WORLD_BEGIN && head <= EQEmu::Constants::WORLD_END) ||
(head >= EQEmu::constants::EQUIPMENT_BEGIN && head <= EQEmu::constants::EQUIPMENT_END) ||
(head >= EQEmu::constants::TRIBUTE_BEGIN && head <= EQEmu::constants::TRIBUTE_END) ||
(head >= EQEmu::constants::WORLD_BEGIN && head <= EQEmu::constants::WORLD_END) ||
(head >= 8000 && head <= 8101) ||
(head == SlotPowerSource)) {
switch (depth)
@@ -3210,7 +3210,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
return true;
if (!parent->IsType(ItemClassCommon))
return true;
if (index >= EQEmu::Constants::ITEM_COMMON_SIZE)
if (index >= EQEmu::constants::ITEM_COMMON_SIZE)
return true;
break;
default: // requirement: none (something bad happened...)
@@ -3218,11 +3218,11 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
}
}
else if (
(head >= EQEmu::Constants::GENERAL_BEGIN && head <= EQEmu::Constants::GENERAL_END) ||
(head >= EQEmu::constants::GENERAL_BEGIN && head <= EQEmu::constants::GENERAL_END) ||
(head == SlotCursor) ||
(head >= EQEmu::Constants::BANK_BEGIN && head <= EQEmu::Constants::BANK_END) ||
(head >= EQEmu::Constants::SHARED_BANK_BEGIN && head <= EQEmu::Constants::SHARED_BANK_END) ||
(head >= EQEmu::Constants::TRADE_BEGIN && head <= EQEmu::Constants::TRADE_END)) {
(head >= EQEmu::constants::BANK_BEGIN && head <= EQEmu::constants::BANK_END) ||
(head >= EQEmu::constants::SHARED_BANK_BEGIN && head <= EQEmu::constants::SHARED_BANK_END) ||
(head >= EQEmu::constants::TRADE_BEGIN && head <= EQEmu::constants::TRADE_END)) {
switch (depth)
{
case 0: // requirement: inst is extant
@@ -3239,7 +3239,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
if (parent->IsType(ItemClassCommon)) {
if (!(inst->GetItem()->AugType > 0))
return true;
if (index >= EQEmu::Constants::ITEM_COMMON_SIZE)
if (index >= EQEmu::constants::ITEM_COMMON_SIZE)
return true;
}
break;
@@ -3253,7 +3253,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
if (parent->IsType(ItemClassCommon)) {
if (!(inst->GetItem()->AugType > 0))
return true;
if (index >= EQEmu::Constants::ITEM_COMMON_SIZE)
if (index >= EQEmu::constants::ITEM_COMMON_SIZE)
return true;
}
break;
+1 -1
View File
@@ -272,7 +272,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
// it is an improvement.
if (!item2->NoPet) {
for (int i = 0; !found && i < EQEmu::Constants::EQUIPMENT_SIZE; i++) {
for (int i = 0; !found && i < EQEmu::constants::EQUIPMENT_SIZE; i++) {
uint32 slots = (1 << i);
if (item2->Slots & slots) {
if(equipment[i])
+6 -6
View File
@@ -1794,13 +1794,13 @@ luabind::scope lua_register_slot() {
luabind::value("General7", static_cast<int>(SlotGeneral7)),
luabind::value("General8", static_cast<int>(SlotGeneral8)),
luabind::value("Cursor", static_cast<int>(SlotCursor)),
luabind::value("PersonalBegin", static_cast<int>(EQEmu::Constants::GENERAL_BEGIN)), // deprecated
luabind::value("GeneralBegin", static_cast<int>(EQEmu::Constants::GENERAL_BEGIN)),
luabind::value("PersonalEnd", static_cast<int>(EQEmu::Constants::GENERAL_END)), // deprecated
luabind::value("GeneralEnd", static_cast<int>(EQEmu::Constants::GENERAL_END)),
luabind::value("PersonalBegin", static_cast<int>(EQEmu::constants::GENERAL_BEGIN)), // deprecated
luabind::value("GeneralBegin", static_cast<int>(EQEmu::constants::GENERAL_BEGIN)),
luabind::value("PersonalEnd", static_cast<int>(EQEmu::constants::GENERAL_END)), // deprecated
luabind::value("GeneralEnd", static_cast<int>(EQEmu::constants::GENERAL_END)),
luabind::value("CursorEnd", 0xFFFE), // deprecated
luabind::value("Tradeskill", static_cast<int>(EQEmu::Legacy::SLOT_TRADESKILL)), // deprecated
luabind::value("Augment", static_cast<int>(EQEmu::Legacy::SLOT_AUGMENT)), // deprecated
luabind::value("Tradeskill", static_cast<int>(EQEmu::legacy::SLOT_TRADESKILL)), // deprecated
luabind::value("Augment", static_cast<int>(EQEmu::legacy::SLOT_AUGMENT)), // deprecated
luabind::value("Invalid", INVALID_INDEX)
];
}
+8 -8
View File
@@ -2552,7 +2552,7 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) {
int16 focus_max_real = 0;
//item focus
for (int x = 0; x < EQEmu::Constants::EQUIPMENT_SIZE; ++x)
for (int x = 0; x < EQEmu::constants::EQUIPMENT_SIZE; ++x)
{
TempItem = nullptr;
if (equipment[x] == 0)
@@ -5026,7 +5026,7 @@ void Merc::UpdateMercAppearance() {
// Copied from Bot Code:
uint32 itemID = NO_ITEM;
uint8 materialFromSlot = MaterialInvalid;
for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) {
for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) {
itemID = equipment[i];
if(itemID != NO_ITEM) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
@@ -5044,15 +5044,15 @@ void Merc::UpdateEquipmentLight()
m_Light.Type.Equipment = 0;
m_Light.Level.Equipment = 0;
for (int index = SLOT_BEGIN; index < EQEmu::Constants::EQUIPMENT_SIZE; ++index) {
for (int index = SLOT_BEGIN; index < EQEmu::constants::EQUIPMENT_SIZE; ++index) {
if (index == SlotAmmo) { continue; }
auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; }
if (EQEmu::LightSource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
m_Light.Type.Equipment = item->Light;
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
}
}
@@ -5064,14 +5064,14 @@ void Merc::UpdateEquipmentLight()
if (item->ItemClass != ItemClassCommon) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (EQEmu::LightSource::TypeToLevel(item->Light))
if (EQEmu::lightsource::TypeToLevel(item->Light))
general_light_type = item->Light;
}
if (EQEmu::LightSource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
m_Light.Type.Equipment = general_light_type;
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
}
void Merc::AddItem(uint8 slot, uint32 item_id) {
+1 -1
View File
@@ -288,7 +288,7 @@ protected:
std::map<uint32,MercTimer> timers;
uint16 skills[HIGHEST_SKILL+1];
uint32 equipment[EQEmu::Constants::EQUIPMENT_SIZE]; //this is an array of item IDs
uint32 equipment[EQEmu::constants::EQUIPMENT_SIZE]; //this is an array of item IDs
uint16 d_melee_texture1; //this is an item Material value
uint16 d_melee_texture2; //this is an item Material value (offhand)
uint8 prim_melee_type; //Sets the Primary Weapon attack message and animation
+3 -3
View File
@@ -179,7 +179,7 @@ Mob::Mob(const char* in_name,
runspeed = 1.25f;
m_Light.Type.Innate = in_light;
m_Light.Level.Innate = EQEmu::LightSource::TypeToLevel(m_Light.Type.Innate);
m_Light.Level.Innate = EQEmu::lightsource::TypeToLevel(m_Light.Type.Innate);
m_Light.Level.Equipment = m_Light.Type.Equipment = 0;
m_Light.Level.Spell = m_Light.Type.Spell = 0;
m_Light.Type.Active = m_Light.Type.Innate;
@@ -2232,11 +2232,11 @@ bool Mob::UpdateActiveLight()
m_Light.Type.Active = 0;
m_Light.Level.Active = 0;
if (EQEmu::LightSource::IsLevelGreater((m_Light.Type.Innate & 0x0F), m_Light.Type.Active)) { m_Light.Type.Active = m_Light.Type.Innate; }
if (EQEmu::lightsource::IsLevelGreater((m_Light.Type.Innate & 0x0F), m_Light.Type.Active)) { m_Light.Type.Active = m_Light.Type.Innate; }
if (m_Light.Level.Equipment > m_Light.Level.Active) { m_Light.Type.Active = m_Light.Type.Equipment; } // limiter in property handler
if (m_Light.Level.Spell > m_Light.Level.Active) { m_Light.Type.Active = m_Light.Type.Spell; } // limiter in property handler
m_Light.Level.Active = EQEmu::LightSource::TypeToLevel(m_Light.Type.Active);
m_Light.Level.Active = EQEmu::lightsource::TypeToLevel(m_Light.Type.Active);
return (m_Light.Level.Active != old_light_level);
}
+4 -4
View File
@@ -364,7 +364,7 @@ public:
virtual inline uint16 GetBaseRace() const { return base_race; }
virtual inline uint8 GetBaseGender() const { return base_gender; }
virtual inline uint16 GetDeity() const { return deity; }
virtual inline EQEmu::Deity::TypeBits GetDeityBit() { return EQEmu::Deity::ConvertDeityToDeityBit((EQEmu::Deity::Types)deity); }
virtual EQEmu::deity::DeityTypeBit GetDeityBit() { return EQEmu::deity::ConvertDeityToDeityBit((EQEmu::deity::DeityType)deity); }
inline uint16 GetRace() const { return race; }
inline uint8 GetGender() const { return gender; }
inline uint8 GetTexture() const { return texture; }
@@ -708,12 +708,12 @@ public:
inline uint8 GetSpellLightType() { return m_Light.Type.Spell; }
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = 0; m_Light.Level.Equipment = 0; }
inline void SetSpellLightType(uint8 light_type) { m_Light.Type.Spell = (light_type & 0x0F); m_Light.Level.Spell = EQEmu::LightSource::TypeToLevel(m_Light.Type.Spell); }
inline void SetSpellLightType(uint8 light_type) { m_Light.Type.Spell = (light_type & 0x0F); m_Light.Level.Spell = EQEmu::lightsource::TypeToLevel(m_Light.Type.Spell); }
inline uint8 GetActiveLightType() { return m_Light.Type.Active; }
bool UpdateActiveLight(); // returns true if change, false if no change
EQEmu::LightSource::impl* GetLightProfile() { return &m_Light; }
EQEmu::lightsource::LightSourceProfile* GetLightProfile() { return &m_Light; }
Mob* GetPet();
void SetPet(Mob* newpet);
@@ -1185,7 +1185,7 @@ protected:
glm::vec4 m_Delta;
EQEmu::LightSource::impl m_Light;
EQEmu::lightsource::LightSourceProfile m_Light;
float fixedZ;
EmuAppearance _appearance;
+8 -8
View File
@@ -529,8 +529,8 @@ void NPC::QueryLoot(Client* to)
continue;
}
EQEmu::SayLink::impl linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemData);
linker.SetItemData(item);
auto item_link = linker.GenerateLink();
@@ -748,15 +748,15 @@ void NPC::UpdateEquipmentLight()
m_Light.Type.Equipment = 0;
m_Light.Level.Equipment = 0;
for (int index = SLOT_BEGIN; index < EQEmu::Constants::EQUIPMENT_SIZE; ++index) {
for (int index = SLOT_BEGIN; index < EQEmu::constants::EQUIPMENT_SIZE; ++index) {
if (index == SlotAmmo) { continue; }
auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; }
if (EQEmu::LightSource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
m_Light.Type.Equipment = item->Light;
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
}
}
@@ -768,14 +768,14 @@ void NPC::UpdateEquipmentLight()
if (item->ItemClass != ItemClassCommon) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (EQEmu::LightSource::TypeToLevel(item->Light))
if (EQEmu::lightsource::TypeToLevel(item->Light))
general_light_type = item->Light;
}
if (EQEmu::LightSource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
m_Light.Type.Equipment = general_light_type;
m_Light.Level.Equipment = EQEmu::LightSource::TypeToLevel(m_Light.Type.Equipment);
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
}
void NPC::Depop(bool StartSpawnTimer) {
+1 -1
View File
@@ -495,7 +495,7 @@ protected:
uint16 skills[HIGHEST_SKILL+1];
uint32 equipment[EQEmu::Constants::EQUIPMENT_SIZE]; //this is an array of item IDs
uint32 equipment[EQEmu::constants::EQUIPMENT_SIZE]; //this is an array of item IDs
uint32 herosforgemodel; //this is the Hero Forge Armor Model (i.e 63 or 84 or 203)
uint16 d_melee_texture1; //this is an item Material value
+3 -3
View File
@@ -324,7 +324,7 @@ void Object::Delete(bool reset_state)
}
const ItemInst* Object::GetItem(uint8 index) {
if (index < EQEmu::Constants::TYPE_WORLD_SIZE) {
if (index < EQEmu::constants::TYPE_WORLD_SIZE) {
return m_inst->GetItem(index);
}
@@ -362,7 +362,7 @@ void Object::Close() {
ItemInst* container = this->m_inst;
if(container != nullptr)
{
for (uint8 i = SUB_BEGIN; i < EQEmu::Constants::ITEM_CONTAINER_SIZE; i++)
for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++)
{
ItemInst* inst = container->PopItem(i);
if(inst != nullptr)
@@ -583,7 +583,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
EQApplicationPacket* outapp=new EQApplicationPacket(OP_ClientReady,0);
sender->QueuePacket(outapp);
safe_delete(outapp);
for (uint8 i = SUB_BEGIN; i < EQEmu::Constants::ITEM_CONTAINER_SIZE; i++) {
for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) {
const ItemInst* inst = m_inst->GetItem(i);
if (inst) {
//sender->GetInv().PutItem(i+4000,inst);
+5 -5
View File
@@ -417,12 +417,12 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
// the base items for the pet. These are always loaded
// so that a rank 1 suspend minion does not kill things
// like the special back items some focused pets may receive.
uint32 petinv[EQEmu::Constants::EQUIPMENT_SIZE];
uint32 petinv[EQEmu::constants::EQUIPMENT_SIZE];
memset(petinv, 0, sizeof(petinv));
const Item_Struct *item = 0;
if (database.GetBasePetItems(record.equipmentset, petinv)) {
for (int i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++)
for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++)
if (petinv[i]) {
item = database.GetItem(petinv[i]);
npc->AddLootDrop(item, &npc->itemlist, 0, 1, 127, true, true);
@@ -572,7 +572,7 @@ void NPC::GetPetState(SpellBuff_Struct *pet_buffs, uint32 *items, char *name) {
strn0cpy(name, GetName(), 64);
//save their items, we only care about what they are actually wearing
memcpy(items, equipment, sizeof(uint32) * EQEmu::Constants::EQUIPMENT_SIZE);
memcpy(items, equipment, sizeof(uint32) * EQEmu::constants::EQUIPMENT_SIZE);
//save their buffs.
for (int i=0; i < GetPetMaxTotalSlots(); i++) {
@@ -660,7 +660,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) {
}
//restore their equipment...
for (i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++) {
for (i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++) {
if(items[i] == 0)
continue;
@@ -722,7 +722,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) {
{
slot = atoi(row[0]);
if (slot >= EQEmu::Constants::EQUIPMENT_SIZE)
if (slot >= EQEmu::constants::EQUIPMENT_SIZE)
continue;
if (items[slot] == 0)
+7 -7
View File
@@ -1307,8 +1307,8 @@ void QuestManager::itemlink(int item_id) {
if (item == nullptr)
return;
EQEmu::SayLink::impl linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemData);
linker.SetItemData(item);
auto item_link = linker.GenerateLink();
@@ -2441,12 +2441,12 @@ int QuestManager::collectitems(uint32 item_id, bool remove)
int quantity = 0;
int slot_id;
for (slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id)
for (slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id)
{
quantity += collectitems_processSlot(slot_id, item_id, remove);
}
for (slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::GENERAL_BAGS_END; ++slot_id)
for (slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::GENERAL_BAGS_END; ++slot_id)
{
quantity += collectitems_processSlot(slot_id, item_id, remove);
}
@@ -2535,8 +2535,8 @@ const char* QuestManager::varlink(char* perltext, int item_id) {
if (!item)
return "INVALID ITEM ID IN VARLINK";
EQEmu::SayLink::impl linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemData);
linker.SetItemData(item);
auto item_link = linker.GenerateLink();
@@ -2761,7 +2761,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam
safe_delete_array(escaped_string);
//Create the say link as an item link hash
EQEmu::SayLink::impl linker;
EQEmu::saylink::SayLinkEngine linker;
linker.SetProxyItemID(SAYLINK_ITEM_ID);
if (silent)
linker.SetProxyAugment2ID(sayid);
+2 -2
View File
@@ -596,7 +596,7 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
if(wpn) {
primaryweapondamage = GetWeaponDamage(other, wpn);
backstab_dmg = wpn->GetItem()->BackstabDmg;
for (int i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; ++i)
for (int i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i)
{
ItemInst *aug = wpn->GetAugment(i);
if(aug)
@@ -729,7 +729,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
//first look for quivers
int r;
bool found = false;
for(r = EQEmu::Constants::GENERAL_BEGIN; r <= EQEmu::Constants::GENERAL_END; r++) {
for(r = EQEmu::constants::GENERAL_BEGIN; r <= EQEmu::constants::GENERAL_END; r++) {
const ItemInst *pi = m_inv[r];
if(pi == nullptr || !pi->IsType(ItemClassContainer))
continue;
+9 -9
View File
@@ -1429,7 +1429,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
}
}
for (int x = EQEmu::Constants::MATERIAL_BEGIN; x <= EQEmu::Constants::MATERIAL_TINT_END; x++)
for (int x = EQEmu::constants::MATERIAL_BEGIN; x <= EQEmu::constants::MATERIAL_TINT_END; x++)
SendWearChange(x);
if (caster == this &&
@@ -1455,7 +1455,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
);
caster->SendAppearancePacket(AT_Size, static_cast<uint32>(caster->GetTarget()->GetSize()));
for (int x = EQEmu::Constants::MATERIAL_BEGIN; x <= EQEmu::Constants::MATERIAL_TINT_END; x++)
for (int x = EQEmu::constants::MATERIAL_BEGIN; x <= EQEmu::constants::MATERIAL_TINT_END; x++)
caster->SendWearChange(x);
}
}
@@ -3809,7 +3809,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
else{
SendAppearancePacket(AT_Size, 6);
}
for (int x = EQEmu::Constants::MATERIAL_BEGIN; x <= EQEmu::Constants::MATERIAL_TINT_END; x++){
for (int x = EQEmu::constants::MATERIAL_BEGIN; x <= EQEmu::constants::MATERIAL_TINT_END; x++){
SendWearChange(x);
}
break;
@@ -5126,7 +5126,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
const Item_Struct* TempItem = 0;
for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::EQUIPMENT_END; x++)
for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++)
{
if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS)
continue;
@@ -5146,7 +5146,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
}
}
for (int y = AUG_BEGIN; y < EQEmu::Constants::ITEM_COMMON_SIZE; ++y)
for (int y = AUG_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y)
{
if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS)
continue;
@@ -5261,7 +5261,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
int16 focus_max_real = 0;
//item focus
for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::EQUIPMENT_END; x++)
for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++)
{
TempItem = nullptr;
ItemInst* ins = GetInv().GetItem(x);
@@ -5295,7 +5295,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
}
}
for (int y = AUG_BEGIN; y < EQEmu::Constants::ITEM_COMMON_SIZE; ++y)
for (int y = AUG_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y)
{
ItemInst *aug = nullptr;
aug = ins->GetAugment(y);
@@ -5333,7 +5333,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
}
//Tribute Focus
for (int x = EQEmu::Constants::TRIBUTE_BEGIN; x <= EQEmu::Constants::TRIBUTE_END; ++x)
for (int x = EQEmu::constants::TRIBUTE_BEGIN; x <= EQEmu::constants::TRIBUTE_END; ++x)
{
TempItem = nullptr;
ItemInst* ins = GetInv().GetItem(x);
@@ -5533,7 +5533,7 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) {
int16 focus_max_real = 0;
//item focus
for (int i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++){
for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]);
if(!cur)
+1 -1
View File
@@ -1206,7 +1206,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
if (inst == nullptr)
break;
for (int r = AUG_BEGIN; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) {
for (int r = AUG_INDEX_BEGIN; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
const ItemInst* aug_i = inst->GetAugment(r);
if (!aug_i)
+2 -2
View File
@@ -2779,8 +2779,8 @@ void TaskManager::SendActiveTaskDescription(Client *c, int TaskID, int SequenceN
if(ItemID) {
const Item_Struct* reward_item = database.GetItem(ItemID);
EQEmu::SayLink::impl linker;
linker.SetLinkType(EQEmu::SayLink::LinkItemData);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemData);
linker.SetItemData(reward_item);
linker.SetTaskUse();
if (strlen(Tasks[TaskID]->Reward) != 0)
+5 -5
View File
@@ -69,7 +69,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
// Verify that no more than two items are in container to guarantee no inadvertant wipes.
uint8 itemsFound = 0;
for (uint8 i = SLOT_BEGIN; i < EQEmu::Constants::TYPE_WORLD_SIZE; i++)
for (uint8 i = SLOT_BEGIN; i < EQEmu::constants::TYPE_WORLD_SIZE; i++)
{
const ItemInst* inst = container->GetItem(i);
if (inst)
@@ -222,7 +222,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
else
{
// Delete items in our inventory container...
for (uint8 i = SLOT_BEGIN; i < EQEmu::Constants::TYPE_WORLD_SIZE; i++)
for (uint8 i = SLOT_BEGIN; i < EQEmu::constants::TYPE_WORLD_SIZE; i++)
{
const ItemInst* inst = container->GetItem(i);
if (inst)
@@ -264,7 +264,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
uint32 some_id = 0;
bool worldcontainer=false;
if (in_combine->container_slot == EQEmu::Legacy::SLOT_TRADESKILL) {
if (in_combine->container_slot == EQEmu::legacy::SLOT_TRADESKILL) {
if(!worldo) {
user->Message(13, "Error: Server is not aware of the tradeskill container you are attempting to use");
return;
@@ -401,7 +401,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
safe_delete(outapp);
database.DeleteWorldContainer(worldo->m_id, zone->GetZoneID());
} else{
for (uint8 i = SLOT_BEGIN; i < EQEmu::Constants::TYPE_WORLD_SIZE; i++) {
for (uint8 i = SLOT_BEGIN; i < EQEmu::constants::TYPE_WORLD_SIZE; i++) {
const ItemInst* inst = container->GetItem(i);
if (inst) {
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot,i),0,true);
@@ -1227,7 +1227,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
for (auto row = results.begin(); row != results.end(); ++row) {
int ccnt = 0;
for (int x = SLOT_BEGIN; x < EQEmu::Constants::TYPE_WORLD_SIZE; x++) {
for (int x = SLOT_BEGIN; x < EQEmu::constants::TYPE_WORLD_SIZE; x++) {
const ItemInst* inst = container->GetItem(x);
if(!inst)
continue;
+36 -36
View File
@@ -171,13 +171,13 @@ void Trade::SendItemData(const ItemInst* inst, int16 dest_slot_id)
Client* with = mob->CastToClient();
Client* trader = owner->CastToClient();
if (with && with->IsClient()) {
with->SendItemPacket(dest_slot_id - EQEmu::Constants::TRADE_BEGIN, inst, ItemPacketTradeView);
with->SendItemPacket(dest_slot_id - EQEmu::constants::TRADE_BEGIN, inst, ItemPacketTradeView);
if (inst->GetItem()->ItemClass == 1) {
for (uint16 i = SUB_BEGIN; i < EQEmu::Constants::ITEM_CONTAINER_SIZE; i++) {
for (uint16 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) {
uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i);
const ItemInst* bagitem = trader->GetInv().GetItem(bagslot_id);
if (bagitem) {
with->SendItemPacket(bagslot_id - EQEmu::Constants::TRADE_BEGIN, bagitem, ItemPacketTradeView);
with->SendItemPacket(bagslot_id - EQEmu::constants::TRADE_BEGIN, bagitem, ItemPacketTradeView);
}
}
}
@@ -199,7 +199,7 @@ void Trade::LogTrade()
uint8 item_count = 0;
if (zone->tradevar != 0) {
for (uint16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_END; i++) {
for (uint16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++) {
if (trader->GetInv().GetItem(i))
item_count++;
}
@@ -251,7 +251,7 @@ void Trade::LogTrade()
if (item_count > 0) {
strcat(logtext, "items {");
for (uint16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_END; i++) {
for (uint16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++) {
const ItemInst* inst = trader->GetInv().GetItem(i);
if (!comma)
@@ -267,7 +267,7 @@ void Trade::LogTrade()
strcat(logtext, item_num);
if (inst->IsType(ItemClassContainer)) {
for (uint8 j = SUB_BEGIN; j < EQEmu::Constants::ITEM_CONTAINER_SIZE; j++) {
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) {
inst = trader->GetInv().GetItem(i, j);
if (inst) {
strcat(logtext, ",");
@@ -303,7 +303,7 @@ void Trade::DumpTrade()
return;
Client* trader = owner->CastToClient();
for (uint16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_END; i++) {
for (uint16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++) {
const ItemInst* inst = trader->GetInv().GetItem(i);
if (inst) {
@@ -312,7 +312,7 @@ void Trade::DumpTrade()
i, ((inst->IsType(ItemClassContainer)) ? "True" : "False"));
if (inst->IsType(ItemClassContainer)) {
for (uint8 j = SUB_BEGIN; j < EQEmu::Constants::ITEM_CONTAINER_SIZE; j++) {
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) {
inst = trader->GetInv().GetItem(i, j);
if (inst) {
Log.Out(Logs::Detail, Logs::Trading, "\tBagItem %i (Charges=%i, Slot=%i)",
@@ -332,7 +332,7 @@ void Client::ResetTrade() {
AddMoneyToPP(trade->cp, trade->sp, trade->gp, trade->pp, true);
// step 1: process bags
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) {
for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
const ItemInst* inst = m_inv[trade_slot];
if (inst && inst->IsType(ItemClassContainer)) {
@@ -351,7 +351,7 @@ void Client::ResetTrade() {
}
// step 2a: process stackables
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) {
for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
ItemInst* inst = GetInv().GetItem(trade_slot);
if (inst && inst->IsStackable()) {
@@ -398,11 +398,11 @@ void Client::ResetTrade() {
// step 2b: adjust trade stack bias
// (if any partial stacks exist before the final stack, FindFreeSlotForTradeItem() will return that slot in step 3 and an overwrite will occur)
for (int16 trade_slot = EQEmu::Constants::TRADE_END; trade_slot >= EQEmu::Constants::TRADE_BEGIN; --trade_slot) {
for (int16 trade_slot = EQEmu::constants::TRADE_END; trade_slot >= EQEmu::constants::TRADE_BEGIN; --trade_slot) {
ItemInst* inst = GetInv().GetItem(trade_slot);
if (inst && inst->IsStackable()) {
for (int16 bias_slot = EQEmu::Constants::TRADE_BEGIN; bias_slot <= EQEmu::Constants::TRADE_END; ++bias_slot) {
for (int16 bias_slot = EQEmu::constants::TRADE_BEGIN; bias_slot <= EQEmu::constants::TRADE_END; ++bias_slot) {
if (bias_slot >= trade_slot)
break;
@@ -432,7 +432,7 @@ void Client::ResetTrade() {
}
// step 3: process everything else
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) {
for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
const ItemInst* inst = m_inv[trade_slot];
if (inst) {
@@ -487,7 +487,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
}
// step 1: process bags
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) {
for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
const ItemInst* inst = m_inv[trade_slot];
if (inst && inst->IsType(ItemClassContainer)) {
@@ -523,7 +523,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
qs_audit->char1_count += detail->charges;
//for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) {
for (uint8 sub_slot = SUB_BEGIN; (sub_slot < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items
for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::constants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items
const ItemInst* bag_inst = inst->GetItem(sub_slot);
if (bag_inst) {
@@ -571,7 +571,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
}
// step 2a: process stackables
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) {
for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
ItemInst* inst = GetInv().GetItem(trade_slot);
if (inst && inst->IsStackable()) {
@@ -653,11 +653,11 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
// step 2b: adjust trade stack bias
// (if any partial stacks exist before the final stack, FindFreeSlotForTradeItem() will return that slot in step 3 and an overwrite will occur)
for (int16 trade_slot = EQEmu::Constants::TRADE_END; trade_slot >= EQEmu::Constants::TRADE_BEGIN; --trade_slot) {
for (int16 trade_slot = EQEmu::constants::TRADE_END; trade_slot >= EQEmu::constants::TRADE_BEGIN; --trade_slot) {
ItemInst* inst = GetInv().GetItem(trade_slot);
if (inst && inst->IsStackable()) {
for (int16 bias_slot = EQEmu::Constants::TRADE_BEGIN; bias_slot <= EQEmu::Constants::TRADE_END; ++bias_slot) {
for (int16 bias_slot = EQEmu::constants::TRADE_BEGIN; bias_slot <= EQEmu::constants::TRADE_END; ++bias_slot) {
if (bias_slot >= trade_slot)
break;
@@ -706,7 +706,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
}
// step 3: process everything else
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_END; ++trade_slot) {
for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) {
const ItemInst* inst = m_inv[trade_slot];
if (inst) {
@@ -743,7 +743,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
// 'step 3' should never really see containers..but, just in case...
//for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) {
for (uint8 sub_slot = SUB_BEGIN; (sub_slot < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items
for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::constants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items
const ItemInst* bag_inst = inst->GetItem(sub_slot);
if (bag_inst) {
@@ -820,7 +820,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
}
if(qs_log) { // This can be incorporated below when revisions are made
for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::TRADE_NPC_END; ++trade_slot) {
for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_NPC_END; ++trade_slot) {
const ItemInst* trade_inst = m_inv[trade_slot];
if(trade_inst) {
@@ -841,7 +841,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
qs_audit->char_count += detail->charges;
if(trade_inst->IsType(ItemClassContainer)) {
for (uint8 sub_slot = SUB_BEGIN; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
for (uint8 sub_slot = SUB_INDEX_BEGIN; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
const ItemInst* trade_baginst = trade_inst->GetItem(sub_slot);
if(trade_baginst) {
@@ -875,7 +875,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
std::vector<EQEmu::Any> item_list;
std::list<ItemInst*> items;
for (int i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_NPC_END; ++i) {
for (int i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_NPC_END; ++i) {
ItemInst *inst = m_inv.GetItem(i);
if(inst) {
items.push_back(inst);
@@ -891,7 +891,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) {
// pets need to look inside bags and try to equip items found there
if(item->ItemClass == ItemClassContainer && item->BagSlots > 0) {
for(int16 bslot = SUB_BEGIN; bslot < item->BagSlots; bslot++) {
for (int16 bslot = SUB_INDEX_BEGIN; bslot < item->BagSlots; bslot++) {
const ItemInst* baginst = inst->GetItem(bslot);
if (baginst) {
const Item_Struct* bagitem = baginst->GetItem();
@@ -948,8 +948,8 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
}
ItemInst *insts[4] = { 0 };
for (int i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_NPC_END; ++i) {
insts[i - EQEmu::Constants::TRADE_BEGIN] = m_inv.PopItem(i);
for (int i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_NPC_END; ++i) {
insts[i - EQEmu::constants::TRADE_BEGIN] = m_inv.PopItem(i);
database.SaveInventory(CharacterID(), nullptr, i);
}
@@ -968,7 +968,7 @@ bool Client::CheckTradeLoreConflict(Client* other)
if (!other)
return true;
// Move each trade slot into free inventory slot
for (int16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_END; i++){
for (int16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++){
const ItemInst* inst = m_inv[i];
if (inst && inst->GetItem()) {
@@ -977,7 +977,7 @@ bool Client::CheckTradeLoreConflict(Client* other)
}
}
for (int16 i = EQEmu::Constants::TRADE_BAGS_BEGIN; i <= EQEmu::Constants::TRADE_BAGS_END; i++){
for (int16 i = EQEmu::constants::TRADE_BAGS_BEGIN; i <= EQEmu::constants::TRADE_BAGS_END; i++){
const ItemInst* inst = m_inv[i];
if (inst && inst->GetItem()) {
@@ -1232,10 +1232,10 @@ uint32 Client::FindTraderItemSerialNumber(int32 ItemID) {
ItemInst* item = nullptr;
uint16 SlotID = 0;
for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++){
for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++){
item = this->GetInv().GetItem(i);
if (item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; x++) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) {
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
@@ -1255,10 +1255,10 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){
ItemInst* item = nullptr;
uint16 SlotID = 0;
for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++){
for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++){
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; x++) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) {
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
@@ -1286,10 +1286,10 @@ GetItems_Struct* Client::GetTraderItems(){
uint8 ndx = 0;
for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) {
for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; x++) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) {
SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
@@ -1310,10 +1310,10 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){
const ItemInst* item= nullptr;
uint16 SlotID = 0;
for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) {
for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; x++){
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++){
SlotID = Inventory::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
+15 -15
View File
@@ -66,7 +66,7 @@ void Client::ToggleTribute(bool enabled) {
int r;
uint32 cost = 0;
uint32 level = GetLevel();
for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) {
for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) {
uint32 tid = m_pp.tributes[r].tribute;
if(tid == TRIBUTE_NONE)
continue;
@@ -119,7 +119,7 @@ void Client::DoTributeUpdate() {
tis->tribute_master_id = tribute_master_id; //Dont know what this is for
int r;
for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) {
for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) {
if(m_pp.tributes[r].tribute != TRIBUTE_NONE) {
tis->tributes[r] = m_pp.tributes[r].tribute;
tis->tiers[r] = m_pp.tributes[r].tier;
@@ -134,24 +134,24 @@ void Client::DoTributeUpdate() {
if(m_pp.tribute_active) {
//send and equip tribute items...
for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) {
for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) {
uint32 tid = m_pp.tributes[r].tribute;
if(tid == TRIBUTE_NONE) {
if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false);
if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false);
continue;
}
if(tribute_list.count(tid) != 1) {
if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false);
if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false);
continue;
}
//sanity check
if(m_pp.tributes[r].tier >= MAX_TRIBUTE_TIERS) {
if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false);
if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false);
m_pp.tributes[r].tier = 0;
continue;
}
@@ -165,15 +165,15 @@ void Client::DoTributeUpdate() {
if(inst == nullptr)
continue;
PutItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, *inst, false);
SendItemPacket(EQEmu::Constants::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem);
PutItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, *inst, false);
SendItemPacket(EQEmu::constants::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem);
safe_delete(inst);
}
} else {
//unequip tribute items...
for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) {
if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false);
for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) {
if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false);
}
}
CalcBonuses();
@@ -192,7 +192,7 @@ void Client::SendTributeTimer() {
void Client::ChangeTributeSettings(TributeInfo_Struct *t) {
int r;
for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) {
for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) {
m_pp.tributes[r].tribute = TRIBUTE_NONE;
+18 -18
View File
@@ -487,7 +487,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container)
uint8 index = (uint8)atoi(row[0]);
uint32 item_id = (uint32)atoi(row[1]);
int8 charges = (int8)atoi(row[2]);
uint32 aug[EQEmu::Constants::ITEM_COMMON_SIZE];
uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE];
aug[0] = (uint32)atoi(row[3]);
aug[1] = (uint32)atoi(row[4]);
aug[2] = (uint32)atoi(row[5]);
@@ -497,7 +497,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container)
ItemInst* inst = database.CreateItem(item_id, charges);
if (inst && inst->GetItem()->ItemClass == ItemClassCommon) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++)
if (aug[i])
inst->PutAugment(&database, i, aug[i]);
// Put item inside world container
@@ -520,17 +520,17 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It
DeleteWorldContainer(parent_id,zone_id);
// Save all 10 items, if they exist
for (uint8 index = SUB_BEGIN; index < EQEmu::Constants::ITEM_CONTAINER_SIZE; index++) {
for (uint8 index = SUB_INDEX_BEGIN; index < EQEmu::constants::ITEM_CONTAINER_SIZE; index++) {
ItemInst* inst = container->GetItem(index);
if (!inst)
continue;
uint32 item_id = inst->GetItem()->ID;
uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
uint32 augslot[EQEmu::constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
if (inst->IsType(ItemClassCommon)) {
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
ItemInst *auginst=inst->GetAugment(i);
augslot[i]=(auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
}
@@ -1181,11 +1181,11 @@ bool ZoneDatabase::LoadCharacterMaterialColor(uint32 character_id, PlayerProfile
bool ZoneDatabase::LoadCharacterBandolier(uint32 character_id, PlayerProfile_Struct* pp)
{
std::string query = StringFormat("SELECT `bandolier_id`, `bandolier_slot`, `item_id`, `icon`, `bandolier_name` FROM `character_bandolier` WHERE `id` = %u LIMIT %u",
character_id, EQEmu::Constants::BANDOLIERS_SIZE);
character_id, EQEmu::constants::BANDOLIERS_SIZE);
auto results = database.QueryDatabase(query); int i = 0; int r = 0; int si = 0;
for (i = 0; i < EQEmu::Constants::BANDOLIERS_SIZE; i++) {
for (i = 0; i < EQEmu::constants::BANDOLIERS_SIZE; i++) {
pp->bandoliers[i].Name[0] = '\0';
for (int si = 0; si < EQEmu::Constants::BANDOLIER_ITEM_COUNT; si++) {
for (int si = 0; si < EQEmu::constants::BANDOLIER_ITEM_COUNT; si++) {
pp->bandoliers[i].Items[si].ID = 0;
pp->bandoliers[i].Items[si].Icon = 0;
pp->bandoliers[i].Items[si].Name[0] = '\0';
@@ -1219,7 +1219,7 @@ bool ZoneDatabase::LoadCharacterTribute(uint32 character_id, PlayerProfile_Struc
std::string query = StringFormat("SELECT `tier`, `tribute` FROM `character_tribute` WHERE `id` = %u", character_id);
auto results = database.QueryDatabase(query);
int i = 0;
for (i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++){
for (i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++){
pp->tributes[i].tribute = 0xFFFFFFFF;
pp->tributes[i].tier = 0;
}
@@ -1238,10 +1238,10 @@ bool ZoneDatabase::LoadCharacterPotions(uint32 character_id, PlayerProfile_Struc
{
std::string query =
StringFormat("SELECT `potion_id`, `item_id`, `icon` FROM `character_potionbelt` WHERE `id` = %u LIMIT %u",
character_id, EQEmu::Constants::POTION_BELT_ITEM_COUNT);
character_id, EQEmu::constants::POTION_BELT_ITEM_COUNT);
auto results = database.QueryDatabase(query);
int i = 0;
for (i = 0; i < EQEmu::Constants::POTION_BELT_ITEM_COUNT; i++) {
for (i = 0; i < EQEmu::constants::POTION_BELT_ITEM_COUNT; i++) {
pp->potionbelt.Items[i].Icon = 0;
pp->potionbelt.Items[i].ID = 0;
pp->potionbelt.Items[i].Name[0] = '\0';
@@ -1339,7 +1339,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc
std::string query = StringFormat("DELETE FROM `character_tribute` WHERE `id` = %u", character_id);
QueryDatabase(query);
/* Save Tributes only if we have values... */
for (int i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++){
for (int i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++){
if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){
std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
QueryDatabase(query);
@@ -2092,7 +2092,7 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
else {
auto armorTint_row = armortint_results.begin();
for (int index = EQEmu::Constants::MATERIAL_BEGIN; index <= EQEmu::Constants::MATERIAL_END; index++) {
for (int index = EQEmu::constants::MATERIAL_BEGIN; index <= EQEmu::constants::MATERIAL_END; index++) {
temp_npctype_data->armor_tint[index] = atoi(armorTint_row[index * 3]) << 16;
temp_npctype_data->armor_tint[index] |= atoi(armorTint_row[index * 3 + 1]) << 8;
temp_npctype_data->armor_tint[index] |= atoi(armorTint_row[index * 3 + 2]);
@@ -2307,7 +2307,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
tmpNPCType->armor_tint[0] |= (tmpNPCType->armor_tint[0]) ? (0xFF << 24) : 0;
if (armor_tint_id == 0)
for (int index = MaterialChest; index <= EQEmu::Constants::MATERIAL_END; index++)
for (int index = MaterialChest; index <= EQEmu::constants::MATERIAL_END; index++)
tmpNPCType->armor_tint[index] = tmpNPCType->armor_tint[0];
else if (tmpNPCType->armor_tint[0] == 0) {
std::string armorTint_query = StringFormat("SELECT red1h, grn1h, blu1h, "
@@ -2327,7 +2327,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
else {
auto armorTint_row = results.begin();
for (int index = EQEmu::Constants::MATERIAL_BEGIN; index <= EQEmu::Constants::MATERIAL_END; index++) {
for (int index = EQEmu::constants::MATERIAL_BEGIN; index <= EQEmu::constants::MATERIAL_END; index++) {
tmpNPCType->armor_tint[index] = atoi(armorTint_row[index * 3]) << 16;
tmpNPCType->armor_tint[index] |= atoi(armorTint_row[index * 3 + 1]) << 8;
tmpNPCType->armor_tint[index] |= atoi(armorTint_row[index * 3 + 2]);
@@ -2684,7 +2684,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) {
int itemCount = 0;
for(auto row = results.begin(); row != results.end(); ++row) {
if (itemCount == EQEmu::Constants::EQUIPMENT_SIZE)
if (itemCount == EQEmu::constants::EQUIPMENT_SIZE)
break;
if(atoi(row[0]) == 0)
@@ -3199,7 +3199,7 @@ void ZoneDatabase::SavePetInfo(Client *client)
query.clear();
// pet inventory!
for (int index = EQEmu::Constants::EQUIPMENT_BEGIN; index <= EQEmu::Constants::EQUIPMENT_END; index++) {
for (int index = EQEmu::constants::EQUIPMENT_BEGIN; index <= EQEmu::constants::EQUIPMENT_END; index++) {
if (!petinfo->Items[index])
continue;
@@ -3331,7 +3331,7 @@ void ZoneDatabase::LoadPetInfo(Client *client)
continue;
int slot = atoi(row[1]);
if (slot < EQEmu::Constants::EQUIPMENT_BEGIN || slot > EQEmu::Constants::EQUIPMENT_END)
if (slot < EQEmu::constants::EQUIPMENT_BEGIN || slot > EQEmu::constants::EQUIPMENT_END)
continue;
pi->Items[slot] = atoul(row[2]);
+1 -1
View File
@@ -126,7 +126,7 @@ struct PetInfo {
uint32 Mana;
float size;
SpellBuff_Struct Buffs[BUFF_COUNT];
uint32 Items[EQEmu::Constants::EQUIPMENT_SIZE];
uint32 Items[EQEmu::constants::EQUIPMENT_SIZE];
char Name[64];
};