Delinked current inventory slot enumeration and constants from EQEmu::constants and global definition

This commit is contained in:
Uleat
2016-04-22 07:34:55 -04:00
parent b3475d7b50
commit 1890d006a2
65 changed files with 1835 additions and 1849 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::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++) // (< 21) added MainAmmo
{
uint32 sitem = 0;
sitem = CorpseToUse->GetWornItem(x);
+53 -53
View File
@@ -166,7 +166,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
}
// If we're attacking with the secondary hand, play the dual wield anim
if (Hand == SlotSecondary) // DW anim
if (Hand == EQEmu::legacy::SlotSecondary) // DW anim
type = animDualWield;
DoAnim(type);
@@ -415,7 +415,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
// riposte -- it may seem crazy, but if the attacker has SPA 173 on them, they are immune to Ripo
bool ImmuneRipo = attacker->aabonuses.RiposteChance || attacker->spellbonuses.RiposteChance || attacker->itembonuses.RiposteChance;
// Need to check if we have something in MainHand to actually attack with (or fists)
if (hand != SlotRange && CanThisClassRiposte() && InFront && !ImmuneRipo) {
if (hand != EQEmu::legacy::SlotRange && CanThisClassRiposte() && InFront && !ImmuneRipo) {
if (IsClient())
CastToClient()->CheckIncreaseSkill(SkillRiposte, other, -10);
// check auto discs ... I guess aa/items too :P
@@ -432,7 +432,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
chance -= chance * counter;
}
// AA Slippery Attacks
if (hand == SlotSecondary) {
if (hand == EQEmu::legacy::SlotSecondary) {
int slip = aabonuses.OffhandRiposteFail + itembonuses.OffhandRiposteFail + spellbonuses.OffhandRiposteFail;
chance += chance * slip / 100;
}
@@ -477,7 +477,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
}
// parry
if (CanThisClassParry() && InFront && hand != SlotRange) {
if (CanThisClassParry() && InFront && hand != EQEmu::legacy::SlotRange) {
if (IsClient())
CastToClient()->CheckIncreaseSkill(SkillParry, other, -10);
// check auto discs ... I guess aa/items too :P
@@ -964,7 +964,7 @@ int Mob::GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate
} else {
bool MagicGloves = false;
if (IsClient()) {
const ItemInst *gloves = CastToClient()->GetInv().GetItem(SlotHands);
const ItemInst *gloves = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotHands);
if (gloves)
MagicGloves = gloves->GetItemMagical(true);
}
@@ -1073,12 +1073,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
return false; // Rogean: How can you attack while feigned? Moved up from Aggro Code.
ItemInst* weapon;
if (Hand == SlotSecondary){ // Kaiyodo - Pick weapon from the attacking hand
weapon = GetInv().GetItem(SlotSecondary);
if (Hand == EQEmu::legacy::SlotSecondary){ // Kaiyodo - Pick weapon from the attacking hand
weapon = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
OffHandAtk(true);
}
else{
weapon = GetInv().GetItem(SlotPrimary);
weapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary);
OffHandAtk(false);
}
@@ -1146,7 +1146,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
int ucDamageBonus = 0;
if( Hand == SlotPrimary && GetLevel() >= 28 && IsWarriorClass() )
if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass())
{
// Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above
// who belong to a melee class. If we're here, then all of these conditions apply.
@@ -1159,7 +1159,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
}
#endif
//Live AA - Sinister Strikes *Adds weapon damage bonus to offhand weapon.
if (Hand == SlotSecondary) {
if (Hand == EQEmu::legacy::SlotSecondary) {
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const Item_Struct*) nullptr, true );
@@ -1621,28 +1621,28 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
FaceTarget(GetTarget());
SkillUseTypes skillinuse = SkillHandtoHand;
if (Hand == SlotPrimary) {
if (Hand == EQEmu::legacy::SlotPrimary) {
skillinuse = static_cast<SkillUseTypes>(GetPrimSkill());
OffHandAtk(false);
}
if (Hand == SlotSecondary) {
if (Hand == EQEmu::legacy::SlotSecondary) {
skillinuse = static_cast<SkillUseTypes>(GetSecSkill());
OffHandAtk(true);
}
//figure out what weapon they are using, if any
const Item_Struct* weapon = nullptr;
if (Hand == SlotPrimary && equipment[SlotPrimary] > 0)
weapon = database.GetItem(equipment[SlotPrimary]);
else if (equipment[SlotSecondary])
weapon = database.GetItem(equipment[SlotSecondary]);
if (Hand == EQEmu::legacy::SlotPrimary && equipment[EQEmu::legacy::SlotPrimary] > 0)
weapon = database.GetItem(equipment[EQEmu::legacy::SlotPrimary]);
else if (equipment[EQEmu::legacy::SlotSecondary])
weapon = database.GetItem(equipment[EQEmu::legacy::SlotSecondary]);
//We dont factor much from the weapon into the attack.
//Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons
if(weapon) {
Log.Out(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID);
if(Hand == SlotSecondary && weapon->ItemType == ItemTypeShield){
if (Hand == EQEmu::legacy::SlotSecondary && weapon->ItemType == ItemTypeShield){
Log.Out(Logs::Detail, Logs::Combat, "Attack with shield canceled.");
return false;
}
@@ -3532,7 +3532,7 @@ void Mob::TryDefensiveProc(Mob *on, uint16 hand) {
float ProcChance, ProcBonus;
on->GetDefensiveProcChances(ProcBonus, ProcChance, hand , this);
if(hand != SlotPrimary)
if (hand != EQEmu::legacy::SlotPrimary)
ProcChance /= 2;
int level_penalty = 0;
@@ -3605,7 +3605,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
ProcBonus += static_cast<float>(itembonuses.ProcChance) / 10.0f; // Combat Effects
float ProcChance = GetProcChances(ProcBonus, hand);
if (hand != SlotPrimary) //Is Archery intened to proc at 50% rate?
if (hand != EQEmu::legacy::SlotPrimary) //Is Archery intened to proc at 50% rate?
ProcChance /= 2;
// Try innate proc on weapon
@@ -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::legacy::ITEM_COMMON_SIZE; r++) {
const ItemInst *aug_i = inst->GetAugment(r);
if (!aug_i) // no aug, try next slot!
continue;
@@ -3683,11 +3683,11 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
float ProcChance = 0.0f;
ProcChance = GetProcChances(ProcBonus, hand);
if (hand != SlotPrimary) //Is Archery intened to proc at 50% rate?
if (hand != EQEmu::legacy::SlotPrimary) //Is Archery intened to proc at 50% rate?
ProcChance /= 2;
bool rangedattk = false;
if (weapon && hand == SlotRange) {
if (weapon && hand == EQEmu::legacy::SlotRange) {
if (weapon->ItemType == ItemTypeArrow ||
weapon->ItemType == ItemTypeLargeThrowing ||
weapon->ItemType == ItemTypeSmallThrowing ||
@@ -3695,11 +3695,11 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
rangedattk = true;
}
if (!weapon && hand == SlotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
if (!weapon && hand == EQEmu::legacy::SlotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
rangedattk = true;
for (uint32 i = 0; i < MAX_PROCS; i++) {
if (IsPet() && hand != SlotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
if (IsPet() && hand != EQEmu::legacy::SlotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
continue; // If pets ever can proc from off hand, this will need to change
// Not ranged
@@ -3762,7 +3762,7 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
}
}
if (HasSkillProcs() && hand != SlotRange){ //We check ranged skill procs within the attack functions.
if (HasSkillProcs() && hand != EQEmu::legacy::SlotRange){ //We check ranged skill procs within the attack functions.
uint16 skillinuse = 28;
if (weapon)
skillinuse = GetSkillByItemType(weapon->ItemType);
@@ -4010,7 +4010,7 @@ void Mob::DoRiposte(Mob *defender)
if (!defender)
return;
defender->Attack(this, SlotPrimary, true);
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
if (HasDied())
return;
@@ -4021,7 +4021,7 @@ void Mob::DoRiposte(Mob *defender)
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
Log.Out(Logs::Detail, Logs::Combat,
"Preforming a double riposted from SE_DoubleRiposte (%d percent chance)", DoubleRipChance);
defender->Attack(this, SlotPrimary, true);
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
if (HasDied())
return;
}
@@ -4034,7 +4034,7 @@ void Mob::DoRiposte(Mob *defender)
Log.Out(Logs::Detail, Logs::Combat,
"Preforming a double riposted from SE_GiveDoubleRiposte base1 == 0 (%d percent chance)",
DoubleRipChance);
defender->Attack(this, SlotPrimary, true);
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
if (HasDied())
return;
}
@@ -4312,7 +4312,7 @@ float Mob::GetSkillProcChances(uint16 ReuseTime, uint16 hand) {
if (!ReuseTime && hand) {
weapon_speed = GetWeaponSpeedbyHand(hand);
ProcChance = static_cast<float>(weapon_speed) * (RuleR(Combat, AvgProcsPerMinute) / 60000.0f);
if (hand != SlotPrimary)
if (hand != EQEmu::legacy::SlotPrimary)
ProcChance /= 2;
}
@@ -4515,13 +4515,13 @@ void Client::SetAttackTimer()
Timer *TimerToUse = nullptr;
for (int i = SlotRange; i <= SlotSecondary; i++) {
for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) {
//pick a timer
if (i == SlotPrimary)
if (i == EQEmu::legacy::SlotPrimary)
TimerToUse = &attack_timer;
else if (i == SlotRange)
else if (i == EQEmu::legacy::SlotRange)
TimerToUse = &ranged_timer;
else if (i == SlotSecondary)
else if (i == EQEmu::legacy::SlotSecondary)
TimerToUse = &attack_dw_timer;
else //invalid slot (hands will always hit this)
continue;
@@ -4534,7 +4534,7 @@ void Client::SetAttackTimer()
ItemToUse = ci->GetItem();
//special offhand stuff
if (i == SlotSecondary) {
if (i == EQEmu::legacy::SlotSecondary) {
//if we cant dual wield, skip it
if (!CanThisClassDualWield() || HasTwoHanderEquipped()) {
attack_dw_timer.Disable();
@@ -4608,19 +4608,19 @@ void NPC::SetAttackTimer()
else
speed = static_cast<int>(((attack_delay / haste_mod) + ((hhe / 100.0f) * attack_delay)) * 100);
for (int i = SlotRange; i <= SlotSecondary; i++) {
for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) {
//pick a timer
if (i == SlotPrimary)
if (i == EQEmu::legacy::SlotPrimary)
TimerToUse = &attack_timer;
else if (i == SlotRange)
else if (i == EQEmu::legacy::SlotRange)
TimerToUse = &ranged_timer;
else if (i == SlotSecondary)
else if (i == EQEmu::legacy::SlotSecondary)
TimerToUse = &attack_dw_timer;
else //invalid slot (hands will always hit this)
continue;
//special offhand stuff
if (i == SlotSecondary) {
if (i == EQEmu::legacy::SlotSecondary) {
// SPECATK_QUAD is uncheesable
if(!CanThisClassDualWield() || (HasTwoHanderEquipped() && !GetSpecialAbility(SPECATK_QUAD))) {
attack_dw_timer.Disable();
@@ -4642,7 +4642,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
bool candouble = CanThisClassDoubleAttack();
// extra off hand non-sense, can only double with skill of 150 or above
// or you have any amount of GiveDoubleAttack
if (candouble && hand == SlotSecondary)
if (candouble && hand == EQEmu::legacy::SlotSecondary)
candouble = GetSkill(SkillDoubleAttack) > 149 || (aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack) > 0;
if (candouble) {
@@ -4650,7 +4650,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
if (CheckDoubleAttack()) {
Attack(target, hand, false, false, IsFromSpell);
// you can only triple from the main hand
if (hand == SlotPrimary && CanThisClassTripleAttack()) {
if (hand == EQEmu::legacy::SlotPrimary && CanThisClassTripleAttack()) {
CheckIncreaseSkill(SkillTripleAttack, target, -10);
if (CheckTripleAttack())
Attack(target, hand, false, false, IsFromSpell);
@@ -4658,7 +4658,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
}
}
if (hand == SlotPrimary) {
if (hand == EQEmu::legacy::SlotPrimary) {
// According to http://www.monkly-business.net/forums/showpost.php?p=312095&postcount=168 a dev told them flurry isn't dependant on triple attack
// the parses kind of back that up and all of my parses seemed to be 4 or 5 attacks in the round which would work out to be
// doubles or triples with 2 from flurries or triple with 1 or 2 flurries ... Going with the "dev quote" I guess like we've always had it
@@ -4711,9 +4711,9 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec
if (RuleB(Combat, UseLiveCombatRounds)) {
// A "quad" on live really is just a successful dual wield where both double attack
// The mobs that could triple lost the ability to when the triple attack skill was added in
Attack(target, SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
if (CanThisClassDoubleAttack() && CheckDoubleAttack()){
Attack(target, SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
@@ -4727,14 +4727,14 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec
if (IsNPC()) {
int16 n_atk = CastToNPC()->GetNumberOfAttacks();
if (n_atk <= 1) {
Attack(target, SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
} else {
for (int i = 0; i < n_atk; ++i) {
Attack(target, SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
}
}
} else {
Attack(target, SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
}
// we use this random value in three comparisons with different
@@ -4745,15 +4745,15 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec
// check double attack, this is NOT the same rules that clients use...
&&
RandRoll < (GetLevel() + NPCDualAttackModifier)) {
Attack(target, SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
// lets see if we can do a triple attack with the main hand
// pets are excluded from triple and quads...
if ((GetSpecialAbility(SPECATK_TRIPLE) || GetSpecialAbility(SPECATK_QUAD)) && !IsPet() &&
RandRoll < (GetLevel() + NPCTripleAttackModifier)) {
Attack(target, SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
// now lets check the quad attack
if (GetSpecialAbility(SPECATK_QUAD) && RandRoll < (GetLevel() + NPCQuadAttackModifier)) {
Attack(target, SlotPrimary, false, false, false, opts, special);
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
}
}
}
@@ -4767,11 +4767,11 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int speci
// For now, SPECATK_QUAD means innate DW when Combat:UseLiveCombatRounds is true
if ((GetSpecialAbility(SPECATK_INNATE_DW) ||
(RuleB(Combat, UseLiveCombatRounds) && GetSpecialAbility(SPECATK_QUAD))) ||
GetEquipment(MaterialSecondary) != 0) {
GetEquipment(EQEmu::legacy::MaterialSecondary) != 0) {
if (CheckDualWield()) {
Attack(target, SlotSecondary, false, false, false, opts, special);
Attack(target, EQEmu::legacy::SlotSecondary, false, false, false, opts, special);
if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()){
Attack(target, SlotSecondary, false, false, false, opts, special);
Attack(target, EQEmu::legacy::SlotSecondary, false, false, false, opts, special);
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
+1 -1
View File
@@ -36,7 +36,7 @@ public:
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; }
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; }
virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return false; }
+33 -32
View File
@@ -145,34 +145,35 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
unsigned int i;
// Update: MainAmmo should only calc skill mods (TODO: Check for other cases)
for (i = SlotCharm; i <= SlotAmmo; i++) {
for (i = EQEmu::legacy::SlotCharm; i <= EQEmu::legacy::SlotAmmo; i++) {
const ItemInst* inst = m_inv[i];
if(inst == 0)
continue;
AddItemBonuses(inst, newbon, false, false, 0, (i == SlotAmmo));
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::legacy::SlotAmmo));
//These are given special flags due to how often they are checked for various spell effects.
const Item_Struct *item = inst->GetItem();
if (i == SlotSecondary && (item && item->ItemType == ItemTypeShield))
if (i == EQEmu::legacy::SlotSecondary && (item && item->ItemType == ItemTypeShield))
SetShieldEquiped(true);
else if (i == SlotPrimary && (item && item->ItemType == ItemType2HBlunt)) {
else if (i == EQEmu::legacy::SlotPrimary && (item && item->ItemType == ItemType2HBlunt)) {
SetTwoHandBluntEquiped(true);
SetTwoHanderEquipped(true);
} else if (i == SlotPrimary && (item && (item->ItemType == ItemType2HSlash || item->ItemType == ItemType2HPiercing)))
}
else if (i == EQEmu::legacy::SlotPrimary && (item && (item->ItemType == ItemType2HSlash || item->ItemType == ItemType2HPiercing)))
SetTwoHanderEquipped(true);
}
//Power Source Slot
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
const ItemInst* inst = m_inv[SlotPowerSource];
const ItemInst* inst = m_inv[EQEmu::legacy::SlotPowerSource];
if(inst)
AddItemBonuses(inst, 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::legacy::TRIBUTE_SIZE; i++) {
const ItemInst* inst = m_inv[EQEmu::legacy::TRIBUTE_BEGIN + i];
if(inst == 0)
continue;
AddItemBonuses(inst, newbon, false, true);
@@ -180,7 +181,7 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
//Optional ability to have worn effects calculate as an addititive bonus instead of highest value
if (RuleI(Spells, AdditiveBonusWornType) && RuleI(Spells, AdditiveBonusWornType) != ET_WornEffect){
for (i = SlotCharm; i < SlotAmmo; i++) {
for (i = EQEmu::legacy::SlotCharm; i < EQEmu::legacy::SlotAmmo; i++) {
const ItemInst* inst = m_inv[i];
if(inst == 0)
continue;
@@ -526,7 +527,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::legacy::ITEM_COMMON_SIZE; i++)
AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item);
}
}
@@ -564,7 +565,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::legacy::ITEM_COMMON_SIZE; i++) {
AdditiveWornBonuses(inst->GetAugment(i),newbon,true);
}
}
@@ -575,7 +576,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::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_BAGS_BEGIN; i++)
{
if (food && drink)
break;
@@ -591,7 +592,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::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::GENERAL_BAGS_END; i++)
{
if (food && drink)
break;
@@ -3200,7 +3201,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon)
{
if(newbon){
for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++){
for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]);
if(cur){
//basic stats
@@ -3278,24 +3279,24 @@ 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::legacy::EQUIPMENT_BEGIN, EQEmu::legacy::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::legacy::GENERAL_BEGIN, EQEmu::legacy::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::legacy::GENERAL_BAGS_BEGIN, EQEmu::legacy::GENERAL_BAGS_END)) // (< 341)
changed = true;
if (CalcItemScale(EQEmu::constants::TRIBUTE_BEGIN, EQEmu::constants::TRIBUTE_END)) // (< 405)
if (CalcItemScale(EQEmu::legacy::TRIBUTE_BEGIN, EQEmu::legacy::TRIBUTE_END)) // (< 405)
changed = true;
//Power Source Slot
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
if(CalcItemScale(SlotPowerSource, SlotPowerSource))
if (CalcItemScale(EQEmu::legacy::SlotPowerSource, EQEmu::legacy::SlotPowerSource))
changed = true;
}
@@ -3310,7 +3311,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
bool changed = false;
uint32 i;
for (i = slot_x; i <= slot_y; i++) {
if (i == SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
if (i == EQEmu::legacy::SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
continue;
ItemInst* inst = m_inv.GetItem(i);
@@ -3320,7 +3321,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::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::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 +3341,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
}
//iterate all augments
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
{
ItemInst * a_inst = inst->GetAugment(x);
if(!a_inst)
@@ -3372,24 +3373,24 @@ 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::legacy::EQUIPMENT_BEGIN, EQEmu::legacy::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::legacy::GENERAL_BEGIN, EQEmu::legacy::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::legacy::GENERAL_BAGS_BEGIN, EQEmu::legacy::GENERAL_BAGS_END)) // (< 341)
changed = true;
if (DoItemEnterZone(EQEmu::constants::TRIBUTE_BEGIN, EQEmu::constants::TRIBUTE_END)) // (< 405)
if (DoItemEnterZone(EQEmu::legacy::TRIBUTE_BEGIN, EQEmu::legacy::TRIBUTE_END)) // (< 405)
changed = true;
//Power Source Slot
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
if(DoItemEnterZone(SlotPowerSource, SlotPowerSource))
if (DoItemEnterZone(EQEmu::legacy::SlotPowerSource, EQEmu::legacy::SlotPowerSource))
changed = true;
}
@@ -3403,7 +3404,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
// behavior change: 'slot_y' is now [RANGE]_END and not [RANGE]_END + 1
bool changed = false;
for(uint32 i = slot_x; i <= slot_y; i++) {
if (i == SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
if (i == EQEmu::legacy::SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
continue;
ItemInst* inst = m_inv.GetItem(i);
@@ -3413,7 +3414,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::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) {
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue;
@@ -3425,7 +3426,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
uint16 oldexp = inst->GetExp();
parse->EventItem(EVENT_ITEM_ENTER_ZONE, this, inst, nullptr, "", 0);
if(i <= SlotAmmo || i == SlotPowerSource) {
if (i <= EQEmu::legacy::SlotAmmo || i == EQEmu::legacy::SlotPowerSource) {
parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i);
}
@@ -3435,7 +3436,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
update_slot = true;
}
} else {
if(i <= SlotAmmo || i == SlotPowerSource) {
if (i <= EQEmu::legacy::SlotAmmo || i == EQEmu::legacy::SlotPowerSource) {
parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i);
}
@@ -3443,7 +3444,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
}
//iterate all augments
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
{
ItemInst *a_inst = inst->GetAugment(x);
if(!a_inst)
+136 -136
View File
@@ -229,8 +229,8 @@ void Bot::SetBotSpellID(uint32 newSpellID) {
}
uint32 Bot::GetBotArcheryRange() {
const ItemInst *range_inst = GetBotItem(SlotRange);
const ItemInst *ammo_inst = GetBotItem(SlotAmmo);
const ItemInst *range_inst = GetBotItem(EQEmu::legacy::SlotRange);
const ItemInst *ammo_inst = GetBotItem(EQEmu::legacy::SlotAmmo);
if (!range_inst || !ammo_inst)
return 0;
@@ -246,15 +246,15 @@ uint32 Bot::GetBotArcheryRange() {
void Bot::ChangeBotArcherWeapons(bool isArcher) {
if((GetClass()==WARRIOR) || (GetClass()==PALADIN) || (GetClass()==RANGER) || (GetClass()==SHADOWKNIGHT) || (GetClass()==ROGUE)) {
if(!isArcher) {
BotAddEquipItem(SlotPrimary, GetBotItemBySlot(SlotPrimary));
BotAddEquipItem(SlotSecondary, GetBotItemBySlot(SlotSecondary));
BotAddEquipItem(EQEmu::legacy::SlotPrimary, GetBotItemBySlot(EQEmu::legacy::SlotPrimary));
BotAddEquipItem(EQEmu::legacy::SlotSecondary, GetBotItemBySlot(EQEmu::legacy::SlotSecondary));
SetAttackTimer();
BotGroupSay(this, "My blade is ready");
} else {
BotRemoveEquipItem(SlotPrimary);
BotRemoveEquipItem(SlotSecondary);
BotAddEquipItem(SlotAmmo, GetBotItemBySlot(SlotAmmo));
BotAddEquipItem(SlotSecondary, GetBotItemBySlot(SlotRange));
BotRemoveEquipItem(EQEmu::legacy::SlotPrimary);
BotRemoveEquipItem(EQEmu::legacy::SlotSecondary);
BotAddEquipItem(EQEmu::legacy::SlotAmmo, GetBotItemBySlot(EQEmu::legacy::SlotAmmo));
BotAddEquipItem(EQEmu::legacy::SlotSecondary, GetBotItemBySlot(EQEmu::legacy::SlotRange));
SetAttackTimer();
BotGroupSay(this, "My bow is true and ready");
}
@@ -1175,11 +1175,11 @@ void Bot::GenerateArmorClass() {
uint16 Bot::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(SlotPrimary);
bool equiped = m_inv.GetItem(EQEmu::legacy::SlotPrimary);
if(!equiped)
skill = SkillHandtoHand;
else {
uint8 type = m_inv.GetItem(SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
switch(type) {
case ItemType1HSlash: {
skill = Skill1HSlashing;
@@ -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::legacy::EQUIPMENT_SIZE];
memset(pet_items, 0, (sizeof(uint32) * EQEmu::legacy::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::legacy::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::legacy::EQUIPMENT_SIZE));
pet_inst->GetPetState(pet_buffs, pet_items, pet_name);
@@ -1906,12 +1906,12 @@ void Bot::BotRangedAttack(Mob* other) {
return;
}
ItemInst* rangedItem = GetBotItem(SlotRange);
ItemInst* rangedItem = GetBotItem(EQEmu::legacy::SlotRange);
const Item_Struct* RangeWeapon = 0;
if(rangedItem)
RangeWeapon = rangedItem->GetItem();
ItemInst* ammoItem = GetBotItem(SlotAmmo);
ItemInst* ammoItem = GetBotItem(EQEmu::legacy::SlotAmmo);
const Item_Struct* Ammo = 0;
if(ammoItem)
Ammo = ammoItem->GetItem();
@@ -2008,7 +2008,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
int damage = 0;
uint32 hate = 0;
int Hand = SlotPrimary;
int Hand = EQEmu::legacy::SlotPrimary;
if (hate == 0 && weapon_damage > 1)
hate = weapon_damage;
@@ -2037,7 +2037,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
else
damage = zone->random.Int(min_hit, max_hit);
if (other->AvoidDamage(this, damage, CanRiposte ? SlotRange : SlotPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior
if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::legacy::SlotRange : EQEmu::legacy::SlotPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior
if (damage == -3) {
DoRiposte(other);
if (HasDied())
@@ -2062,7 +2062,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
damage = -5;
if(skillinuse == SkillBash){
const ItemInst* inst = GetBotItem(SlotSecondary);
const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
const Item_Struct* botweapon = 0;
if(inst)
botweapon = inst->GetItem();
@@ -2109,19 +2109,19 @@ void Bot::ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg)
case SkillFlyingKick:
case SkillRoundKick:
case SkillKick:
item_slot = SlotFeet;
item_slot = EQEmu::legacy::SlotFeet;
break;
case SkillBash:
item_slot = SlotSecondary;
item_slot = EQEmu::legacy::SlotSecondary;
break;
case SkillDragonPunch:
case SkillEagleStrike:
case SkillTigerClaw:
item_slot = SlotHands;
item_slot = EQEmu::legacy::SlotHands;
break;
}
if (item_slot >= EQEmu::constants::EQUIPMENT_BEGIN){
if (item_slot >= EQEmu::legacy::EQUIPMENT_BEGIN){
const ItemInst* inst = GetBotItem(item_slot);
const Item_Struct* botweapon = 0;
if(inst)
@@ -2455,23 +2455,23 @@ void Bot::AI_Process() {
// First, special attack per class (kick, backstab etc..)
DoClassAttacks(GetTarget());
if(attack_timer.Check()) {
Attack(GetTarget(), SlotPrimary);
TriggerDefensiveProcs(GetTarget(), SlotPrimary, false);
ItemInst *wpn = GetBotItem(SlotPrimary);
TryWeaponProc(wpn, GetTarget(), SlotPrimary);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary);
TriggerDefensiveProcs(GetTarget(), EQEmu::legacy::SlotPrimary, false);
ItemInst *wpn = GetBotItem(EQEmu::legacy::SlotPrimary);
TryWeaponProc(wpn, GetTarget(), EQEmu::legacy::SlotPrimary);
bool tripleSuccess = false;
if(BotOwner && GetTarget() && CanThisClassDoubleAttack()) {
if(BotOwner && CheckBotDoubleAttack())
Attack(GetTarget(), SlotPrimary, true);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
if(BotOwner && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE) && CheckBotDoubleAttack(true)) {
tripleSuccess = true;
Attack(GetTarget(), SlotPrimary, true);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
}
//quad attack, does this belong here??
if(BotOwner && GetTarget() && GetSpecialAbility(SPECATK_QUAD) && CheckBotDoubleAttack(true))
Attack(GetTarget(), SlotPrimary, true);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
}
//Live AA - Flurry, Rapid Strikes ect (Flurry does not require Triple Attack).
@@ -2479,18 +2479,18 @@ void Bot::AI_Process() {
if (GetTarget() && flurrychance) {
if(zone->random.Int(0, 100) < flurrychance) {
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
Attack(GetTarget(), SlotPrimary, false);
Attack(GetTarget(), SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
}
}
int32 ExtraAttackChanceBonus = (spellbonuses.ExtraAttackChance + itembonuses.ExtraAttackChance + aabonuses.ExtraAttackChance);
if (GetTarget() && ExtraAttackChanceBonus) {
ItemInst *wpn = GetBotItem(SlotPrimary);
ItemInst *wpn = GetBotItem(EQEmu::legacy::SlotPrimary);
if(wpn) {
if(wpn->GetItem()->ItemType == ItemType2HSlash || wpn->GetItem()->ItemType == ItemType2HBlunt || wpn->GetItem()->ItemType == ItemType2HPiercing) {
if(zone->random.Int(0, 100) < ExtraAttackChanceBonus)
Attack(GetTarget(), SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
}
}
}
@@ -2510,7 +2510,7 @@ void Bot::AI_Process() {
//now off hand
if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) {
const ItemInst* instweapon = GetBotItem(SlotSecondary);
const ItemInst* instweapon = GetBotItem(EQEmu::legacy::SlotSecondary);
const Item_Struct* weapon = 0;
//can only dual wield without a weapon if you're a monk
if(instweapon || (botClass == MONK)) {
@@ -2532,12 +2532,12 @@ void Bot::AI_Process() {
DualWieldProbability += (DualWieldProbability * float(DWBonus) / 100.0f);
float random = zone->random.Real(0, 1);
if (random < DualWieldProbability){ // Max 78% of DW
Attack(GetTarget(), SlotSecondary); // Single attack with offhand
ItemInst *wpn = GetBotItem(SlotSecondary);
TryWeaponProc(wpn, GetTarget(), SlotSecondary);
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
ItemInst *wpn = GetBotItem(EQEmu::legacy::SlotSecondary);
TryWeaponProc(wpn, GetTarget(), EQEmu::legacy::SlotSecondary);
if( CanThisClassDoubleAttack() && CheckBotDoubleAttack()) {
if(GetTarget() && GetTarget()->GetHP() > -10)
Attack(GetTarget(), SlotSecondary); // Single attack with offhand
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
}
}
}
@@ -2708,12 +2708,12 @@ void Bot::PetAIProcess() {
if(!botPet->BehindMob(botPet->GetTarget(), botPet->GetX(), botPet->GetY()) && botPet->GetTarget()->IsEnraged())
return;
if(botPet->Attack(GetTarget(), SlotPrimary)) // try the main hand
if (botPet->Attack(GetTarget(), EQEmu::legacy::SlotPrimary)) // try the main hand
if (botPet->GetTarget()) {
// We're a pet so we re able to dual attack
int32 RandRoll = zone->random.Int(0, 99);
if (botPet->CanThisClassDoubleAttack() && (RandRoll < (botPet->GetLevel() + NPCDualAttackModifier))) {
if(botPet->Attack(botPet->GetTarget(), SlotPrimary)) {}
if (botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotPrimary)) {}
}
}
@@ -2751,11 +2751,11 @@ void Bot::PetAIProcess() {
float DualWieldProbability = ((botPet->GetSkill(SkillDualWield) + botPet->GetLevel()) / 400.0f);
DualWieldProbability -= zone->random.Real(0, 1);
if(DualWieldProbability < 0) {
botPet->Attack(botPet->GetTarget(), SlotSecondary);
botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotSecondary);
if (botPet->CanThisClassDoubleAttack()) {
int32 RandRoll = zone->random.Int(0, 99);
if (RandRoll < (botPet->GetLevel() + 20))
botPet->Attack(botPet->GetTarget(), SlotSecondary);
botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotSecondary);
}
}
}
@@ -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::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
itemID = GetBotItemBySlot(i);
if(itemID != 0) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
@@ -2962,7 +2962,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
const ItemInst* inst = 0;
uint32 spawnedbotid = 0;
spawnedbotid = this->GetBotID();
for (int i = 0; i < MaterialPrimary; i++) {
for (int i = 0; i < EQEmu::legacy::MaterialPrimary; i++) {
inst = GetBotItem(i);
if (inst) {
item = inst->GetItem();
@@ -2981,25 +2981,25 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
}
}
inst = GetBotItem(SlotPrimary);
inst = GetBotItem(EQEmu::legacy::SlotPrimary);
if(inst) {
item = inst->GetItem();
if(item) {
if(strlen(item->IDFile) > 2)
ns->spawn.equipment[MaterialPrimary].Material = atoi(&item->IDFile[2]);
ns->spawn.equipment[EQEmu::legacy::MaterialPrimary].Material = atoi(&item->IDFile[2]);
ns->spawn.colors[MaterialPrimary].Color = GetEquipmentColor(MaterialPrimary);
ns->spawn.colors[EQEmu::legacy::MaterialPrimary].Color = GetEquipmentColor(EQEmu::legacy::MaterialPrimary);
}
}
inst = GetBotItem(SlotSecondary);
inst = GetBotItem(EQEmu::legacy::SlotSecondary);
if(inst) {
item = inst->GetItem();
if(item) {
if(strlen(item->IDFile) > 2)
ns->spawn.equipment[MaterialSecondary].Material = atoi(&item->IDFile[2]);
ns->spawn.equipment[EQEmu::legacy::MaterialSecondary].Material = atoi(&item->IDFile[2]);
ns->spawn.colors[MaterialSecondary].Color = GetEquipmentColor(MaterialSecondary);
ns->spawn.colors[EQEmu::legacy::MaterialSecondary].Color = GetEquipmentColor(EQEmu::legacy::MaterialSecondary);
}
}
}
@@ -3243,7 +3243,7 @@ void Bot::BotAddEquipItem(int slot, uint32 id) {
if(slot > 0 && id > 0) {
uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot);
if(materialFromSlot != MaterialInvalid) {
if (materialFromSlot != EQEmu::legacy::MaterialInvalid) {
equipment[slot] = id; // npc has more than just material slots. Valid material should mean valid inventory index
SendWearChange(materialFromSlot);
}
@@ -3259,11 +3259,11 @@ void Bot::BotRemoveEquipItem(int slot) {
if(slot > 0) {
uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot);
if(materialFromSlot != MaterialInvalid) {
if (materialFromSlot != EQEmu::legacy::MaterialInvalid) {
equipment[slot] = 0; // npc has more than just material slots. Valid material should mean valid inventory index
SendWearChange(materialFromSlot);
if(materialFromSlot == MaterialChest)
SendWearChange(MaterialArms);
if (materialFromSlot == EQEmu::legacy::MaterialChest)
SendWearChange(EQEmu::legacy::MaterialArms);
}
UpdateEquipmentLight();
@@ -3361,12 +3361,12 @@ 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::legacy::TRADE_BEGIN, EQEmu::legacy::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.
// If it is a bag, then we have to search for items in slots 331 thru 340
PerformTradeWithClient(SlotCursor, SlotCursor, client);
PerformTradeWithClient(EQEmu::legacy::SlotCursor, EQEmu::legacy::SlotCursor, client);
// TODO: Add logic here to test if the item in SLOT_CURSOR is a container type, if it is then we need to call the following:
// PerformTradeWithClient(331, 340, client);
@@ -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::legacy::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};
@@ -3395,7 +3395,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
charges[i] = inst->GetCharges();
}
if (i == SlotCursor)
if (i == EQEmu::legacy::SlotCursor)
UpdateClient = true;
//EQoffline: will give the items to the bots and change the bot stats
@@ -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_INDEX_BEGIN; m < EQEmu::constants::ITEM_COMMON_SIZE; ++m) {
for (int m = AUG_INDEX_BEGIN; m < EQEmu::legacy::ITEM_COMMON_SIZE; ++m) {
ItemInst *itm = inst->GetAugment(m);
if(itm)
{
@@ -3423,29 +3423,29 @@ 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::legacy::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::legacy::EQUIPMENT_BEGIN; j <= (EQEmu::legacy::EQUIPMENT_END + 1); ++j) {
if((mWeaponItem->Slots & (1 << j))) {
if (j == 22)
j = 9999;
how_many_slots++;
if(!GetBotItem(j)) {
if(j == SlotPrimary) {
if (j == EQEmu::legacy::SlotPrimary) {
if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if(GetBotItem(SlotSecondary)) {
if (GetBotItem(EQEmu::legacy::SlotSecondary)) {
if(mWeaponItem && (mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if(client->CheckLoreConflict(GetBotItem(SlotSecondary)->GetItem())) {
if (client->CheckLoreConflict(GetBotItem(EQEmu::legacy::SlotSecondary)->GetItem())) {
failedLoreCheck = true;
}
}
else {
ItemInst* remove_item = GetBotItem(SlotSecondary);
BotTradeSwapItem(client, SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
ItemInst* remove_item = GetBotItem(EQEmu::legacy::SlotSecondary);
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
}
@@ -3455,7 +3455,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
}
break;
}
else if(j == SlotSecondary) {
else if (j == EQEmu::legacy::SlotSecondary) {
if(inst->IsWeapon()) {
if(CanThisClassDualWield()) {
BotTradeAddItem(mWeaponItem->ID, inst, inst->GetCharges(), mWeaponItem->Slots, j, &TempErrorMessage);
@@ -3471,10 +3471,10 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
success = true;
}
if(success) {
if(GetBotItem(SlotPrimary)) {
ItemInst* remove_item = GetBotItem(SlotPrimary);
if (GetBotItem(EQEmu::legacy::SlotPrimary)) {
ItemInst* remove_item = GetBotItem(EQEmu::legacy::SlotPrimary);
if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) {
BotTradeSwapItem(client, SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
break;
@@ -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::legacy::EQUIPMENT_BEGIN; j <= (EQEmu::legacy::EQUIPMENT_END + 1); ++j) {
if((mWeaponItem->Slots & (1 << j))) {
if (j == 22)
j = 9999;
swap_item = GetBotItem(j);
failedLoreCheck = false;
for (int k = AUG_INDEX_BEGIN; k < EQEmu::constants::ITEM_COMMON_SIZE; ++k) {
for (int k = AUG_INDEX_BEGIN; k < EQEmu::legacy::ITEM_COMMON_SIZE; ++k) {
ItemInst *itm = swap_item->GetAugment(k);
if(itm)
{
@@ -3509,28 +3509,28 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
failedLoreCheck = true;
}
if(!failedLoreCheck) {
if(j == SlotPrimary) {
if (j == EQEmu::legacy::SlotPrimary) {
if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if(GetBotItem(SlotSecondary)) {
if(client->CheckLoreConflict(GetBotItem(SlotSecondary)->GetItem())) {
if (GetBotItem(EQEmu::legacy::SlotSecondary)) {
if (client->CheckLoreConflict(GetBotItem(EQEmu::legacy::SlotSecondary)->GetItem())) {
failedLoreCheck = true;
}
else {
ItemInst* remove_item = GetBotItem(SlotSecondary);
BotTradeSwapItem(client, SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
ItemInst* remove_item = GetBotItem(EQEmu::legacy::SlotSecondary);
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
}
if(!failedLoreCheck) {
BotTradeSwapItem(client, SlotPrimary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
success = true;
}
break;
}
else if(j == SlotSecondary) {
else if (j == EQEmu::legacy::SlotSecondary) {
if(inst->IsWeapon()) {
if(CanThisClassDualWield()) {
BotTradeSwapItem(client, SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
success = true;
}
else {
@@ -3539,13 +3539,13 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
}
}
else {
BotTradeSwapItem(client, SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
success = true;
}
if(success && GetBotItem(SlotPrimary)) {
ItemInst* remove_item = GetBotItem(SlotPrimary);
if (success && GetBotItem(EQEmu::legacy::SlotPrimary)) {
ItemInst* remove_item = GetBotItem(EQEmu::legacy::SlotPrimary);
if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) {
BotTradeSwapItem(client, SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
break;
@@ -3745,13 +3745,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
FaceTarget(GetTarget());
ItemInst* weapon = nullptr;
if(Hand == SlotPrimary) {
weapon = GetBotItem(SlotPrimary);
if (Hand == EQEmu::legacy::SlotPrimary) {
weapon = GetBotItem(EQEmu::legacy::SlotPrimary);
OffHandAtk(false);
}
if(Hand == SlotSecondary) {
weapon = GetBotItem(SlotSecondary);
if (Hand == EQEmu::legacy::SlotSecondary) {
weapon = GetBotItem(EQEmu::legacy::SlotSecondary);
OffHandAtk(true);
}
@@ -3816,7 +3816,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
// This is not recommended for normal usage, as the damage bonus represents a non-trivial component of the DPS output
// of weapons wielded by higher-level melee characters (especially for two-handed weapons).
int ucDamageBonus = 0;
if(Hand == SlotPrimary && GetLevel() >= 28 && IsWarriorClass()) {
if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass()) {
// Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above
// who belong to a melee class. If we're here, then all of these conditions apply.
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const Item_Struct*) nullptr);
@@ -3826,7 +3826,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
}
#endif
//Live AA - Sinister Strikes *Adds weapon damage bonus to offhand weapon.
if (Hand == SlotSecondary) {
if (Hand == EQEmu::legacy::SlotSecondary) {
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const Item_Struct*) nullptr);
min_hit += (int) ucDamageBonus;
@@ -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::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::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_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y) {
for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::ITEM_COMMON_SIZE; ++y) {
ItemInst *aug = nullptr;
aug = ins->GetAugment(y);
if(aug) {
@@ -4755,15 +4755,15 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) {
float ProcChance = 0.0f;
uint32 weapon_speed = 0;
switch (hand) {
case SlotPrimary:
weapon_speed = attack_timer.GetDuration();
break;
case SlotSecondary:
weapon_speed = attack_dw_timer.GetDuration();
break;
case SlotRange:
weapon_speed = ranged_timer.GetDuration();
break;
case EQEmu::legacy::SlotPrimary:
weapon_speed = attack_timer.GetDuration();
break;
case EQEmu::legacy::SlotSecondary:
weapon_speed = attack_dw_timer.GetDuration();
break;
case EQEmu::legacy::SlotRange:
weapon_speed = ranged_timer.GetDuration();
break;
}
if (weapon_speed < RuleI(Combat, MinHastedDelay))
@@ -4787,7 +4787,7 @@ int Bot::GetHandToHandDamage(void) {
// everyone uses this in the revamp!
int skill = GetSkill(SkillHandtoHand);
int epic = 0;
if (CastToNPC()->GetEquipment(MaterialHands) == 10652 && GetLevel() > 46)
if (CastToNPC()->GetEquipment(EQEmu::legacy::MaterialHands) == 10652 && GetLevel() > 46)
epic = 280;
if (epic > skill)
skill = epic;
@@ -4809,7 +4809,7 @@ int Bot::GetHandToHandDamage(void) {
9, 9, 9, 9, 9, 10, 10, 10, 10, 10, // 31-40
10, 11, 11, 11, 11, 11, 11, 12, 12}; // 41-49
if (GetClass() == MONK) {
if (CastToNPC()->GetEquipment(MaterialHands) == 10652 && GetLevel() > 50)
if (CastToNPC()->GetEquipment(EQEmu::legacy::MaterialHands) == 10652 && GetLevel() > 50)
return 9;
if (level > 62)
return 15;
@@ -4848,11 +4848,11 @@ void Bot::DoRiposte(Mob* defender) {
if (!defender)
return;
defender->Attack(this, SlotPrimary, true);
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
int32 DoubleRipChance = (defender->GetAABonuses().GiveDoubleRiposte[0] + defender->GetSpellBonuses().GiveDoubleRiposte[0] + defender->GetItemBonuses().GiveDoubleRiposte[0]);
if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) {
Log.Out(Logs::Detail, Logs::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
defender->Attack(this, SlotPrimary, true);
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
}
DoubleRipChance = defender->GetAABonuses().GiveDoubleRiposte[1];
@@ -4870,7 +4870,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
hate = hate_override;
if(skill == SkillBash) {
const ItemInst* inst = GetBotItem(SlotSecondary);
const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
const Item_Struct* botweapon = 0;
if(inst)
botweapon = inst->GetItem();
@@ -4884,14 +4884,14 @@ void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
}
min_damage += (min_damage * GetMeleeMinDamageMod_SE(skill) / 100);
int hand = SlotPrimary;
int hand = EQEmu::legacy::SlotPrimary;
if (skill == SkillThrowing || skill == SkillArchery)
hand = SlotRange;
hand = EQEmu::legacy::SlotRange;
if (who->AvoidDamage(this, max_damage, hand)) {
if (max_damage == -3)
DoRiposte(who);
} else {
if (HitChance || who->CheckHitChance(this, skill, SlotPrimary)) {
if (HitChance || who->CheckHitChance(this, skill, EQEmu::legacy::SlotPrimary)) {
who->MeleeMitigation(this, max_damage, min_damage);
ApplyMeleeDamageBonus(skill, max_damage);
max_damage += who->GetFcDamageAmtIncoming(this, 0, true, skill);
@@ -4935,7 +4935,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
bool bIsBehind = false;
bool bCanFrontalBS = false;
const ItemInst* inst = GetBotItem(SlotPrimary);
const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotPrimary);
const Item_Struct* botpiercer = nullptr;
if(inst)
botpiercer = inst->GetItem();
@@ -4985,7 +4985,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
}
}
else
Attack(other, SlotPrimary);
Attack(other, EQEmu::legacy::SlotPrimary);
}
void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
@@ -4995,11 +4995,11 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
int32 hate = 0;
int32 primaryweapondamage = 0;
int32 backstab_dmg = 0;
ItemInst* botweaponInst = GetBotItem(SlotPrimary);
ItemInst* botweaponInst = GetBotItem(EQEmu::legacy::SlotPrimary);
if(botweaponInst) {
primaryweapondamage = GetWeaponDamage(other, botweaponInst);
backstab_dmg = botweaponInst->GetItem()->BackstabDmg;
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) {
ItemInst *aug = botweaponInst->GetAugment(i);
if(aug)
backstab_dmg += aug->GetItem()->BackstabDmg;
@@ -5043,7 +5043,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
}
void Bot::RogueAssassinate(Mob* other) {
ItemInst* botweaponInst = GetBotItem(SlotPrimary);
ItemInst* botweaponInst = GetBotItem(EQEmu::legacy::SlotPrimary);
if(botweaponInst) {
if(GetWeaponDamage(other, botweaponInst))
other->Damage(this, 32000, SPELL_UNKNOWN, SkillBackstab);
@@ -5109,7 +5109,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
case WARRIOR:
if(level >= RuleI(Combat, NPCBashKickLevel)){
bool canBash = false;
if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(SlotSecondary) && m_inv.GetItem(SlotSecondary)->GetItem()->ItemType == ItemTypeShield) || (m_inv.GetItem(SlotPrimary) && (m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1))
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::legacy::SlotSecondary) && m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType == ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && (m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1))
canBash = true;
if(!canBash || zone->random.Int(0, 100) > 25)
@@ -5128,7 +5128,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
case SHADOWKNIGHT:
case PALADIN:
if(level >= RuleI(Combat, NPCBashKickLevel)){
if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(SlotSecondary) && m_inv.GetItem(SlotSecondary)->GetItem()->ItemType == ItemTypeShield) || (m_inv.GetItem(SlotPrimary) && (m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1))
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::legacy::SlotSecondary) && m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType == ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && (m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1))
skill_to_use = SkillBash;
}
break;
@@ -5157,7 +5157,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
if(skill_to_use == SkillBash) {
if (target != this) {
DoAnim(animTailRake);
if(GetWeaponDamage(target, GetBotItem(SlotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(SlotShoulders)) <= 0)
if (GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotShoulders)) <= 0)
dmg = -5;
else {
if(!target->CheckHitChance(this, SkillBash, 0))
@@ -5207,7 +5207,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
if(skill_to_use == SkillKick) {
if(target != this) {
DoAnim(animKick);
if(GetWeaponDamage(target, GetBotItem(SlotFeet)) <= 0)
if (GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotFeet)) <= 0)
dmg = -5;
else {
if(!target->CheckHitChance(this, SkillKick, 0))
@@ -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::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
inst = GetBotItem(i);
if(inst) {
item = inst->GetItem();
@@ -5501,12 +5501,12 @@ void Bot::SetAttackTimer() {
attack_timer.SetAtTrigger(4000, true);
Timer* TimerToUse = nullptr;
const Item_Struct* PrimaryWeapon = nullptr;
for (int i = SlotRange; i <= SlotSecondary; i++) {
if (i == SlotPrimary)
for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) {
if (i == EQEmu::legacy::SlotPrimary)
TimerToUse = &attack_timer;
else if (i == SlotRange)
else if (i == EQEmu::legacy::SlotRange)
TimerToUse = &ranged_timer;
else if (i == SlotSecondary)
else if (i == EQEmu::legacy::SlotSecondary)
TimerToUse = &attack_dw_timer;
else
continue;
@@ -5516,7 +5516,7 @@ void Bot::SetAttackTimer() {
if (ci)
ItemToUse = ci->GetItem();
if (i == SlotSecondary) {
if (i == EQEmu::legacy::SlotSecondary) {
if (PrimaryWeapon != nullptr) {
if (PrimaryWeapon->ItemClass == ItemClassCommon && (PrimaryWeapon->ItemType == ItemType2HSlash || PrimaryWeapon->ItemType == ItemType2HBlunt || PrimaryWeapon->ItemType == ItemType2HPiercing)) {
attack_dw_timer.Disable();
@@ -5547,7 +5547,7 @@ void Bot::SetAttackTimer() {
speed = (RuleB(Spells, Jun182014HundredHandsRevamp) ? static_cast<int>(((delay / haste_mod) + ((hhe / 1000.0f) * (delay / haste_mod))) * 100) : static_cast<int>(((delay / haste_mod) + ((hhe / 100.0f) * delay)) * 100));
TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true);
if(i == SlotPrimary)
if (i == EQEmu::legacy::SlotPrimary)
PrimaryWeapon = ItemToUse;
}
}
@@ -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::legacy::EQUIPMENT_BEGIN; L <= EQEmu::legacy::SlotWaist; L++) {
inst = inspectedBot->GetBotItem(L);
if(inst) {
@@ -7206,7 +7206,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
}
}
inst = inspectedBot->GetBotItem(SlotPowerSource);
inst = inspectedBot->GetBotItem(EQEmu::legacy::SlotPowerSource);
if(inst) {
item = inst->GetItem();
@@ -7218,7 +7218,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
insr->itemicons[SoF::inventory::SlotPowerSource] = 0xFFFFFFFF;
}
inst = inspectedBot->GetBotItem(SlotAmmo);
inst = inspectedBot->GetBotItem(EQEmu::legacy::SlotAmmo);
if(inst) {
item = inst->GetItem();
@@ -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::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::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::legacy::ITEM_COMMON_SIZE; i++)
AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level);
}
@@ -8042,12 +8042,12 @@ uint8 Bot::GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets) {
int Bot::GetRawACNoShield(int &shield_ac) {
int ac = itembonuses.AC + spellbonuses.AC;
shield_ac = 0;
ItemInst* inst = GetBotItem(SlotSecondary);
ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
if(inst) {
if(inst->GetItem()->ItemType == ItemTypeShield) {
ac -= inst->GetItem()->AC;
shield_ac = inst->GetItem()->AC;
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::legacy::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::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
inst = GetBotItem(i);
if(inst) {
TempItem = inst->GetItem();
@@ -8421,7 +8421,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag)
if (slot_id != INVALID_INDEX)
return false;
for (uint8 i = 0; i < MaterialPrimary; ++i) {
for (uint8 i = 0; i < EQEmu::legacy::MaterialPrimary; ++i) {
uint8 inv_slot = Inventory::CalcSlotFromMaterial(i);
ItemInst* inst = m_inv.GetItem(inv_slot);
if (!inst)
@@ -8433,7 +8433,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag)
}
else {
uint8 mat_slot = Inventory::CalcMaterialFromSlot(slot_id);
if (mat_slot == MaterialInvalid || mat_slot >= MaterialPrimary)
if (mat_slot == EQEmu::legacy::MaterialInvalid || mat_slot >= EQEmu::legacy::MaterialPrimary)
return false;
ItemInst* inst = m_inv.GetItem(slot_id);
+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::legacy::EQUIPMENT_BEGIN && x <= EQEmu::legacy::EQUIPMENT_END) ? (x) : ((x == EQEmu::legacy::SlotPowerSource) ? (22) : (23)))
static std::string bot_equip_slot_name[EQEmu::constants::EQUIPMENT_SIZE + 2] =
static std::string bot_equip_slot_name[EQEmu::legacy::EQUIPMENT_SIZE + 2] =
{
"Charm", // MainCharm
"Left Ear", // MainEar1
@@ -207,7 +207,7 @@ public:
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr, int special = 0);
virtual bool HasRaid() { return (GetRaid() ? true : false); }
virtual bool HasGroup() { return (GetGroup() ? true : false); }
+39 -39
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::legacy::EQUIPMENT_BEGIN; index <= EQEmu::legacy::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));
@@ -4357,7 +4357,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
// TODO: Trouble-shoot model update issue
const std::string msg_matslot = StringFormat("mat_slot: %c(All), %i(Head), %i(Chest), %i(Arms), %i(Wrists), %i(Hands), %i(Legs), %i(Feet)",
'*', MaterialHead, MaterialChest, MaterialArms, MaterialWrist, MaterialHands, MaterialLegs, MaterialFeet);
'*', EQEmu::legacy::MaterialHead, EQEmu::legacy::MaterialChest, EQEmu::legacy::MaterialArms, EQEmu::legacy::MaterialWrist, EQEmu::legacy::MaterialHands, EQEmu::legacy::MaterialLegs, EQEmu::legacy::MaterialFeet);
if (helper_command_alias_fail(c, "bot_subcommand_bot_dye_armor", sep->arg[0], "botdyearmor"))
return;
@@ -4368,7 +4368,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
}
const int ab_mask = ActionableBots::ABM_NoFilter;
uint8 material_slot = MaterialInvalid;
uint8 material_slot = EQEmu::legacy::MaterialInvalid;
int16 slot_id = INVALID_INDEX;
bool dye_all = (sep->arg[1][0] == '*');
@@ -4376,7 +4376,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
material_slot = atoi(sep->arg[1]);
slot_id = Inventory::CalcSlotFromMaterial(material_slot);
if (!sep->IsNumber(1) || slot_id == INVALID_INDEX || material_slot > MaterialFeet) {
if (!sep->IsNumber(1) || slot_id == INVALID_INDEX || material_slot > EQEmu::legacy::MaterialFeet) {
c->Message(m_fail, "Valid [mat_slot]s for this command are:");
c->Message(m_fail, msg_matslot.c_str());
return;
@@ -7070,24 +7070,24 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
linker.SetLinkType(linker.SayLinkItemInst);
uint32 inventory_count = 0;
for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= (EQEmu::constants::EQUIPMENT_END + 1); ++i) {
if ((i == SlotSecondary) && is2Hweapon)
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
if ((i == EQEmu::legacy::SlotSecondary) && is2Hweapon)
continue;
inst = my_bot->CastToBot()->GetBotItem(i == 22 ? SlotPowerSource : i);
inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::legacy::SlotPowerSource : i);
if (!inst || !inst->GetItem()) {
c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? SlotPowerSource : i));
c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? EQEmu::legacy::SlotPowerSource : i));
continue;
}
item = inst->GetItem();
if ((i == SlotPrimary) && ((item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HPiercing))) {
if ((i == EQEmu::legacy::SlotPrimary) && ((item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HPiercing))) {
is2Hweapon = true;
}
linker.SetItemInst(inst);
item_link = linker.GenerateLink();
c->Message(m_message, "Using %s in my %s (slot %i)", item_link.c_str(), GetBotEquipSlotName(i), (i == 22 ? SlotPowerSource : i));
c->Message(m_message, "Using %s in my %s (slot %i)", item_link.c_str(), GetBotEquipSlotName(i), (i == 22 ? EQEmu::legacy::SlotPowerSource : i));
++inventory_count;
}
@@ -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::legacy::EQUIPMENT_END || slotId < EQEmu::legacy::EQUIPMENT_BEGIN) && slotId != EQEmu::legacy::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_INDEX_BEGIN; m < EQEmu::constants::ITEM_COMMON_SIZE; ++m) {
for (int m = AUG_INDEX_BEGIN; m < EQEmu::legacy::ITEM_COMMON_SIZE; ++m) {
if (!itminst)
break;
@@ -7158,7 +7158,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
std::string error_message;
if (itm) {
c->PushItemOnCursor(*itminst, true);
if ((slotId == SlotRange) || (slotId == SlotAmmo) || (slotId == SlotPrimary) || (slotId == SlotSecondary))
if ((slotId == EQEmu::legacy::SlotRange) || (slotId == EQEmu::legacy::SlotAmmo) || (slotId == EQEmu::legacy::SlotPrimary) || (slotId == EQEmu::legacy::SlotSecondary))
my_bot->SetBotArcher(false);
my_bot->RemoveBotItemBySlot(slotId, &error_message);
@@ -7172,31 +7172,31 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
}
switch (slotId) {
case SlotCharm:
case SlotEar1:
case SlotHead:
case SlotFace:
case SlotEar2:
case SlotNeck:
case SlotBack:
case SlotWrist1:
case SlotWrist2:
case SlotRange:
case SlotPrimary:
case SlotSecondary:
case SlotFinger1:
case SlotFinger2:
case SlotChest:
case SlotWaist:
case SlotPowerSource:
case SlotAmmo:
case EQEmu::legacy::SlotCharm:
case EQEmu::legacy::SlotEar1:
case EQEmu::legacy::SlotHead:
case EQEmu::legacy::SlotFace:
case EQEmu::legacy::SlotEar2:
case EQEmu::legacy::SlotNeck:
case EQEmu::legacy::SlotBack:
case EQEmu::legacy::SlotWrist1:
case EQEmu::legacy::SlotWrist2:
case EQEmu::legacy::SlotRange:
case EQEmu::legacy::SlotPrimary:
case EQEmu::legacy::SlotSecondary:
case EQEmu::legacy::SlotFinger1:
case EQEmu::legacy::SlotFinger2:
case EQEmu::legacy::SlotChest:
case EQEmu::legacy::SlotWaist:
case EQEmu::legacy::SlotPowerSource:
case EQEmu::legacy::SlotAmmo:
c->Message(m_message, "My %s is %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already")));
break;
case SlotShoulders:
case SlotArms:
case SlotHands:
case SlotLegs:
case SlotFeet:
case EQEmu::legacy::SlotShoulders:
case EQEmu::legacy::SlotArms:
case EQEmu::legacy::SlotHands:
case EQEmu::legacy::SlotLegs:
case EQEmu::legacy::SlotFeet:
c->Message(m_message, "My %s are %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already")));
break;
default:
@@ -7233,14 +7233,14 @@ 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::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
const Item_Struct* item = nullptr;
const ItemInst* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? SlotPowerSource : i);
const ItemInst* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::legacy::SlotPowerSource : i);
if (inst)
item = inst->GetItem();
window_text.append("<c \"#FFFFFF\">");
window_text.append(GetBotEquipSlotName(i == 22 ? SlotPowerSource : i));
window_text.append(GetBotEquipSlotName(i == 22 ? EQEmu::legacy::SlotPowerSource : i));
window_text.append(": ");
if (item) {
//window_text.append("</c>");
+12 -12
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::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::legacy::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::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || slot_id == EQEmu::legacy::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::legacy::EQUIPMENT_END && slot_id != EQEmu::legacy::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::legacy::EQUIPMENT_END && slot_id != EQEmu::legacy::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::legacy::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::legacy::EQUIPMENT_END && slot_id != EQEmu::legacy::SlotPowerSource))
return false;
query = StringFormat("DELETE FROM `bot_inventories` WHERE `bot_id` = '%u' AND `slot_id` = '%u'", bot_id, slot_id);
@@ -1294,12 +1294,12 @@ 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::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::legacy::SlotPowerSource && !all_flag)
return false;
std::string where_clause;
if (all_flag)
where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", SlotHead, SlotArms, SlotWrist1, SlotHands, SlotChest, SlotLegs, SlotFeet);
where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", EQEmu::legacy::SlotHead, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet);
else
where_clause = StringFormat(" AND `slot_id` = '%u'", slot_id);
@@ -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::legacy::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::legacy::EQUIPMENT_SIZE; ++item_index) {
if (!pet_items[item_index])
continue;
@@ -1744,7 +1744,7 @@ bool BotDatabase::SaveAllArmorColorBySlot(const uint32 owner_id, const int16 slo
" AND bi.`slot_id` = '%i'",
owner_id,
rgb_value,
SlotHead, SlotChest, SlotArms, SlotWrist1, SlotWrist2, SlotHands, SlotLegs, SlotFeet,
EQEmu::legacy::SlotHead, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotWrist2, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet,
slot_id
);
auto results = QueryDatabase(query);
@@ -1768,7 +1768,7 @@ bool BotDatabase::SaveAllArmorColors(const uint32 owner_id, const uint32 rgb_val
" AND bi.`slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
owner_id,
rgb_value,
SlotHead, SlotChest, SlotArms, SlotWrist1, SlotWrist2, SlotHands, SlotLegs, SlotFeet
EQEmu::legacy::SlotHead, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotWrist2, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet
);
auto results = QueryDatabase(query);
if (!results.Success())
+73 -73
View File
@@ -2732,7 +2732,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 != EQEmu::legacy::MaterialInvalid)
{
m_pp.item_material[matslot] = GetEquipmentMaterial(matslot);
}
@@ -3074,7 +3074,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 != EQEmu::legacy::MaterialInvalid)
{
m_pp.item_tint[matslot].Color = color.Color;
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.Color);
@@ -3151,58 +3151,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...)
if(bracer)
return SlotWrist2;
switch(slot){
case MaterialHead:
slot2 = SlotHead;
break;
case MaterialChest:
slot2 = SlotChest;
break;
case MaterialArms:
slot2 = SlotArms;
break;
case MaterialWrist:
slot2 = SlotWrist1;
break;
case MaterialHands:
slot2 = SlotHands;
break;
case MaterialLegs:
slot2 = SlotLegs;
break;
case MaterialFeet:
slot2 = SlotFeet;
break;
}
return EQEmu::legacy::SlotWrist2;
switch(slot) {
case EQEmu::legacy::MaterialHead:
slot2 = EQEmu::legacy::SlotHead;
break;
case EQEmu::legacy::MaterialChest:
slot2 = EQEmu::legacy::SlotChest;
break;
case EQEmu::legacy::MaterialArms:
slot2 = EQEmu::legacy::SlotArms;
break;
case EQEmu::legacy::MaterialWrist:
slot2 = EQEmu::legacy::SlotWrist1;
break;
case EQEmu::legacy::MaterialHands:
slot2 = EQEmu::legacy::SlotHands;
break;
case EQEmu::legacy::MaterialLegs:
slot2 = EQEmu::legacy::SlotLegs;
break;
case EQEmu::legacy::MaterialFeet:
slot2 = EQEmu::legacy::SlotFeet;
break;
}
return slot2;
}
uint8 Client::SlotConvert2(uint8 slot){
uint8 slot2 = 0; // same as above...
switch(slot){
case SlotHead:
slot2 = MaterialHead;
break;
case SlotChest:
slot2 = MaterialChest;
break;
case SlotArms:
slot2 = MaterialArms;
break;
case SlotWrist1:
slot2 = MaterialWrist;
break;
case SlotHands:
slot2 = MaterialHands;
break;
case SlotLegs:
slot2 = MaterialLegs;
break;
case SlotFeet:
slot2 = MaterialFeet;
break;
}
case EQEmu::legacy::SlotHead:
slot2 = EQEmu::legacy::MaterialHead;
break;
case EQEmu::legacy::SlotChest:
slot2 = EQEmu::legacy::MaterialChest;
break;
case EQEmu::legacy::SlotArms:
slot2 = EQEmu::legacy::MaterialArms;
break;
case EQEmu::legacy::SlotWrist1:
slot2 = EQEmu::legacy::MaterialWrist;
break;
case EQEmu::legacy::SlotHands:
slot2 = EQEmu::legacy::MaterialHands;
break;
case EQEmu::legacy::SlotLegs:
slot2 = EQEmu::legacy::MaterialLegs;
break;
case EQEmu::legacy::SlotFeet:
slot2 = EQEmu::legacy::MaterialFeet;
break;
}
return slot2;
}
@@ -4204,14 +4204,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(SlotPrimary);
bool equiped = m_inv.GetItem(EQEmu::legacy::SlotPrimary);
if (!equiped)
skill = SkillHandtoHand;
else {
uint8 type = m_inv.GetItem(SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
switch (type)
{
@@ -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::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; ++i) {
ItemInst *item = GetInv().GetItem(i);
if (!item) {
free_slot = i;
@@ -5738,7 +5738,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
}
}
inst = requestee->GetInv().GetItem(SlotPowerSource);
inst = requestee->GetInv().GetItem(EQEmu::legacy::SlotPowerSource);
if(inst) {
item = inst->GetItem();
@@ -5752,7 +5752,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
insr->itemicons[SoF::inventory::SlotPowerSource] = 0xFFFFFFFF;
}
inst = requestee->GetInv().GetItem(SlotAmmo);
inst = requestee->GetInv().GetItem(EQEmu::legacy::SlotAmmo);
if(inst) {
item = inst->GetItem();
@@ -6293,8 +6293,8 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
made_npc->Corrup = GetCorrup();
made_npc->PhR = GetPhR();
// looks
made_npc->texture = GetEquipmentMaterial(MaterialChest);
made_npc->helmtexture = GetEquipmentMaterial(MaterialHead);
made_npc->texture = GetEquipmentMaterial(EQEmu::legacy::MaterialChest);
made_npc->helmtexture = GetEquipmentMaterial(EQEmu::legacy::MaterialHead);
made_npc->haircolor = GetHairColor();
made_npc->beardcolor = GetBeardColor();
made_npc->eyecolor1 = GetEyeColor1();
@@ -6305,9 +6305,9 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
made_npc->drakkin_heritage = GetDrakkinHeritage();
made_npc->drakkin_tattoo = GetDrakkinTattoo();
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++) {
made_npc->d_melee_texture1 = GetEquipmentMaterial(EQEmu::legacy::MaterialPrimary);
made_npc->d_melee_texture2 = GetEquipmentMaterial(EQEmu::legacy::MaterialSecondary);
for (int i = EQEmu::legacy::MATERIAL_BEGIN; i <= EQEmu::legacy::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::legacy::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::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; i++)
{
TryItemTick(i);
}
//Scan main inventory + cursor
for (i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++)
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++)
{
TryItemTick(i);
}
//Scan bags
for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++)
for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::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::legacy::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::legacy::EQUIPMENT_END) { return; }
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::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::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; i++)
{
TryItemTimer(i);
}
for (i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++)
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++)
{
TryItemTimer(i);
}
for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++)
for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::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::legacy::EQUIPMENT_END) {
return;
}
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::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::legacy::GENERAL_BEGIN; r <= EQEmu::legacy::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::legacy::GENERAL_END)
// we will get here if we don't find a valid quiver
return 0;
}
@@ -8435,7 +8435,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, SlotPowerSource);
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, EQEmu::legacy::SlotPowerSource);
if (faction)
{
+2 -2
View File
@@ -218,7 +218,7 @@ public:
//abstract virtual function implementations required by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr, int special = 0);
virtual bool HasRaid() { return (GetRaid() ? true : false); }
virtual bool HasGroup() { return (GetGroup() ? true : false); }
@@ -814,7 +814,7 @@ public:
void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false);
void PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data = 0);
bool AutoPutLootInInventory(ItemInst& inst, bool try_worn = false, bool try_cursor = true, ServerLootItem_Struct** bag_item_data = 0);
bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = SlotCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0);
bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = EQEmu::legacy::SlotCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0);
void SetStats(uint8 type,int16 set_val);
void IncStats(uint8 type,int16 increase_val);
void DropItem(int16 slot_id);
+11 -11
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::legacy::EQUIPMENT_BEGIN; slot_id < EQEmu::legacy::EQUIPMENT_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if (inst && inst->IsType(ItemClassCommon)) {
Total += inst->GetItem()->AC;
@@ -1067,9 +1067,9 @@ int32 Client::CalcAC()
}
// Shield AC bonus for HeroicSTR
if (itembonuses.HeroicSTR) {
bool equiped = CastToClient()->m_inv.GetItem(SlotSecondary);
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary);
if (equiped) {
uint8 shield = CastToClient()->m_inv.GetItem(SlotSecondary)->GetItem()->ItemType;
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType;
if (shield == ItemTypeShield) {
displayed += itembonuses.HeroicSTR / 2;
}
@@ -1096,9 +1096,9 @@ int32 Client::GetACMit()
}
// Shield AC bonus for HeroicSTR
if (itembonuses.HeroicSTR) {
bool equiped = CastToClient()->m_inv.GetItem(SlotSecondary);
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary);
if (equiped) {
uint8 shield = CastToClient()->m_inv.GetItem(SlotSecondary)->GetItem()->ItemType;
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType;
if (shield == ItemTypeShield) {
mitigation += itembonuses.HeroicSTR / 2;
}
@@ -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::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::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::legacy::GENERAL_BAGS_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++) { // include cursor bags or not?
int TmpWeight = 0;
TempItem = 0;
ins = GetInv().GetItem(x);
@@ -1329,9 +1329,9 @@ uint32 Client::CalcCurrentWeight()
if (TmpWeight > 0) {
// this code indicates that weight redux bags can only be in the first general inventory slot to be effective...
// is this correct? or can we scan for the highest weight redux and use that? (need client verifications)
int bagslot = SlotGeneral1;
int bagslot = EQEmu::legacy::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::legacy::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::legacy::GENERAL_BAGS_END; m += 10) { // include cursor bags or not?
if (x >= m) {
bagslot += 1;
}
@@ -2205,12 +2205,12 @@ int Client::GetRawACNoShield(int &shield_ac) const
{
int ac = itembonuses.AC + spellbonuses.AC + aabonuses.AC;
shield_ac = 0;
const ItemInst *inst = m_inv.GetItem(SlotSecondary);
const ItemInst *inst = m_inv.GetItem(EQEmu::legacy::SlotSecondary);
if (inst) {
if (inst->GetItem()->ItemType == ItemTypeShield) {
ac -= inst->GetItem()->AC;
shield_ac = inst->GetItem()->AC;
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
if (inst->GetAugment(i)) {
ac -= inst->GetAugment(i)->GetItem()->AC;
shield_ac += inst->GetAugment(i)->GetItem()->AC;
+31 -31
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::legacy::MATERIAL_BEGIN; i <= EQEmu::legacy::MATERIAL_END; i++)
{
if (m_pp.item_tint[i].RGB.UseTint == 1 || m_pp.item_tint[i].RGB.UseTint == 255)
{
@@ -1689,7 +1689,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
if (iter == m_inv.cursor_cbegin())
continue;
const ItemInst *inst = *iter;
SendItemPacket(SlotCursor, inst, ItemPacketSummonItem);
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketSummonItem);
}
}
@@ -2027,7 +2027,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
ItemInst *inst = database.CreateItem(item, charges);
if (!AutoPutLootInInventory(*inst, true, true))
{
PutLootInInventory(SlotCursor, *inst);
PutLootInInventory(EQEmu::legacy::SlotCursor, *inst);
}
Save(1);
}
@@ -2550,7 +2550,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
ItemInst *inst = database.CreateItem(item, charges);
if (!AutoPutLootInInventory(*inst, true, true))
{
PutLootInInventory(SlotCursor, *inst);
PutLootInInventory(EQEmu::legacy::SlotCursor, *inst);
}
Save(1);
@@ -2600,7 +2600,7 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app)
SetAlternateCurrencyValue(reclaim->currency_id, 0);
}
else {
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, SlotCursor);
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, EQEmu::legacy::SlotCursor);
AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count));
}
/* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */
@@ -2811,8 +2811,8 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
}
uint32 ApplyPoisonSuccessResult = 0;
ApplyPoison_Struct* ApplyPoisonData = (ApplyPoison_Struct*)app->pBuffer;
const ItemInst* PrimaryWeapon = GetInv().GetItem(SlotPrimary);
const ItemInst* SecondaryWeapon = GetInv().GetItem(SlotSecondary);
const ItemInst* PrimaryWeapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary);
const ItemInst* SecondaryWeapon = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
const ItemInst* PoisonItemInstance = GetInv()[ApplyPoisonData->inventorySlot];
bool IsPoison = PoisonItemInstance && (PoisonItemInstance->GetItem()->ItemType == ItemTypePoison);
@@ -2994,7 +2994,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
{
case 0: // Adding an augment
case 2: // Swapping augment
new_aug = user_inv.GetItem(SlotCursor);
new_aug = user_inv.GetItem(EQEmu::legacy::SlotCursor);
if (!new_aug) // Shouldn't get the OP code without the augment on the user's cursor, but maybe it's h4x.
{
@@ -3052,7 +3052,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
if (itemOneToPush)
{
DeleteItemInInventory(item_slot, 0, true);
DeleteItemInInventory(SlotCursor, new_aug->IsStackable() ? 1 : 0, true);
DeleteItemInInventory(EQEmu::legacy::SlotCursor, new_aug->IsStackable() ? 1 : 0, true);
if (solvent)
{
@@ -3063,7 +3063,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
if (itemTwoToPush)
{
// This is a swap. Return the old aug to the player's cursor.
if (!PutItemInInventory(SlotCursor, *itemTwoToPush, true))
if (!PutItemInInventory(EQEmu::legacy::SlotCursor, *itemTwoToPush, true))
{
Log.Out(Logs::General, Logs::Error, "Problem returning old augment to player's cursor after augmentation swap.");
Message(15, "Error: Failed to retrieve old augment after augmentation swap!");
@@ -3076,7 +3076,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
CalcBonuses();
if (mat != MaterialInvalid)
if (mat != EQEmu::legacy::MaterialInvalid)
{
SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed.
}
@@ -3141,13 +3141,13 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
CalcBonuses();
if (mat != MaterialInvalid)
if (mat != EQEmu::legacy::MaterialInvalid)
{
SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed.
}
// Drop the removed augment on the player's cursor
if (!PutItemInInventory(SlotCursor, *itemTwoToPush, true))
if (!PutItemInInventory(EQEmu::legacy::SlotCursor, *itemTwoToPush, true))
{
Log.Out(Logs::General, Logs::Error, "Problem returning augment to player's cursor after safe removal.");
Message(15, "Error: Failed to return augment after removal from item!");
@@ -3196,7 +3196,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
CalcBonuses();
if (mat != MaterialInvalid)
if (mat != EQEmu::legacy::MaterialInvalid)
{
SendWearChange(mat);
}
@@ -4072,7 +4072,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
}
else
{
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", SlotCursor, castspell->inventoryslot);
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", EQEmu::legacy::SlotCursor, castspell->inventoryslot);
InterruptSpell(castspell->spell_id);
}
}
@@ -4991,7 +4991,7 @@ void Client::Handle_OP_CrashDump(const EQApplicationPacket *app)
void Client::Handle_OP_CreateObject(const EQApplicationPacket *app)
{
DropItem(SlotCursor);
DropItem(EQEmu::legacy::SlotCursor);
return;
}
@@ -6905,7 +6905,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
return;
}
ItemInst *CursorItemInst = GetInv().GetItem(SlotCursor);
ItemInst *CursorItemInst = GetInv().GetItem(EQEmu::legacy::SlotCursor);
bool Allowed = true;
@@ -6953,7 +6953,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
{
GuildBankDepositAck(false, sentAction);
DeleteItemInInventory(SlotCursor, 0, false);
DeleteItemInInventory(EQEmu::legacy::SlotCursor, 0, false);
}
break;
@@ -6974,7 +6974,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
case GuildBankWithdraw:
{
if (GetInv()[SlotCursor])
if (GetInv()[EQEmu::legacy::SlotCursor])
{
Message_StringID(13, GUILD_BANK_EMPTY_HANDS);
@@ -7020,7 +7020,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
{
PushItemOnCursor(*inst);
SendItemPacket(SlotCursor, inst, ItemPacketSummonItem);
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketSummonItem);
GuildBanks->DeleteItem(GuildID(), gbwis->Area, gbwis->SlotID, gbwis->Quantity);
}
@@ -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::legacy::EQUIPMENT_BEGIN; L <= EQEmu::legacy::SlotWaist; L++) {
const ItemInst* inst = GetInv().GetItem(L);
item = inst ? inst->GetItem() : nullptr;
@@ -8014,7 +8014,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
else { insr->itemicons[L] = 0xFFFFFFFF; }
}
const ItemInst* inst = GetInv().GetItem(SlotAmmo);
const ItemInst* inst = GetInv().GetItem(EQEmu::legacy::SlotAmmo);
item = inst ? inst->GetItem() : nullptr;
if (item) {
@@ -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::legacy::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::legacy::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::legacy::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::legacy::CURSOR_BAG_END) {
if (mi->from_slot >= EQEmu::legacy::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::legacy::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::legacy::CURSOR_BAG_END) {
if (mi->to_slot >= EQEmu::legacy::CURSOR_BAG_BEGIN) { mi_hack = true; }
else {
int16 to_parent = m_inv.CalcSlotId(mi->to_slot);
if (!m_inv[to_parent]) { mi_hack = true; }
@@ -12023,7 +12023,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
Shielding_Struct* shield = (Shielding_Struct*)app->pBuffer;
shield_target = entity_list.GetMob(shield->target_id);
bool ack = false;
ItemInst* inst = GetInv().GetItem(SlotSecondary);
ItemInst* inst = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
if (!shield_target)
return;
if (inst)
@@ -12240,8 +12240,8 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
// shouldn't we be reimbursing if these two fail?
//make sure we are not completely full...
if (freeslotid == SlotCursor) {
if (m_inv.GetItem(SlotCursor) != nullptr) {
if (freeslotid == EQEmu::legacy::SlotCursor) {
if (m_inv.GetItem(EQEmu::legacy::SlotCursor) != nullptr) {
Message(13, "You do not have room for any more items.");
safe_delete(outapp);
safe_delete(inst);
+15 -15
View File
@@ -296,7 +296,7 @@ bool Client::Process() {
}
if(AutoFireEnabled()){
ItemInst *ranged = GetInv().GetItem(SlotRange);
ItemInst *ranged = GetInv().GetItem(EQEmu::legacy::SlotRange);
if(ranged)
{
if(ranged->GetItem() && ranged->GetItem()->ItemType == ItemTypeBow){
@@ -391,10 +391,10 @@ bool Client::Process() {
}
else if (auto_attack_target->GetHP() > -10) // -10 so we can watch people bleed in PvP
{
ItemInst *wpn = GetInv().GetItem(SlotPrimary);
TryWeaponProc(wpn, auto_attack_target, SlotPrimary);
ItemInst *wpn = GetInv().GetItem(EQEmu::legacy::SlotPrimary);
TryWeaponProc(wpn, auto_attack_target, EQEmu::legacy::SlotPrimary);
DoAttackRounds(auto_attack_target, SlotPrimary);
DoAttackRounds(auto_attack_target, EQEmu::legacy::SlotPrimary);
if (CheckAATimer(aaTimerRampage))
entity_list.AEAttack(this, 30);
}
@@ -430,10 +430,10 @@ bool Client::Process() {
else if(auto_attack_target->GetHP() > -10) {
CheckIncreaseSkill(SkillDualWield, auto_attack_target, -10);
if (CheckDualWield()) {
ItemInst *wpn = GetInv().GetItem(SlotSecondary);
TryWeaponProc(wpn, auto_attack_target, SlotSecondary);
ItemInst *wpn = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
TryWeaponProc(wpn, auto_attack_target, EQEmu::legacy::SlotSecondary);
DoAttackRounds(auto_attack_target, SlotSecondary);
DoAttackRounds(auto_attack_target, EQEmu::legacy::SlotSecondary);
}
}
}
@@ -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::legacy::TRADE_BEGIN; slot_id <= EQEmu::legacy::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::legacy::TYPE_POSSESSIONS_SIZE; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if(inst) {
std::string packet = inst->Serialize(slot_id);
@@ -801,16 +801,16 @@ void Client::BulkSendInventoryItems() {
// Power Source
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
const ItemInst* inst = m_inv[SlotPowerSource];
const ItemInst* inst = m_inv[EQEmu::legacy::SlotPowerSource];
if(inst) {
std::string packet = inst->Serialize(SlotPowerSource);
std::string packet = inst->Serialize(EQEmu::legacy::SlotPowerSource);
ser_items[i++] = packet;
size += packet.length();
}
}
// Bank items
for(slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; slot_id++) {
for (slot_id = EQEmu::legacy::BANK_BEGIN; slot_id <= EQEmu::legacy::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::legacy::SHARED_BANK_BEGIN; slot_id <= EQEmu::legacy::SHARED_BANK_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if(inst) {
std::string packet = inst->Serialize(slot_id);
@@ -1147,7 +1147,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
switch(memspell->scribing)
{
case memSpellScribing: { // scribing spell to book
const ItemInst* inst = m_inv[SlotCursor];
const ItemInst* inst = m_inv[EQEmu::legacy::SlotCursor];
if(inst && inst->IsType(ItemClassCommon))
{
@@ -1161,7 +1161,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
if(item && item->Scroll.Effect == (int32)(memspell->spell_id))
{
ScribeSpell(memspell->spell_id, memspell->slot);
DeleteItemInInventory(SlotCursor, 1, true);
DeleteItemInInventory(EQEmu::legacy::SlotCursor, 1, true);
}
else
Message(0,"Scribing spell: inst exists but item does not or spell ids do not match.");
+28 -28
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::legacy::MATERIAL_BEGIN; i <= EQEmu::legacy::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::legacy::MATERIAL_BEGIN; i <= EQEmu::legacy::MATERIAL_TINT_END; i++)
{
c->GetTarget()->SendTextureWC(i, texture);
}
@@ -2551,7 +2551,7 @@ void command_peekinv(Client *c, const Seperator *sep)
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::legacy::EQUIPMENT_BEGIN; (scopeWhere & peekWorn) && (indexMain <= EQEmu::legacy::EQUIPMENT_END); ++indexMain) {
inst_main = targetClient->GetInv().GetItem(indexMain);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
@@ -2563,18 +2563,18 @@ void command_peekinv(Client *c, const Seperator *sep)
}
if ((scopeWhere & peekWorn) && (targetClient->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)) {
inst_main = targetClient->GetInv().GetItem(SlotPowerSource);
inst_main = targetClient->GetInv().GetItem(EQEmu::legacy::SlotPowerSource);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), "WornSlot: %i, Item: %i (%s), Charges: %i",
SlotPowerSource, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
EQEmu::legacy::SlotPowerSource, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
}
// inv
for (int16 indexMain = EQEmu::constants::GENERAL_BEGIN; (scopeWhere & peekInv) && (indexMain <= EQEmu::constants::GENERAL_END); ++indexMain) {
for (int16 indexMain = EQEmu::legacy::GENERAL_BEGIN; (scopeWhere & peekInv) && (indexMain <= EQEmu::legacy::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_INDEX_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::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2604,7 +2604,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message(1, "CursorSlot: %i, Item: %i (%s), Charges: %i",
SlotCursor, 0, item_link.c_str(), 0);
EQEmu::legacy::SlotCursor, 0, item_link.c_str(), 0);
}
else {
int cursorDepth = 0;
@@ -2616,9 +2616,9 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
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()));
EQEmu::legacy::SlotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_INDEX_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::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2626,14 +2626,14 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " CursorBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(SlotCursor, indexSub), SlotCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, indexSub), EQEmu::legacy::SlotCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}
}
}
// trib
for (int16 indexMain = EQEmu::constants::TRIBUTE_BEGIN; (scopeWhere & peekTrib) && (indexMain <= EQEmu::constants::TRIBUTE_END); ++indexMain) {
for (int16 indexMain = EQEmu::legacy::TRIBUTE_BEGIN; (scopeWhere & peekTrib) && (indexMain <= EQEmu::legacy::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::legacy::BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::legacy::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_INDEX_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::legacy::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::legacy::SHARED_BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::legacy::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_INDEX_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::legacy::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::legacy::TRADE_BEGIN; (scopeWhere & peekTrade) && (indexMain <= EQEmu::legacy::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_INDEX_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::legacy::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::legacy::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::legacy::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_INDEX_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::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -3140,8 +3140,8 @@ 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))) {
const ItemInst* from_inst = c->GetInv().GetItem(SlotCursor);
if (sep->IsNumber(1) && ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::legacy::SlotPowerSource))) {
const ItemInst* from_inst = c->GetInv().GetItem(EQEmu::legacy::SlotCursor);
const ItemInst* to_inst = c->GetInv().GetItem(slot_id); // added (desync issue when forcing stack to stack)
bool partialmove = false;
int16 movecount;
@@ -3149,7 +3149,7 @@ void command_equipitem(Client *c, const Seperator *sep)
if (from_inst && from_inst->IsType(ItemClassCommon)) {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveItem, sizeof(MoveItem_Struct));
MoveItem_Struct* mi = (MoveItem_Struct*)outapp->pBuffer;
mi->from_slot = SlotCursor;
mi->from_slot = EQEmu::legacy::SlotCursor;
mi->to_slot = slot_id;
// mi->number_in_stack = from_inst->GetCharges(); // replaced with con check for stacking
@@ -4333,7 +4333,7 @@ void command_goto(Client *c, const Seperator *sep)
void command_iteminfo(Client *c, const Seperator *sep)
{
auto inst = c->GetInv()[SlotCursor];
auto inst = c->GetInv()[EQEmu::legacy::SlotCursor];
if (!inst) { c->Message(13, "Error: You need an item on your cursor for this command"); }
auto item = inst->GetItem();
if (!item) {
@@ -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) {
if (link_open != link_close && (cmd_msg.length() - link_open) > EQEmu::legacy::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));
EQEmu::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::legacy::TEXT_LINK_BODY_LENGTH));
itemid = link_body.item_id;
}
else if (!sep->IsNumber(1)) {
@@ -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::legacy::MATERIAL_BEGIN; cur_slot <= EQEmu::legacy::MATERIAL_END; cur_slot++) {
uint8 slot2=SlotConvert(cur_slot);
ItemInst* inst = m_inv.GetItem(slot2);
+24 -24
View File
@@ -328,12 +328,12 @@ 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) {
if (i == SlotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
item = client->GetInv().GetItem(SlotPowerSource);
for (i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++i) {
if (i == EQEmu::legacy::SlotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
item = client->GetInv().GetItem(EQEmu::legacy::SlotPowerSource);
if (item != nullptr) {
if (!client->IsBecomeNPC() || (client->IsBecomeNPC() && !item->GetItem()->NoRent))
MoveItemToCorpse(client, item, SlotPowerSource, removed_list);
MoveItemToCorpse(client, item, EQEmu::legacy::SlotPowerSource, removed_list);
}
}
@@ -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::legacy::GENERAL_BEGIN || equipSlot > EQEmu::legacy::SlotCursor) { break; }
for (auto sub_index = SUB_INDEX_BEGIN; sub_index < EQEmu::constants::ITEM_CONTAINER_SIZE; ++sub_index) {
for (auto sub_index = SUB_INDEX_BEGIN; sub_index < EQEmu::legacy::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; }
@@ -748,7 +748,7 @@ void Corpse::RemoveItem(ServerLootItem_Struct* item_data)
itemlist.erase(iter);
uint8 material = Inventory::CalcMaterialFromSlot(sitem->equip_slot); // autos to unsigned char
if (material != MaterialInvalid)
if (material != EQEmu::legacy::MaterialInvalid)
SendWearChange(material);
UpdateEquipmentLight();
@@ -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::legacy::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::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()), TypeCorpse);
int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()), EQEmu::legacy::TypeCorpse);
for(; cur != end; ++cur) {
ServerLootItem_Struct* item_data = *cur;
@@ -1009,7 +1009,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
// Dont display the item if it's in a bag
// Added cursor queue slots to corpse item visibility list. Nothing else should be making it to corpse.
if(!IsPlayerCorpse() || item_data->equip_slot <= SlotCursor || item_data->equip_slot == SlotPowerSource || Loot_Request_Type>=3 ||
if (!IsPlayerCorpse() || item_data->equip_slot <= EQEmu::legacy::SlotCursor || item_data->equip_slot == EQEmu::legacy::SlotPowerSource || Loot_Request_Type >= 3 ||
(item_data->equip_slot >= 8000 && item_data->equip_slot <= 8999)) {
if(i < corpselootlimit) {
item = database.GetItem(item_data->item_id);
@@ -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::legacy::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::legacy::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::legacy::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_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
ItemInst *itm = inst->GetAugment(i);
if (itm) {
if (client->CheckLoreConflict(itm->GetItem())) {
@@ -1190,10 +1190,10 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
/* First add it to the looter - this will do the bag contents too */
if (lootitem->auto_loot) {
if (!client->AutoPutLootInInventory(*inst, true, true, bag_item_data))
client->PutLootInInventory(SlotCursor, *inst, bag_item_data);
client->PutLootInInventory(EQEmu::legacy::SlotCursor, *inst, bag_item_data);
}
else {
client->PutLootInInventory(SlotCursor, *inst, bag_item_data);
client->PutLootInInventory(EQEmu::legacy::SlotCursor, *inst, bag_item_data);
}
/* Update any tasks that have an activity to loot this item */
@@ -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_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) {
for (int i = SUB_INDEX_BEGIN; i < EQEmu::legacy::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);
@@ -1294,13 +1294,13 @@ void Corpse::QueryLoot(Client* to) {
cur = itemlist.begin();
end = itemlist.end();
int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()), TypeCorpse);
int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()), EQEmu::legacy::TypeCorpse);
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::legacy::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::legacy::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::legacy::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::legacy::MATERIAL_END) {
return 0;
}
@@ -1436,8 +1436,8 @@ 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 == SlotAmmo) { continue; }
if (((*iter)->equip_slot < EQEmu::legacy::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::legacy::EQUIPMENT_END) && (*iter)->equip_slot != EQEmu::legacy::SlotPowerSource) { continue; }
if ((*iter)->equip_slot == EQEmu::legacy::SlotAmmo) { continue; }
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
@@ -1448,7 +1448,7 @@ void Corpse::UpdateEquipmentLight()
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::legacy::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::legacy::GENERAL_END) { continue; }
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
+1 -1
View File
@@ -49,7 +49,7 @@ class Corpse : public Mob {
/* Corpse: General */
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; }
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; }
virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return false; }
virtual Raid* GetRaid() { return 0; }
+1 -1
View File
@@ -187,7 +187,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
uint8 keepoffkeyring = GetNoKeyring();
uint32 haskey = 0;
uint32 playerkey = 0;
const ItemInst *lockpicks = sender->GetInv().GetItem(SlotCursor);
const ItemInst *lockpicks = sender->GetInv().GetItem(EQEmu::legacy::SlotCursor);
haskey = sender->GetInv().HasItem(keyneeded, 1);
+1 -1
View File
@@ -36,7 +36,7 @@ public:
//abstract virtual function implementations required by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; }
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; }
virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr, int special = 0) {
return false;
}
+1 -1
View File
@@ -322,7 +322,7 @@ public:
void QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPacket* app);
void QueueManaged(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true);
void AEAttack(Mob *attacker, float dist, int Hand = SlotPrimary, int count = 0, bool IsFromSpell = false);
void AEAttack(Mob *attacker, float dist, int Hand = EQEmu::legacy::SlotPrimary, int count = 0, bool IsFromSpell = false);
void AETaunt(Client *caster, float range=0, int32 bonus_hate=0);
void AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true, int16 resist_adjust = 0);
void MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true);
+7 -7
View File
@@ -153,7 +153,7 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
//we need this function to immediately determine, after we receive OP_Fishing, if we can even try to fish, otherwise we have to wait a while to get the failure
bool Client::CanFish() {
//make sure we still have a fishing pole on:
const ItemInst* Pole = m_inv[SlotPrimary];
const ItemInst* Pole = m_inv[EQEmu::legacy::SlotPrimary];
int32 bslot = m_inv.HasItemByUse(ItemTypeFishingBait, 1, invWhereWorn|invWherePersonal);
const ItemInst* Bait = nullptr;
if (bslot != INVALID_INDEX)
@@ -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::legacy::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == SkillFishing) {
fishing_skill += Bait->GetItem()->SkillModValue;
}
@@ -317,12 +317,12 @@ void Client::GoFish()
else
{
PushItemOnCursor(*inst);
SendItemPacket(SlotCursor, inst, ItemPacketSummonItem);
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketSummonItem);
if(RuleB(TaskSystem, EnableTaskSystem))
UpdateTasksForItem(ActivityFish, food_id);
safe_delete(inst);
inst = m_inv.GetItem(SlotCursor);
inst = m_inv.GetItem(EQEmu::legacy::SlotCursor);
}
if(inst) {
@@ -354,7 +354,7 @@ void Client::GoFish()
//and then swap out items in primary slot... too lazy to fix right now
if (zone->random.Int(0, 49) == 1) {
Message_StringID(MT_Skills, FISHING_POLE_BROKE); //Your fishing pole broke!
DeleteItemInInventory(SlotPrimary, 0, true);
DeleteItemInInventory(EQEmu::legacy::SlotPrimary, 0, true);
}
if(CheckIncreaseSkill(SkillFishing, nullptr, 5))
@@ -433,12 +433,12 @@ void Client::ForageItem(bool guarantee) {
}
else {
PushItemOnCursor(*inst);
SendItemPacket(SlotCursor, inst, ItemPacketSummonItem);
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketSummonItem);
if(RuleB(TaskSystem, EnableTaskSystem))
UpdateTasksForItem(ActivityForage, foragedfood);
safe_delete(inst);
inst = m_inv.GetItem(SlotCursor);
inst = m_inv.GetItem(EQEmu::legacy::SlotCursor);
}
if(inst) {
+179 -179
View File
File diff suppressed because it is too large Load Diff
+20 -20
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::legacy::EQUIPMENT_SIZE; i++) {
uint32 slots = (1 << i);
if (item2->Slots & slots) {
if(equipment[i])
@@ -313,7 +313,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
// @merth: IDFile size has been increased, this needs to change
uint16 emat;
if(item2->Material <= 0
|| item2->Slots & (1 << SlotPrimary | 1 << SlotSecondary)) {
|| item2->Slots & (1 << EQEmu::legacy::SlotPrimary | 1 << EQEmu::legacy::SlotSecondary)) {
memset(newid, 0, sizeof(newid));
for(int i=0;i<7;i++){
if (!isalpha(item2->IDFile[i])){
@@ -327,17 +327,17 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
emat = item2->Material;
}
if (foundslot == SlotPrimary) {
if (foundslot == EQEmu::legacy::SlotPrimary) {
if (item2->Proc.Effect != 0)
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
eslot = MaterialPrimary;
eslot = EQEmu::legacy::MaterialPrimary;
if (item2->Damage > 0)
SendAddPlayerState(PlayerState::PrimaryWeaponEquipped);
if (item2->ItemType == ItemType2HBlunt || item2->ItemType == ItemType2HSlash || item2->ItemType == ItemType2HPiercing)
SetTwoHanderEquipped(true);
}
else if (foundslot == SlotSecondary
else if (foundslot == EQEmu::legacy::SlotSecondary
&& (GetOwner() != nullptr || (CanThisClassDualWield() && zone->random.Roll(NPC_DW_CHANCE)) || (item2->Damage==0)) &&
(item2->ItemType == ItemType1HSlash || item2->ItemType == ItemType1HBlunt || item2->ItemType == ItemTypeShield ||
item2->ItemType == ItemType1HPiercing))
@@ -345,30 +345,30 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
if (item2->Proc.Effect!=0)
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
eslot = MaterialSecondary;
eslot = EQEmu::legacy::MaterialSecondary;
if (item2->Damage > 0)
SendAddPlayerState(PlayerState::SecondaryWeaponEquipped);
}
else if (foundslot == SlotHead) {
eslot = MaterialHead;
else if (foundslot == EQEmu::legacy::SlotHead) {
eslot = EQEmu::legacy::MaterialHead;
}
else if (foundslot == SlotChest) {
eslot = MaterialChest;
else if (foundslot == EQEmu::legacy::SlotChest) {
eslot = EQEmu::legacy::MaterialChest;
}
else if (foundslot == SlotArms) {
eslot = MaterialArms;
else if (foundslot == EQEmu::legacy::SlotArms) {
eslot = EQEmu::legacy::MaterialArms;
}
else if (foundslot == SlotWrist1 || foundslot == SlotWrist2) {
eslot = MaterialWrist;
else if (foundslot == EQEmu::legacy::SlotWrist1 || foundslot == EQEmu::legacy::SlotWrist2) {
eslot = EQEmu::legacy::MaterialWrist;
}
else if (foundslot == SlotHands) {
eslot = MaterialHands;
else if (foundslot == EQEmu::legacy::SlotHands) {
eslot = EQEmu::legacy::MaterialHands;
}
else if (foundslot == SlotLegs) {
eslot = MaterialLegs;
else if (foundslot == EQEmu::legacy::SlotLegs) {
eslot = EQEmu::legacy::MaterialLegs;
}
else if (foundslot == SlotFeet) {
eslot = MaterialFeet;
else if (foundslot == EQEmu::legacy::SlotFeet) {
eslot = EQEmu::legacy::MaterialFeet;
}
/*
+54 -54
View File
@@ -1757,47 +1757,47 @@ luabind::scope lua_register_slot() {
return luabind::class_<Slots>("Slot")
.enum_("constants")
[
luabind::value("Charm", static_cast<int>(SlotCharm)),
luabind::value("Ear1", static_cast<int>(SlotEar1)),
luabind::value("Head", static_cast<int>(SlotHead)),
luabind::value("Face", static_cast<int>(SlotFace)),
luabind::value("Ear2", static_cast<int>(SlotEar2)),
luabind::value("Neck", static_cast<int>(SlotNeck)),
luabind::value("Shoulder", static_cast<int>(SlotShoulders)), // deprecated
luabind::value("Shoulders", static_cast<int>(SlotShoulders)),
luabind::value("Arms", static_cast<int>(SlotArms)),
luabind::value("Back", static_cast<int>(SlotBack)),
luabind::value("Bracer1", static_cast<int>(SlotWrist1)), // deprecated
luabind::value("Wrist1", static_cast<int>(SlotWrist1)),
luabind::value("Bracer2", static_cast<int>(SlotWrist2)), // deprecated
luabind::value("Wrist2", static_cast<int>(SlotWrist2)),
luabind::value("Range", static_cast<int>(SlotRange)),
luabind::value("Hands", static_cast<int>(SlotHands)),
luabind::value("Primary", static_cast<int>(SlotPrimary)),
luabind::value("Secondary", static_cast<int>(SlotSecondary)),
luabind::value("Ring1", static_cast<int>(SlotFinger1)), // deprecated
luabind::value("Finger1", static_cast<int>(SlotFinger1)),
luabind::value("Ring2", static_cast<int>(SlotFinger2)), // deprecated
luabind::value("Finger2", static_cast<int>(SlotFinger2)),
luabind::value("Chest", static_cast<int>(SlotChest)),
luabind::value("Legs", static_cast<int>(SlotLegs)),
luabind::value("Feet", static_cast<int>(SlotFeet)),
luabind::value("Waist", static_cast<int>(SlotWaist)),
luabind::value("PowerSource", static_cast<int>(SlotPowerSource)),
luabind::value("Ammo", static_cast<int>(SlotAmmo)),
luabind::value("General1", static_cast<int>(SlotGeneral1)),
luabind::value("General2", static_cast<int>(SlotGeneral2)),
luabind::value("General3", static_cast<int>(SlotGeneral3)),
luabind::value("General4", static_cast<int>(SlotGeneral4)),
luabind::value("General5", static_cast<int>(SlotGeneral5)),
luabind::value("General6", static_cast<int>(SlotGeneral6)),
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("Charm", static_cast<int>(EQEmu::legacy::SlotCharm)),
luabind::value("Ear1", static_cast<int>(EQEmu::legacy::SlotEar1)),
luabind::value("Head", static_cast<int>(EQEmu::legacy::SlotHead)),
luabind::value("Face", static_cast<int>(EQEmu::legacy::SlotFace)),
luabind::value("Ear2", static_cast<int>(EQEmu::legacy::SlotEar2)),
luabind::value("Neck", static_cast<int>(EQEmu::legacy::SlotNeck)),
luabind::value("Shoulder", static_cast<int>(EQEmu::legacy::SlotShoulders)), // deprecated
luabind::value("Shoulders", static_cast<int>(EQEmu::legacy::SlotShoulders)),
luabind::value("Arms", static_cast<int>(EQEmu::legacy::SlotArms)),
luabind::value("Back", static_cast<int>(EQEmu::legacy::SlotBack)),
luabind::value("Bracer1", static_cast<int>(EQEmu::legacy::SlotWrist1)), // deprecated
luabind::value("Wrist1", static_cast<int>(EQEmu::legacy::SlotWrist1)),
luabind::value("Bracer2", static_cast<int>(EQEmu::legacy::SlotWrist2)), // deprecated
luabind::value("Wrist2", static_cast<int>(EQEmu::legacy::SlotWrist2)),
luabind::value("Range", static_cast<int>(EQEmu::legacy::SlotRange)),
luabind::value("Hands", static_cast<int>(EQEmu::legacy::SlotHands)),
luabind::value("Primary", static_cast<int>(EQEmu::legacy::SlotPrimary)),
luabind::value("Secondary", static_cast<int>(EQEmu::legacy::SlotSecondary)),
luabind::value("Ring1", static_cast<int>(EQEmu::legacy::SlotFinger1)), // deprecated
luabind::value("Finger1", static_cast<int>(EQEmu::legacy::SlotFinger1)),
luabind::value("Ring2", static_cast<int>(EQEmu::legacy::SlotFinger2)), // deprecated
luabind::value("Finger2", static_cast<int>(EQEmu::legacy::SlotFinger2)),
luabind::value("Chest", static_cast<int>(EQEmu::legacy::SlotChest)),
luabind::value("Legs", static_cast<int>(EQEmu::legacy::SlotLegs)),
luabind::value("Feet", static_cast<int>(EQEmu::legacy::SlotFeet)),
luabind::value("Waist", static_cast<int>(EQEmu::legacy::SlotWaist)),
luabind::value("PowerSource", static_cast<int>(EQEmu::legacy::SlotPowerSource)),
luabind::value("Ammo", static_cast<int>(EQEmu::legacy::SlotAmmo)),
luabind::value("General1", static_cast<int>(EQEmu::legacy::SlotGeneral1)),
luabind::value("General2", static_cast<int>(EQEmu::legacy::SlotGeneral2)),
luabind::value("General3", static_cast<int>(EQEmu::legacy::SlotGeneral3)),
luabind::value("General4", static_cast<int>(EQEmu::legacy::SlotGeneral4)),
luabind::value("General5", static_cast<int>(EQEmu::legacy::SlotGeneral5)),
luabind::value("General6", static_cast<int>(EQEmu::legacy::SlotGeneral6)),
luabind::value("General7", static_cast<int>(EQEmu::legacy::SlotGeneral7)),
luabind::value("General8", static_cast<int>(EQEmu::legacy::SlotGeneral8)),
luabind::value("Cursor", static_cast<int>(EQEmu::legacy::SlotCursor)),
luabind::value("PersonalBegin", static_cast<int>(EQEmu::legacy::GENERAL_BEGIN)), // deprecated
luabind::value("GeneralBegin", static_cast<int>(EQEmu::legacy::GENERAL_BEGIN)),
luabind::value("PersonalEnd", static_cast<int>(EQEmu::legacy::GENERAL_END)), // deprecated
luabind::value("GeneralEnd", static_cast<int>(EQEmu::legacy::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
@@ -1809,19 +1809,19 @@ luabind::scope lua_register_material() {
return luabind::class_<Materials>("Material")
.enum_("constants")
[
luabind::value("Head", static_cast<int>(MaterialHead)),
luabind::value("Chest", static_cast<int>(MaterialChest)),
luabind::value("Arms", static_cast<int>(MaterialArms)),
luabind::value("Bracer", static_cast<int>(MaterialWrist)), // deprecated
luabind::value("Wrist", static_cast<int>(MaterialWrist)),
luabind::value("Hands", static_cast<int>(MaterialHands)),
luabind::value("Legs", static_cast<int>(MaterialLegs)),
luabind::value("Feet", static_cast<int>(MaterialFeet)),
luabind::value("Primary", static_cast<int>(MaterialPrimary)),
luabind::value("Secondary", static_cast<int>(MaterialSecondary)),
luabind::value("Max", static_cast<int>(MaterialCount)), // deprecated
luabind::value("Count", static_cast<int>(MaterialCount)),
luabind::value("Invalid", static_cast<int>(MaterialInvalid))
luabind::value("Head", static_cast<int>(EQEmu::legacy::MaterialHead)),
luabind::value("Chest", static_cast<int>(EQEmu::legacy::MaterialChest)),
luabind::value("Arms", static_cast<int>(EQEmu::legacy::MaterialArms)),
luabind::value("Bracer", static_cast<int>(EQEmu::legacy::MaterialWrist)), // deprecated
luabind::value("Wrist", static_cast<int>(EQEmu::legacy::MaterialWrist)),
luabind::value("Hands", static_cast<int>(EQEmu::legacy::MaterialHands)),
luabind::value("Legs", static_cast<int>(EQEmu::legacy::MaterialLegs)),
luabind::value("Feet", static_cast<int>(EQEmu::legacy::MaterialFeet)),
luabind::value("Primary", static_cast<int>(EQEmu::legacy::MaterialPrimary)),
luabind::value("Secondary", static_cast<int>(EQEmu::legacy::MaterialSecondary)),
luabind::value("Max", static_cast<int>(EQEmu::legacy::MaterialCount)), // deprecated
luabind::value("Count", static_cast<int>(EQEmu::legacy::MaterialCount)),
luabind::value("Invalid", static_cast<int>(EQEmu::legacy::MaterialInvalid))
];
}
+16 -16
View File
@@ -214,7 +214,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
unsigned int i;
//should not include 21 (SLOT_AMMO)
for (i = 0; i < SlotAmmo; i++) {
for (i = 0; i < EQEmu::legacy::SlotAmmo; i++) {
if(equipment[i] == 0)
continue;
const Item_Struct * itm = database.GetItem(equipment[i]);
@@ -1559,24 +1559,24 @@ void Merc::AI_Process() {
//try main hand first
if(attack_timer.Check())
{
Attack(GetTarget(), SlotPrimary);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary);
bool tripleSuccess = false;
if(GetOwner() && GetTarget() && CanThisClassDoubleAttack())
{
if(GetOwner()) {
Attack(GetTarget(), SlotPrimary, true);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
}
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE)) {
tripleSuccess = true;
Attack(GetTarget(), SlotPrimary, true);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
}
//quad attack, does this belong here??
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_QUAD)) {
Attack(GetTarget(), SlotPrimary, true);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
}
}
@@ -1588,8 +1588,8 @@ void Merc::AI_Process() {
if(zone->random.Roll(flurrychance))
{
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
Attack(GetTarget(), SlotPrimary, false);
Attack(GetTarget(), SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
}
}
@@ -1598,7 +1598,7 @@ void Merc::AI_Process() {
if (GetTarget() && ExtraAttackChanceBonus) {
if(zone->random.Roll(ExtraAttackChanceBonus))
{
Attack(GetTarget(), SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
}
}
}
@@ -1633,11 +1633,11 @@ void Merc::AI_Process() {
// Max 78% of DW
if (zone->random.Roll(DualWieldProbability))
{
Attack(GetTarget(), SlotSecondary); // Single attack with offhand
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
if(CanThisClassDoubleAttack()) {
if(GetTarget() && GetTarget()->GetHP() > -10)
Attack(GetTarget(), SlotSecondary); // Single attack with offhand
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
}
}
}
@@ -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::legacy::EQUIPMENT_SIZE; ++x)
{
TempItem = nullptr;
if (equipment[x] == 0)
@@ -5025,12 +5025,12 @@ void Merc::ScaleStats(int scalepercent, bool setmax) {
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) {
uint8 materialFromSlot = EQEmu::legacy::MaterialInvalid;
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
itemID = equipment[i];
if(itemID != NO_ITEM) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
if(materialFromSlot != MaterialInvalid)
if (materialFromSlot != EQEmu::legacy::MaterialInvalid)
this->SendWearChange(materialFromSlot);
}
}
@@ -5044,8 +5044,8 @@ void Merc::UpdateEquipmentLight()
m_Light.Type.Equipment = 0;
m_Light.Level.Equipment = 0;
for (int index = SLOT_BEGIN; index < EQEmu::constants::EQUIPMENT_SIZE; ++index) {
if (index == SlotAmmo) { continue; }
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
if (index == EQEmu::legacy::SlotAmmo) { continue; }
auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; }
+2 -2
View File
@@ -62,7 +62,7 @@ public:
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0);
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return (GetGroup() ? true : false); }
@@ -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::legacy::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
+6 -6
View File
@@ -73,7 +73,7 @@ Mob::Mob(const char* in_name,
uint32 in_drakkin_heritage,
uint32 in_drakkin_tattoo,
uint32 in_drakkin_details,
uint32 in_armor_tint[MaterialCount],
uint32 in_armor_tint[EQEmu::legacy::MaterialCount],
uint8 in_aa_title,
uint8 in_see_invis, // see through invis/ivu
@@ -280,7 +280,7 @@ Mob::Mob(const char* in_name,
RangedProcs[j].level_override = -1;
}
for (i = 0; i < MaterialCount; i++)
for (i = 0; i < EQEmu::legacy::MaterialCount; i++)
{
if (in_armor_tint)
{
@@ -2379,8 +2379,8 @@ bool Mob::CanThisClassDualWield(void) const {
return(GetSkill(SkillDualWield) > 0);
}
else if(CastToClient()->HasSkill(SkillDualWield)) {
const ItemInst* pinst = CastToClient()->GetInv().GetItem(SlotPrimary);
const ItemInst* sinst = CastToClient()->GetInv().GetItem(SlotSecondary);
const ItemInst* pinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
const ItemInst* sinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
// 2HS, 2HB, or 2HP
if(pinst && pinst->IsWeapon()) {
@@ -2865,7 +2865,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
if (item != 0)
{
// For primary and secondary we need the model, not the material
if (material_slot == MaterialPrimary || material_slot == MaterialSecondary)
if (material_slot == EQEmu::legacy::MaterialPrimary || material_slot == EQEmu::legacy::MaterialSecondary)
{
if (this->IsClient())
{
@@ -2909,7 +2909,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
int32 Mob::GetHerosForgeModel(uint8 material_slot) const
{
uint32 HeroModel = 0;
if (material_slot >= 0 && material_slot < MaterialPrimary)
if (material_slot >= 0 && material_slot < EQEmu::legacy::MaterialPrimary)
{
uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
const Item_Struct *item;
+11 -11
View File
@@ -108,7 +108,7 @@ public:
uint32 in_drakkin_heritage,
uint32 in_drakkin_tattoo,
uint32 in_drakkin_details,
uint32 in_armor_tint[MaterialCount],
uint32 in_armor_tint[EQEmu::legacy::MaterialCount],
uint8 in_aa_title,
uint8 in_see_invis, // see through invis
uint8 in_see_invis_undead, // see through invis vs. undead
@@ -148,7 +148,7 @@ public:
virtual void ThrowingAttack(Mob* other) { }
uint16 GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg);
// 13 = Primary (default), 14 = secondary
virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) = 0;
int MonkSpecialAttack(Mob* other, uint8 skill_used);
virtual void TryBackstab(Mob *other,int ReuseTime = 10);
@@ -379,7 +379,7 @@ public:
inline uint8 GetDrakkinHeritage() const { return drakkin_heritage; }
inline uint8 GetDrakkinTattoo() const { return drakkin_tattoo; }
inline uint8 GetDrakkinDetails() const { return drakkin_details; }
inline uint32 GetArmorTint(uint8 i) const { return armor_tint[(i < MaterialCount) ? i : 0]; }
inline uint32 GetArmorTint(uint8 i) const { return armor_tint[(i < EQEmu::legacy::MaterialCount) ? i : 0]; }
inline uint8 GetClass() const { return class_; }
inline uint8 GetLevel() const { return level; }
inline uint8 GetOrigLevel() const { return orig_level; }
@@ -566,7 +566,7 @@ public:
bool lookForAftArc = true);
//Procs
void TriggerDefensiveProcs(Mob *on, uint16 hand = SlotPrimary, bool FromSkillProc=false, int damage = 0);
void TriggerDefensiveProcs(Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary, bool FromSkillProc = false, int damage = 0);
bool AddRangedProc(uint16 spell_id, uint16 iChance = 3, uint16 base_spell_id = SPELL_UNKNOWN);
bool RemoveRangedProc(uint16 spell_id, bool bAll = false);
bool HasRangedProcs() const;
@@ -1146,13 +1146,13 @@ protected:
void TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success = false, uint16 hand = 0, bool IsDefensive = false); // hand = SlotCharm?
bool PassLimitToSkill(uint16 spell_id, uint16 skill);
bool PassLimitClass(uint32 Classes_, uint16 Class_);
void TryDefensiveProc(Mob *on, uint16 hand = SlotPrimary);
void TryWeaponProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = SlotPrimary);
void TrySpellProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = SlotPrimary);
void TryWeaponProc(const ItemInst* weapon, Mob *on, uint16 hand = SlotPrimary);
void TryDefensiveProc(Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TryWeaponProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TrySpellProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TryWeaponProc(const ItemInst* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void ExecWeaponProc(const ItemInst* weapon, uint16 spell_id, Mob *on, int level_override = -1);
virtual float GetProcChances(float ProcBonus, uint16 hand = SlotPrimary);
virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = SlotPrimary, Mob *on = nullptr);
virtual float GetProcChances(float ProcBonus, uint16 hand = EQEmu::legacy::SlotPrimary);
virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = EQEmu::legacy::SlotPrimary, Mob *on = nullptr);
virtual float GetSpecialProcChances(uint16 hand);
virtual float GetAssassinateProcChances(uint16 ReuseTime);
virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm?
@@ -1243,7 +1243,7 @@ protected:
uint32 drakkin_heritage;
uint32 drakkin_tattoo;
uint32 drakkin_details;
uint32 armor_tint[MaterialCount];
uint32 armor_tint[EQEmu::legacy::MaterialCount];
uint8 aa_title;
+4 -4
View File
@@ -847,7 +847,7 @@ void Client::AI_Process()
if (GetTarget() && !IsStunned() && !IsMezzed() && !GetFeigned()) {
if (attack_timer.Check()) {
// Should charmed clients not be procing?
DoAttackRounds(GetTarget(), SlotPrimary);
DoAttackRounds(GetTarget(), EQEmu::legacy::SlotPrimary);
}
}
@@ -855,7 +855,7 @@ void Client::AI_Process()
if (attack_dw_timer.Check()) {
if (CheckDualWield()) {
// Should charmed clients not be procing?
DoAttackRounds(GetTarget(), SlotSecondary);
DoAttackRounds(GetTarget(), EQEmu::legacy::SlotSecondary);
}
}
}
@@ -1106,7 +1106,7 @@ void Mob::AI_Process() {
//try main hand first
if(attack_timer.Check()) {
DoMainHandAttackRounds(target);
TriggerDefensiveProcs(target, SlotPrimary, false);
TriggerDefensiveProcs(target, EQEmu::legacy::SlotPrimary, false);
bool specialed = false; // NPCs can only do one of these a round
if (GetSpecialAbility(SPECATK_FLURRY)) {
@@ -1952,7 +1952,7 @@ bool Mob::Flurry(ExtraAttackOptions *opts)
int num_attacks = GetSpecialAbilityParam(SPECATK_FLURRY, 1);
num_attacks = num_attacks > 0 ? num_attacks : RuleI(Combat, MaxFlurryHits);
for (int i = 0; i < num_attacks; i++)
Attack(target, SlotPrimary, false, false, false, opts);
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts);
}
return true;
}
+13 -13
View File
@@ -488,7 +488,7 @@ void NPC::CheckMinMaxLevel(Mob *them)
if(themlevel < (*cur)->min_level || themlevel > (*cur)->max_level)
{
material = Inventory::CalcMaterialFromSlot((*cur)->equip_slot);
if (material != MaterialInvalid)
if (material != EQEmu::legacy::MaterialInvalid)
SendWearChange(material);
cur = itemlist.erase(cur);
@@ -748,8 +748,8 @@ void NPC::UpdateEquipmentLight()
m_Light.Type.Equipment = 0;
m_Light.Level.Equipment = 0;
for (int index = SLOT_BEGIN; index < EQEmu::constants::EQUIPMENT_SIZE; ++index) {
if (index == SlotAmmo) { continue; }
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
if (index == EQEmu::legacy::SlotAmmo) { continue; }
auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; }
@@ -1372,7 +1372,7 @@ uint32 ZoneDatabase::NPCSpawnDB(uint8 command, const char* zone, uint32 zone_ver
int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
{
if (material_slot >= MaterialCount)
if (material_slot >= EQEmu::legacy::MaterialCount)
return 0;
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
@@ -1383,23 +1383,23 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
{
switch(material_slot)
{
case MaterialHead:
case EQEmu::legacy::MaterialHead:
return helmtexture;
case MaterialChest:
case EQEmu::legacy::MaterialChest:
return texture;
case MaterialArms:
case EQEmu::legacy::MaterialArms:
return armtexture;
case MaterialWrist:
case EQEmu::legacy::MaterialWrist:
return bracertexture;
case MaterialHands:
case EQEmu::legacy::MaterialHands:
return handtexture;
case MaterialLegs:
case EQEmu::legacy::MaterialLegs:
return legtexture;
case MaterialFeet:
case EQEmu::legacy::MaterialFeet:
return feettexture;
case MaterialPrimary:
case EQEmu::legacy::MaterialPrimary:
return d_melee_texture1;
case MaterialSecondary:
case EQEmu::legacy::MaterialSecondary:
return d_melee_texture2;
default:
//they have nothing in the slot, and its not a special slot... they get nothing.
+2 -2
View File
@@ -106,7 +106,7 @@ public:
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0);
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return false; }
@@ -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::legacy::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
+6 -6
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::legacy::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_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++)
for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++)
{
ItemInst* inst = container->PopItem(i);
if(inst != nullptr)
@@ -503,11 +503,11 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
// Transfer item to client
sender->PutItemInInventory(SlotCursor, *m_inst, false);
sender->SendItemPacket(SlotCursor, m_inst, ItemPacketTrade);
sender->PutItemInInventory(EQEmu::legacy::SlotCursor, *m_inst, false);
sender->SendItemPacket(EQEmu::legacy::SlotCursor, m_inst, ItemPacketTrade);
if(cursordelete) // delete the item if it's a duplicate lore. We have to do this because the client expects the item packet
sender->DeleteItemInInventory(SlotCursor);
sender->DeleteItemInInventory(EQEmu::legacy::SlotCursor);
if(!m_ground_spawn)
safe_delete(m_inst);
@@ -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_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) {
for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::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::legacy::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::legacy::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::legacy::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::legacy::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::legacy::EQUIPMENT_SIZE)
continue;
if (items[slot] == 0)
+2 -2
View File
@@ -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::legacy::GENERAL_BEGIN; slot_id <= EQEmu::legacy::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::legacy::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::legacy::GENERAL_BAGS_END; ++slot_id)
{
quantity += collectitems_processSlot(slot_id, item_id, remove);
}
+61 -61
View File
@@ -69,17 +69,17 @@ void Mob::ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg)
case SkillFlyingKick:
case SkillRoundKick:
case SkillKick:
item_slot = SlotFeet;
item_slot = EQEmu::legacy::SlotFeet;
break;
case SkillBash:
item_slot = SlotSecondary;
item_slot = EQEmu::legacy::SlotSecondary;
break;
case SkillDragonPunch:
case SkillEagleStrike:
case SkillTigerClaw:
item_slot = SlotHands;
item_slot = EQEmu::legacy::SlotHands;
break;
default:
@@ -115,7 +115,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
if(skill == SkillBash){
if(IsClient()){
ItemInst *item = CastToClient()->GetInv().GetItem(SlotSecondary);
ItemInst *item = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
if(item)
{
if(item->GetItem()->ItemType == ItemTypeShield)
@@ -133,14 +133,14 @@ void Mob::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
min_damage += min_damage * GetMeleeMinDamageMod_SE(skill) / 100;
int hand = SlotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should work for most
int hand = EQEmu::legacy::SlotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should work for most
if (skill == SkillThrowing || skill == SkillArchery)
hand = SlotRange;
hand = EQEmu::legacy::SlotRange;
if (who->AvoidDamage(this, max_damage, hand)) {
if (max_damage == -3)
DoRiposte(who);
} else {
if (HitChance || who->CheckHitChance(this, skill, SlotPrimary)) {
if (HitChance || who->CheckHitChance(this, skill, EQEmu::legacy::SlotPrimary)) {
who->MeleeMitigation(this, max_damage, min_damage);
CommonOutgoingHitSuccess(who, max_damage, skill);
} else {
@@ -198,7 +198,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
//These two are not subject to the combat ability timer, as they
//allready do their checking in conjunction with the attack timer
//throwing weapons
if(ca_atk->m_atk == SlotRange) {
if (ca_atk->m_atk == EQEmu::legacy::SlotRange) {
if (ca_atk->m_skill == SkillThrowing) {
SetAttackTimer();
ThrowingAttack(GetTarget());
@@ -248,8 +248,8 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
DoAnim(animTailRake);
int32 ht = 0;
if(GetWeaponDamage(GetTarget(), GetInv().GetItem(SlotSecondary)) <= 0 &&
GetWeaponDamage(GetTarget(), GetInv().GetItem(SlotShoulders)) <= 0){
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotSecondary)) <= 0 &&
GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotShoulders)) <= 0){
dmg = -5;
}
else{
@@ -325,7 +325,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
DoAnim(animKick);
int32 ht = 0;
if(GetWeaponDamage(GetTarget(), GetInv().GetItem(SlotFeet)) <= 0){
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotFeet)) <= 0){
dmg = -5;
}
else{
@@ -408,7 +408,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
int32 min_dmg = 1;
int reuse = 0;
SkillUseTypes skill_type; //to avoid casting... even though it "would work"
uint8 itemslot = SlotFeet;
uint8 itemslot = EQEmu::legacy::SlotFeet;
switch(unchecked_type){
case SkillFlyingKick:{
@@ -423,7 +423,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
case SkillDragonPunch:{
skill_type = SkillDragonPunch;
max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, DragonPunchBonus) / 100) + 26;
itemslot = SlotHands;
itemslot = EQEmu::legacy::SlotHands;
ApplySpecialAttackMod(skill_type, max_dmg, min_dmg);
DoAnim(animTailRake);
reuse = TailRakeReuseTime;
@@ -433,7 +433,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
case SkillEagleStrike:{
skill_type = SkillEagleStrike;
max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, EagleStrikeBonus) / 100) + 19;
itemslot = SlotHands;
itemslot = EQEmu::legacy::SlotHands;
ApplySpecialAttackMod(skill_type, max_dmg, min_dmg);
DoAnim(animEagleStrike);
reuse = EagleStrikeReuseTime;
@@ -443,7 +443,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
case SkillTigerClaw:{
skill_type = SkillTigerClaw;
max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, TigerClawBonus) / 100) + 12;
itemslot = SlotHands;
itemslot = EQEmu::legacy::SlotHands;
ApplySpecialAttackMod(skill_type, max_dmg, min_dmg);
DoAnim(animTigerClaw);
reuse = TigerClawReuseTime;
@@ -512,7 +512,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
//make sure we have a proper weapon if we are a client.
if(IsClient()) {
const ItemInst *wpn = CastToClient()->GetInv().GetItem(SlotPrimary);
const ItemInst *wpn = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
if(!wpn || (wpn->GetItem()->ItemType != ItemType1HPiercing)){
Message_StringID(13, BACKSTAB_WEAPON);
return;
@@ -573,7 +573,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
CastToClient()->CheckIncreaseSkill(SkillBackstab, other, 10);
}
else { //We do a single regular attack if we attack from the front without chaotic stab
Attack(other, SlotPrimary);
Attack(other, EQEmu::legacy::SlotPrimary);
}
}
@@ -592,11 +592,11 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
if(IsClient()){
const ItemInst *wpn = nullptr;
wpn = CastToClient()->GetInv().GetItem(SlotPrimary);
wpn = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
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::legacy::ITEM_COMMON_SIZE; ++i)
{
ItemInst *aug = wpn->GetAugment(i);
if(aug)
@@ -671,7 +671,7 @@ void Mob::RogueAssassinate(Mob* other)
{
//can you dodge, parry, etc.. an assassinate??
//if so, use DoSpecialAttackDamage(other, BACKSTAB, 32000); instead
if(GetWeaponDamage(other, IsClient()?CastToClient()->GetInv().GetItem(SlotPrimary):(const ItemInst*)nullptr) > 0){
if (GetWeaponDamage(other, IsClient() ? CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary) : (const ItemInst*)nullptr) > 0){
other->Damage(this, 32000, SPELL_UNKNOWN, SkillBackstab);
}else{
other->Damage(this, -5, SPELL_UNKNOWN, SkillBackstab);
@@ -691,20 +691,20 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
//Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
return;
}
const ItemInst* RangeWeapon = m_inv[SlotRange];
const ItemInst* RangeWeapon = m_inv[EQEmu::legacy::SlotRange];
//locate ammo
int ammo_slot = SlotAmmo;
const ItemInst* Ammo = m_inv[SlotAmmo];
int ammo_slot = EQEmu::legacy::SlotAmmo;
const ItemInst* Ammo = m_inv[EQEmu::legacy::SlotAmmo];
if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(SlotRange), SlotRange);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(SlotRange));
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotRange), EQEmu::legacy::SlotRange);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(EQEmu::legacy::SlotRange));
return;
}
if (!Ammo || !Ammo->IsType(ItemClassCommon)) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(SlotAmmo), SlotAmmo);
Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(SlotAmmo));
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotAmmo), EQEmu::legacy::SlotAmmo);
Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(EQEmu::legacy::SlotAmmo));
return;
}
@@ -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::legacy::GENERAL_BEGIN; r <= EQEmu::legacy::GENERAL_END; r++) {
const ItemInst *pi = m_inv[r];
if(pi == nullptr || !pi->IsType(ItemClassContainer))
continue;
@@ -859,7 +859,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
if (IsClient()){
_RangeWeapon = CastToClient()->m_inv[SlotRange];
_RangeWeapon = CastToClient()->m_inv[EQEmu::legacy::SlotRange];
if (_RangeWeapon && _RangeWeapon->GetItem() && _RangeWeapon->GetItem()->ID == range_id)
RangeWeapon = _RangeWeapon;
@@ -875,7 +875,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
else if (AmmoItem)
SendItemAnimation(other, AmmoItem, SkillArchery);
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, SlotPrimary, chance_mod))) {
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, EQEmu::legacy::SlotPrimary, chance_mod))) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack missed %s.", other->GetName());
if (LaunchProjectile){
@@ -973,7 +973,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
}
if (!HeadShot)
other->AvoidDamage(this, TotalDmg, SlotRange);
other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange);
other->MeleeMitigation(this, TotalDmg, minDmg);
if(TotalDmg > 0){
@@ -997,7 +997,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
if (ReuseTime)
TrySkillProc(other, SkillArchery, ReuseTime);
else
TrySkillProc(other, SkillArchery, 0, true, SlotRange);
TrySkillProc(other, SkillArchery, 0, true, EQEmu::legacy::SlotRange);
}
}
@@ -1006,20 +1006,20 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
//Weapon Proc
if(RangeWeapon && other && !other->HasDied())
TryWeaponProc(RangeWeapon, other, SlotRange);
TryWeaponProc(RangeWeapon, other, EQEmu::legacy::SlotRange);
//Ammo Proc
if (ammo_lost)
TryWeaponProc(nullptr, ammo_lost, other, SlotRange);
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::legacy::SlotRange);
else if(Ammo && other && !other->HasDied())
TryWeaponProc(Ammo, other, SlotRange);
TryWeaponProc(Ammo, other, EQEmu::legacy::SlotRange);
//Skill Proc
if (HasSkillProcs() && other && !other->HasDied()){
if (ReuseTime)
TrySkillProc(other, SkillArchery, ReuseTime);
else
TrySkillProc(other, SkillArchery, 0, false, SlotRange);
TrySkillProc(other, SkillArchery, 0, false, EQEmu::legacy::SlotRange);
}
}
@@ -1285,7 +1285,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
if (!chance_mod)
chance_mod = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 2);
if (!other->CheckHitChance(this, skillInUse, SlotRange, chance_mod))
if (!other->CheckHitChance(this, skillInUse, EQEmu::legacy::SlotRange, chance_mod))
{
other->Damage(this, 0, SPELL_UNKNOWN, skillInUse);
}
@@ -1306,7 +1306,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
TotalDmg += TotalDmg * damage_mod / 100;
other->AvoidDamage(this, TotalDmg, SlotRange);
other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange);
other->MeleeMitigation(this, TotalDmg, MinDmg);
if (TotalDmg > 0)
@@ -1322,15 +1322,15 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
other->Damage(this, TotalDmg, SPELL_UNKNOWN, skillInUse);
if (TotalDmg > 0 && HasSkillProcSuccess() && !other->HasDied())
TrySkillProc(other, skillInUse, 0, true, SlotRange);
TrySkillProc(other, skillInUse, 0, true, EQEmu::legacy::SlotRange);
}
//try proc on hits and misses
if(other && !other->HasDied())
TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, SlotRange);
TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, EQEmu::legacy::SlotRange);
if (HasSkillProcs() && other && !other->HasDied())
TrySkillProc(other, skillInUse, 0, false, SlotRange);
TrySkillProc(other, skillInUse, 0, false, EQEmu::legacy::SlotRange);
}
uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg) {
@@ -1372,19 +1372,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
return;
}
int ammo_slot = SlotRange;
const ItemInst* RangeWeapon = m_inv[SlotRange];
int ammo_slot = EQEmu::legacy::SlotRange;
const ItemInst* RangeWeapon = m_inv[EQEmu::legacy::SlotRange];
if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(SlotRange), SlotRange);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(SlotRange));
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotRange), EQEmu::legacy::SlotRange);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(EQEmu::legacy::SlotRange));
return;
}
const Item_Struct* item = RangeWeapon->GetItem();
if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(SlotRange));
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(EQEmu::legacy::SlotRange));
return;
}
@@ -1392,11 +1392,11 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
if(RangeWeapon->GetCharges() == 1) {
//first check ammo
const ItemInst* AmmoItem = m_inv[SlotAmmo];
const ItemInst* AmmoItem = m_inv[EQEmu::legacy::SlotAmmo];
if(AmmoItem != nullptr && AmmoItem->GetID() == RangeWeapon->GetID()) {
//more in the ammo slot, use it
RangeWeapon = AmmoItem;
ammo_slot = SlotAmmo;
ammo_slot = EQEmu::legacy::SlotAmmo;
Log.Out(Logs::Detail, Logs::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges());
} else {
//look through our inventory for more
@@ -1493,7 +1493,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
else if (AmmoItem)
SendItemAnimation(other, AmmoItem, SkillThrowing);
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, SlotPrimary, chance_mod))){
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, EQEmu::legacy::SlotPrimary, chance_mod))){
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack missed %s.", other->GetName());
if (LaunchProjectile){
TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed);
@@ -1540,7 +1540,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
Log.Out(Logs::Detail, Logs::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg);
if (!Assassinate_Dmg)
other->AvoidDamage(this, TotalDmg, SlotRange);
other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange);
other->MeleeMitigation(this, TotalDmg, minDmg);
if(TotalDmg > 0)
@@ -1559,7 +1559,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
if (ReuseTime)
TrySkillProc(other, SkillThrowing, ReuseTime);
else
TrySkillProc(other, SkillThrowing, 0, true, SlotRange);
TrySkillProc(other, SkillThrowing, 0, true, EQEmu::legacy::SlotRange);
}
}
@@ -1568,15 +1568,15 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
//Throwing item Proc
if (ammo_lost)
TryWeaponProc(nullptr, ammo_lost, other, SlotRange);
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::legacy::SlotRange);
else if(RangeWeapon && other && !other->HasDied())
TryWeaponProc(RangeWeapon, other, SlotRange);
TryWeaponProc(RangeWeapon, other, EQEmu::legacy::SlotRange);
if (HasSkillProcs() && other && !other->HasDied()){
if (ReuseTime)
TrySkillProc(other, SkillThrowing, ReuseTime);
else
TrySkillProc(other, SkillThrowing, 0, false, SlotRange);
TrySkillProc(other, SkillThrowing, 0, false, EQEmu::legacy::SlotRange);
}
}
@@ -1976,7 +1976,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
if (ca_target!=this) {
DoAnim(animTailRake);
if(GetWeaponDamage(ca_target, GetInv().GetItem(SlotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(SlotShoulders)) <= 0){
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotShoulders)) <= 0){
dmg = -5;
}
else{
@@ -2040,7 +2040,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
if(ca_target!=this){
DoAnim(animKick);
if(GetWeaponDamage(ca_target, GetInv().GetItem(SlotFeet)) <= 0){
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotFeet)) <= 0){
dmg = -5;
}
else{
@@ -2252,7 +2252,7 @@ uint32 Mob::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) {
HeadShot_Level = itembonuses.HSLevel;
if(HeadShot_Dmg && HeadShot_Level && (defender->GetLevel() <= HeadShot_Level)){
float ProcChance = GetSpecialProcChances(SlotRange);
float ProcChance = GetSpecialProcChances(EQEmu::legacy::SlotRange);
if(zone->random.Roll(ProcChance))
return HeadShot_Dmg;
}
@@ -2315,7 +2315,7 @@ uint32 Mob::TryAssassinate(Mob* defender, SkillUseTypes skillInUse, uint16 Reuse
float ProcChance = 0.0f;
if (skillInUse == SkillThrowing)
ProcChance = GetSpecialProcChances(SlotRange);
ProcChance = GetSpecialProcChances(EQEmu::legacy::SlotRange);
else
ProcChance = GetAssassinateProcChances(ReuseTime);
@@ -2366,7 +2366,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
int damage = 0;
uint32 hate = 0;
int Hand = SlotPrimary;
int Hand = EQEmu::legacy::SlotPrimary;
if (hate == 0 && weapon_damage > 1) hate = weapon_damage;
if(weapon_damage > 0){
@@ -2390,7 +2390,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
if(skillinuse == SkillBash){
if(IsClient()){
ItemInst *item = CastToClient()->GetInv().GetItem(SlotSecondary);
ItemInst *item = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
if(item){
if(item->GetItem()->ItemType == ItemTypeShield) {
hate += item->GetItem()->AC;
@@ -2412,7 +2412,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
else
damage = zone->random.Int(min_hit, max_hit);
if (other->AvoidDamage(this, damage, CanRiposte ? SlotRange : SlotPrimary)) { // SlotRange excludes ripo, primary doesn't have any extra behavior
if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::legacy::SlotRange : EQEmu::legacy::SlotPrimary)) { // SlotRange excludes ripo, primary doesn't have any extra behavior
if (damage == -3) {
DoRiposte(other);
if (HasDied())
+14 -14
View File
@@ -616,7 +616,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
snprintf(effect_desc, _EDLEN, "Flesh To Bone");
#endif
if(IsClient()){
ItemInst* transI = CastToClient()->GetInv().GetItem(SlotCursor);
ItemInst* transI = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotCursor);
if(transI && transI->IsType(ItemClassCommon) && transI->IsStackable()){
uint32 fcharges = transI->GetCharges();
//Does it sound like meat... maybe should check if it looks like meat too...
@@ -626,7 +626,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
strstr(transI->GetItem()->Name, "Flesh") ||
strstr(transI->GetItem()->Name, "parts") ||
strstr(transI->GetItem()->Name, "Parts")){
CastToClient()->DeleteItemInInventory(SlotCursor, fcharges, true);
CastToClient()->DeleteItemInInventory(EQEmu::legacy::SlotCursor, fcharges, true);
CastToClient()->SummonItem(13073, fcharges);
}
else{
@@ -1157,7 +1157,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (SummonedItem) {
c->PushItemOnCursor(*SummonedItem);
c->SendItemPacket(SlotCursor, SummonedItem, ItemPacketSummonItem);
c->SendItemPacket(EQEmu::legacy::SlotCursor, SummonedItem, ItemPacketSummonItem);
safe_delete(SummonedItem);
}
SummonedItem = database.CreateItem(spell.base[i], charges);
@@ -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::legacy::MATERIAL_BEGIN; x <= EQEmu::legacy::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::legacy::MATERIAL_BEGIN; x <= EQEmu::legacy::MATERIAL_TINT_END; x++)
caster->SendWearChange(x);
}
}
@@ -2216,7 +2216,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
snprintf(effect_desc, _EDLEN, "Rampage");
#endif
if(caster)
entity_list.AEAttack(caster, 30, SlotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal
entity_list.AEAttack(caster, 30, EQEmu::legacy::SlotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal
break;
}
@@ -3014,7 +3014,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (SummonedItem) {
Client *c=CastToClient();
c->PushItemOnCursor(*SummonedItem);
c->SendItemPacket(SlotCursor, SummonedItem, ItemPacketSummonItem);
c->SendItemPacket(EQEmu::legacy::SlotCursor, SummonedItem, ItemPacketSummonItem);
safe_delete(SummonedItem);
}
@@ -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::legacy::MATERIAL_BEGIN; x <= EQEmu::legacy::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::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::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_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y)
for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::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::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::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_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y)
for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::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::legacy::TRIBUTE_BEGIN; x <= EQEmu::legacy::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::legacy::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]);
if(!cur)
+2 -2
View File
@@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
return(false);
}
}
if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= SlotAmmo || item_slot == SlotPowerSource) ){
if (itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= EQEmu::legacy::SlotAmmo || item_slot == EQEmu::legacy::SlotPowerSource)){
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are attempting to cast a must equip clicky without having it equipped
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID);
@@ -1206,7 +1206,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
if (inst == nullptr)
break;
for (int r = AUG_INDEX_BEGIN; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) {
for (int r = AUG_INDEX_BEGIN; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) {
const ItemInst* aug_i = inst->GetAugment(r);
if (!aug_i)
+6 -6
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::legacy::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::legacy::TYPE_WORLD_SIZE; i++)
{
const ItemInst* inst = container->GetItem(i);
if (inst)
@@ -297,7 +297,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
const Item_Struct* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), SlotCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::legacy::SlotCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
if (RuleB(Inventory, DeleteTransformationMold))
user->DeleteItemInInventory(in_combine->container_slot, 0, true);
@@ -317,7 +317,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
const Item_Struct* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), SlotCursor, 0, 0);
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::legacy::SlotCursor, 0, 0);
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
}
else if (inst) {
@@ -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::legacy::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::legacy::TYPE_WORLD_SIZE; x++) {
const ItemInst* inst = container->GetItem(x);
if(!inst)
continue;
+39 -39
View File
@@ -98,7 +98,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
// Item always goes into trade bucket from cursor
Client* client = owner->CastToClient();
ItemInst* inst = client->GetInv().GetItem(SlotCursor);
ItemInst* inst = client->GetInv().GetItem(EQEmu::legacy::SlotCursor);
if (!inst) {
client->Message(13, "Error: Could not find item on your cursor!");
@@ -131,7 +131,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
if (_stack_size > 0)
inst->SetCharges(_stack_size);
else
client->DeleteItemInInventory(SlotCursor);
client->DeleteItemInInventory(EQEmu::legacy::SlotCursor);
SendItemData(inst2, trade_slot_id);
}
@@ -146,7 +146,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
Log.Out(Logs::Detail, Logs::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id);
client->PutItemInInventory(trade_slot_id, *inst);
client->DeleteItemInInventory(SlotCursor);
client->DeleteItemInInventory(EQEmu::legacy::SlotCursor);
}
}
@@ -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::legacy::TRADE_BEGIN, inst, ItemPacketTradeView);
if (inst->GetItem()->ItemClass == 1) {
for (uint16 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) {
for (uint16 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::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::legacy::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::legacy::TRADE_BEGIN; i <= EQEmu::legacy::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::legacy::TRADE_BEGIN; i <= EQEmu::legacy::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_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) {
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::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::legacy::TRADE_BEGIN; i <= EQEmu::legacy::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_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) {
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::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::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::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::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
ItemInst* inst = GetInv().GetItem(trade_slot);
if (inst && inst->IsStackable()) {
@@ -359,7 +359,7 @@ void Client::ResetTrade() {
// there's no built-in safety check against an infinite loop..but, it should break on one of the conditional checks
int16 free_slot = m_inv.FindFreeSlotForTradeItem(inst);
if ((free_slot == SlotCursor) || (free_slot == INVALID_INDEX))
if ((free_slot == EQEmu::legacy::SlotCursor) || (free_slot == INVALID_INDEX))
break;
ItemInst* partial_inst = GetInv().GetItem(free_slot);
@@ -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::legacy::TRADE_END; trade_slot >= EQEmu::legacy::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::legacy::TRADE_BEGIN; bias_slot <= EQEmu::legacy::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::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::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::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::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_INDEX_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::legacy::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::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
ItemInst* inst = GetInv().GetItem(trade_slot);
if (inst && inst->IsStackable()) {
@@ -579,7 +579,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
// there's no built-in safety check against an infinite loop..but, it should break on one of the conditional checks
int16 partial_slot = other->GetInv().FindFreeSlotForTradeItem(inst);
if ((partial_slot == SlotCursor) || (partial_slot == INVALID_INDEX))
if ((partial_slot == EQEmu::legacy::SlotCursor) || (partial_slot == INVALID_INDEX))
break;
ItemInst* partial_inst = other->GetInv().GetItem(partial_slot);
@@ -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::legacy::TRADE_END; trade_slot >= EQEmu::legacy::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::legacy::TRADE_BEGIN; bias_slot <= EQEmu::legacy::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::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::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_INDEX_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::legacy::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::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_NPC_END; ++trade_slot) {
const ItemInst* trade_inst = m_inv[trade_slot];
if(trade_inst) {
@@ -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::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_NPC_END; ++i) {
ItemInst *inst = m_inv.GetItem(i);
if(inst) {
items.push_back(inst);
@@ -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::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_NPC_END; ++i) {
insts[i - EQEmu::legacy::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::legacy::TRADE_BEGIN; i <= EQEmu::legacy::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::legacy::TRADE_BAGS_BEGIN; i <= EQEmu::legacy::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::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++){
item = this->GetInv().GetItem(i);
if (item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::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::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++){
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::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::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) {
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::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::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++){
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::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::legacy::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::legacy::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::legacy::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::legacy::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::legacy::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::legacy::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::legacy::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::legacy::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::legacy::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::legacy::TRIBUTE_BEGIN + r, *inst, false);
SendItemPacket(EQEmu::legacy::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::legacy::TRIBUTE_SIZE; r++) {
if (m_inv[EQEmu::legacy::TRIBUTE_BEGIN + r])
DeleteItemInInventory(EQEmu::legacy::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::legacy::TRIBUTE_SIZE; r++) {
m_pp.tributes[r].tribute = TRIBUTE_NONE;
+21 -21
View File
@@ -582,13 +582,13 @@ int32 Client::Tune_GetMeleeMitDmg(Mob* GM, Mob *attacker, int32 damage, int32 mi
int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage)
{
int Hand = SlotPrimary;
int Hand = EQEmu::legacy::SlotPrimary;
if (!other)
return 0;
ItemInst* weapon;
weapon = GetInv().GetItem(SlotPrimary);
weapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary);
if(weapon != nullptr) {
if (!weapon->IsWeapon()) {
@@ -628,7 +628,7 @@ int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage)
int ucDamageBonus = 0;
if( Hand == SlotPrimary && GetLevel() >= 28 && IsWarriorClass() )
if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass())
{
ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr );
@@ -662,24 +662,24 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
if (attacker->IsClient())
{//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow.
ItemInst* weapon;
weapon = attacker->CastToClient()->GetInv().GetItem(SlotPrimary);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
if(weapon && weapon->IsWeapon()){
attacker->CastToClient()->AttackAnimation(skillinuse, SlotPrimary, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotPrimary, weapon);
}
else {
weapon = attacker->CastToClient()->GetInv().GetItem(SlotSecondary);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
if (weapon && weapon->IsWeapon())
attacker->CastToClient()->AttackAnimation(skillinuse, SlotSecondary, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotSecondary, weapon);
else {
weapon = attacker->CastToClient()->GetInv().GetItem(SlotRange);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotRange);
if (weapon && weapon->IsWeapon())
attacker->CastToClient()->AttackAnimation(skillinuse, SlotRange, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotRange, weapon);
}
}
}
tmp_hit_chance = Tune_CheckHitChance(defender,attacker, skillinuse, SlotPrimary,0,0,0, avoid_override);
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, 0, avoid_override);
Message(0, "#Tune - Begin Parse [Interval %i Max Loop Iterations %i]", interval, max_loop);
@@ -691,7 +691,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
for (int j=0; j < max_loop; j++)
{
tmp_hit_chance =Tune_CheckHitChance(defender,attacker, skillinuse, SlotPrimary,0,false,0, avoid_override, add_acc);
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, false, 0, avoid_override, add_acc);
if (Msg >= 3)
Message(15, "#Tune - Processing... [%i] [ACCURACY %i] Hit Chance %.2f ",j,add_acc,tmp_hit_chance);
@@ -706,7 +706,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
if (end){
Tune_CheckHitChance(defender,attacker, skillinuse, SlotPrimary,0,Msg,0,avoid_override);//Display Stat Report
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, Msg, 0, avoid_override);//Display Stat Report
Message(0, " ");
@@ -742,24 +742,24 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
if (attacker->IsClient())
{//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow.
ItemInst* weapon;
weapon = attacker->CastToClient()->GetInv().GetItem(SlotPrimary);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
if(weapon && weapon->IsWeapon()){
attacker->CastToClient()->AttackAnimation(skillinuse, SlotPrimary, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotPrimary, weapon);
}
else {
weapon = attacker->CastToClient()->GetInv().GetItem(SlotSecondary);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
if (weapon && weapon->IsWeapon())
attacker->CastToClient()->AttackAnimation(skillinuse, SlotSecondary, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotSecondary, weapon);
else {
weapon = attacker->CastToClient()->GetInv().GetItem(SlotRange);
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotRange);
if (weapon && weapon->IsWeapon())
attacker->CastToClient()->AttackAnimation(skillinuse, SlotRange, weapon);
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotRange, weapon);
}
}
}
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, SlotPrimary,0,0,acc_override, 0);
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, acc_override, 0);
Message(0, "#Tune - Begin Parse [Interval %i Max Loop Iterations %i]", interval, max_loop);
Message(0, "#Tune - Processing... Find Avoidance for hit chance on defender of (%.0f) pct from attacker. [Current Hit Chance %.2f]", hit_chance, tmp_hit_chance);
@@ -769,7 +769,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
for (int j=0; j < max_loop; j++)
{
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, SlotPrimary, 0,0, acc_override, 0,0,add_avoid);
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, acc_override, 0, 0, add_avoid);
if (Msg >= 3)
Message(0, "#Tune - Processing... [%i] [AVOIDANCE %i] Hit Chance %.2f ",j,add_avoid,tmp_hit_chance);
@@ -784,7 +784,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
if (end){
Tune_CheckHitChance(defender,attacker, skillinuse, SlotPrimary,0,Msg,acc_override, 0);//Display Stat Report
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, Msg, acc_override, 0);//Display Stat Report
Message(0, " ");
+19 -19
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::legacy::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_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++)
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::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_INDEX_BEGIN; index < EQEmu::constants::ITEM_CONTAINER_SIZE; index++) {
for (uint8 index = SUB_INDEX_BEGIN; index < EQEmu::legacy::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::legacy::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
if (inst->IsType(ItemClassCommon)) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::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::legacy::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::legacy::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::legacy::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::legacy::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::legacy::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::legacy::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::legacy::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::legacy::MATERIAL_BEGIN; index <= EQEmu::legacy::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]);
@@ -2102,7 +2102,7 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
}
// Try loading npc_types tint fields if armor tint is 0 or query failed to get results
if (armor_tint_id == 0) {
for (int index = MaterialChest; index < MaterialCount; index++) {
for (int index = EQEmu::legacy::MaterialChest; index < EQEmu::legacy::MaterialCount; index++) {
temp_npctype_data->armor_tint[index] = temp_npctype_data->armor_tint[0];
}
}
@@ -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 = EQEmu::legacy::MaterialChest; index <= EQEmu::legacy::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::legacy::MATERIAL_BEGIN; index <= EQEmu::legacy::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::legacy::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::legacy::EQUIPMENT_BEGIN; index <= EQEmu::legacy::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::legacy::EQUIPMENT_BEGIN || slot > EQEmu::legacy::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::legacy::EQUIPMENT_SIZE];
char Name[64];
};
+1 -1
View File
@@ -86,7 +86,7 @@ struct NPCType
uint32 drakkin_heritage;
uint32 drakkin_tattoo;
uint32 drakkin_details;
uint32 armor_tint[MaterialCount];
uint32 armor_tint[EQEmu::legacy::MaterialCount];
uint32 min_dmg;
uint32 max_dmg;
int16 attack_count;