mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Rework of eq_dictionary
This commit is contained in:
+56
-56
@@ -2731,7 +2731,7 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) {
|
||||
if (item && (item->ItemClass==ItemClassCommon))
|
||||
{
|
||||
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
|
||||
if (matslot != _MaterialInvalid)
|
||||
if (matslot != MaterialInvalid)
|
||||
{
|
||||
m_pp.item_material[matslot] = GetEquipmentMaterial(matslot);
|
||||
}
|
||||
@@ -3073,7 +3073,7 @@ void Client::SetTint(int16 in_slot, uint32 color) {
|
||||
void Client::SetTint(int16 in_slot, Color_Struct& color) {
|
||||
|
||||
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
|
||||
if (matslot != _MaterialInvalid)
|
||||
if (matslot != MaterialInvalid)
|
||||
{
|
||||
m_pp.item_tint[matslot].Color = color.Color;
|
||||
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.Color);
|
||||
@@ -3148,58 +3148,58 @@ void Client::LinkDead()
|
||||
}
|
||||
|
||||
uint8 Client::SlotConvert(uint8 slot,bool bracer){
|
||||
uint8 slot2=0; // why are we returning MainCharm instead of INVALID_INDEX? (must be a pre-charm segment...)
|
||||
uint8 slot2 = 0; // why are we returning MainCharm instead of INVALID_INDEX? (must be a pre-charm segment...)
|
||||
if(bracer)
|
||||
return MainWrist2;
|
||||
return SlotWrist2;
|
||||
switch(slot){
|
||||
case MaterialHead:
|
||||
slot2=MainHead;
|
||||
slot2 = SlotHead;
|
||||
break;
|
||||
case MaterialChest:
|
||||
slot2=MainChest;
|
||||
slot2 = SlotChest;
|
||||
break;
|
||||
case MaterialArms:
|
||||
slot2=MainArms;
|
||||
slot2 = SlotArms;
|
||||
break;
|
||||
case MaterialWrist:
|
||||
slot2=MainWrist1;
|
||||
slot2 = SlotWrist1;
|
||||
break;
|
||||
case MaterialHands:
|
||||
slot2=MainHands;
|
||||
slot2 = SlotHands;
|
||||
break;
|
||||
case MaterialLegs:
|
||||
slot2=MainLegs;
|
||||
slot2 = SlotLegs;
|
||||
break;
|
||||
case MaterialFeet:
|
||||
slot2=MainFeet;
|
||||
slot2 = SlotFeet;
|
||||
break;
|
||||
}
|
||||
return slot2;
|
||||
}
|
||||
|
||||
uint8 Client::SlotConvert2(uint8 slot){
|
||||
uint8 slot2=0; // same as above...
|
||||
uint8 slot2 = 0; // same as above...
|
||||
switch(slot){
|
||||
case MainHead:
|
||||
slot2=MaterialHead;
|
||||
case SlotHead:
|
||||
slot2 = MaterialHead;
|
||||
break;
|
||||
case MainChest:
|
||||
slot2=MaterialChest;
|
||||
case SlotChest:
|
||||
slot2 = MaterialChest;
|
||||
break;
|
||||
case MainArms:
|
||||
slot2=MaterialArms;
|
||||
case SlotArms:
|
||||
slot2 = MaterialArms;
|
||||
break;
|
||||
case MainWrist1:
|
||||
slot2=MaterialWrist;
|
||||
case SlotWrist1:
|
||||
slot2 = MaterialWrist;
|
||||
break;
|
||||
case MainHands:
|
||||
slot2=MaterialHands;
|
||||
case SlotHands:
|
||||
slot2 = MaterialHands;
|
||||
break;
|
||||
case MainLegs:
|
||||
slot2=MaterialLegs;
|
||||
case SlotLegs:
|
||||
slot2 = MaterialLegs;
|
||||
break;
|
||||
case MainFeet:
|
||||
slot2=MaterialFeet;
|
||||
case SlotFeet:
|
||||
slot2 = MaterialFeet;
|
||||
break;
|
||||
}
|
||||
return slot2;
|
||||
@@ -4203,14 +4203,14 @@ bool Client::GroupFollow(Client* inviter) {
|
||||
uint16 Client::GetPrimarySkillValue()
|
||||
{
|
||||
SkillUseTypes skill = HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||
bool equiped = m_inv.GetItem(MainPrimary);
|
||||
bool equiped = m_inv.GetItem(SlotPrimary);
|
||||
|
||||
if (!equiped)
|
||||
skill = SkillHandtoHand;
|
||||
|
||||
else {
|
||||
|
||||
uint8 type = m_inv.GetItem(MainPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
uint8 type = m_inv.GetItem(SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@@ -5391,7 +5391,7 @@ bool Client::TryReward(uint32 claim_id)
|
||||
// save
|
||||
uint32 free_slot = 0xFFFFFFFF;
|
||||
|
||||
for (int i = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::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;
|
||||
@@ -5737,30 +5737,30 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = requestee->GetInv().GetItem(MainPowerSource);
|
||||
inst = requestee->GetInv().GetItem(SlotPowerSource);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
// we shouldn't do this..but, that's the way it's coded atm...
|
||||
// (this type of action should be handled exclusively in the client translator)
|
||||
strcpy(insr->itemnames[SoF::slots::MainPowerSource], item->Name);
|
||||
insr->itemicons[SoF::slots::MainPowerSource] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::inventory::SlotPowerSource], item->Name);
|
||||
insr->itemicons[SoF::inventory::SlotPowerSource] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[SoF::slots::MainPowerSource] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::inventory::SlotPowerSource] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
inst = requestee->GetInv().GetItem(MainAmmo);
|
||||
inst = requestee->GetInv().GetItem(SlotAmmo);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[SoF::slots::MainAmmo], item->Name);
|
||||
insr->itemicons[SoF::slots::MainAmmo] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::inventory::SlotAmmo], item->Name);
|
||||
insr->itemicons[SoF::inventory::SlotAmmo] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[SoF::slots::MainAmmo] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::inventory::SlotAmmo] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
strcpy(insr->text, requestee->GetInspectMessage().text);
|
||||
@@ -6306,7 +6306,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 = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::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;
|
||||
@@ -7582,7 +7582,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 += EmuConstants::TEXT_LINK_BODY_LENGTH; }
|
||||
if (!(delimiter_count & 1)) { i += EQEmu::Constants::TEXT_LINK_BODY_LENGTH; }
|
||||
++delimiter_count;
|
||||
continue;
|
||||
}
|
||||
@@ -8007,17 +8007,17 @@ void Client::TickItemCheck()
|
||||
if(zone->tick_items.empty()) { return; }
|
||||
|
||||
//Scan equip slots for items
|
||||
for(i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; i++)
|
||||
for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
//Scan main inventory + cursor
|
||||
for(i = EmuConstants::GENERAL_BEGIN; i <= MainCursor; i++)
|
||||
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
//Scan bags
|
||||
for(i = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::CURSOR_BAG_END; i++)
|
||||
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
@@ -8033,7 +8033,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 <= EmuConstants::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);
|
||||
@@ -8041,9 +8041,9 @@ void Client::TryItemTick(int slot)
|
||||
}
|
||||
|
||||
//Only look at augs in main inventory
|
||||
if(slot > EmuConstants::EQUIPMENT_END) { return; }
|
||||
if (slot > EQEmu::Constants::EQUIPMENT_END) { return; }
|
||||
|
||||
for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x)
|
||||
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x)
|
||||
{
|
||||
ItemInst * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst) { continue; }
|
||||
@@ -8064,17 +8064,17 @@ void Client::TryItemTick(int slot)
|
||||
void Client::ItemTimerCheck()
|
||||
{
|
||||
int i;
|
||||
for(i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; i++)
|
||||
for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
|
||||
for(i = EmuConstants::GENERAL_BEGIN; i <= MainCursor; i++)
|
||||
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
|
||||
for(i = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::CURSOR_BAG_END; i++)
|
||||
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
@@ -8096,11 +8096,11 @@ void Client::TryItemTimer(int slot)
|
||||
++it_iter;
|
||||
}
|
||||
|
||||
if(slot > EmuConstants::EQUIPMENT_END) {
|
||||
if (slot > EQEmu::Constants::EQUIPMENT_END) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x)
|
||||
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x)
|
||||
{
|
||||
ItemInst * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst) {
|
||||
@@ -8388,12 +8388,12 @@ void Client::ShowNumHits()
|
||||
int Client::GetQuiverHaste(int delay)
|
||||
{
|
||||
const ItemInst *pi = nullptr;
|
||||
for (int r = EmuConstants::GENERAL_BEGIN; r <= EmuConstants::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 == EmuConstants::GENERAL_END)
|
||||
if (r == EQEmu::Constants::GENERAL_END)
|
||||
// we will get here if we don't find a valid quiver
|
||||
return 0;
|
||||
}
|
||||
@@ -8427,7 +8427,7 @@ std::string Client::TextLink::GenerateLink()
|
||||
generate_body();
|
||||
generate_text();
|
||||
|
||||
if ((m_LinkBody.length() == EmuConstants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) {
|
||||
if ((m_LinkBody.length() == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) {
|
||||
m_Link.push_back(0x12);
|
||||
m_Link.append(m_LinkBody);
|
||||
m_Link.append(m_LinkText);
|
||||
@@ -8619,7 +8619,7 @@ void Client::TextLink::generate_text()
|
||||
bool Client::TextLink::DegenerateLinkBody(TextLinkBody_Struct& textLinkBodyStruct, const std::string& textLinkBody)
|
||||
{
|
||||
memset(&textLinkBodyStruct, 0, sizeof(TextLinkBody_Struct));
|
||||
if (textLinkBody.length() != EmuConstants::TEXT_LINK_BODY_LENGTH) { return false; }
|
||||
if (textLinkBody.length() != EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { return false; }
|
||||
|
||||
textLinkBodyStruct.unknown_1 = (uint8)strtol(textLinkBody.substr(0, 1).c_str(), nullptr, 16);
|
||||
textLinkBodyStruct.item_id = (uint32)strtol(textLinkBody.substr(1, 5).c_str(), nullptr, 16);
|
||||
@@ -8657,7 +8657,7 @@ bool Client::TextLink::GenerateLinkBody(std::string& textLinkBody, const TextLin
|
||||
(0xFFFFFFFF & textLinkBodyStruct.hash)
|
||||
);
|
||||
|
||||
if (textLinkBody.length() != EmuConstants::TEXT_LINK_BODY_LENGTH) { return false; }
|
||||
if (textLinkBody.length() != EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8680,7 +8680,7 @@ void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold,
|
||||
AddMoneyToPP(copper, silver, gold, platinum, false);
|
||||
|
||||
if (itemid > 0)
|
||||
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, MainPowerSource);
|
||||
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, SlotPowerSource);
|
||||
|
||||
if (faction)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user