mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Reintegration of inventory-based EQDictionary references
This commit is contained in:
+1
-1
@@ -435,7 +435,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::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++) // (< 21) added MainAmmo
|
||||
for (int x = EQEmu::invslot::EQUIPMENT_BEGIN; x <= EQEmu::invslot::EQUIPMENT_END; x++)
|
||||
{
|
||||
uint32 sitem = 0;
|
||||
sitem = CorpseToUse->GetWornItem(x);
|
||||
|
||||
+55
-55
@@ -136,7 +136,7 @@ EQEmu::skills::SkillType Mob::AttackAnimation(int Hand, const EQEmu::ItemInstanc
|
||||
}
|
||||
|
||||
// If we're attacking with the secondary hand, play the dual wield anim
|
||||
if (Hand == EQEmu::inventory::slotSecondary) // DW anim
|
||||
if (Hand == EQEmu::invslot::slotSecondary) // DW anim
|
||||
type = animDualWield;
|
||||
|
||||
DoAnim(type, 0, false);
|
||||
@@ -386,7 +386,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
|
||||
// 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 || attacker->IsEnraged();
|
||||
// Need to check if we have something in MainHand to actually attack with (or fists)
|
||||
if (hit.hand != EQEmu::inventory::slotRange && (CanThisClassRiposte() || IsEnraged()) && InFront && !ImmuneRipo) {
|
||||
if (hit.hand != EQEmu::invslot::slotRange && (CanThisClassRiposte() || IsEnraged()) && InFront && !ImmuneRipo) {
|
||||
if (IsEnraged()) {
|
||||
hit.damage_done = DMG_RIPOSTED;
|
||||
Log(Logs::Detail, Logs::Combat, "I am enraged, riposting frontal attack.");
|
||||
@@ -408,7 +408,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
|
||||
chance -= chance * counter;
|
||||
}
|
||||
// AA Slippery Attacks
|
||||
if (hit.hand == EQEmu::inventory::slotSecondary) {
|
||||
if (hit.hand == EQEmu::invslot::slotSecondary) {
|
||||
int slip = aabonuses.OffhandRiposteFail + itembonuses.OffhandRiposteFail + spellbonuses.OffhandRiposteFail;
|
||||
chance += chance * slip / 100;
|
||||
}
|
||||
@@ -453,7 +453,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
|
||||
}
|
||||
|
||||
// parry
|
||||
if (CanThisClassParry() && InFront && hit.hand != EQEmu::inventory::slotRange) {
|
||||
if (CanThisClassParry() && InFront && hit.hand != EQEmu::invslot::slotRange) {
|
||||
if (IsClient())
|
||||
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillParry, other, -10);
|
||||
// check auto discs ... I guess aa/items too :P
|
||||
@@ -783,7 +783,7 @@ int Mob::ACSum()
|
||||
int shield_ac = 0;
|
||||
if (HasShieldEquiped() && IsClient()) {
|
||||
auto client = CastToClient();
|
||||
auto inst = client->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
auto inst = client->GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (inst) {
|
||||
if (inst->GetItemRecommendedLevel(true) <= GetLevel())
|
||||
shield_ac = inst->GetItemArmorClass(true);
|
||||
@@ -1111,7 +1111,7 @@ int Mob::GetWeaponDamage(Mob *against, const EQEmu::ItemInstance *weapon_item, u
|
||||
else {
|
||||
bool MagicGloves = false;
|
||||
if (IsClient()) {
|
||||
const EQEmu::ItemInstance *gloves = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotHands);
|
||||
const EQEmu::ItemInstance *gloves = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotHands);
|
||||
if (gloves)
|
||||
MagicGloves = gloves->GetItemMagical(true);
|
||||
}
|
||||
@@ -1397,12 +1397,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.
|
||||
|
||||
EQEmu::ItemInstance* weapon = nullptr;
|
||||
if (Hand == EQEmu::inventory::slotSecondary) { // Kaiyodo - Pick weapon from the attacking hand
|
||||
weapon = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
if (Hand == EQEmu::invslot::slotSecondary) { // Kaiyodo - Pick weapon from the attacking hand
|
||||
weapon = GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
OffHandAtk(true);
|
||||
}
|
||||
else {
|
||||
weapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
weapon = GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
OffHandAtk(false);
|
||||
}
|
||||
|
||||
@@ -1440,10 +1440,10 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
if (my_hit.base_damage > 0) {
|
||||
// if we revamp this function be more general, we will have to make sure this isn't
|
||||
// executed for anything BUT normal melee damage weapons from auto attack
|
||||
if (Hand == EQEmu::inventory::slotPrimary || Hand == EQEmu::inventory::slotSecondary)
|
||||
if (Hand == EQEmu::invslot::slotPrimary || Hand == EQEmu::invslot::slotSecondary)
|
||||
my_hit.base_damage = DoDamageCaps(my_hit.base_damage);
|
||||
auto shield_inc = spellbonuses.ShieldEquipDmgMod + itembonuses.ShieldEquipDmgMod + aabonuses.ShieldEquipDmgMod;
|
||||
if (shield_inc > 0 && HasShieldEquiped() && Hand == EQEmu::inventory::slotPrimary) {
|
||||
if (shield_inc > 0 && HasShieldEquiped() && Hand == EQEmu::invslot::slotPrimary) {
|
||||
my_hit.base_damage = my_hit.base_damage * (100 + shield_inc) / 100;
|
||||
hate = hate * (100 + shield_inc) / 100;
|
||||
}
|
||||
@@ -1465,7 +1465,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
|
||||
int ucDamageBonus = 0;
|
||||
|
||||
if (Hand == EQEmu::inventory::slotPrimary && GetLevel() >= 28 && IsWarriorClass())
|
||||
if (Hand == EQEmu::invslot::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.
|
||||
@@ -1477,7 +1477,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 == EQEmu::inventory::slotSecondary) {
|
||||
if (Hand == EQEmu::invslot::slotSecondary) {
|
||||
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc) {
|
||||
|
||||
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr, true);
|
||||
@@ -1927,28 +1927,28 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
my_hit.skill = EQEmu::skills::SkillHandtoHand;
|
||||
my_hit.hand = Hand;
|
||||
my_hit.damage_done = 1;
|
||||
if (Hand == EQEmu::inventory::slotPrimary) {
|
||||
if (Hand == EQEmu::invslot::slotPrimary) {
|
||||
my_hit.skill = static_cast<EQEmu::skills::SkillType>(GetPrimSkill());
|
||||
OffHandAtk(false);
|
||||
}
|
||||
if (Hand == EQEmu::inventory::slotSecondary) {
|
||||
if (Hand == EQEmu::invslot::slotSecondary) {
|
||||
my_hit.skill = static_cast<EQEmu::skills::SkillType>(GetSecSkill());
|
||||
OffHandAtk(true);
|
||||
}
|
||||
|
||||
//figure out what weapon they are using, if any
|
||||
const EQEmu::ItemData* weapon = nullptr;
|
||||
if (Hand == EQEmu::inventory::slotPrimary && equipment[EQEmu::inventory::slotPrimary] > 0)
|
||||
weapon = database.GetItem(equipment[EQEmu::inventory::slotPrimary]);
|
||||
else if (equipment[EQEmu::inventory::slotSecondary])
|
||||
weapon = database.GetItem(equipment[EQEmu::inventory::slotSecondary]);
|
||||
if (Hand == EQEmu::invslot::slotPrimary && equipment[EQEmu::invslot::slotPrimary] > 0)
|
||||
weapon = database.GetItem(equipment[EQEmu::invslot::slotPrimary]);
|
||||
else if (equipment[EQEmu::invslot::slotSecondary])
|
||||
weapon = database.GetItem(equipment[EQEmu::invslot::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(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID);
|
||||
|
||||
if (Hand == EQEmu::inventory::slotSecondary && weapon->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
if (Hand == EQEmu::invslot::slotSecondary && weapon->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
Log(Logs::Detail, Logs::Combat, "Attack with shield canceled.");
|
||||
return false;
|
||||
}
|
||||
@@ -3896,7 +3896,7 @@ void Mob::TryDefensiveProc(Mob *on, uint16 hand) {
|
||||
float ProcChance, ProcBonus;
|
||||
on->GetDefensiveProcChances(ProcBonus, ProcChance, hand, this);
|
||||
|
||||
if (hand != EQEmu::inventory::slotPrimary)
|
||||
if (hand != EQEmu::invslot::slotPrimary)
|
||||
ProcChance /= 2;
|
||||
|
||||
int level_penalty = 0;
|
||||
@@ -3969,7 +3969,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
|
||||
ProcBonus += static_cast<float>(itembonuses.ProcChance) / 10.0f; // Combat Effects
|
||||
float ProcChance = GetProcChances(ProcBonus, hand);
|
||||
|
||||
if (hand != EQEmu::inventory::slotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
if (hand != EQEmu::invslot::slotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
ProcChance /= 2;
|
||||
|
||||
// Try innate proc on weapon
|
||||
@@ -4008,7 +4008,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
|
||||
proced = false;
|
||||
|
||||
if (!proced && inst) {
|
||||
for (int r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
|
||||
for (int r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
||||
const EQEmu::ItemInstance *aug_i = inst->GetAugment(r);
|
||||
if (!aug_i) // no aug, try next slot!
|
||||
continue;
|
||||
@@ -4051,11 +4051,11 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
float ProcChance = 0.0f;
|
||||
ProcChance = GetProcChances(ProcBonus, hand);
|
||||
|
||||
if (hand != EQEmu::inventory::slotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
if (hand != EQEmu::invslot::slotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
ProcChance /= 2;
|
||||
|
||||
bool rangedattk = false;
|
||||
if (weapon && hand == EQEmu::inventory::slotRange) {
|
||||
if (weapon && hand == EQEmu::invslot::slotRange) {
|
||||
if (weapon->ItemType == EQEmu::item::ItemTypeArrow ||
|
||||
weapon->ItemType == EQEmu::item::ItemTypeLargeThrowing ||
|
||||
weapon->ItemType == EQEmu::item::ItemTypeSmallThrowing ||
|
||||
@@ -4064,11 +4064,11 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
}
|
||||
}
|
||||
|
||||
if (!weapon && hand == EQEmu::inventory::slotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
|
||||
if (!weapon && hand == EQEmu::invslot::slotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
|
||||
rangedattk = true;
|
||||
|
||||
for (uint32 i = 0; i < MAX_PROCS; i++) {
|
||||
if (IsPet() && hand != EQEmu::inventory::slotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
|
||||
if (IsPet() && hand != EQEmu::invslot::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
|
||||
@@ -4128,7 +4128,7 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
}
|
||||
}
|
||||
|
||||
if (HasSkillProcs() && hand != EQEmu::inventory::slotRange) { //We check ranged skill procs within the attack functions.
|
||||
if (HasSkillProcs() && hand != EQEmu::invslot::slotRange) { //We check ranged skill procs within the attack functions.
|
||||
uint16 skillinuse = 28;
|
||||
if (weapon)
|
||||
skillinuse = GetSkillByItemType(weapon->ItemType);
|
||||
@@ -4451,7 +4451,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
return;
|
||||
}
|
||||
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
|
||||
@@ -4462,7 +4462,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Preforming a double riposted from SE_DoubleRiposte (%d percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
}
|
||||
@@ -4475,7 +4475,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Preforming a double riposted from SE_GiveDoubleRiposte base1 == 0 (%d percent chance)",
|
||||
DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
}
|
||||
@@ -4888,7 +4888,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 != EQEmu::inventory::slotPrimary)
|
||||
if (hand != EQEmu::invslot::slotPrimary)
|
||||
ProcChance /= 2;
|
||||
}
|
||||
|
||||
@@ -5182,13 +5182,13 @@ void Client::SetAttackTimer()
|
||||
|
||||
Timer *TimerToUse = nullptr;
|
||||
|
||||
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
|
||||
for (int i = EQEmu::invslot::slotRange; i <= EQEmu::invslot::slotSecondary; i++) {
|
||||
//pick a timer
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
if (i == EQEmu::invslot::slotPrimary)
|
||||
TimerToUse = &attack_timer;
|
||||
else if (i == EQEmu::inventory::slotRange)
|
||||
else if (i == EQEmu::invslot::slotRange)
|
||||
TimerToUse = &ranged_timer;
|
||||
else if (i == EQEmu::inventory::slotSecondary)
|
||||
else if (i == EQEmu::invslot::slotSecondary)
|
||||
TimerToUse = &attack_dw_timer;
|
||||
else //invalid slot (hands will always hit this)
|
||||
continue;
|
||||
@@ -5201,7 +5201,7 @@ void Client::SetAttackTimer()
|
||||
ItemToUse = ci->GetItem();
|
||||
|
||||
//special offhand stuff
|
||||
if (i == EQEmu::inventory::slotSecondary) {
|
||||
if (i == EQEmu::invslot::slotSecondary) {
|
||||
//if we cant dual wield, skip it
|
||||
if (!CanThisClassDualWield() || HasTwoHanderEquipped()) {
|
||||
attack_dw_timer.Disable();
|
||||
@@ -5276,19 +5276,19 @@ void NPC::SetAttackTimer()
|
||||
else
|
||||
speed = static_cast<int>((attack_delay / haste_mod) + ((hhe / 100.0f) * attack_delay));
|
||||
|
||||
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
|
||||
for (int i = EQEmu::invslot::slotRange; i <= EQEmu::invslot::slotSecondary; i++) {
|
||||
//pick a timer
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
if (i == EQEmu::invslot::slotPrimary)
|
||||
TimerToUse = &attack_timer;
|
||||
else if (i == EQEmu::inventory::slotRange)
|
||||
else if (i == EQEmu::invslot::slotRange)
|
||||
TimerToUse = &ranged_timer;
|
||||
else if (i == EQEmu::inventory::slotSecondary)
|
||||
else if (i == EQEmu::invslot::slotSecondary)
|
||||
TimerToUse = &attack_dw_timer;
|
||||
else //invalid slot (hands will always hit this)
|
||||
continue;
|
||||
|
||||
//special offhand stuff
|
||||
if (i == EQEmu::inventory::slotSecondary) {
|
||||
if (i == EQEmu::invslot::slotSecondary) {
|
||||
// SPECATK_QUAD is uncheesable
|
||||
if (!CanThisClassDualWield() || (HasTwoHanderEquipped() && !GetSpecialAbility(SPECATK_QUAD))) {
|
||||
attack_dw_timer.Disable();
|
||||
@@ -5310,7 +5310,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 == EQEmu::inventory::slotSecondary)
|
||||
if (candouble && hand == EQEmu::invslot::slotSecondary)
|
||||
candouble =
|
||||
GetSkill(EQEmu::skills::SkillDoubleAttack) > 149 ||
|
||||
(aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack) > 0;
|
||||
@@ -5321,7 +5321,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
|
||||
Attack(target, hand, false, false, IsFromSpell);
|
||||
|
||||
// Modern AA description: Increases your chance of ... performing one additional hit with a 2-handed weapon when double attacking by 2%.
|
||||
if (hand == EQEmu::inventory::slotPrimary) {
|
||||
if (hand == EQEmu::invslot::slotPrimary) {
|
||||
auto extraattackchance = aabonuses.ExtraAttackChance + spellbonuses.ExtraAttackChance +
|
||||
itembonuses.ExtraAttackChance;
|
||||
if (extraattackchance && HasTwoHanderEquipped() && zone->random.Roll(extraattackchance))
|
||||
@@ -5329,7 +5329,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
|
||||
}
|
||||
|
||||
// you can only triple from the main hand
|
||||
if (hand == EQEmu::inventory::slotPrimary && CanThisClassTripleAttack()) {
|
||||
if (hand == EQEmu::invslot::slotPrimary && CanThisClassTripleAttack()) {
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillTripleAttack, target, -10);
|
||||
if (CheckTripleAttack()) {
|
||||
Attack(target, hand, false, false, IsFromSpell);
|
||||
@@ -5383,9 +5383,9 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
|
||||
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, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
if (CanThisClassDoubleAttack() && CheckDoubleAttack()) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) {
|
||||
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
|
||||
if (chance && zone->random.Roll(chance))
|
||||
@@ -5398,16 +5398,16 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
|
||||
if (IsNPC()) {
|
||||
int16 n_atk = CastToNPC()->GetNumberOfAttacks();
|
||||
if (n_atk <= 1) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < n_atk; ++i) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
}
|
||||
|
||||
// we use this random value in three comparisons with different
|
||||
@@ -5418,15 +5418,15 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
|
||||
// check double attack, this is NOT the same rules that clients use...
|
||||
&&
|
||||
RandRoll < (GetLevel() + NPCDualAttackModifier)) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
// 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, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
// now lets check the quad attack
|
||||
if (GetSpecialAbility(SPECATK_QUAD) && RandRoll < (GetLevel() + NPCQuadAttackModifier)) {
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5442,9 +5442,9 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
|
||||
(RuleB(Combat, UseLiveCombatRounds) && GetSpecialAbility(SPECATK_QUAD))) ||
|
||||
GetEquipment(EQEmu::textures::weaponSecondary) != 0) {
|
||||
if (CheckDualWield()) {
|
||||
Attack(target, EQEmu::inventory::slotSecondary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotSecondary, false, false, false, opts);
|
||||
if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()) {
|
||||
Attack(target, EQEmu::inventory::slotSecondary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotSecondary, false, false, false, opts);
|
||||
|
||||
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) {
|
||||
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill) { return true; }
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; }
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr) { return false; }
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return false; }
|
||||
|
||||
+36
-36
@@ -161,35 +161,35 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
|
||||
|
||||
unsigned int i;
|
||||
// Update: MainAmmo should only calc skill mods (TODO: Check for other cases)
|
||||
for (i = EQEmu::inventory::slotCharm; i <= EQEmu::inventory::slotAmmo; i++) {
|
||||
for (i = EQEmu::invslot::BONUS_BEGIN; i <= EQEmu::invslot::BONUS_SKILL_END; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::inventory::slotAmmo));
|
||||
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::invslot::slotAmmo));
|
||||
|
||||
//These are given special flags due to how often they are checked for various spell effects.
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
if (i == EQEmu::inventory::slotSecondary && (item && item->ItemType == EQEmu::item::ItemTypeShield))
|
||||
if (i == EQEmu::invslot::slotSecondary && (item && item->ItemType == EQEmu::item::ItemTypeShield))
|
||||
SetShieldEquiped(true);
|
||||
else if (i == EQEmu::inventory::slotPrimary && (item && item->ItemType == EQEmu::item::ItemType2HBlunt)) {
|
||||
else if (i == EQEmu::invslot::slotPrimary && (item && item->ItemType == EQEmu::item::ItemType2HBlunt)) {
|
||||
SetTwoHandBluntEquiped(true);
|
||||
SetTwoHanderEquipped(true);
|
||||
}
|
||||
else if (i == EQEmu::inventory::slotPrimary && (item && (item->ItemType == EQEmu::item::ItemType2HSlash || item->ItemType == EQEmu::item::ItemType2HPiercing)))
|
||||
else if (i == EQEmu::invslot::slotPrimary && (item && (item->ItemType == EQEmu::item::ItemType2HSlash || item->ItemType == EQEmu::item::ItemType2HPiercing)))
|
||||
SetTwoHanderEquipped(true);
|
||||
}
|
||||
|
||||
//Power Source Slot
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
{
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotPowerSource];
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::invslot::SLOT_POWER_SOURCE];
|
||||
if(inst)
|
||||
AddItemBonuses(inst, newbon);
|
||||
}
|
||||
|
||||
//tribute items
|
||||
for (i = 0; i < EQEmu::legacy::TRIBUTE_SIZE; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::legacy::TRIBUTE_BEGIN + i];
|
||||
for (i = EQEmu::invslot::TRIBUTE_BEGIN; i <= EQEmu::invslot::TRIBUTE_END; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon, false, true);
|
||||
@@ -197,7 +197,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) != EQEmu::item::ItemEffectWorn){
|
||||
for (i = EQEmu::inventory::slotCharm; i < EQEmu::inventory::slotAmmo; i++) {
|
||||
for (i = EQEmu::invslot::BONUS_BEGIN; i <= EQEmu::invslot::BONUS_STAT_END; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
@@ -543,7 +543,7 @@ void Client::AddItemBonuses(const EQEmu::ItemInstance *inst, StatBonuses *newbon
|
||||
}
|
||||
|
||||
if (!isAug) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++)
|
||||
AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item);
|
||||
}
|
||||
}
|
||||
@@ -581,7 +581,7 @@ void Client::AdditiveWornBonuses(const EQEmu::ItemInstance *inst, StatBonuses* n
|
||||
if (!isAug)
|
||||
{
|
||||
int i;
|
||||
for (i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
AdditiveWornBonuses(inst->GetAugment(i),newbon,true);
|
||||
}
|
||||
}
|
||||
@@ -592,32 +592,32 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
|
||||
|
||||
bool food = false;
|
||||
bool drink = false;
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_BAGS_BEGIN; i++)
|
||||
for (i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::GENERAL_END; i++)
|
||||
{
|
||||
if (food && drink)
|
||||
break;
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(i);
|
||||
if (inst && inst->GetItem() && inst->IsClassCommon()) {
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
if (item->ItemType == EQEmu::item::ItemTypeFood && !food)
|
||||
if (!food && item->ItemType == EQEmu::item::ItemTypeFood)
|
||||
food = true;
|
||||
else if (item->ItemType == EQEmu::item::ItemTypeDrink && !drink)
|
||||
else if (!drink && item->ItemType == EQEmu::item::ItemTypeDrink)
|
||||
drink = true;
|
||||
else
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon);
|
||||
}
|
||||
}
|
||||
for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::GENERAL_BAGS_END; i++)
|
||||
for (i = EQEmu::invbag::GENERAL_BAGS_BEGIN; i <= EQEmu::invbag::GENERAL_BAGS_END; i++)
|
||||
{
|
||||
if (food && drink)
|
||||
break;
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(i);
|
||||
if (inst && inst->GetItem() && inst->IsClassCommon()) {
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
if (item->ItemType == EQEmu::item::ItemTypeFood && !food)
|
||||
if (!food && item->ItemType == EQEmu::item::ItemTypeFood)
|
||||
food = true;
|
||||
else if (item->ItemType == EQEmu::item::ItemTypeDrink && !drink)
|
||||
else if (!drink && item->ItemType == EQEmu::item::ItemTypeDrink)
|
||||
drink = true;
|
||||
else
|
||||
continue;
|
||||
@@ -3261,7 +3261,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon)
|
||||
{
|
||||
if(newbon){
|
||||
|
||||
for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++){
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; i++){
|
||||
const EQEmu::ItemData *cur = database.GetItem(equipment[i]);
|
||||
if(cur){
|
||||
//basic stats
|
||||
@@ -3339,24 +3339,24 @@ void Client::CalcItemScale() {
|
||||
bool changed = false;
|
||||
|
||||
// MainAmmo excluded in helper function below
|
||||
if (CalcItemScale(EQEmu::legacy::EQUIPMENT_BEGIN, EQEmu::legacy::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
|
||||
if (CalcItemScale(EQEmu::invslot::EQUIPMENT_BEGIN, EQEmu::invslot::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
|
||||
changed = true;
|
||||
|
||||
if (CalcItemScale(EQEmu::legacy::GENERAL_BEGIN, EQEmu::legacy::GENERAL_END)) // original coding excluded MainCursor (< 30)
|
||||
if (CalcItemScale(EQEmu::invslot::GENERAL_BEGIN, EQEmu::invslot::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::legacy::GENERAL_BAGS_BEGIN, EQEmu::legacy::GENERAL_BAGS_END)) // (< 341)
|
||||
if (CalcItemScale(EQEmu::invbag::GENERAL_BAGS_BEGIN, EQEmu::invbag::GENERAL_BAGS_END)) // (< 341)
|
||||
changed = true;
|
||||
|
||||
if (CalcItemScale(EQEmu::legacy::TRIBUTE_BEGIN, EQEmu::legacy::TRIBUTE_END)) // (< 405)
|
||||
if (CalcItemScale(EQEmu::invslot::TRIBUTE_BEGIN, EQEmu::invslot::TRIBUTE_END)) // (< 405)
|
||||
changed = true;
|
||||
|
||||
//Power Source Slot
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
{
|
||||
if (CalcItemScale(EQEmu::inventory::slotPowerSource, EQEmu::inventory::slotPowerSource))
|
||||
if (CalcItemScale(EQEmu::invslot::SLOT_POWER_SOURCE, EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -3371,7 +3371,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 == EQEmu::inventory::slotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
if (i == EQEmu::invslot::slotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
continue;
|
||||
|
||||
EQEmu::ItemInstance* inst = m_inv.GetItem(i);
|
||||
@@ -3381,7 +3381,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::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) {
|
||||
if (i >= EQEmu::invbag::GENERAL_BAGS_BEGIN && i <= EQEmu::invbag::GENERAL_BAGS_END) {
|
||||
EQEmu::ItemInstance* parent_item = m_inv.GetItem(EQEmu::InventoryProfile::CalcSlotId(i));
|
||||
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
|
||||
continue;
|
||||
@@ -3401,7 +3401,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
|
||||
}
|
||||
|
||||
//iterate all augments
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
for (int x = EQEmu::invaug::SOCKET_BEGIN; x <= EQEmu::invaug::SOCKET_END; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst)
|
||||
@@ -3433,24 +3433,24 @@ void Client::DoItemEnterZone() {
|
||||
bool changed = false;
|
||||
|
||||
// MainAmmo excluded in helper function below
|
||||
if (DoItemEnterZone(EQEmu::legacy::EQUIPMENT_BEGIN, EQEmu::legacy::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
|
||||
if (DoItemEnterZone(EQEmu::invslot::EQUIPMENT_BEGIN, EQEmu::invslot::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
|
||||
changed = true;
|
||||
|
||||
if (DoItemEnterZone(EQEmu::legacy::GENERAL_BEGIN, EQEmu::legacy::GENERAL_END)) // original coding excluded MainCursor (< 30)
|
||||
if (DoItemEnterZone(EQEmu::invslot::GENERAL_BEGIN, EQEmu::invslot::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::legacy::GENERAL_BAGS_BEGIN, EQEmu::legacy::GENERAL_BAGS_END)) // (< 341)
|
||||
if (DoItemEnterZone(EQEmu::invbag::GENERAL_BAGS_BEGIN, EQEmu::invbag::GENERAL_BAGS_END)) // (< 341)
|
||||
changed = true;
|
||||
|
||||
if (DoItemEnterZone(EQEmu::legacy::TRIBUTE_BEGIN, EQEmu::legacy::TRIBUTE_END)) // (< 405)
|
||||
if (DoItemEnterZone(EQEmu::invslot::TRIBUTE_BEGIN, EQEmu::invslot::TRIBUTE_END)) // (< 405)
|
||||
changed = true;
|
||||
|
||||
//Power Source Slot
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
{
|
||||
if (DoItemEnterZone(EQEmu::inventory::slotPowerSource, EQEmu::inventory::slotPowerSource))
|
||||
if (DoItemEnterZone(EQEmu::invslot::SLOT_POWER_SOURCE, EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -3464,7 +3464,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 == EQEmu::inventory::slotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
if (i == EQEmu::invslot::slotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
continue;
|
||||
|
||||
EQEmu::ItemInstance* inst = m_inv.GetItem(i);
|
||||
@@ -3474,7 +3474,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::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) {
|
||||
if (i >= EQEmu::invbag::GENERAL_BAGS_BEGIN && i <= EQEmu::invbag::GENERAL_BAGS_END) {
|
||||
EQEmu::ItemInstance* parent_item = m_inv.GetItem(EQEmu::InventoryProfile::CalcSlotId(i));
|
||||
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
|
||||
continue;
|
||||
@@ -3486,7 +3486,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 <= EQEmu::inventory::slotAmmo || i == EQEmu::inventory::slotPowerSource) {
|
||||
if (i <= EQEmu::invslot::slotAmmo || i == EQEmu::invslot::SLOT_POWER_SOURCE) {
|
||||
parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i);
|
||||
}
|
||||
|
||||
@@ -3496,7 +3496,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
update_slot = true;
|
||||
}
|
||||
} else {
|
||||
if (i <= EQEmu::inventory::slotAmmo || i == EQEmu::inventory::slotPowerSource) {
|
||||
if (i <= EQEmu::invslot::slotAmmo || i == EQEmu::invslot::SLOT_POWER_SOURCE) {
|
||||
parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i);
|
||||
}
|
||||
|
||||
@@ -3504,7 +3504,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
}
|
||||
|
||||
//iterate all augments
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
for (int x = EQEmu::invaug::SOCKET_BEGIN; x <= EQEmu::invaug::SOCKET_END; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance *a_inst = inst->GetAugment(x);
|
||||
if(!a_inst)
|
||||
|
||||
+132
-132
@@ -243,8 +243,8 @@ void Bot::SetBotSpellID(uint32 newSpellID) {
|
||||
}
|
||||
|
||||
uint32 Bot::GetBotArcheryRange() {
|
||||
const EQEmu::ItemInstance *range_inst = GetBotItem(EQEmu::inventory::slotRange);
|
||||
const EQEmu::ItemInstance *ammo_inst = GetBotItem(EQEmu::inventory::slotAmmo);
|
||||
const EQEmu::ItemInstance *range_inst = GetBotItem(EQEmu::invslot::slotRange);
|
||||
const EQEmu::ItemInstance *ammo_inst = GetBotItem(EQEmu::invslot::slotAmmo);
|
||||
if (!range_inst || !ammo_inst)
|
||||
return 0;
|
||||
|
||||
@@ -260,15 +260,15 @@ uint32 Bot::GetBotArcheryRange() {
|
||||
void Bot::ChangeBotArcherWeapons(bool isArcher) {
|
||||
if((GetClass()==WARRIOR) || (GetClass()==PALADIN) || (GetClass()==RANGER) || (GetClass()==SHADOWKNIGHT) || (GetClass()==ROGUE)) {
|
||||
if(!isArcher) {
|
||||
BotAddEquipItem(EQEmu::inventory::slotPrimary, GetBotItemBySlot(EQEmu::inventory::slotPrimary));
|
||||
BotAddEquipItem(EQEmu::inventory::slotSecondary, GetBotItemBySlot(EQEmu::inventory::slotSecondary));
|
||||
BotAddEquipItem(EQEmu::invslot::slotPrimary, GetBotItemBySlot(EQEmu::invslot::slotPrimary));
|
||||
BotAddEquipItem(EQEmu::invslot::slotSecondary, GetBotItemBySlot(EQEmu::invslot::slotSecondary));
|
||||
SetAttackTimer();
|
||||
BotGroupSay(this, "My blade is ready");
|
||||
} else {
|
||||
BotRemoveEquipItem(EQEmu::inventory::slotPrimary);
|
||||
BotRemoveEquipItem(EQEmu::inventory::slotSecondary);
|
||||
BotAddEquipItem(EQEmu::inventory::slotAmmo, GetBotItemBySlot(EQEmu::inventory::slotAmmo));
|
||||
BotAddEquipItem(EQEmu::inventory::slotSecondary, GetBotItemBySlot(EQEmu::inventory::slotRange));
|
||||
BotRemoveEquipItem(EQEmu::invslot::slotPrimary);
|
||||
BotRemoveEquipItem(EQEmu::invslot::slotSecondary);
|
||||
BotAddEquipItem(EQEmu::invslot::slotAmmo, GetBotItemBySlot(EQEmu::invslot::slotAmmo));
|
||||
BotAddEquipItem(EQEmu::invslot::slotSecondary, GetBotItemBySlot(EQEmu::invslot::slotRange));
|
||||
SetAttackTimer();
|
||||
BotGroupSay(this, "My bow is true and ready");
|
||||
}
|
||||
@@ -1166,11 +1166,11 @@ int32 Bot::acmod() {
|
||||
|
||||
uint16 Bot::GetPrimarySkillValue() {
|
||||
EQEmu::skills::SkillType skill = EQEmu::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||
bool equiped = m_inv.GetItem(EQEmu::inventory::slotPrimary);
|
||||
bool equiped = m_inv.GetItem(EQEmu::invslot::slotPrimary);
|
||||
if(!equiped)
|
||||
skill = EQEmu::skills::SkillHandtoHand;
|
||||
else {
|
||||
uint8 type = m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
uint8 type = m_inv.GetItem(EQEmu::invslot::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
switch(type) {
|
||||
case EQEmu::item::ItemType1HSlash:
|
||||
skill = EQEmu::skills::Skill1HSlashing;
|
||||
@@ -1718,8 +1718,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::legacy::EQUIPMENT_SIZE];
|
||||
memset(pet_items, 0, (sizeof(uint32) * EQEmu::legacy::EQUIPMENT_SIZE));
|
||||
uint32 pet_items[EQEmu::invslot::EQUIPMENT_COUNT];
|
||||
memset(pet_items, 0, (sizeof(uint32) * EQEmu::invslot::EQUIPMENT_COUNT));
|
||||
if (!botdb.LoadPetItems(GetBotID(), pet_items))
|
||||
bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetItems(), GetCleanName());
|
||||
|
||||
@@ -1746,11 +1746,11 @@ bool Bot::SavePet()
|
||||
|
||||
char* pet_name = new char[64];
|
||||
SpellBuff_Struct pet_buffs[PET_BUFF_COUNT];
|
||||
uint32 pet_items[EQEmu::legacy::EQUIPMENT_SIZE];
|
||||
uint32 pet_items[EQEmu::invslot::EQUIPMENT_COUNT];
|
||||
|
||||
memset(pet_name, 0, 64);
|
||||
memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * PET_BUFF_COUNT));
|
||||
memset(pet_items, 0, (sizeof(uint32) * EQEmu::legacy::EQUIPMENT_SIZE));
|
||||
memset(pet_items, 0, (sizeof(uint32) * EQEmu::invslot::EQUIPMENT_COUNT));
|
||||
|
||||
pet_inst->GetPetState(pet_buffs, pet_items, pet_name);
|
||||
|
||||
@@ -1904,12 +1904,12 @@ void Bot::BotRangedAttack(Mob* other) {
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance* rangedItem = GetBotItem(EQEmu::inventory::slotRange);
|
||||
EQEmu::ItemInstance* rangedItem = GetBotItem(EQEmu::invslot::slotRange);
|
||||
const EQEmu::ItemData* RangeWeapon = nullptr;
|
||||
if(rangedItem)
|
||||
RangeWeapon = rangedItem->GetItem();
|
||||
|
||||
EQEmu::ItemInstance* ammoItem = GetBotItem(EQEmu::inventory::slotAmmo);
|
||||
EQEmu::ItemInstance* ammoItem = GetBotItem(EQEmu::invslot::slotAmmo);
|
||||
const EQEmu::ItemData* Ammo = nullptr;
|
||||
if(ammoItem)
|
||||
Ammo = ammoItem->GetItem();
|
||||
@@ -2003,19 +2003,19 @@ void Bot::ApplySpecialAttackMod(EQEmu::skills::SkillType skill, int32 &dmg, int3
|
||||
case EQEmu::skills::SkillFlyingKick:
|
||||
case EQEmu::skills::SkillRoundKick:
|
||||
case EQEmu::skills::SkillKick:
|
||||
item_slot = EQEmu::inventory::slotFeet;
|
||||
item_slot = EQEmu::invslot::slotFeet;
|
||||
break;
|
||||
case EQEmu::skills::SkillBash:
|
||||
item_slot = EQEmu::inventory::slotSecondary;
|
||||
item_slot = EQEmu::invslot::slotSecondary;
|
||||
break;
|
||||
case EQEmu::skills::SkillDragonPunch:
|
||||
case EQEmu::skills::SkillEagleStrike:
|
||||
case EQEmu::skills::SkillTigerClaw:
|
||||
item_slot = EQEmu::inventory::slotHands;
|
||||
item_slot = EQEmu::invslot::slotHands;
|
||||
break;
|
||||
}
|
||||
|
||||
if (item_slot >= EQEmu::legacy::EQUIPMENT_BEGIN){
|
||||
if (item_slot >= EQEmu::invslot::EQUIPMENT_BEGIN){
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(item_slot);
|
||||
const EQEmu::ItemData* botweapon = nullptr;
|
||||
if(inst)
|
||||
@@ -2312,8 +2312,8 @@ void Bot::AI_Process() {
|
||||
|
||||
bool atCombatRange = false;
|
||||
|
||||
const auto* p_item = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
const auto* s_item = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
const auto* p_item = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
const auto* s_item = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
|
||||
bool behind_mob = false;
|
||||
bool backstab_weapon = false;
|
||||
@@ -2589,31 +2589,31 @@ void Bot::AI_Process() {
|
||||
|
||||
TEST_TARGET();
|
||||
if (attack_timer.Check()) { // Process primary weapon attacks
|
||||
Attack(tar, EQEmu::inventory::slotPrimary);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary);
|
||||
|
||||
TEST_TARGET();
|
||||
TriggerDefensiveProcs(tar, EQEmu::inventory::slotPrimary, false);
|
||||
TriggerDefensiveProcs(tar, EQEmu::invslot::slotPrimary, false);
|
||||
|
||||
TEST_TARGET();
|
||||
TryWeaponProc(p_item, tar, EQEmu::inventory::slotPrimary);
|
||||
TryWeaponProc(p_item, tar, EQEmu::invslot::slotPrimary);
|
||||
|
||||
//bool tripleSuccess = false;
|
||||
|
||||
TEST_TARGET();
|
||||
if (CanThisClassDoubleAttack()) {
|
||||
if (CheckBotDoubleAttack())
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, true);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, true);
|
||||
|
||||
TEST_TARGET();
|
||||
if (GetSpecialAbility(SPECATK_TRIPLE) && CheckBotDoubleAttack(true)) {
|
||||
//tripleSuccess = true;
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, true);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
TEST_TARGET();
|
||||
//quad attack, does this belong here??
|
||||
if (GetSpecialAbility(SPECATK_QUAD) && CheckBotDoubleAttack(true))
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, true);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
TEST_TARGET();
|
||||
@@ -2622,10 +2622,10 @@ void Bot::AI_Process() {
|
||||
if (flurrychance) {
|
||||
if (zone->random.Int(0, 100) < flurrychance) {
|
||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, false);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, false);
|
||||
|
||||
TEST_TARGET();
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, false);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2634,7 +2634,7 @@ void Bot::AI_Process() {
|
||||
if (ExtraAttackChanceBonus) {
|
||||
if (p_item && p_item->GetItem()->IsType2HWeapon()) {
|
||||
if (zone->random.Int(0, 100) < ExtraAttackChanceBonus)
|
||||
Attack(tar, EQEmu::inventory::slotPrimary, false);
|
||||
Attack(tar, EQEmu::invslot::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2666,15 +2666,15 @@ void Bot::AI_Process() {
|
||||
float random = zone->random.Real(0, 1);
|
||||
|
||||
if (random < DualWieldProbability){ // Max 78% of DW
|
||||
Attack(tar, EQEmu::inventory::slotSecondary); // Single attack with offhand
|
||||
Attack(tar, EQEmu::invslot::slotSecondary); // Single attack with offhand
|
||||
|
||||
TEST_TARGET();
|
||||
TryWeaponProc(s_item, tar, EQEmu::inventory::slotSecondary);
|
||||
TryWeaponProc(s_item, tar, EQEmu::invslot::slotSecondary);
|
||||
|
||||
TEST_TARGET();
|
||||
if (CanThisClassDoubleAttack() && CheckBotDoubleAttack()) {
|
||||
if (tar->GetHP() > -10)
|
||||
Attack(tar, EQEmu::inventory::slotSecondary); // Single attack with offhand
|
||||
Attack(tar, EQEmu::invslot::slotSecondary); // Single attack with offhand
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2945,12 +2945,12 @@ void Bot::PetAIProcess() {
|
||||
if(!botPet->BehindMob(botPet->GetTarget(), botPet->GetX(), botPet->GetY()) && botPet->GetTarget()->IsEnraged())
|
||||
return;
|
||||
|
||||
if (botPet->Attack(GetTarget(), EQEmu::inventory::slotPrimary)) // try the main hand
|
||||
if (botPet->Attack(GetTarget(), EQEmu::invslot::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(), EQEmu::inventory::slotPrimary)) {}
|
||||
if (botPet->Attack(botPet->GetTarget(), EQEmu::invslot::slotPrimary)) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2988,11 +2988,11 @@ void Bot::PetAIProcess() {
|
||||
float DualWieldProbability = ((botPet->GetSkill(EQEmu::skills::SkillDualWield) + botPet->GetLevel()) / 400.0f);
|
||||
DualWieldProbability -= zone->random.Real(0, 1);
|
||||
if(DualWieldProbability < 0) {
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotSecondary);
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::invslot::slotSecondary);
|
||||
if (botPet->CanThisClassDoubleAttack()) {
|
||||
int32 RandRoll = zone->random.Int(0, 99);
|
||||
if (RandRoll < (botPet->GetLevel() + 20))
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotSecondary);
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::invslot::slotSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3117,7 +3117,7 @@ bool Bot::Spawn(Client* botCharacterOwner) {
|
||||
// I re-enabled this until I can sort it out
|
||||
uint32 itemID = 0;
|
||||
uint8 materialFromSlot = 0xFF;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; ++i) {
|
||||
itemID = GetBotItemBySlot(i);
|
||||
if(itemID != 0) {
|
||||
materialFromSlot = EQEmu::InventoryProfile::CalcMaterialFromSlot(i);
|
||||
@@ -3225,7 +3225,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
inst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
@@ -3236,7 +3236,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
inst = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
@@ -3617,12 +3617,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::legacy::TRADE_BEGIN, EQEmu::legacy::TRADE_END, client); // {3000..3007}
|
||||
PerformTradeWithClient(EQEmu::invslot::TRADE_BEGIN, EQEmu::invslot::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(EQEmu::inventory::slotCursor, EQEmu::inventory::slotCursor, client);
|
||||
PerformTradeWithClient(EQEmu::invslot::slotCursor, EQEmu::invslot::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);
|
||||
@@ -3641,7 +3641,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
int adjustStackSize;
|
||||
std::string acceptedItemName;
|
||||
|
||||
ClientTrade(const ItemInstance* item, int16 from, const char* name = "") : tradeItemInstance(item), fromClientSlot(from), toBotSlot(legacy::SLOT_INVALID), adjustStackSize(0), acceptedItemName(name) { }
|
||||
ClientTrade(const ItemInstance* item, int16 from, const char* name = "") : tradeItemInstance(item), fromClientSlot(from), toBotSlot(invslot::SLOT_INVALID), adjustStackSize(0), acceptedItemName(name) { }
|
||||
};
|
||||
|
||||
struct ClientReturn {
|
||||
@@ -3651,18 +3651,18 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
int adjustStackSize;
|
||||
std::string failedItemName;
|
||||
|
||||
ClientReturn(const ItemInstance* item, int16 from, const char* name = "") : returnItemInstance(item), fromBotSlot(from), toClientSlot(legacy::SLOT_INVALID), adjustStackSize(0), failedItemName(name) { }
|
||||
ClientReturn(const ItemInstance* item, int16 from, const char* name = "") : returnItemInstance(item), fromBotSlot(from), toClientSlot(invslot::SLOT_INVALID), adjustStackSize(0), failedItemName(name) { }
|
||||
};
|
||||
|
||||
static const int16 proxyPowerSource = 22;
|
||||
|
||||
static const int16 bot_equip_order[(legacy::EQUIPMENT_SIZE + 1)] = {
|
||||
inventory::slotCharm, inventory::slotEar1, inventory::slotHead, inventory::slotFace,
|
||||
inventory::slotEar2, inventory::slotNeck, inventory::slotShoulders, inventory::slotArms,
|
||||
inventory::slotBack, inventory::slotWrist1, inventory::slotWrist2, inventory::slotRange,
|
||||
inventory::slotHands, inventory::slotPrimary, inventory::slotSecondary, inventory::slotFinger1,
|
||||
inventory::slotFinger2, inventory::slotChest, inventory::slotLegs, inventory::slotFeet,
|
||||
inventory::slotWaist, inventory::slotAmmo, proxyPowerSource // inventory::slotPowerSource
|
||||
static const int16 bot_equip_order[(invslot::CORPSE_BEGIN + 1)] = {
|
||||
invslot::slotCharm, invslot::slotEar1, invslot::slotHead, invslot::slotFace,
|
||||
invslot::slotEar2, invslot::slotNeck, invslot::slotShoulders, invslot::slotArms,
|
||||
invslot::slotBack, invslot::slotWrist1, invslot::slotWrist2, invslot::slotRange,
|
||||
invslot::slotHands, invslot::slotPrimary, invslot::slotSecondary, invslot::slotFinger1,
|
||||
invslot::slotFinger2, invslot::slotChest, invslot::slotLegs, invslot::slotFeet,
|
||||
invslot::slotWaist, invslot::slotAmmo, proxyPowerSource // invslot::SLOT_POWER_SOURCE
|
||||
};
|
||||
|
||||
enum { stageStackable = 0, stageEmpty, stageReplaceable };
|
||||
@@ -3677,17 +3677,17 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
client->ResetTrade();
|
||||
return;
|
||||
}
|
||||
if ((beginSlotID != legacy::TRADE_BEGIN) && (beginSlotID != inventory::slotCursor)) {
|
||||
if ((beginSlotID != invslot::TRADE_BEGIN) && (beginSlotID != invslot::slotCursor)) {
|
||||
client->Message(CC_Red, "Trade request processing from illegal 'begin' slot - Trade Canceled.");
|
||||
client->ResetTrade();
|
||||
return;
|
||||
}
|
||||
if ((endSlotID != legacy::TRADE_END) && (endSlotID != inventory::slotCursor)) {
|
||||
if ((endSlotID != invslot::TRADE_END) && (endSlotID != invslot::slotCursor)) {
|
||||
client->Message(CC_Red, "Trade request processing from illegal 'end' slot - Trade Canceled.");
|
||||
client->ResetTrade();
|
||||
return;
|
||||
}
|
||||
if (((beginSlotID == inventory::slotCursor) && (endSlotID != inventory::slotCursor)) || ((beginSlotID != inventory::slotCursor) && (endSlotID == inventory::slotCursor))) {
|
||||
if (((beginSlotID == invslot::slotCursor) && (endSlotID != invslot::slotCursor)) || ((beginSlotID != invslot::slotCursor) && (endSlotID == invslot::slotCursor))) {
|
||||
client->Message(CC_Red, "Trade request processing illegal slot range - Trade Canceled.");
|
||||
client->ResetTrade();
|
||||
return;
|
||||
@@ -3718,7 +3718,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
client->ResetTrade();
|
||||
return;
|
||||
}
|
||||
if ((trade_index != inventory::slotCursor) && !trade_instance->IsDroppable()) {
|
||||
if ((trade_index != invslot::slotCursor) && !trade_instance->IsDroppable()) {
|
||||
// TODO: add logging
|
||||
client->Message(CC_Red, "Trade hack detected - Trade Canceled.");
|
||||
client->ResetTrade();
|
||||
@@ -3781,7 +3781,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
//for (unsigned stage_loop = stageStackable; stage_loop <= stageReplaceable; ++stage_loop) { // awaiting implementation
|
||||
for (unsigned stage_loop = stageEmpty; stage_loop <= stageReplaceable; ++stage_loop) {
|
||||
for (auto& trade_iterator : client_trade) {
|
||||
if (trade_iterator.toBotSlot != legacy::SLOT_INVALID)
|
||||
if (trade_iterator.toBotSlot != invslot::SLOT_INVALID)
|
||||
continue;
|
||||
|
||||
auto trade_instance = trade_iterator.tradeItemInstance;
|
||||
@@ -3798,7 +3798,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
//}
|
||||
|
||||
if (stage_loop != stageReplaceable) {
|
||||
if ((index == proxyPowerSource) && m_inv[inventory::slotPowerSource])
|
||||
if ((index == proxyPowerSource) && m_inv[invslot::SLOT_POWER_SOURCE])
|
||||
continue;
|
||||
else if (m_inv[index])
|
||||
continue;
|
||||
@@ -3817,28 +3817,28 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
if (slot_taken)
|
||||
continue;
|
||||
|
||||
if (index == inventory::slotPrimary) {
|
||||
if (index == invslot::slotPrimary) {
|
||||
if (trade_instance->GetItem()->IsType2HWeapon()) {
|
||||
if (!melee_secondary) {
|
||||
melee_2h_weapon = true;
|
||||
|
||||
auto equipped_secondary_weapon = m_inv[inventory::slotSecondary];
|
||||
auto equipped_secondary_weapon = m_inv[invslot::slotSecondary];
|
||||
if (equipped_secondary_weapon)
|
||||
client_return.push_back(ClientReturn(equipped_secondary_weapon, inventory::slotSecondary));
|
||||
client_return.push_back(ClientReturn(equipped_secondary_weapon, invslot::slotSecondary));
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (index == inventory::slotSecondary) {
|
||||
if (index == invslot::slotSecondary) {
|
||||
if (!melee_2h_weapon) {
|
||||
if ((can_dual_wield && trade_instance->GetItem()->IsType1HWeapon()) || trade_instance->GetItem()->IsTypeShield() || !trade_instance->IsWeapon()) {
|
||||
melee_secondary = true;
|
||||
|
||||
auto equipped_primary_weapon = m_inv[inventory::slotPrimary];
|
||||
auto equipped_primary_weapon = m_inv[invslot::slotPrimary];
|
||||
if (equipped_primary_weapon && equipped_primary_weapon->GetItem()->IsType2HWeapon())
|
||||
client_return.push_back(ClientReturn(equipped_primary_weapon, inventory::slotPrimary));
|
||||
client_return.push_back(ClientReturn(equipped_primary_weapon, invslot::slotPrimary));
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
@@ -3850,10 +3850,10 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
}
|
||||
|
||||
if (index == proxyPowerSource) {
|
||||
trade_iterator.toBotSlot = inventory::slotPowerSource;
|
||||
trade_iterator.toBotSlot = invslot::SLOT_POWER_SOURCE;
|
||||
|
||||
if (m_inv[inventory::slotPowerSource])
|
||||
client_return.push_back(ClientReturn(m_inv[inventory::slotPowerSource], inventory::slotPowerSource));
|
||||
if (m_inv[invslot::SLOT_POWER_SOURCE])
|
||||
client_return.push_back(ClientReturn(m_inv[invslot::SLOT_POWER_SOURCE], invslot::SLOT_POWER_SOURCE));
|
||||
}
|
||||
else {
|
||||
trade_iterator.toBotSlot = index;
|
||||
@@ -3869,7 +3869,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
|
||||
// move unassignable items from trade list to return list
|
||||
for (std::list<ClientTrade>::iterator trade_iterator = client_trade.begin(); trade_iterator != client_trade.end();) {
|
||||
if (trade_iterator->toBotSlot == legacy::SLOT_INVALID) {
|
||||
if (trade_iterator->toBotSlot == invslot::SLOT_INVALID) {
|
||||
client_return.push_back(ClientReturn(trade_iterator->tradeItemInstance, trade_iterator->fromClientSlot, trade_iterator->tradeItemInstance->GetItem()->Name));
|
||||
trade_iterator = client_trade.erase(trade_iterator);
|
||||
continue;
|
||||
@@ -3895,17 +3895,17 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
return;
|
||||
}
|
||||
|
||||
if (return_iterator.fromBotSlot == inventory::slotCursor) {
|
||||
return_iterator.toClientSlot = inventory::slotCursor;
|
||||
if (return_iterator.fromBotSlot == invslot::slotCursor) {
|
||||
return_iterator.toClientSlot = invslot::slotCursor;
|
||||
}
|
||||
else {
|
||||
int16 client_search_general = legacy::GENERAL_BEGIN;
|
||||
uint8 client_search_bag = inventory::containerBegin;
|
||||
int16 client_search_general = invslot::GENERAL_BEGIN;
|
||||
uint8 client_search_bag = invbag::SLOT_BEGIN;
|
||||
|
||||
bool run_search = true;
|
||||
while (run_search) {
|
||||
int16 client_test_slot = client->GetInv().FindFreeSlotForTradeItem(return_instance, client_search_general, client_search_bag);
|
||||
if (client_test_slot == legacy::SLOT_INVALID) {
|
||||
if (client_test_slot == invslot::SLOT_INVALID) {
|
||||
run_search = false;
|
||||
continue;
|
||||
}
|
||||
@@ -3915,26 +3915,26 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
if (check_iterator.fromBotSlot == return_iterator.fromBotSlot)
|
||||
continue;
|
||||
|
||||
if ((check_iterator.toClientSlot == client_test_slot) && (client_test_slot != inventory::slotCursor)) {
|
||||
if ((check_iterator.toClientSlot == client_test_slot) && (client_test_slot != invslot::slotCursor)) {
|
||||
slot_taken = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (slot_taken) {
|
||||
if ((client_test_slot >= legacy::GENERAL_BEGIN) && (client_test_slot <= legacy::GENERAL_END)) {
|
||||
if ((client_test_slot >= invslot::GENERAL_BEGIN) && (client_test_slot <= invslot::GENERAL_END)) {
|
||||
++client_search_general;
|
||||
client_search_bag = inventory::containerBegin;
|
||||
client_search_bag = invbag::SLOT_BEGIN;
|
||||
}
|
||||
else {
|
||||
client_search_general = InventoryProfile::CalcSlotId(client_test_slot);
|
||||
client_search_bag = InventoryProfile::CalcBagIdx(client_test_slot);
|
||||
|
||||
++client_search_bag;
|
||||
if (client_search_bag >= inventory::ContainerCount) {
|
||||
if (client_search_bag >= invbag::SLOT_COUNT) {
|
||||
// incrementing this past legacy::GENERAL_END triggers the (client_test_slot == legacy::SLOT_INVALID) at the beginning of the search loop
|
||||
// ideally, this will never occur because we always start fresh with each loop iteration and should receive SLOT_CURSOR as a return value
|
||||
++client_search_general;
|
||||
client_search_bag = inventory::containerBegin;
|
||||
client_search_bag = invbag::SLOT_BEGIN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3946,7 +3946,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
}
|
||||
}
|
||||
|
||||
if (return_iterator.toClientSlot == legacy::SLOT_INVALID) {
|
||||
if (return_iterator.toClientSlot == invslot::SLOT_INVALID) {
|
||||
client->Message(CC_Yellow, "You do not have room to complete this trade - Trade Canceled!");
|
||||
client->ResetTrade();
|
||||
return;
|
||||
@@ -3958,10 +3958,10 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
for (auto& return_iterator : client_return) {
|
||||
// TODO: code for stackables
|
||||
|
||||
if (return_iterator.fromBotSlot == inventory::slotCursor) { // failed trade return
|
||||
if (return_iterator.fromBotSlot == invslot::slotCursor) { // failed trade return
|
||||
// no movement action required
|
||||
}
|
||||
else if ((return_iterator.fromBotSlot >= legacy::TRADE_BEGIN) && (return_iterator.fromBotSlot <= legacy::TRADE_END)) { // failed trade returns
|
||||
else if ((return_iterator.fromBotSlot >= invslot::TRADE_BEGIN) && (return_iterator.fromBotSlot <= invslot::TRADE_END)) { // failed trade returns
|
||||
client->PutItemInInventory(return_iterator.toClientSlot, *return_iterator.returnItemInstance);
|
||||
client->SendItemPacket(return_iterator.toClientSlot, return_iterator.returnItemInstance, ItemPacketTrade);
|
||||
client->DeleteItemInInventory(return_iterator.fromBotSlot);
|
||||
@@ -4174,13 +4174,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
|
||||
FaceTarget(GetTarget());
|
||||
EQEmu::ItemInstance* weapon = nullptr;
|
||||
if (Hand == EQEmu::inventory::slotPrimary) {
|
||||
weapon = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
if (Hand == EQEmu::invslot::slotPrimary) {
|
||||
weapon = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
OffHandAtk(false);
|
||||
}
|
||||
|
||||
if (Hand == EQEmu::inventory::slotSecondary) {
|
||||
weapon = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
if (Hand == EQEmu::invslot::slotSecondary) {
|
||||
weapon = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
OffHandAtk(true);
|
||||
}
|
||||
|
||||
@@ -4229,7 +4229,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 == EQEmu::inventory::slotPrimary && GetLevel() >= 28 && IsWarriorClass()) {
|
||||
if (Hand == EQEmu::invslot::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 EQEmu::ItemData*) nullptr);
|
||||
@@ -4238,7 +4238,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 == EQEmu::inventory::slotSecondary) {
|
||||
if (Hand == EQEmu::invslot::slotSecondary) {
|
||||
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
|
||||
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr);
|
||||
my_hit.min_damage = ucDamageBonus;
|
||||
@@ -4645,7 +4645,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
|
||||
int32 focus_max = 0;
|
||||
int32 focus_max_real = 0;
|
||||
//item focus
|
||||
for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++) {
|
||||
for (int x = EQEmu::invslot::EQUIPMENT_BEGIN; x <= EQEmu::invslot::EQUIPMENT_END; x++) {
|
||||
TempItem = nullptr;
|
||||
EQEmu::ItemInstance* ins = GetBotItem(x);
|
||||
if (!ins)
|
||||
@@ -4670,7 +4670,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = EQEmu::inventory::socketBegin; y < EQEmu::inventory::SocketCount; ++y) {
|
||||
for (int y = EQEmu::invaug::SOCKET_BEGIN; y <= EQEmu::invaug::SOCKET_END; ++y) {
|
||||
EQEmu::ItemInstance *aug = nullptr;
|
||||
aug = ins->GetAugment(y);
|
||||
if(aug) {
|
||||
@@ -5106,13 +5106,13 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) {
|
||||
float ProcChance = 0.0f;
|
||||
uint32 weapon_speed = 0;
|
||||
switch (hand) {
|
||||
case EQEmu::inventory::slotPrimary:
|
||||
case EQEmu::invslot::slotPrimary:
|
||||
weapon_speed = attack_timer.GetDuration();
|
||||
break;
|
||||
case EQEmu::inventory::slotSecondary:
|
||||
case EQEmu::invslot::slotSecondary:
|
||||
weapon_speed = attack_dw_timer.GetDuration();
|
||||
break;
|
||||
case EQEmu::inventory::slotRange:
|
||||
case EQEmu::invslot::slotRange:
|
||||
weapon_speed = ranged_timer.GetDuration();
|
||||
break;
|
||||
}
|
||||
@@ -5202,11 +5202,11 @@ void Bot::DoRiposte(Mob* defender) {
|
||||
if (!defender)
|
||||
return;
|
||||
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
defender->Attack(this, EQEmu::invslot::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(Logs::Detail, Logs::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
DoubleRipChance = defender->GetAABonuses().GiveDoubleRiposte[1];
|
||||
@@ -5236,7 +5236,7 @@ int Bot::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
base++;
|
||||
return base;
|
||||
case EQEmu::skills::SkillFrenzy:
|
||||
if (GetBotItem(EQEmu::inventory::slotPrimary)) {
|
||||
if (GetBotItem(EQEmu::invslot::slotPrimary)) {
|
||||
if (GetLevel() > 15)
|
||||
base += GetLevel() - 15;
|
||||
if (base > 23)
|
||||
@@ -5252,7 +5252,7 @@ int Bot::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
case EQEmu::skills::SkillFlyingKick: {
|
||||
float skill_bonus = skill_level / 9.0f;
|
||||
float ac_bonus = 0.0f;
|
||||
auto inst = GetBotItem(EQEmu::inventory::slotFeet);
|
||||
auto inst = GetBotItem(EQEmu::invslot::slotFeet);
|
||||
if (inst)
|
||||
ac_bonus = inst->GetItemArmorClass(true) / 25.0f;
|
||||
if (ac_bonus > skill_bonus)
|
||||
@@ -5262,7 +5262,7 @@ int Bot::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
case EQEmu::skills::SkillKick: {
|
||||
float skill_bonus = skill_level / 10.0f;
|
||||
float ac_bonus = 0.0f;
|
||||
auto inst = GetBotItem(EQEmu::inventory::slotFeet);
|
||||
auto inst = GetBotItem(EQEmu::invslot::slotFeet);
|
||||
if (inst)
|
||||
ac_bonus = inst->GetItemArmorClass(true) / 25.0f;
|
||||
if (ac_bonus > skill_bonus)
|
||||
@@ -5274,9 +5274,9 @@ int Bot::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
float ac_bonus = 0.0f;
|
||||
const EQEmu::ItemInstance *inst = nullptr;
|
||||
if (HasShieldEquiped())
|
||||
inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
inst = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
else if (HasTwoHanderEquipped())
|
||||
inst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
inst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
if (inst)
|
||||
ac_bonus = inst->GetItemArmorClass(true) / 25.0f;
|
||||
if (ac_bonus > skill_bonus)
|
||||
@@ -5285,7 +5285,7 @@ int Bot::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
}
|
||||
case EQEmu::skills::SkillBackstab: {
|
||||
float skill_bonus = static_cast<float>(skill_level) * 0.02f;
|
||||
auto inst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
auto inst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
if (inst && inst->GetItem() && inst->GetItem()->ItemType == EQEmu::item::ItemType1HPiercing) {
|
||||
base = inst->GetItemBackstabDamage(true);
|
||||
if (!inst->GetItemBackstabDamage())
|
||||
@@ -5310,7 +5310,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
|
||||
hate = hate_override;
|
||||
|
||||
if (skill == EQEmu::skills::SkillBash) {
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
const EQEmu::ItemData* botweapon = nullptr;
|
||||
if(inst)
|
||||
botweapon = inst->GetItem();
|
||||
@@ -5331,10 +5331,10 @@ void Bot::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
|
||||
my_hit.skill = skill;
|
||||
my_hit.offense = offense(my_hit.skill);
|
||||
my_hit.tohit = GetTotalToHit(my_hit.skill, 0);
|
||||
my_hit.hand = EQEmu::inventory::slotPrimary;
|
||||
my_hit.hand = EQEmu::invslot::slotPrimary;
|
||||
|
||||
if (skill == EQEmu::skills::SkillThrowing || skill == EQEmu::skills::SkillArchery)
|
||||
my_hit.hand = EQEmu::inventory::slotRange;
|
||||
my_hit.hand = EQEmu::invslot::slotRange;
|
||||
|
||||
DoAttack(who, my_hit);
|
||||
|
||||
@@ -5371,7 +5371,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
||||
|
||||
bool bIsBehind = false;
|
||||
bool bCanFrontalBS = false;
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
const EQEmu::ItemData* botpiercer = nullptr;
|
||||
if(inst)
|
||||
botpiercer = inst->GetItem();
|
||||
@@ -5414,7 +5414,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
||||
m_specialattacks = eSpecialAttacks::None;
|
||||
}
|
||||
else
|
||||
Attack(other, EQEmu::inventory::slotPrimary);
|
||||
Attack(other, EQEmu::invslot::slotPrimary);
|
||||
}
|
||||
|
||||
void Bot::RogueBackstab(Mob *other, bool min_damage, int ReuseTime)
|
||||
@@ -5422,7 +5422,7 @@ void Bot::RogueBackstab(Mob *other, bool min_damage, int ReuseTime)
|
||||
if (!other)
|
||||
return;
|
||||
|
||||
EQEmu::ItemInstance *botweaponInst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
EQEmu::ItemInstance *botweaponInst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
if (botweaponInst) {
|
||||
if (!GetWeaponDamage(other, botweaponInst))
|
||||
return;
|
||||
@@ -5440,7 +5440,7 @@ void Bot::RogueBackstab(Mob *other, bool min_damage, int ReuseTime)
|
||||
}
|
||||
|
||||
void Bot::RogueAssassinate(Mob* other) {
|
||||
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::invslot::slotPrimary);
|
||||
if(botweaponInst) {
|
||||
if(GetWeaponDamage(other, botweaponInst))
|
||||
other->Damage(this, 32000, SPELL_UNKNOWN, EQEmu::skills::SkillBackstab);
|
||||
@@ -5505,7 +5505,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(EQEmu::inventory::slotSecondary) && m_inv.GetItem(EQEmu::inventory::slotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::inventory::slotPrimary) && m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::invslot::slotSecondary) && m_inv.GetItem(EQEmu::invslot::slotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::invslot::slotPrimary) && m_inv.GetItem(EQEmu::invslot::slotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||
canBash = true;
|
||||
|
||||
if(!canBash || zone->random.Int(0, 100) > 25)
|
||||
@@ -5524,7 +5524,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(EQEmu::inventory::slotSecondary) && m_inv.GetItem(EQEmu::inventory::slotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::inventory::slotPrimary) && m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::invslot::slotSecondary) && m_inv.GetItem(EQEmu::invslot::slotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::invslot::slotPrimary) && m_inv.GetItem(EQEmu::invslot::slotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||
skill_to_use = EQEmu::skills::SkillBash;
|
||||
}
|
||||
break;
|
||||
@@ -5555,7 +5555,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
||||
if (skill_to_use == EQEmu::skills::SkillBash) {
|
||||
if (target != this) {
|
||||
DoAnim(animTailRake);
|
||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotShoulders)) <= 0)
|
||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::invslot::slotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::invslot::slotShoulders)) <= 0)
|
||||
dmg = DMG_INVULNERABLE;
|
||||
|
||||
reuse = (BashReuseTime * 1000);
|
||||
@@ -5582,7 +5582,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
||||
if (skill_to_use == EQEmu::skills::SkillKick) {
|
||||
if(target != this) {
|
||||
DoAnim(animKick);
|
||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotFeet)) <= 0)
|
||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::invslot::slotFeet)) <= 0)
|
||||
dmg = DMG_INVULNERABLE;
|
||||
|
||||
reuse = (KickReuseTime * 1000);
|
||||
@@ -5720,7 +5720,7 @@ void Bot::EquipBot(std::string* errorMessage) {
|
||||
GetBotItems(m_inv, errorMessage);
|
||||
const EQEmu::ItemInstance* inst = nullptr;
|
||||
const EQEmu::ItemData* item = nullptr;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; ++i) {
|
||||
inst = GetBotItem(i);
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
@@ -5847,12 +5847,12 @@ void Bot::SetAttackTimer() {
|
||||
attack_timer.SetAtTrigger(4000, true);
|
||||
Timer* TimerToUse = nullptr;
|
||||
const EQEmu::ItemData* PrimaryWeapon = nullptr;
|
||||
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
for (int i = EQEmu::invslot::slotRange; i <= EQEmu::invslot::slotSecondary; i++) {
|
||||
if (i == EQEmu::invslot::slotPrimary)
|
||||
TimerToUse = &attack_timer;
|
||||
else if (i == EQEmu::inventory::slotRange)
|
||||
else if (i == EQEmu::invslot::slotRange)
|
||||
TimerToUse = &ranged_timer;
|
||||
else if (i == EQEmu::inventory::slotSecondary)
|
||||
else if (i == EQEmu::invslot::slotSecondary)
|
||||
TimerToUse = &attack_dw_timer;
|
||||
else
|
||||
continue;
|
||||
@@ -5862,7 +5862,7 @@ void Bot::SetAttackTimer() {
|
||||
if (ci)
|
||||
ItemToUse = ci->GetItem();
|
||||
|
||||
if (i == EQEmu::inventory::slotSecondary) {
|
||||
if (i == EQEmu::invslot::slotSecondary) {
|
||||
if (PrimaryWeapon != nullptr) {
|
||||
if (PrimaryWeapon->IsClassCommon() && PrimaryWeapon->IsType2HWeapon()) {
|
||||
attack_dw_timer.Disable();
|
||||
@@ -5893,7 +5893,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, true);
|
||||
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
if (i == EQEmu::invslot::slotPrimary)
|
||||
PrimaryWeapon = ItemToUse;
|
||||
}
|
||||
}
|
||||
@@ -7603,7 +7603,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::legacy::EQUIPMENT_BEGIN; L <= EQEmu::inventory::slotWaist; L++) {
|
||||
for (int16 L = EQEmu::invslot::EQUIPMENT_BEGIN; L <= EQEmu::invslot::slotWaist; L++) {
|
||||
inst = inspectedBot->GetBotItem(L);
|
||||
|
||||
if(inst) {
|
||||
@@ -7617,28 +7617,28 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = inspectedBot->GetBotItem(EQEmu::inventory::slotPowerSource);
|
||||
inst = inspectedBot->GetBotItem(EQEmu::invslot::SLOT_POWER_SOURCE);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[SoF::invslot::PossessionsPowerSource], item->Name);
|
||||
insr->itemicons[SoF::invslot::PossessionsPowerSource] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::invslot::slotPowerSource], item->Name);
|
||||
insr->itemicons[SoF::invslot::slotPowerSource] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[SoF::invslot::PossessionsPowerSource] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::invslot::slotPowerSource] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
inst = inspectedBot->GetBotItem(EQEmu::inventory::slotAmmo);
|
||||
inst = inspectedBot->GetBotItem(EQEmu::invslot::slotAmmo);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[SoF::invslot::PossessionsAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::PossessionsAmmo] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::invslot::slotAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::slotAmmo] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[SoF::invslot::PossessionsAmmo] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::invslot::slotAmmo] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
strcpy(insr->text, inspectedBot->GetInspectMessage().text);
|
||||
@@ -7651,7 +7651,7 @@ void Bot::CalcItemBonuses(StatBonuses* newbon)
|
||||
{
|
||||
const EQEmu::ItemData* itemtmp = nullptr;
|
||||
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= (EQEmu::invslot::EQUIPMENT_END + 1); ++i) {
|
||||
const EQEmu::ItemInstance* item = GetBotItem((i == 22 ? 9999 : i));
|
||||
if(item) {
|
||||
AddItemBonuses(item, newbon);
|
||||
@@ -7964,7 +7964,7 @@ void Bot::AddItemBonuses(const EQEmu::ItemInstance *inst, StatBonuses* newbon, b
|
||||
|
||||
if (!isAug)
|
||||
{
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++)
|
||||
AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level);
|
||||
}
|
||||
|
||||
@@ -8473,12 +8473,12 @@ uint8 Bot::GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets) {
|
||||
int Bot::GetRawACNoShield(int &shield_ac) {
|
||||
int ac = itembonuses.AC + spellbonuses.AC;
|
||||
shield_ac = 0;
|
||||
EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
EQEmu::ItemInstance* inst = GetBotItem(EQEmu::invslot::slotSecondary);
|
||||
if(inst) {
|
||||
if (inst->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
ac -= inst->GetItem()->AC;
|
||||
shield_ac = inst->GetItem()->AC;
|
||||
for (uint8 i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (uint8 i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
if(inst->GetAugment(i)) {
|
||||
ac -= inst->GetAugment(i)->GetItem()->AC;
|
||||
shield_ac += inst->GetAugment(i)->GetItem()->AC;
|
||||
@@ -8493,7 +8493,7 @@ uint32 Bot::CalcCurrentWeight() {
|
||||
const EQEmu::ItemData* TempItem = nullptr;
|
||||
EQEmu::ItemInstance* inst = nullptr;
|
||||
uint32 Total = 0;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; ++i) {
|
||||
inst = GetBotItem(i);
|
||||
if(inst) {
|
||||
TempItem = inst->GetItem();
|
||||
|
||||
+3
-3
@@ -80,9 +80,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::legacy::EQUIPMENT_BEGIN && x <= EQEmu::legacy::EQUIPMENT_END) ? (x) : ((x == EQEmu::inventory::slotPowerSource) ? (22) : (23)))
|
||||
#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::invslot::EQUIPMENT_BEGIN && x <= EQEmu::invslot::EQUIPMENT_END) ? (x) : ((x == EQEmu::invslot::SLOT_POWER_SOURCE) ? (22) : (23)))
|
||||
|
||||
static std::string bot_equip_slot_name[EQEmu::legacy::EQUIPMENT_SIZE + 2] =
|
||||
static std::string bot_equip_slot_name[EQEmu::invslot::EQUIPMENT_COUNT + 2] =
|
||||
{
|
||||
"Charm", // MainCharm
|
||||
"Left Ear", // MainEar1
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr);
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
|
||||
+36
-36
@@ -2403,7 +2403,7 @@ namespace ActionableBots
|
||||
continue;
|
||||
|
||||
mod_skill_value = base_skill_value;
|
||||
for (int16 index = EQEmu::legacy::EQUIPMENT_BEGIN; index <= EQEmu::legacy::EQUIPMENT_END; ++index) {
|
||||
for (int16 index = EQEmu::invslot::EQUIPMENT_BEGIN; index <= EQEmu::invslot::EQUIPMENT_END; ++index) {
|
||||
const EQEmu::ItemInstance* 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));
|
||||
@@ -7137,23 +7137,23 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
|
||||
linker.SetLinkType(EQEmu::saylink::SayLinkItemInst);
|
||||
|
||||
uint32 inventory_count = 0;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
|
||||
if ((i == EQEmu::inventory::slotSecondary) && is2Hweapon)
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= (EQEmu::invslot::EQUIPMENT_END + 1); ++i) {
|
||||
if ((i == EQEmu::invslot::slotSecondary) && is2Hweapon)
|
||||
continue;
|
||||
|
||||
inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::inventory::slotPowerSource : i);
|
||||
inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::invslot::SLOT_POWER_SOURCE : i);
|
||||
if (!inst || !inst->GetItem()) {
|
||||
c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? EQEmu::inventory::slotPowerSource : i));
|
||||
c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? EQEmu::invslot::SLOT_POWER_SOURCE : i));
|
||||
continue;
|
||||
}
|
||||
|
||||
item = inst->GetItem();
|
||||
if ((i == EQEmu::inventory::slotPrimary) && item->IsType2HWeapon()) {
|
||||
if ((i == EQEmu::invslot::slotPrimary) && item->IsType2HWeapon()) {
|
||||
is2Hweapon = true;
|
||||
}
|
||||
|
||||
linker.SetItemInst(inst);
|
||||
c->Message(m_message, "Using %s in my %s (slot %i)", linker.GenerateLink().c_str(), GetBotEquipSlotName(i), (i == 22 ? EQEmu::inventory::slotPowerSource : i));
|
||||
c->Message(m_message, "Using %s in my %s (slot %i)", linker.GenerateLink().c_str(), GetBotEquipSlotName(i), (i == 22 ? EQEmu::invslot::SLOT_POWER_SOURCE : i));
|
||||
|
||||
++inventory_count;
|
||||
}
|
||||
@@ -7192,7 +7192,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
int slotId = atoi(sep->arg[1]);
|
||||
if (!sep->IsNumber(1) || ((slotId > EQEmu::legacy::EQUIPMENT_END || slotId < EQEmu::legacy::EQUIPMENT_BEGIN) && slotId != EQEmu::inventory::slotPowerSource)) {
|
||||
if (!sep->IsNumber(1) || ((slotId > EQEmu::invslot::EQUIPMENT_END || slotId < EQEmu::invslot::EQUIPMENT_BEGIN) && slotId != EQEmu::invslot::SLOT_POWER_SOURCE)) {
|
||||
c->Message(m_fail, "Valid slots are 0-21 or 9999");
|
||||
return;
|
||||
}
|
||||
@@ -7207,7 +7207,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
for (int m = EQEmu::inventory::socketBegin; m < EQEmu::inventory::SocketCount; ++m) {
|
||||
for (int m = EQEmu::invaug::SOCKET_BEGIN; m <= EQEmu::invaug::SOCKET_END; ++m) {
|
||||
if (!itminst)
|
||||
break;
|
||||
|
||||
@@ -7224,7 +7224,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
std::string error_message;
|
||||
if (itm) {
|
||||
c->PushItemOnCursor(*itminst, true);
|
||||
if ((slotId == EQEmu::inventory::slotRange) || (slotId == EQEmu::inventory::slotAmmo) || (slotId == EQEmu::inventory::slotPrimary) || (slotId == EQEmu::inventory::slotSecondary))
|
||||
if ((slotId == EQEmu::invslot::slotRange) || (slotId == EQEmu::invslot::slotAmmo) || (slotId == EQEmu::invslot::slotPrimary) || (slotId == EQEmu::invslot::slotSecondary))
|
||||
my_bot->SetBotArcher(false);
|
||||
|
||||
my_bot->RemoveBotItemBySlot(slotId, &error_message);
|
||||
@@ -7238,31 +7238,31 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
switch (slotId) {
|
||||
case EQEmu::inventory::slotCharm:
|
||||
case EQEmu::inventory::slotEar1:
|
||||
case EQEmu::inventory::slotHead:
|
||||
case EQEmu::inventory::slotFace:
|
||||
case EQEmu::inventory::slotEar2:
|
||||
case EQEmu::inventory::slotNeck:
|
||||
case EQEmu::inventory::slotBack:
|
||||
case EQEmu::inventory::slotWrist1:
|
||||
case EQEmu::inventory::slotWrist2:
|
||||
case EQEmu::inventory::slotRange:
|
||||
case EQEmu::inventory::slotPrimary:
|
||||
case EQEmu::inventory::slotSecondary:
|
||||
case EQEmu::inventory::slotFinger1:
|
||||
case EQEmu::inventory::slotFinger2:
|
||||
case EQEmu::inventory::slotChest:
|
||||
case EQEmu::inventory::slotWaist:
|
||||
case EQEmu::inventory::slotPowerSource:
|
||||
case EQEmu::inventory::slotAmmo:
|
||||
case EQEmu::invslot::slotCharm:
|
||||
case EQEmu::invslot::slotEar1:
|
||||
case EQEmu::invslot::slotHead:
|
||||
case EQEmu::invslot::slotFace:
|
||||
case EQEmu::invslot::slotEar2:
|
||||
case EQEmu::invslot::slotNeck:
|
||||
case EQEmu::invslot::slotBack:
|
||||
case EQEmu::invslot::slotWrist1:
|
||||
case EQEmu::invslot::slotWrist2:
|
||||
case EQEmu::invslot::slotRange:
|
||||
case EQEmu::invslot::slotPrimary:
|
||||
case EQEmu::invslot::slotSecondary:
|
||||
case EQEmu::invslot::slotFinger1:
|
||||
case EQEmu::invslot::slotFinger2:
|
||||
case EQEmu::invslot::slotChest:
|
||||
case EQEmu::invslot::slotWaist:
|
||||
case EQEmu::invslot::SLOT_POWER_SOURCE:
|
||||
case EQEmu::invslot::slotAmmo:
|
||||
c->Message(m_message, "My %s is %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already")));
|
||||
break;
|
||||
case EQEmu::inventory::slotShoulders:
|
||||
case EQEmu::inventory::slotArms:
|
||||
case EQEmu::inventory::slotHands:
|
||||
case EQEmu::inventory::slotLegs:
|
||||
case EQEmu::inventory::slotFeet:
|
||||
case EQEmu::invslot::slotShoulders:
|
||||
case EQEmu::invslot::slotArms:
|
||||
case EQEmu::invslot::slotHands:
|
||||
case EQEmu::invslot::slotLegs:
|
||||
case EQEmu::invslot::slotFeet:
|
||||
c->Message(m_message, "My %s are %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already")));
|
||||
break;
|
||||
default:
|
||||
@@ -7299,14 +7299,14 @@ void bot_subcommand_inventory_window(Client *c, const Seperator *sep)
|
||||
//EQEmu::SayLinkEngine linker;
|
||||
//linker.SetLinkType(EQEmu::saylink::SayLinkItemInst);
|
||||
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= (EQEmu::invslot::EQUIPMENT_END + 1); ++i) {
|
||||
const EQEmu::ItemData* item = nullptr;
|
||||
const EQEmu::ItemInstance* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::inventory::slotPowerSource : i);
|
||||
const EQEmu::ItemInstance* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::invslot::SLOT_POWER_SOURCE : i);
|
||||
if (inst)
|
||||
item = inst->GetItem();
|
||||
|
||||
window_text.append("<c \"#FFFFFF\">");
|
||||
window_text.append(GetBotEquipSlotName(i == 22 ? EQEmu::inventory::slotPowerSource : i));
|
||||
window_text.append(GetBotEquipSlotName(i == 22 ? EQEmu::invslot::SLOT_POWER_SOURCE : i));
|
||||
window_text.append(": ");
|
||||
if (item) {
|
||||
//window_text.append("</c>");
|
||||
|
||||
+14
-14
@@ -1138,7 +1138,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, EQEmu::InventoryProfile& invent
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
int16 slot_id = atoi(row[0]);
|
||||
if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::inventory::slotPowerSource)
|
||||
if ((slot_id < EQEmu::invslot::EQUIPMENT_BEGIN || slot_id > EQEmu::invslot::EQUIPMENT_END) && slot_id != EQEmu::invslot::SLOT_POWER_SOURCE)
|
||||
continue;
|
||||
|
||||
uint32 item_id = atoi(row[1]);
|
||||
@@ -1173,7 +1173,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, EQEmu::InventoryProfile& invent
|
||||
if (item_inst->GetItem()->Attuneable) {
|
||||
if (atoi(row[4]))
|
||||
item_inst->SetAttuned(true);
|
||||
else if (((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || slot_id == EQEmu::inventory::slotPowerSource))
|
||||
else if (((slot_id >= EQEmu::invslot::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::invslot::EQUIPMENT_END) || slot_id == EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
item_inst->SetAttuned(true);
|
||||
}
|
||||
|
||||
@@ -1241,7 +1241,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::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
|
||||
if (!bot_id || (slot_id > EQEmu::invslot::EQUIPMENT_END && slot_id != EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
return false;
|
||||
|
||||
query = StringFormat("SELECT `item_id` FROM `bot_inventories` WHERE `bot_id` = '%i' AND `slot_id` = '%i' LIMIT 1", bot_id, slot_id);
|
||||
@@ -1259,7 +1259,7 @@ bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint
|
||||
|
||||
bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQEmu::ItemInstance* item_inst)
|
||||
{
|
||||
if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
|
||||
if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::invslot::EQUIPMENT_END && slot_id != EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
return false;
|
||||
|
||||
if (!DeleteItemBySlot(bot_inst->GetBotID(), slot_id))
|
||||
@@ -1268,8 +1268,8 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQEm
|
||||
if (!item_inst || !item_inst->GetID())
|
||||
return true;
|
||||
|
||||
uint32 augment_id[EQEmu::inventory::SocketCount] = { 0, 0, 0, 0, 0, 0 };
|
||||
for (int augment_iter = EQEmu::inventory::socketBegin; augment_iter < EQEmu::inventory::SocketCount; ++augment_iter)
|
||||
uint32 augment_id[EQEmu::invaug::SOCKET_COUNT] = { 0, 0, 0, 0, 0, 0 };
|
||||
for (int augment_iter = EQEmu::invaug::SOCKET_BEGIN; augment_iter <= EQEmu::invaug::SOCKET_END; ++augment_iter)
|
||||
augment_id[augment_iter] = item_inst->GetAugmentItemID(augment_iter);
|
||||
|
||||
uint16 item_charges = 0;
|
||||
@@ -1343,7 +1343,7 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQEm
|
||||
|
||||
bool BotDatabase::DeleteItemBySlot(const uint32 bot_id, const uint32 slot_id)
|
||||
{
|
||||
if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
|
||||
if (!bot_id || (slot_id > EQEmu::invslot::EQUIPMENT_END && slot_id != EQEmu::invslot::SLOT_POWER_SOURCE))
|
||||
return false;
|
||||
|
||||
query = StringFormat("DELETE FROM `bot_inventories` WHERE `bot_id` = '%u' AND `slot_id` = '%u'", bot_id, slot_id);
|
||||
@@ -1382,12 +1382,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::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::inventory::slotPowerSource && !all_flag)
|
||||
if ((slot_id < EQEmu::invslot::EQUIPMENT_BEGIN || slot_id > EQEmu::invslot::EQUIPMENT_END) && slot_id != EQEmu::invslot::SLOT_POWER_SOURCE && !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')", EQEmu::inventory::slotHead, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotHands, EQEmu::inventory::slotChest, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet);
|
||||
where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", EQEmu::invslot::slotHead, EQEmu::invslot::slotArms, EQEmu::invslot::slotWrist1, EQEmu::invslot::slotHands, EQEmu::invslot::slotChest, EQEmu::invslot::slotLegs, EQEmu::invslot::slotFeet);
|
||||
else
|
||||
where_clause = StringFormat(" AND `slot_id` = '%u'", slot_id);
|
||||
|
||||
@@ -1658,8 +1658,8 @@ bool BotDatabase::LoadPetItems(const uint32 bot_id, uint32* pet_items)
|
||||
if (!results.RowCount())
|
||||
return true;
|
||||
|
||||
int item_index = 0;
|
||||
for (auto row = results.begin(); row != results.end() && item_index < EQEmu::legacy::EQUIPMENT_SIZE; ++row) {
|
||||
int item_index = EQEmu::invslot::EQUIPMENT_BEGIN;
|
||||
for (auto row = results.begin(); row != results.end() && item_index <= EQEmu::invslot::EQUIPMENT_END; ++row) {
|
||||
pet_items[item_index] = atoi(row[0]);
|
||||
++item_index;
|
||||
}
|
||||
@@ -1683,7 +1683,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::legacy::EQUIPMENT_SIZE; ++item_index) {
|
||||
for (int item_index = EQEmu::invslot::SLOT_BEGIN; item_index <= EQEmu::invslot::EQUIPMENT_END; ++item_index) {
|
||||
if (!pet_items[item_index])
|
||||
continue;
|
||||
|
||||
@@ -1832,7 +1832,7 @@ bool BotDatabase::SaveAllArmorColorBySlot(const uint32 owner_id, const int16 slo
|
||||
" AND bi.`slot_id` = '%i'",
|
||||
owner_id,
|
||||
rgb_value,
|
||||
EQEmu::inventory::slotHead, EQEmu::inventory::slotChest, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotWrist2, EQEmu::inventory::slotHands, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet,
|
||||
EQEmu::invslot::slotHead, EQEmu::invslot::slotChest, EQEmu::invslot::slotArms, EQEmu::invslot::slotWrist1, EQEmu::invslot::slotWrist2, EQEmu::invslot::slotHands, EQEmu::invslot::slotLegs, EQEmu::invslot::slotFeet,
|
||||
slot_id
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
@@ -1856,7 +1856,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,
|
||||
EQEmu::inventory::slotHead, EQEmu::inventory::slotChest, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotWrist2, EQEmu::inventory::slotHands, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet
|
||||
EQEmu::invslot::slotHead, EQEmu::invslot::slotChest, EQEmu::invslot::slotArms, EQEmu::invslot::slotWrist1, EQEmu::invslot::slotWrist2, EQEmu::invslot::slotHands, EQEmu::invslot::slotLegs, EQEmu::invslot::slotFeet
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
|
||||
+43
-44
@@ -33,7 +33,6 @@ extern volatile bool RunLoops;
|
||||
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "../common/features.h"
|
||||
#include "../common/emu_legacy.h"
|
||||
#include "../common/spdat.h"
|
||||
#include "../common/guilds.h"
|
||||
#include "../common/rulesys.h"
|
||||
@@ -2108,7 +2107,7 @@ void Client::ReadBook(BookRequest_Struct *book) {
|
||||
|
||||
const EQEmu::ItemInstance *inst = nullptr;
|
||||
|
||||
if (read_from_slot <= EQEmu::legacy::SLOT_PERSONAL_BAGS_END)
|
||||
if (read_from_slot <= EQEmu::invbag::GENERAL_BAGS_END)
|
||||
{
|
||||
inst = m_inv[read_from_slot];
|
||||
}
|
||||
@@ -3322,28 +3321,28 @@ 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 EQEmu::inventory::slotWrist2;
|
||||
return EQEmu::invslot::slotWrist2;
|
||||
switch(slot) {
|
||||
case EQEmu::textures::armorHead:
|
||||
slot2 = EQEmu::inventory::slotHead;
|
||||
slot2 = EQEmu::invslot::slotHead;
|
||||
break;
|
||||
case EQEmu::textures::armorChest:
|
||||
slot2 = EQEmu::inventory::slotChest;
|
||||
slot2 = EQEmu::invslot::slotChest;
|
||||
break;
|
||||
case EQEmu::textures::armorArms:
|
||||
slot2 = EQEmu::inventory::slotArms;
|
||||
slot2 = EQEmu::invslot::slotArms;
|
||||
break;
|
||||
case EQEmu::textures::armorWrist:
|
||||
slot2 = EQEmu::inventory::slotWrist1;
|
||||
slot2 = EQEmu::invslot::slotWrist1;
|
||||
break;
|
||||
case EQEmu::textures::armorHands:
|
||||
slot2 = EQEmu::inventory::slotHands;
|
||||
slot2 = EQEmu::invslot::slotHands;
|
||||
break;
|
||||
case EQEmu::textures::armorLegs:
|
||||
slot2 = EQEmu::inventory::slotLegs;
|
||||
slot2 = EQEmu::invslot::slotLegs;
|
||||
break;
|
||||
case EQEmu::textures::armorFeet:
|
||||
slot2 = EQEmu::inventory::slotFeet;
|
||||
slot2 = EQEmu::invslot::slotFeet;
|
||||
break;
|
||||
}
|
||||
return slot2;
|
||||
@@ -3352,25 +3351,25 @@ uint8 Client::SlotConvert(uint8 slot,bool bracer){
|
||||
uint8 Client::SlotConvert2(uint8 slot){
|
||||
uint8 slot2 = 0; // same as above...
|
||||
switch(slot){
|
||||
case EQEmu::inventory::slotHead:
|
||||
case EQEmu::invslot::slotHead:
|
||||
slot2 = EQEmu::textures::armorHead;
|
||||
break;
|
||||
case EQEmu::inventory::slotChest:
|
||||
case EQEmu::invslot::slotChest:
|
||||
slot2 = EQEmu::textures::armorChest;
|
||||
break;
|
||||
case EQEmu::inventory::slotArms:
|
||||
case EQEmu::invslot::slotArms:
|
||||
slot2 = EQEmu::textures::armorArms;
|
||||
break;
|
||||
case EQEmu::inventory::slotWrist1:
|
||||
case EQEmu::invslot::slotWrist1:
|
||||
slot2 = EQEmu::textures::armorWrist;
|
||||
break;
|
||||
case EQEmu::inventory::slotHands:
|
||||
case EQEmu::invslot::slotHands:
|
||||
slot2 = EQEmu::textures::armorHands;
|
||||
break;
|
||||
case EQEmu::inventory::slotLegs:
|
||||
case EQEmu::invslot::slotLegs:
|
||||
slot2 = EQEmu::textures::armorLegs;
|
||||
break;
|
||||
case EQEmu::inventory::slotFeet:
|
||||
case EQEmu::invslot::slotFeet:
|
||||
slot2 = EQEmu::textures::armorFeet;
|
||||
break;
|
||||
}
|
||||
@@ -4425,14 +4424,14 @@ bool Client::GroupFollow(Client* inviter) {
|
||||
uint16 Client::GetPrimarySkillValue()
|
||||
{
|
||||
EQEmu::skills::SkillType skill = EQEmu::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||
bool equiped = m_inv.GetItem(EQEmu::inventory::slotPrimary);
|
||||
bool equiped = m_inv.GetItem(EQEmu::invslot::slotPrimary);
|
||||
|
||||
if (!equiped)
|
||||
skill = EQEmu::skills::SkillHandtoHand;
|
||||
|
||||
else {
|
||||
|
||||
uint8 type = m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
uint8 type = m_inv.GetItem(EQEmu::invslot::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
|
||||
switch (type) {
|
||||
case EQEmu::item::ItemType1HSlash: // 1H Slashing
|
||||
@@ -5596,7 +5595,7 @@ bool Client::TryReward(uint32 claim_id)
|
||||
// save
|
||||
uint32 free_slot = 0xFFFFFFFF;
|
||||
|
||||
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; ++i) {
|
||||
for (int i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::GENERAL_END; ++i) {
|
||||
EQEmu::ItemInstance *item = GetInv().GetItem(i);
|
||||
if (!item) {
|
||||
free_slot = i;
|
||||
@@ -5956,30 +5955,30 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = requestee->GetInv().GetItem(EQEmu::inventory::slotPowerSource);
|
||||
inst = requestee->GetInv().GetItem(EQEmu::invslot::SLOT_POWER_SOURCE);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
// we shouldn't do this..but, that's the way it's coded atm...
|
||||
// (this type of action should be handled exclusively in the client translator)
|
||||
strcpy(insr->itemnames[SoF::invslot::PossessionsPowerSource], item->Name);
|
||||
insr->itemicons[SoF::invslot::PossessionsPowerSource] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::invslot::slotPowerSource], item->Name);
|
||||
insr->itemicons[SoF::invslot::slotPowerSource] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[SoF::invslot::PossessionsPowerSource] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::invslot::slotPowerSource] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
inst = requestee->GetInv().GetItem(EQEmu::inventory::slotAmmo);
|
||||
inst = requestee->GetInv().GetItem(EQEmu::invslot::slotAmmo);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[SoF::invslot::PossessionsAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::PossessionsAmmo] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::invslot::slotAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::slotAmmo] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[SoF::invslot::PossessionsAmmo] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::invslot::slotAmmo] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
strcpy(insr->text, requestee->GetInspectMessage().text);
|
||||
@@ -7035,7 +7034,7 @@ void Client::SendStatsWindow(Client* client, bool use_window)
|
||||
}
|
||||
|
||||
EQEmu::skills::SkillType skill = EQEmu::skills::SkillHandtoHand;
|
||||
auto *inst = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
auto *inst = GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
if (inst && inst->IsClassCommon()) {
|
||||
switch (inst->GetItem()->ItemType) {
|
||||
case EQEmu::item::ItemType1HSlash:
|
||||
@@ -7908,7 +7907,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::SayLinkBodySize; }
|
||||
if (!(delimiter_count & 1)) { i += EQEmu::constants::SAY_LINK_BODY_SIZE; }
|
||||
++delimiter_count;
|
||||
continue;
|
||||
}
|
||||
@@ -8333,17 +8332,17 @@ void Client::TickItemCheck()
|
||||
if(zone->tick_items.empty()) { return; }
|
||||
|
||||
//Scan equip slots for items
|
||||
for (i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; i++)
|
||||
for (i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
//Scan main inventory + cursor
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++)
|
||||
for (i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::slotCursor; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
//Scan bags
|
||||
for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::CURSOR_BAG_END; i++)
|
||||
for (i = EQEmu::invbag::GENERAL_BAGS_BEGIN; i <= EQEmu::invbag::CURSOR_BAG_END; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
@@ -8359,7 +8358,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::legacy::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::invslot::EQUIPMENT_END))
|
||||
{
|
||||
EQEmu::ItemInstance* e_inst = (EQEmu::ItemInstance*)inst;
|
||||
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
|
||||
@@ -8367,9 +8366,9 @@ void Client::TryItemTick(int slot)
|
||||
}
|
||||
|
||||
//Only look at augs in main inventory
|
||||
if (slot > EQEmu::legacy::EQUIPMENT_END) { return; }
|
||||
if (slot > EQEmu::invslot::EQUIPMENT_END) { return; }
|
||||
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
for (int x = EQEmu::invaug::SOCKET_BEGIN; x <= EQEmu::invaug::SOCKET_END; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst) { continue; }
|
||||
@@ -8390,17 +8389,17 @@ void Client::TryItemTick(int slot)
|
||||
void Client::ItemTimerCheck()
|
||||
{
|
||||
int i;
|
||||
for (i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; i++)
|
||||
for (i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++)
|
||||
for (i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::slotCursor; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
|
||||
for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::CURSOR_BAG_END; i++)
|
||||
for (i = EQEmu::invbag::GENERAL_BAGS_BEGIN; i <= EQEmu::invbag::CURSOR_BAG_END; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
@@ -8422,11 +8421,11 @@ void Client::TryItemTimer(int slot)
|
||||
++it_iter;
|
||||
}
|
||||
|
||||
if (slot > EQEmu::legacy::EQUIPMENT_END) {
|
||||
if (slot > EQEmu::invslot::EQUIPMENT_END) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
for (int x = EQEmu::invaug::SOCKET_BEGIN; x <= EQEmu::invaug::SOCKET_END; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst) {
|
||||
@@ -8715,12 +8714,12 @@ void Client::ShowNumHits()
|
||||
int Client::GetQuiverHaste(int delay)
|
||||
{
|
||||
const EQEmu::ItemInstance *pi = nullptr;
|
||||
for (int r = EQEmu::legacy::GENERAL_BEGIN; r <= EQEmu::legacy::GENERAL_END; r++) {
|
||||
for (int r = EQEmu::invslot::GENERAL_BEGIN; r <= EQEmu::invslot::GENERAL_END; r++) {
|
||||
pi = GetInv().GetItem(r);
|
||||
if (pi && pi->IsClassBag() && pi->GetItem()->BagType == EQEmu::item::BagTypeQuiver &&
|
||||
pi->GetItem()->BagWR > 0)
|
||||
break;
|
||||
if (r == EQEmu::legacy::GENERAL_END)
|
||||
if (r == EQEmu::invslot::GENERAL_END)
|
||||
// we will get here if we don't find a valid quiver
|
||||
return 0;
|
||||
}
|
||||
@@ -8760,7 +8759,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, EQEmu::inventory::slotPowerSource);
|
||||
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, EQEmu::invslot::slotCursor);
|
||||
|
||||
if (faction)
|
||||
{
|
||||
|
||||
+2
-2
@@ -249,7 +249,7 @@ public:
|
||||
//abstract virtual function implementations required by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr);
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
@@ -871,7 +871,7 @@ public:
|
||||
void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false);
|
||||
void PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst, ServerLootItem_Struct** bag_item_data = 0);
|
||||
bool AutoPutLootInInventory(EQEmu::ItemInstance& 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 = EQEmu::inventory::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::invslot::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, bool recurse = true);
|
||||
|
||||
@@ -552,7 +552,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::legacy::EQUIPMENT_BEGIN; slot_id < EQEmu::legacy::EQUIPMENT_END; slot_id++) {
|
||||
for (int16 slot_id = EQEmu::invslot::BONUS_BEGIN; slot_id <= EQEmu::invslot::BONUS_STAT_END; slot_id++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[slot_id];
|
||||
if (inst && inst->IsClassCommon()) {
|
||||
Total += inst->GetItem()->AC;
|
||||
@@ -1319,7 +1319,7 @@ uint32 Client::CalcCurrentWeight()
|
||||
EQEmu::ItemInstance* ins = nullptr;
|
||||
uint32 Total = 0;
|
||||
int x;
|
||||
for (x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::inventory::slotCursor; x++) { // include cursor or not?
|
||||
for (x = EQEmu::invslot::POSSESSIONS_BEGIN; x <= EQEmu::invslot::POSSESSIONS_END; x++) {
|
||||
TempItem = 0;
|
||||
ins = GetInv().GetItem(x);
|
||||
if (ins) {
|
||||
@@ -1329,7 +1329,7 @@ uint32 Client::CalcCurrentWeight()
|
||||
Total += TempItem->Weight;
|
||||
}
|
||||
}
|
||||
for (x = EQEmu::legacy::GENERAL_BAGS_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++) { // include cursor bags or not?
|
||||
for (x = EQEmu::invbag::GENERAL_BAGS_BEGIN; x <= EQEmu::invbag::CURSOR_BAG_END; x++) {
|
||||
int TmpWeight = 0;
|
||||
TempItem = 0;
|
||||
ins = GetInv().GetItem(x);
|
||||
@@ -1342,9 +1342,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 = EQEmu::inventory::slotGeneral1;
|
||||
int bagslot = EQEmu::invslot::slotGeneral1;
|
||||
int reduction = 0;
|
||||
for (int m = EQEmu::legacy::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::legacy::GENERAL_BAGS_END; m += 10) { // include cursor bags or not?
|
||||
for (int m = EQEmu::invbag::GENERAL_BAGS_BEGIN + EQEmu::invbag::SLOT_COUNT; m <= EQEmu::invbag::CURSOR_BAG_END; m += EQEmu::invbag::SLOT_COUNT) {
|
||||
if (x >= m) {
|
||||
bagslot += 1;
|
||||
}
|
||||
@@ -2293,12 +2293,12 @@ int Client::GetRawACNoShield(int &shield_ac) const
|
||||
{
|
||||
int ac = itembonuses.AC + spellbonuses.AC + aabonuses.AC;
|
||||
shield_ac = 0;
|
||||
const EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (inst) {
|
||||
if (inst->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
ac -= inst->GetItem()->AC;
|
||||
shield_ac = inst->GetItem()->AC;
|
||||
for (uint8 i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (uint8 i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
if (inst->GetAugment(i)) {
|
||||
ac -= inst->GetAugment(i)->GetItem()->AC;
|
||||
shield_ac += inst->GetAugment(i)->GetItem()->AC;
|
||||
|
||||
+35
-35
@@ -1731,7 +1731,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
if (iter == m_inv.cursor_cbegin())
|
||||
continue;
|
||||
const EQEmu::ItemInstance *inst = *iter;
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::invslot::slotCursor, inst, ItemPacketLimbo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2069,7 +2069,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
|
||||
EQEmu::ItemInstance *inst = database.CreateItem(item, charges);
|
||||
if (!AutoPutLootInInventory(*inst, true, true))
|
||||
{
|
||||
PutLootInInventory(EQEmu::inventory::slotCursor, *inst);
|
||||
PutLootInInventory(EQEmu::invslot::slotCursor, *inst);
|
||||
}
|
||||
Save(1);
|
||||
}
|
||||
@@ -2603,7 +2603,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
|
||||
EQEmu::ItemInstance *inst = database.CreateItem(item, charges);
|
||||
if (!AutoPutLootInInventory(*inst, true, true))
|
||||
{
|
||||
PutLootInInventory(EQEmu::inventory::slotCursor, *inst);
|
||||
PutLootInInventory(EQEmu::invslot::slotCursor, *inst);
|
||||
}
|
||||
|
||||
Save(1);
|
||||
@@ -2653,7 +2653,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, EQEmu::inventory::slotCursor);
|
||||
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, EQEmu::invslot::slotCursor);
|
||||
AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count));
|
||||
}
|
||||
/* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */
|
||||
@@ -2866,8 +2866,8 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
|
||||
|
||||
uint32 ApplyPoisonSuccessResult = 0;
|
||||
ApplyPoison_Struct* ApplyPoisonData = (ApplyPoison_Struct*)app->pBuffer;
|
||||
const EQEmu::ItemInstance* PrimaryWeapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
const EQEmu::ItemInstance* SecondaryWeapon = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemInstance* PrimaryWeapon = GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
const EQEmu::ItemInstance* SecondaryWeapon = GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
const EQEmu::ItemInstance* PoisonItemInstance = GetInv()[ApplyPoisonData->inventorySlot];
|
||||
const EQEmu::ItemData* poison=PoisonItemInstance->GetItem();
|
||||
const EQEmu::ItemData* primary=nullptr;
|
||||
@@ -3001,14 +3001,14 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
bool deleteItems = false;
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
|
||||
{
|
||||
if ((in_augment->container_slot < 0 || in_augment->container_slot >= EQEmu::legacy::SLOT_CURSOR) &&
|
||||
in_augment->container_slot != EQEmu::legacy::SLOT_POWER_SOURCE &&
|
||||
(in_augment->container_slot < EQEmu::legacy::SLOT_PERSONAL_BAGS_BEGIN || in_augment->container_slot > EQEmu::legacy::SLOT_PERSONAL_BAGS_END))
|
||||
if ((in_augment->container_slot < 0 || in_augment->container_slot >= EQEmu::invslot::slotCursor) &&
|
||||
in_augment->container_slot != EQEmu::invslot::SLOT_POWER_SOURCE &&
|
||||
(in_augment->container_slot < EQEmu::invbag::GENERAL_BAGS_BEGIN || in_augment->container_slot > EQEmu::invbag::GENERAL_BAGS_END))
|
||||
{
|
||||
Message(13, "The server does not allow augmentation actions from this slot.");
|
||||
auto cursor_item = m_inv[EQEmu::legacy::SLOT_CURSOR];
|
||||
auto cursor_item = m_inv[EQEmu::invslot::slotCursor];
|
||||
auto augmented_item = m_inv[in_augment->container_slot];
|
||||
SendItemPacket(EQEmu::legacy::SLOT_CURSOR, cursor_item, ItemPacketCharInventory);
|
||||
SendItemPacket(EQEmu::invslot::slotCursor, cursor_item, ItemPacketCharInventory);
|
||||
// this may crash clients on certain slots
|
||||
SendItemPacket(in_augment->container_slot, augmented_item, ItemPacketCharInventory);
|
||||
return;
|
||||
@@ -3083,7 +3083,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
{
|
||||
case 0: // Adding an augment
|
||||
case 2: // Swapping augment
|
||||
new_aug = user_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
new_aug = user_inv.GetItem(EQEmu::invslot::slotCursor);
|
||||
|
||||
if (!new_aug) // Shouldn't get the OP code without the augment on the user's cursor, but maybe it's h4x.
|
||||
{
|
||||
@@ -3141,7 +3141,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
if (itemOneToPush)
|
||||
{
|
||||
DeleteItemInInventory(item_slot, 0, true);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor, new_aug->IsStackable() ? 1 : 0, true);
|
||||
DeleteItemInInventory(EQEmu::invslot::slotCursor, new_aug->IsStackable() ? 1 : 0, true);
|
||||
|
||||
if (solvent)
|
||||
{
|
||||
@@ -3152,7 +3152,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(EQEmu::inventory::slotCursor, *itemTwoToPush, true))
|
||||
if (!PutItemInInventory(EQEmu::invslot::slotCursor, *itemTwoToPush, true))
|
||||
{
|
||||
Log(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!");
|
||||
@@ -3237,7 +3237,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
// Drop the removed augment on the player's cursor
|
||||
if (!PutItemInInventory(EQEmu::inventory::slotCursor, *itemTwoToPush, true))
|
||||
if (!PutItemInInventory(EQEmu::invslot::slotCursor, *itemTwoToPush, true))
|
||||
{
|
||||
Log(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!");
|
||||
@@ -4175,7 +4175,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
|
||||
}
|
||||
else
|
||||
{
|
||||
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", EQEmu::inventory::slotCursor, castspell->inventoryslot);
|
||||
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", EQEmu::invslot::slotCursor, castspell->inventoryslot);
|
||||
InterruptSpell(castspell->spell_id);
|
||||
}
|
||||
}
|
||||
@@ -5123,7 +5123,7 @@ void Client::Handle_OP_CreateObject(const EQApplicationPacket *app)
|
||||
if (LogSys.log_settings[Logs::Inventory].is_category_enabled)
|
||||
Log(Logs::Detail, Logs::Inventory, "Handle_OP_CreateObject() [psize: %u] %s", app->size, DumpPacketToString(app).c_str());
|
||||
|
||||
DropItem(EQEmu::inventory::slotCursor);
|
||||
DropItem(EQEmu::invslot::slotCursor);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7049,7 +7049,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance *CursorItemInst = GetInv().GetItem(EQEmu::inventory::slotCursor);
|
||||
EQEmu::ItemInstance *CursorItemInst = GetInv().GetItem(EQEmu::invslot::slotCursor);
|
||||
|
||||
bool Allowed = true;
|
||||
|
||||
@@ -7097,7 +7097,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
{
|
||||
GuildBankDepositAck(false, sentAction);
|
||||
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor, 0, false);
|
||||
DeleteItemInInventory(EQEmu::invslot::slotCursor, 0, false);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -7118,7 +7118,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
|
||||
case GuildBankWithdraw:
|
||||
{
|
||||
if (GetInv()[EQEmu::inventory::slotCursor])
|
||||
if (GetInv()[EQEmu::invslot::slotCursor])
|
||||
{
|
||||
Message_StringID(13, GUILD_BANK_EMPTY_HANDS);
|
||||
|
||||
@@ -7164,7 +7164,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
{
|
||||
PushItemOnCursor(*inst);
|
||||
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::invslot::slotCursor, inst, ItemPacketLimbo);
|
||||
|
||||
GuildBanks->DeleteItem(GuildID(), gbwis->Area, gbwis->SlotID, gbwis->Quantity);
|
||||
}
|
||||
@@ -8147,7 +8147,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
|
||||
const EQEmu::ItemData* item = nullptr;
|
||||
|
||||
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
|
||||
for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::inventory::slotWaist; L++) {
|
||||
for (int16 L = EQEmu::invslot::EQUIPMENT_BEGIN; L <= EQEmu::invslot::slotWaist; L++) {
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(L);
|
||||
item = inst ? inst->GetItem() : nullptr;
|
||||
|
||||
@@ -8167,15 +8167,15 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
|
||||
else { insr->itemicons[L] = 0xFFFFFFFF; }
|
||||
}
|
||||
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::inventory::slotAmmo);
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::invslot::slotAmmo);
|
||||
item = inst ? inst->GetItem() : nullptr;
|
||||
|
||||
if (item) {
|
||||
// another one..I did these, didn't I!!?
|
||||
strcpy(insr->itemnames[SoF::invslot::PossessionsAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::PossessionsAmmo] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::invslot::slotAmmo], item->Name);
|
||||
insr->itemicons[SoF::invslot::slotAmmo] = item->Icon;
|
||||
}
|
||||
else { insr->itemicons[SoF::invslot::PossessionsAmmo] = 0xFFFFFFFF; }
|
||||
else { insr->itemicons[SoF::invslot::slotAmmo] = 0xFFFFFFFF; }
|
||||
|
||||
InspectMessage_Struct* newmessage = (InspectMessage_Struct*)insr->text;
|
||||
InspectMessage_Struct& playermessage = this->GetInspectMessage();
|
||||
@@ -8637,7 +8637,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
||||
EQEmu::ItemInstance* clickaug = nullptr;
|
||||
EQEmu::ItemData* augitem = nullptr;
|
||||
|
||||
for (r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
|
||||
for (r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
||||
const EQEmu::ItemInstance* aug_i = inst->GetAugment(r);
|
||||
if (!aug_i)
|
||||
continue;
|
||||
@@ -9817,7 +9817,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::legacy::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::invslot::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot))
|
||||
{
|
||||
char *detect = nullptr;
|
||||
const EQEmu::ItemInstance *itm_from = GetInv().GetItem(mi->from_slot);
|
||||
@@ -9838,8 +9838,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::legacy::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::legacy::CURSOR_BAG_END) {
|
||||
if (mi->from_slot >= EQEmu::legacy::CURSOR_BAG_BEGIN) { mi_hack = true; }
|
||||
if (mi->from_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::invbag::CURSOR_BAG_END) {
|
||||
if (mi->from_slot >= EQEmu::invbag::CURSOR_BAG_BEGIN) { mi_hack = true; }
|
||||
else {
|
||||
int16 from_parent = m_inv.CalcSlotId(mi->from_slot);
|
||||
if (!m_inv[from_parent]) { mi_hack = true; }
|
||||
@@ -9848,8 +9848,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
||||
}
|
||||
}
|
||||
|
||||
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; }
|
||||
if (mi->to_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::invbag::CURSOR_BAG_END) {
|
||||
if (mi->to_slot >= EQEmu::invbag::CURSOR_BAG_BEGIN) { mi_hack = true; }
|
||||
else {
|
||||
int16 to_parent = m_inv.CalcSlotId(mi->to_slot);
|
||||
if (!m_inv[to_parent]) { mi_hack = true; }
|
||||
@@ -12475,7 +12475,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;
|
||||
EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (!shield_target)
|
||||
return;
|
||||
if (inst)
|
||||
@@ -12687,8 +12687,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 == EQEmu::inventory::slotCursor) {
|
||||
if (m_inv.GetItem(EQEmu::inventory::slotCursor) != nullptr) {
|
||||
if (freeslotid == EQEmu::invslot::slotCursor) {
|
||||
if (m_inv.GetItem(EQEmu::invslot::slotCursor) != nullptr) {
|
||||
Message(13, "You do not have room for any more items.");
|
||||
safe_delete(outapp);
|
||||
safe_delete(inst);
|
||||
|
||||
+17
-17
@@ -310,7 +310,7 @@ bool Client::Process() {
|
||||
}
|
||||
|
||||
if (AutoFireEnabled()) {
|
||||
EQEmu::ItemInstance *ranged = GetInv().GetItem(EQEmu::inventory::slotRange);
|
||||
EQEmu::ItemInstance *ranged = GetInv().GetItem(EQEmu::invslot::slotRange);
|
||||
if (ranged)
|
||||
{
|
||||
if (ranged->GetItem() && ranged->GetItem()->ItemType == EQEmu::item::ItemTypeBow) {
|
||||
@@ -405,11 +405,11 @@ bool Client::Process() {
|
||||
}
|
||||
else if (auto_attack_target->GetHP() > -10) // -10 so we can watch people bleed in PvP
|
||||
{
|
||||
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
TryWeaponProc(wpn, auto_attack_target, EQEmu::inventory::slotPrimary);
|
||||
TriggerDefensiveProcs(auto_attack_target, EQEmu::inventory::slotPrimary, false);
|
||||
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
TryWeaponProc(wpn, auto_attack_target, EQEmu::invslot::slotPrimary);
|
||||
TriggerDefensiveProcs(auto_attack_target, EQEmu::invslot::slotPrimary, false);
|
||||
|
||||
DoAttackRounds(auto_attack_target, EQEmu::inventory::slotPrimary);
|
||||
DoAttackRounds(auto_attack_target, EQEmu::invslot::slotPrimary);
|
||||
if (CheckAATimer(aaTimerRampage))
|
||||
entity_list.AEAttack(this, 30);
|
||||
}
|
||||
@@ -445,10 +445,10 @@ bool Client::Process() {
|
||||
else if (auto_attack_target->GetHP() > -10) {
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillDualWield, auto_attack_target, -10);
|
||||
if (CheckDualWield()) {
|
||||
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
TryWeaponProc(wpn, auto_attack_target, EQEmu::inventory::slotSecondary);
|
||||
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
TryWeaponProc(wpn, auto_attack_target, EQEmu::invslot::slotSecondary);
|
||||
|
||||
DoAttackRounds(auto_attack_target, EQEmu::inventory::slotSecondary);
|
||||
DoAttackRounds(auto_attack_target, EQEmu::invslot::slotSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -776,7 +776,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 (int16 slot_id = EQEmu::legacy::TRADE_BEGIN; slot_id <= EQEmu::legacy::TRADE_END; slot_id++) {
|
||||
for (int16 slot_id = EQEmu::invslot::TRADE_BEGIN; slot_id <= EQEmu::invslot::TRADE_END; slot_id++) {
|
||||
EQEmu::ItemInstance* inst = m_inv.PopItem(slot_id);
|
||||
if(inst) {
|
||||
bool is_arrow = (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
|
||||
@@ -802,7 +802,7 @@ void Client::BulkSendInventoryItems()
|
||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
|
||||
// Possessions items
|
||||
for (int16 slot_id = EQEmu::inventory::slotBegin; slot_id < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; slot_id++) {
|
||||
for (int16 slot_id = EQEmu::invslot::POSSESSIONS_BEGIN; slot_id <= EQEmu::invslot::POSSESSIONS_END; slot_id++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[slot_id];
|
||||
if (!inst)
|
||||
continue;
|
||||
@@ -817,19 +817,19 @@ void Client::BulkSendInventoryItems()
|
||||
|
||||
// PowerSource item
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotPowerSource];
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::invslot::SLOT_POWER_SOURCE];
|
||||
if (inst) {
|
||||
inst->Serialize(ob, EQEmu::inventory::slotPowerSource);
|
||||
inst->Serialize(ob, EQEmu::invslot::SLOT_POWER_SOURCE);
|
||||
|
||||
if (ob.tellp() == last_pos)
|
||||
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::inventory::slotPowerSource);
|
||||
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::invslot::SLOT_POWER_SOURCE);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
}
|
||||
|
||||
// Bank items
|
||||
for (int16 slot_id = EQEmu::legacy::BANK_BEGIN; slot_id <= EQEmu::legacy::BANK_END; slot_id++) {
|
||||
for (int16 slot_id = EQEmu::invslot::BANK_BEGIN; slot_id <= EQEmu::invslot::BANK_END; slot_id++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[slot_id];
|
||||
if (!inst)
|
||||
continue;
|
||||
@@ -843,7 +843,7 @@ void Client::BulkSendInventoryItems()
|
||||
}
|
||||
|
||||
// SharedBank items
|
||||
for (int16 slot_id = EQEmu::legacy::SHARED_BANK_BEGIN; slot_id <= EQEmu::legacy::SHARED_BANK_END; slot_id++) {
|
||||
for (int16 slot_id = EQEmu::invslot::SHARED_BANK_BEGIN; slot_id <= EQEmu::invslot::SHARED_BANK_END; slot_id++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[slot_id];
|
||||
if (!inst)
|
||||
continue;
|
||||
@@ -1133,7 +1133,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
|
||||
switch(memspell->scribing)
|
||||
{
|
||||
case memSpellScribing: { // scribing spell to book
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotCursor];
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::invslot::slotCursor];
|
||||
|
||||
if (inst && inst->IsClassCommon())
|
||||
{
|
||||
@@ -1147,7 +1147,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
|
||||
if(item && item->Scroll.Effect == (int32)(memspell->spell_id))
|
||||
{
|
||||
ScribeSpell(memspell->spell_id, memspell->slot);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor, 1, true);
|
||||
DeleteItemInInventory(EQEmu::invslot::slotCursor, 1, true);
|
||||
}
|
||||
else
|
||||
Message(0,"Scribing spell: inst exists but item does not or spell ids do not match.");
|
||||
|
||||
+29
-29
@@ -2537,15 +2537,15 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
static char* scope_prefix[] = { "Equip", "Gen", "Cursor", "Limbo", "Trib", "Bank", "ShBank", "Trade", "World" };
|
||||
|
||||
static int16 scope_range[][2] = {
|
||||
{ EQEmu::legacy::EQUIPMENT_BEGIN, EQEmu::legacy::EQUIPMENT_END },
|
||||
{ EQEmu::legacy::GENERAL_BEGIN, EQEmu::legacy::GENERAL_END },
|
||||
{ EQEmu::legacy::SLOT_CURSOR, EQEmu::legacy::SLOT_CURSOR },
|
||||
{ EQEmu::legacy::SLOT_INVALID, EQEmu::legacy::SLOT_INVALID },
|
||||
{ EQEmu::legacy::TRIBUTE_BEGIN, EQEmu::legacy::TRIBUTE_END },
|
||||
{ EQEmu::legacy::BANK_BEGIN, EQEmu::legacy::BANK_END },
|
||||
{ EQEmu::legacy::SHARED_BANK_BEGIN, EQEmu::legacy::SHARED_BANK_END },
|
||||
{ EQEmu::legacy::TRADE_BEGIN, EQEmu::legacy::TRADE_END },
|
||||
{ EQEmu::inventory::slotBegin, (EQEmu::legacy::WORLD_SIZE - 1) }
|
||||
{ EQEmu::invslot::EQUIPMENT_BEGIN, EQEmu::invslot::EQUIPMENT_END },
|
||||
{ EQEmu::invslot::GENERAL_BEGIN, EQEmu::invslot::GENERAL_END },
|
||||
{ EQEmu::invslot::slotCursor, EQEmu::invslot::slotCursor },
|
||||
{ EQEmu::invslot::SLOT_INVALID, EQEmu::invslot::SLOT_INVALID },
|
||||
{ EQEmu::invslot::TRIBUTE_BEGIN, EQEmu::invslot::TRIBUTE_END },
|
||||
{ EQEmu::invslot::BANK_BEGIN, EQEmu::invslot::BANK_END },
|
||||
{ EQEmu::invslot::SHARED_BANK_BEGIN, EQEmu::invslot::SHARED_BANK_END },
|
||||
{ EQEmu::invslot::TRADE_BEGIN, EQEmu::invslot::TRADE_END },
|
||||
{ EQEmu::invslot::SLOT_BEGIN, (EQEmu::invtype::WORLD_SIZE - 1) }
|
||||
};
|
||||
|
||||
static bool scope_bag[] = { false, true, true, true, false, true, true, true, true };
|
||||
@@ -2614,7 +2614,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
for (int16 indexMain = scope_range[scopeIndex][0]; indexMain <= scope_range[scopeIndex][1]; ++indexMain) {
|
||||
if (indexMain == EQEmu::legacy::SLOT_INVALID)
|
||||
if (indexMain == EQEmu::invslot::SLOT_INVALID)
|
||||
continue;
|
||||
|
||||
inst_main = ((scopeBit & peekWorld) ? objectTradeskill->GetItem(indexMain) : targetClient->GetInv().GetItem(indexMain));
|
||||
@@ -2632,14 +2632,14 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
(item_data == nullptr),
|
||||
"%sSlot: %i, Item: %i (%s), Charges: %i",
|
||||
scope_prefix[scopeIndex],
|
||||
((scopeBit & peekWorld) ? (EQEmu::legacy::WORLD_BEGIN + indexMain) : indexMain),
|
||||
((scopeBit & peekWorld) ? (EQEmu::invslot::WORLD_BEGIN + indexMain) : indexMain),
|
||||
((item_data == nullptr) ? 0 : item_data->ID),
|
||||
linker.GenerateLink().c_str(),
|
||||
((inst_main == nullptr) ? 0 : inst_main->GetCharges())
|
||||
);
|
||||
|
||||
if (inst_main && inst_main->IsClassCommon()) {
|
||||
for (uint8 indexAug = EQEmu::inventory::socketBegin; indexAug < EQEmu::inventory::SocketCount; ++indexAug) {
|
||||
for (uint8 indexAug = EQEmu::invaug::SOCKET_BEGIN; indexAug <= EQEmu::invaug::SOCKET_END; ++indexAug) {
|
||||
inst_aug = inst_main->GetItem(indexAug);
|
||||
if (!inst_aug) // extant only
|
||||
continue;
|
||||
@@ -2652,7 +2652,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
".%sAugSlot: %i (Slot #%i, Aug idx #%i), Item: %i (%s), Charges: %i",
|
||||
scope_prefix[scopeIndex],
|
||||
INVALID_INDEX,
|
||||
((scopeBit & peekWorld) ? (EQEmu::legacy::WORLD_BEGIN + indexMain) : indexMain),
|
||||
((scopeBit & peekWorld) ? (EQEmu::invslot::WORLD_BEGIN + indexMain) : indexMain),
|
||||
indexAug,
|
||||
((item_data == nullptr) ? 0 : item_data->ID),
|
||||
linker.GenerateLink().c_str(),
|
||||
@@ -2664,7 +2664,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
if (!scope_bag[scopeIndex] || !(inst_main && inst_main->IsClassBag()))
|
||||
continue;
|
||||
|
||||
for (uint8 indexSub = EQEmu::inventory::containerBegin; indexSub < EQEmu::inventory::ContainerCount; ++indexSub) {
|
||||
for (uint8 indexSub = EQEmu::invbag::SLOT_BEGIN; indexSub <= EQEmu::invbag::SLOT_END; ++indexSub) {
|
||||
inst_sub = inst_main->GetItem(indexSub);
|
||||
if (!inst_sub) // extant only
|
||||
continue;
|
||||
@@ -2677,7 +2677,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
"..%sBagSlot: %i (Slot #%i, Bag idx #%i), Item: %i (%s), Charges: %i",
|
||||
scope_prefix[scopeIndex],
|
||||
((scopeBit & peekWorld) ? INVALID_INDEX : EQEmu::InventoryProfile::CalcSlotId(indexMain, indexSub)),
|
||||
((scopeBit & peekWorld) ? (EQEmu::legacy::WORLD_BEGIN + indexMain) : indexMain),
|
||||
((scopeBit & peekWorld) ? (EQEmu::invslot::WORLD_BEGIN + indexMain) : indexMain),
|
||||
indexSub,
|
||||
((item_data == nullptr) ? 0 : item_data->ID),
|
||||
linker.GenerateLink().c_str(),
|
||||
@@ -2685,7 +2685,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
);
|
||||
|
||||
if (inst_sub->IsClassCommon()) {
|
||||
for (uint8 indexAug = EQEmu::inventory::socketBegin; indexAug < EQEmu::inventory::SocketCount; ++indexAug) {
|
||||
for (uint8 indexAug = EQEmu::invaug::SOCKET_BEGIN; indexAug <= EQEmu::invaug::SOCKET_END; ++indexAug) {
|
||||
inst_aug = inst_sub->GetItem(indexAug);
|
||||
if (!inst_aug) // extant only
|
||||
continue;
|
||||
@@ -2711,7 +2711,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if ((scopeBit & peekEquip) && (targetClient->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)) {
|
||||
inst_main = targetClient->GetInv().GetItem(EQEmu::inventory::slotPowerSource);
|
||||
inst_main = targetClient->GetInv().GetItem(EQEmu::invslot::SLOT_POWER_SOURCE);
|
||||
if (inst_main) {
|
||||
itemsFound = true;
|
||||
item_data = inst_main->GetItem();
|
||||
@@ -2726,14 +2726,14 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
(item_data == nullptr),
|
||||
"%sSlot: %i, Item: %i (%s), Charges: %i",
|
||||
scope_prefix[scopeIndex],
|
||||
EQEmu::inventory::slotPowerSource,
|
||||
EQEmu::invslot::SLOT_POWER_SOURCE,
|
||||
((item_data == nullptr) ? 0 : item_data->ID),
|
||||
linker.GenerateLink().c_str(),
|
||||
((inst_main == nullptr) ? 0 : inst_main->GetCharges())
|
||||
);
|
||||
|
||||
if (inst_main && inst_main->IsClassCommon()) {
|
||||
for (uint8 indexAug = EQEmu::inventory::socketBegin; indexAug < EQEmu::inventory::SocketCount; ++indexAug) {
|
||||
for (uint8 indexAug = EQEmu::invaug::SOCKET_BEGIN; indexAug <= EQEmu::invaug::SOCKET_END; ++indexAug) {
|
||||
inst_aug = inst_main->GetItem(indexAug);
|
||||
if (!inst_aug) // extant only
|
||||
continue;
|
||||
@@ -2746,7 +2746,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
".%sAugSlot: %i (Slot #%i, Aug idx #%i), Item: %i (%s), Charges: %i",
|
||||
scope_prefix[scopeIndex],
|
||||
INVALID_INDEX,
|
||||
EQEmu::inventory::slotPowerSource,
|
||||
EQEmu::invslot::SLOT_POWER_SOURCE,
|
||||
indexAug,
|
||||
((item_data == nullptr) ? 0 : item_data->ID),
|
||||
linker.GenerateLink().c_str(),
|
||||
@@ -2784,7 +2784,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
);
|
||||
|
||||
if (inst_main && inst_main->IsClassCommon()) {
|
||||
for (uint8 indexAug = EQEmu::inventory::socketBegin; indexAug < EQEmu::inventory::SocketCount; ++indexAug) {
|
||||
for (uint8 indexAug = EQEmu::invaug::SOCKET_BEGIN; indexAug <= EQEmu::invaug::SOCKET_END; ++indexAug) {
|
||||
inst_aug = inst_main->GetItem(indexAug);
|
||||
if (!inst_aug) // extant only
|
||||
continue;
|
||||
@@ -2809,7 +2809,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
if (!scope_bag[scopeIndex] || !(inst_main && inst_main->IsClassBag()))
|
||||
continue;
|
||||
|
||||
for (uint8 indexSub = EQEmu::inventory::containerBegin; indexSub < EQEmu::inventory::ContainerCount; ++indexSub) {
|
||||
for (uint8 indexSub = EQEmu::invbag::SLOT_BEGIN; indexSub <= EQEmu::invbag::SLOT_END; ++indexSub) {
|
||||
inst_sub = inst_main->GetItem(indexSub);
|
||||
if (!inst_sub)
|
||||
continue;
|
||||
@@ -2831,7 +2831,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
);
|
||||
|
||||
if (inst_sub->IsClassCommon()) {
|
||||
for (uint8 indexAug = EQEmu::inventory::socketBegin; indexAug < EQEmu::inventory::SocketCount; ++indexAug) {
|
||||
for (uint8 indexAug = EQEmu::invaug::SOCKET_BEGIN; indexAug <= EQEmu::invaug::SOCKET_END; ++indexAug) {
|
||||
inst_aug = inst_sub->GetItem(indexAug);
|
||||
if (!inst_aug) // extant only
|
||||
continue;
|
||||
@@ -3266,8 +3266,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::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::inventory::slotPowerSource))) {
|
||||
const EQEmu::ItemInstance* from_inst = c->GetInv().GetItem(EQEmu::inventory::slotCursor);
|
||||
if (sep->IsNumber(1) && ((slot_id >= EQEmu::invslot::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::invslot::EQUIPMENT_END) || (slot_id == EQEmu::invslot::SLOT_POWER_SOURCE))) {
|
||||
const EQEmu::ItemInstance* from_inst = c->GetInv().GetItem(EQEmu::invslot::slotCursor);
|
||||
const EQEmu::ItemInstance* to_inst = c->GetInv().GetItem(slot_id); // added (desync issue when forcing stack to stack)
|
||||
bool partialmove = false;
|
||||
int16 movecount;
|
||||
@@ -3275,7 +3275,7 @@ void command_equipitem(Client *c, const Seperator *sep)
|
||||
if (from_inst && from_inst->IsClassCommon()) {
|
||||
auto outapp = new EQApplicationPacket(OP_MoveItem, sizeof(MoveItem_Struct));
|
||||
MoveItem_Struct* mi = (MoveItem_Struct*)outapp->pBuffer;
|
||||
mi->from_slot = EQEmu::inventory::slotCursor;
|
||||
mi->from_slot = EQEmu::invslot::slotCursor;
|
||||
mi->to_slot = slot_id;
|
||||
// mi->number_in_stack = from_inst->GetCharges(); // replaced with con check for stacking
|
||||
|
||||
@@ -4521,7 +4521,7 @@ void command_goto(Client *c, const Seperator *sep)
|
||||
|
||||
void command_iteminfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto inst = c->GetInv()[EQEmu::inventory::slotCursor];
|
||||
auto inst = c->GetInv()[EQEmu::invslot::slotCursor];
|
||||
if (!inst) {
|
||||
c->Message(13, "Error: You need an item on your cursor for this command");
|
||||
return;
|
||||
@@ -5681,9 +5681,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::SayLinkBodySize) {
|
||||
if (link_open != link_close && (cmd_msg.length() - link_open) > EQEmu::constants::SAY_LINK_BODY_SIZE) {
|
||||
EQEmu::SayLinkBody_Struct link_body;
|
||||
EQEmu::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::constants::SayLinkBodySize));
|
||||
EQEmu::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::constants::SAY_LINK_BODY_SIZE));
|
||||
itemid = link_body.item_id;
|
||||
}
|
||||
else if (!sep->IsNumber(1)) {
|
||||
|
||||
+22
-22
@@ -322,12 +322,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 = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++i) {
|
||||
if (i == EQEmu::inventory::slotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
|
||||
item = client->GetInv().GetItem(EQEmu::inventory::slotPowerSource);
|
||||
for (i = EQEmu::invslot::POSSESSIONS_BEGIN; i <= EQEmu::invslot::POSSESSIONS_END; ++i) {
|
||||
if (i == EQEmu::invslot::slotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
|
||||
item = client->GetInv().GetItem(EQEmu::invslot::SLOT_POWER_SOURCE);
|
||||
if (item != nullptr) {
|
||||
if (!client->IsBecomeNPC() || (client->IsBecomeNPC() && !item->GetItem()->NoRent))
|
||||
MoveItemToCorpse(client, item, EQEmu::inventory::slotPowerSource, removed_list);
|
||||
MoveItemToCorpse(client, item, EQEmu::invslot::SLOT_POWER_SOURCE, removed_list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,9 +404,9 @@ void Corpse::MoveItemToCorpse(Client *client, EQEmu::ItemInstance *inst, int16 e
|
||||
|
||||
while (true) {
|
||||
if (!inst->IsClassBag()) { break; }
|
||||
if (equipSlot < EQEmu::legacy::GENERAL_BEGIN || equipSlot > EQEmu::inventory::slotCursor) { break; }
|
||||
if (equipSlot < EQEmu::invslot::GENERAL_BEGIN || equipSlot > EQEmu::invslot::slotCursor) { break; }
|
||||
|
||||
for (int16 sub_index = EQEmu::inventory::containerBegin; sub_index < EQEmu::inventory::ContainerCount; ++sub_index) {
|
||||
for (int16 sub_index = EQEmu::invbag::SLOT_BEGIN; sub_index <= EQEmu::invbag::SLOT_END; ++sub_index) {
|
||||
int16 real_bag_slot = EQEmu::InventoryProfile::CalcSlotId(equipSlot, sub_index);
|
||||
auto bag_inst = client->GetInv().GetItem(real_bag_slot);
|
||||
if (bag_inst == nullptr) { continue; }
|
||||
@@ -684,7 +684,7 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct**
|
||||
}
|
||||
|
||||
if (sitem && bag_item_data && EQEmu::InventoryProfile::SupportsContainers(sitem->equip_slot)) {
|
||||
int16 bagstart = EQEmu::InventoryProfile::CalcSlotId(sitem->equip_slot, EQEmu::inventory::containerBegin);
|
||||
int16 bagstart = EQEmu::InventoryProfile::CalcSlotId(sitem->equip_slot, EQEmu::invbag::SLOT_BEGIN);
|
||||
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
@@ -983,7 +983,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::legacy::CORPSE_BEGIN, inst, ItemPacketLoot);
|
||||
client->SendItemPacket(EQEmu::invslot::CORPSE_BEGIN, inst, ItemPacketLoot);
|
||||
safe_delete(inst);
|
||||
}
|
||||
else { client->Message(13, "Could not find item number %i to send!!", GetPlayerKillItem()); }
|
||||
@@ -998,7 +998,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
|
||||
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToMobVersion(client->ClientVersion()))->InventoryTypeSize[EQEmu::inventory::typeCorpse];
|
||||
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToMobVersion(client->ClientVersion()))->InventoryTypeSize[EQEmu::invtype::typeCorpse];
|
||||
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* item_data = *cur;
|
||||
@@ -1007,7 +1007,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 <= EQEmu::inventory::slotCursor || item_data->equip_slot == EQEmu::inventory::slotPowerSource || Loot_Request_Type >= 3 ||
|
||||
if (!IsPlayerCorpse() || item_data->equip_slot <= EQEmu::invslot::slotCursor || item_data->equip_slot == EQEmu::invslot::SLOT_POWER_SOURCE || Loot_Request_Type >= 3 ||
|
||||
(item_data->equip_slot >= 8000 && item_data->equip_slot <= 8999)) {
|
||||
if(i < corpselootlimit) {
|
||||
item = database.GetItem(item_data->item_id);
|
||||
@@ -1017,7 +1017,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::legacy::CORPSE_BEGIN, inst, ItemPacketLoot);
|
||||
client->SendItemPacket(i + EQEmu::invslot::CORPSE_BEGIN, inst, ItemPacketLoot);
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
@@ -1126,9 +1126,9 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
|
||||
} else if (GetPlayerKillItem() == -1 || GetPlayerKillItem() == 1) {
|
||||
item_data =
|
||||
GetItem(lootitem->slot_id -
|
||||
EQEmu::legacy::CORPSE_BEGIN); // dont allow them to loot entire bags of items as pvp reward
|
||||
EQEmu::invslot::CORPSE_BEGIN); // dont allow them to loot entire bags of items as pvp reward
|
||||
} else {
|
||||
item_data = GetItem(lootitem->slot_id - EQEmu::legacy::CORPSE_BEGIN, bag_item_data);
|
||||
item_data = GetItem(lootitem->slot_id - EQEmu::invslot::CORPSE_BEGIN, bag_item_data);
|
||||
}
|
||||
|
||||
if (GetPlayerKillItem() <= 1 && item_data != 0) {
|
||||
@@ -1156,7 +1156,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
if (inst->IsAugmented()) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
EQEmu::ItemInstance *itm = inst->GetAugment(i);
|
||||
if (itm) {
|
||||
if (client->CheckLoreConflict(itm->GetItem())) {
|
||||
@@ -1210,9 +1210,9 @@ 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 > 0) {
|
||||
if (!client->AutoPutLootInInventory(*inst, true, true, bag_item_data))
|
||||
client->PutLootInInventory(EQEmu::inventory::slotCursor, *inst, bag_item_data);
|
||||
client->PutLootInInventory(EQEmu::invslot::slotCursor, *inst, bag_item_data);
|
||||
} else {
|
||||
client->PutLootInInventory(EQEmu::inventory::slotCursor, *inst, bag_item_data);
|
||||
client->PutLootInInventory(EQEmu::invslot::slotCursor, *inst, bag_item_data);
|
||||
}
|
||||
|
||||
/* Update any tasks that have an activity to loot this item */
|
||||
@@ -1231,7 +1231,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
|
||||
|
||||
/* Remove Bag Contents */
|
||||
if (item->IsClassBag() && (GetPlayerKillItem() != -1 || GetPlayerKillItem() != 1)) {
|
||||
for (int i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
|
||||
for (int i = EQEmu::invbag::SLOT_BEGIN; i <= EQEmu::invbag::SLOT_END; i++) {
|
||||
if (bag_item_data[i]) {
|
||||
/* Delete needs to be before RemoveItem because its deletes the pointer for
|
||||
* item_data/bag_item_data */
|
||||
@@ -1317,13 +1317,13 @@ void Corpse::QueryLoot(Client* to) {
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
|
||||
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToMobVersion(to->ClientVersion()))->InventoryTypeSize[EQEmu::inventory::typeCorpse];
|
||||
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToMobVersion(to->ClientVersion()))->InventoryTypeSize[EQEmu::invtype::typeCorpse];
|
||||
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* sitem = *cur;
|
||||
|
||||
if (IsPlayerCorpse()) {
|
||||
if (sitem->equip_slot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::legacy::CURSOR_BAG_END)
|
||||
if (sitem->equip_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::invbag::CURSOR_BAG_END)
|
||||
sitem->lootslot = 0xFFFF;
|
||||
else
|
||||
x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF;
|
||||
@@ -1457,8 +1457,8 @@ void Corpse::UpdateEquipmentLight()
|
||||
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
|
||||
|
||||
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
|
||||
if (((*iter)->equip_slot < EQEmu::legacy::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::legacy::EQUIPMENT_END) && (*iter)->equip_slot != EQEmu::inventory::slotPowerSource) { continue; }
|
||||
if ((*iter)->equip_slot == EQEmu::inventory::slotAmmo) { continue; }
|
||||
if (((*iter)->equip_slot < EQEmu::invslot::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::invslot::EQUIPMENT_END) && (*iter)->equip_slot != EQEmu::invslot::SLOT_POWER_SOURCE) { continue; }
|
||||
if ((*iter)->equip_slot == EQEmu::invslot::slotAmmo) { continue; }
|
||||
|
||||
auto item = database.GetItem((*iter)->item_id);
|
||||
if (item == nullptr) { continue; }
|
||||
@@ -1469,7 +1469,7 @@ void Corpse::UpdateEquipmentLight()
|
||||
|
||||
uint8 general_light_type = 0;
|
||||
for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
|
||||
if ((*iter)->equip_slot < EQEmu::legacy::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::legacy::GENERAL_END) { continue; }
|
||||
if ((*iter)->equip_slot < EQEmu::invslot::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::invslot::GENERAL_END) { continue; }
|
||||
|
||||
auto item = database.GetItem((*iter)->item_id);
|
||||
if (item == nullptr) { continue; }
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ class Corpse : public Mob {
|
||||
/* Corpse: General */
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill) { return true; }
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; }
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) { return false; }
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) { return false; }
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return false; }
|
||||
virtual Raid* GetRaid() { return 0; }
|
||||
|
||||
+1
-1
@@ -210,7 +210,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
|
||||
uint32 player_has_key = 0;
|
||||
uint32 player_key = 0;
|
||||
|
||||
const EQEmu::ItemInstance *lock_pick_item = sender->GetInv().GetItem(EQEmu::inventory::slotCursor);
|
||||
const EQEmu::ItemInstance *lock_pick_item = sender->GetInv().GetItem(EQEmu::invslot::slotCursor);
|
||||
player_has_key = static_cast<uint32>(sender->GetInv().HasItem(required_key_item, 1));
|
||||
|
||||
if (player_has_key != INVALID_INDEX) {
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public:
|
||||
//abstract virtual function implementations required by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill) { return true; }
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; }
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -357,7 +357,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 = EQEmu::inventory::slotPrimary, int count = 0, bool IsFromSpell = false);
|
||||
void AEAttack(Mob *attacker, float dist, int Hand = EQEmu::invslot::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, int *max_targets = nullptr);
|
||||
void MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true);
|
||||
|
||||
+7
-7
@@ -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 EQEmu::ItemInstance* Pole = m_inv[EQEmu::inventory::slotPrimary];
|
||||
const EQEmu::ItemInstance* Pole = m_inv[EQEmu::invslot::slotPrimary];
|
||||
int32 bslot = m_inv.HasItemByUse(EQEmu::item::ItemTypeFishingBait, 1, invWhereWorn | invWherePersonal);
|
||||
const EQEmu::ItemInstance* 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::legacy::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == EQEmu::skills::SkillFishing) {
|
||||
if (bslot >= EQEmu::invslot::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == EQEmu::skills::SkillFishing) {
|
||||
fishing_skill += Bait->GetItem()->SkillModValue;
|
||||
}
|
||||
|
||||
@@ -331,12 +331,12 @@ void Client::GoFish()
|
||||
else
|
||||
{
|
||||
PushItemOnCursor(*inst);
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::invslot::slotCursor, inst, ItemPacketLimbo);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||
UpdateTasksForItem(ActivityFish, food_id);
|
||||
|
||||
safe_delete(inst);
|
||||
inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
inst = m_inv.GetItem(EQEmu::invslot::slotCursor);
|
||||
}
|
||||
|
||||
if(inst) {
|
||||
@@ -368,7 +368,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(EQEmu::inventory::slotPrimary, 0, true);
|
||||
DeleteItemInInventory(EQEmu::invslot::slotPrimary, 0, true);
|
||||
}
|
||||
|
||||
if (CheckIncreaseSkill(EQEmu::skills::SkillFishing, nullptr, 5))
|
||||
@@ -445,12 +445,12 @@ void Client::ForageItem(bool guarantee) {
|
||||
}
|
||||
else {
|
||||
PushItemOnCursor(*inst);
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::invslot::slotCursor, inst, ItemPacketLimbo);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||
UpdateTasksForItem(ActivityForage, foragedfood);
|
||||
|
||||
safe_delete(inst);
|
||||
inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
inst = m_inv.GetItem(EQEmu::invslot::slotCursor);
|
||||
}
|
||||
|
||||
if(inst) {
|
||||
|
||||
+180
-180
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -263,7 +263,7 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
|
||||
item->attuned = 0;
|
||||
item->min_level = minlevel;
|
||||
item->max_level = maxlevel;
|
||||
item->equip_slot = EQEmu::inventory::slotInvalid;
|
||||
item->equip_slot = EQEmu::invslot::SLOT_INVALID;
|
||||
|
||||
if (equipit) {
|
||||
uint8 eslot = 0xFF;
|
||||
@@ -282,7 +282,7 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
|
||||
// it is an improvement.
|
||||
|
||||
if (!item2->NoPet) {
|
||||
for (int i = 0; !found && i < EQEmu::legacy::EQUIPMENT_SIZE; i++) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; !found && i <= EQEmu::invslot::EQUIPMENT_END; i++) {
|
||||
uint32 slots = (1 << i);
|
||||
if (item2->Slots & slots) {
|
||||
if(equipment[i])
|
||||
@@ -323,7 +323,7 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
|
||||
// @merth: IDFile size has been increased, this needs to change
|
||||
uint16 emat;
|
||||
if(item2->Material <= 0
|
||||
|| item2->Slots & (1 << EQEmu::inventory::slotPrimary | 1 << EQEmu::inventory::slotSecondary)) {
|
||||
|| item2->Slots & (1 << EQEmu::invslot::slotPrimary | 1 << EQEmu::invslot::slotSecondary)) {
|
||||
memset(newid, 0, sizeof(newid));
|
||||
for(int i=0;i<7;i++){
|
||||
if (!isalpha(item2->IDFile[i])){
|
||||
@@ -337,7 +337,7 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
|
||||
emat = item2->Material;
|
||||
}
|
||||
|
||||
if (foundslot == EQEmu::inventory::slotPrimary) {
|
||||
if (foundslot == EQEmu::invslot::slotPrimary) {
|
||||
if (item2->Proc.Effect != 0)
|
||||
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
|
||||
|
||||
@@ -350,7 +350,7 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
|
||||
if (item2->IsType2HWeapon())
|
||||
SetTwoHanderEquipped(true);
|
||||
}
|
||||
else if (foundslot == EQEmu::inventory::slotSecondary
|
||||
else if (foundslot == EQEmu::invslot::slotSecondary
|
||||
&& (GetOwner() != nullptr || (CanThisClassDualWield() && zone->random.Roll(NPC_DW_CHANCE)) || (item2->Damage==0)) &&
|
||||
(item2->IsType1HWeapon() || item2->ItemType == EQEmu::item::ItemTypeShield))
|
||||
{
|
||||
@@ -361,25 +361,25 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
|
||||
if (item2->Damage > 0)
|
||||
SendAddPlayerState(PlayerState::SecondaryWeaponEquipped);
|
||||
}
|
||||
else if (foundslot == EQEmu::inventory::slotHead) {
|
||||
else if (foundslot == EQEmu::invslot::slotHead) {
|
||||
eslot = EQEmu::textures::armorHead;
|
||||
}
|
||||
else if (foundslot == EQEmu::inventory::slotChest) {
|
||||
else if (foundslot == EQEmu::invslot::slotChest) {
|
||||
eslot = EQEmu::textures::armorChest;
|
||||
}
|
||||
else if (foundslot == EQEmu::inventory::slotArms) {
|
||||
else if (foundslot == EQEmu::invslot::slotArms) {
|
||||
eslot = EQEmu::textures::armorArms;
|
||||
}
|
||||
else if (foundslot == EQEmu::inventory::slotWrist1 || foundslot == EQEmu::inventory::slotWrist2) {
|
||||
else if (foundslot == EQEmu::invslot::slotWrist1 || foundslot == EQEmu::invslot::slotWrist2) {
|
||||
eslot = EQEmu::textures::armorWrist;
|
||||
}
|
||||
else if (foundslot == EQEmu::inventory::slotHands) {
|
||||
else if (foundslot == EQEmu::invslot::slotHands) {
|
||||
eslot = EQEmu::textures::armorHands;
|
||||
}
|
||||
else if (foundslot == EQEmu::inventory::slotLegs) {
|
||||
else if (foundslot == EQEmu::invslot::slotLegs) {
|
||||
eslot = EQEmu::textures::armorLegs;
|
||||
}
|
||||
else if (foundslot == EQEmu::inventory::slotFeet) {
|
||||
else if (foundslot == EQEmu::invslot::slotFeet) {
|
||||
eslot = EQEmu::textures::armorFeet;
|
||||
}
|
||||
|
||||
|
||||
+41
-41
@@ -1841,47 +1841,47 @@ luabind::scope lua_register_slot() {
|
||||
return luabind::class_<Slots>("Slot")
|
||||
.enum_("constants")
|
||||
[
|
||||
luabind::value("Charm", static_cast<int>(EQEmu::inventory::slotCharm)),
|
||||
luabind::value("Ear1", static_cast<int>(EQEmu::inventory::slotEar1)),
|
||||
luabind::value("Head", static_cast<int>(EQEmu::inventory::slotHead)),
|
||||
luabind::value("Face", static_cast<int>(EQEmu::inventory::slotFace)),
|
||||
luabind::value("Ear2", static_cast<int>(EQEmu::inventory::slotEar2)),
|
||||
luabind::value("Neck", static_cast<int>(EQEmu::inventory::slotNeck)),
|
||||
luabind::value("Shoulder", static_cast<int>(EQEmu::inventory::slotShoulders)), // deprecated
|
||||
luabind::value("Shoulders", static_cast<int>(EQEmu::inventory::slotShoulders)),
|
||||
luabind::value("Arms", static_cast<int>(EQEmu::inventory::slotArms)),
|
||||
luabind::value("Back", static_cast<int>(EQEmu::inventory::slotBack)),
|
||||
luabind::value("Bracer1", static_cast<int>(EQEmu::inventory::slotWrist1)), // deprecated
|
||||
luabind::value("Wrist1", static_cast<int>(EQEmu::inventory::slotWrist1)),
|
||||
luabind::value("Bracer2", static_cast<int>(EQEmu::inventory::slotWrist2)), // deprecated
|
||||
luabind::value("Wrist2", static_cast<int>(EQEmu::inventory::slotWrist2)),
|
||||
luabind::value("Range", static_cast<int>(EQEmu::inventory::slotRange)),
|
||||
luabind::value("Hands", static_cast<int>(EQEmu::inventory::slotHands)),
|
||||
luabind::value("Primary", static_cast<int>(EQEmu::inventory::slotPrimary)),
|
||||
luabind::value("Secondary", static_cast<int>(EQEmu::inventory::slotSecondary)),
|
||||
luabind::value("Ring1", static_cast<int>(EQEmu::inventory::slotFinger1)), // deprecated
|
||||
luabind::value("Finger1", static_cast<int>(EQEmu::inventory::slotFinger1)),
|
||||
luabind::value("Ring2", static_cast<int>(EQEmu::inventory::slotFinger2)), // deprecated
|
||||
luabind::value("Finger2", static_cast<int>(EQEmu::inventory::slotFinger2)),
|
||||
luabind::value("Chest", static_cast<int>(EQEmu::inventory::slotChest)),
|
||||
luabind::value("Legs", static_cast<int>(EQEmu::inventory::slotLegs)),
|
||||
luabind::value("Feet", static_cast<int>(EQEmu::inventory::slotFeet)),
|
||||
luabind::value("Waist", static_cast<int>(EQEmu::inventory::slotWaist)),
|
||||
luabind::value("PowerSource", static_cast<int>(EQEmu::inventory::slotPowerSource)),
|
||||
luabind::value("Ammo", static_cast<int>(EQEmu::inventory::slotAmmo)),
|
||||
luabind::value("General1", static_cast<int>(EQEmu::inventory::slotGeneral1)),
|
||||
luabind::value("General2", static_cast<int>(EQEmu::inventory::slotGeneral2)),
|
||||
luabind::value("General3", static_cast<int>(EQEmu::inventory::slotGeneral3)),
|
||||
luabind::value("General4", static_cast<int>(EQEmu::inventory::slotGeneral4)),
|
||||
luabind::value("General5", static_cast<int>(EQEmu::inventory::slotGeneral5)),
|
||||
luabind::value("General6", static_cast<int>(EQEmu::inventory::slotGeneral6)),
|
||||
luabind::value("General7", static_cast<int>(EQEmu::inventory::slotGeneral7)),
|
||||
luabind::value("General8", static_cast<int>(EQEmu::inventory::slotGeneral8)),
|
||||
luabind::value("Cursor", static_cast<int>(EQEmu::inventory::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("Charm", static_cast<int>(EQEmu::invslot::slotCharm)),
|
||||
luabind::value("Ear1", static_cast<int>(EQEmu::invslot::slotEar1)),
|
||||
luabind::value("Head", static_cast<int>(EQEmu::invslot::slotHead)),
|
||||
luabind::value("Face", static_cast<int>(EQEmu::invslot::slotFace)),
|
||||
luabind::value("Ear2", static_cast<int>(EQEmu::invslot::slotEar2)),
|
||||
luabind::value("Neck", static_cast<int>(EQEmu::invslot::slotNeck)),
|
||||
luabind::value("Shoulder", static_cast<int>(EQEmu::invslot::slotShoulders)), // deprecated
|
||||
luabind::value("Shoulders", static_cast<int>(EQEmu::invslot::slotShoulders)),
|
||||
luabind::value("Arms", static_cast<int>(EQEmu::invslot::slotArms)),
|
||||
luabind::value("Back", static_cast<int>(EQEmu::invslot::slotBack)),
|
||||
luabind::value("Bracer1", static_cast<int>(EQEmu::invslot::slotWrist1)), // deprecated
|
||||
luabind::value("Wrist1", static_cast<int>(EQEmu::invslot::slotWrist1)),
|
||||
luabind::value("Bracer2", static_cast<int>(EQEmu::invslot::slotWrist2)), // deprecated
|
||||
luabind::value("Wrist2", static_cast<int>(EQEmu::invslot::slotWrist2)),
|
||||
luabind::value("Range", static_cast<int>(EQEmu::invslot::slotRange)),
|
||||
luabind::value("Hands", static_cast<int>(EQEmu::invslot::slotHands)),
|
||||
luabind::value("Primary", static_cast<int>(EQEmu::invslot::slotPrimary)),
|
||||
luabind::value("Secondary", static_cast<int>(EQEmu::invslot::slotSecondary)),
|
||||
luabind::value("Ring1", static_cast<int>(EQEmu::invslot::slotFinger1)), // deprecated
|
||||
luabind::value("Finger1", static_cast<int>(EQEmu::invslot::slotFinger1)),
|
||||
luabind::value("Ring2", static_cast<int>(EQEmu::invslot::slotFinger2)), // deprecated
|
||||
luabind::value("Finger2", static_cast<int>(EQEmu::invslot::slotFinger2)),
|
||||
luabind::value("Chest", static_cast<int>(EQEmu::invslot::slotChest)),
|
||||
luabind::value("Legs", static_cast<int>(EQEmu::invslot::slotLegs)),
|
||||
luabind::value("Feet", static_cast<int>(EQEmu::invslot::slotFeet)),
|
||||
luabind::value("Waist", static_cast<int>(EQEmu::invslot::slotWaist)),
|
||||
luabind::value("PowerSource", static_cast<int>(EQEmu::invslot::SLOT_POWER_SOURCE)),
|
||||
luabind::value("Ammo", static_cast<int>(EQEmu::invslot::slotAmmo)),
|
||||
luabind::value("General1", static_cast<int>(EQEmu::invslot::slotGeneral1)),
|
||||
luabind::value("General2", static_cast<int>(EQEmu::invslot::slotGeneral2)),
|
||||
luabind::value("General3", static_cast<int>(EQEmu::invslot::slotGeneral3)),
|
||||
luabind::value("General4", static_cast<int>(EQEmu::invslot::slotGeneral4)),
|
||||
luabind::value("General5", static_cast<int>(EQEmu::invslot::slotGeneral5)),
|
||||
luabind::value("General6", static_cast<int>(EQEmu::invslot::slotGeneral6)),
|
||||
luabind::value("General7", static_cast<int>(EQEmu::invslot::slotGeneral7)),
|
||||
luabind::value("General8", static_cast<int>(EQEmu::invslot::slotGeneral8)),
|
||||
luabind::value("Cursor", static_cast<int>(EQEmu::invslot::slotCursor)),
|
||||
luabind::value("PersonalBegin", static_cast<int>(EQEmu::invslot::GENERAL_BEGIN)), // deprecated
|
||||
luabind::value("GeneralBegin", static_cast<int>(EQEmu::invslot::GENERAL_BEGIN)),
|
||||
luabind::value("PersonalEnd", static_cast<int>(EQEmu::invslot::GENERAL_END)), // deprecated
|
||||
luabind::value("GeneralEnd", static_cast<int>(EQEmu::invslot::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
|
||||
|
||||
+14
-14
@@ -217,7 +217,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
|
||||
|
||||
unsigned int i;
|
||||
//should not include 21 (SLOT_AMMO)
|
||||
for (i = 0; i < EQEmu::inventory::slotAmmo; i++) {
|
||||
for (i = 0; i < EQEmu::invslot::slotAmmo; i++) {
|
||||
if(equipment[i] == 0)
|
||||
continue;
|
||||
const EQEmu::ItemData * itm = database.GetItem(equipment[i]);
|
||||
@@ -1610,24 +1610,24 @@ void Merc::AI_Process() {
|
||||
//try main hand first
|
||||
if(attack_timer.Check())
|
||||
{
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary);
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary);
|
||||
|
||||
bool tripleSuccess = false;
|
||||
|
||||
if(GetOwner() && GetTarget() && CanThisClassDoubleAttack())
|
||||
{
|
||||
if(GetOwner()) {
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE)) {
|
||||
tripleSuccess = true;
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
//quad attack, does this belong here??
|
||||
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_QUAD)) {
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1639,8 +1639,8 @@ void Merc::AI_Process() {
|
||||
if(zone->random.Roll(flurrychance))
|
||||
{
|
||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1649,7 +1649,7 @@ void Merc::AI_Process() {
|
||||
if (GetTarget() && ExtraAttackChanceBonus) {
|
||||
if(zone->random.Roll(ExtraAttackChanceBonus))
|
||||
{
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1685,11 +1685,11 @@ void Merc::AI_Process() {
|
||||
// Max 78% of DW
|
||||
if (zone->random.Roll(DualWieldProbability))
|
||||
{
|
||||
Attack(GetTarget(), EQEmu::inventory::slotSecondary); // Single attack with offhand
|
||||
Attack(GetTarget(), EQEmu::invslot::slotSecondary); // Single attack with offhand
|
||||
|
||||
if(CanThisClassDoubleAttack()) {
|
||||
if(GetTarget() && GetTarget()->GetHP() > -10)
|
||||
Attack(GetTarget(), EQEmu::inventory::slotSecondary); // Single attack with offhand
|
||||
Attack(GetTarget(), EQEmu::invslot::slotSecondary); // Single attack with offhand
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2614,7 +2614,7 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) {
|
||||
int16 focus_max_real = 0;
|
||||
|
||||
//item focus
|
||||
for (int x = 0; x < EQEmu::legacy::EQUIPMENT_SIZE; ++x)
|
||||
for (int x = EQEmu::invslot::EQUIPMENT_BEGIN; x <= EQEmu::invslot::EQUIPMENT_END; ++x)
|
||||
{
|
||||
TempItem = nullptr;
|
||||
if (equipment[x] == 0)
|
||||
@@ -5093,7 +5093,7 @@ void Merc::UpdateMercAppearance() {
|
||||
// Copied from Bot Code:
|
||||
uint32 itemID = 0;
|
||||
uint8 materialFromSlot = EQEmu::textures::materialInvalid;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; ++i) {
|
||||
itemID = equipment[i];
|
||||
if(itemID != 0) {
|
||||
materialFromSlot = EQEmu::InventoryProfile::CalcMaterialFromSlot(i);
|
||||
@@ -5111,8 +5111,8 @@ void Merc::UpdateEquipmentLight()
|
||||
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
|
||||
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
|
||||
|
||||
for (int index = EQEmu::inventory::slotBegin; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
|
||||
if (index == EQEmu::inventory::slotAmmo) { continue; }
|
||||
for (int index = EQEmu::invslot::EQUIPMENT_BEGIN; index <= EQEmu::invslot::EQUIPMENT_END; ++index) {
|
||||
if (index == EQEmu::invslot::slotAmmo) { continue; }
|
||||
|
||||
auto item = database.GetItem(equipment[index]);
|
||||
if (item == nullptr) { continue; }
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr);
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
@@ -293,7 +293,7 @@ protected:
|
||||
Timer evade_timer; // can be moved to pTimers at some point
|
||||
|
||||
uint16 skills[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||
uint32 equipment[EQEmu::legacy::EQUIPMENT_SIZE]; //this is an array of item IDs
|
||||
uint32 equipment[EQEmu::invslot::EQUIPMENT_COUNT]; //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
|
||||
|
||||
+2
-2
@@ -2486,8 +2486,8 @@ bool Mob::CanThisClassDualWield(void) const {
|
||||
return(GetSkill(EQEmu::skills::SkillDualWield) > 0);
|
||||
}
|
||||
else if (CastToClient()->HasSkill(EQEmu::skills::SkillDualWield)) {
|
||||
const EQEmu::ItemInstance* pinst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
const EQEmu::ItemInstance* sinst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemInstance* pinst = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
const EQEmu::ItemInstance* sinst = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
|
||||
// 2HS, 2HB, or 2HP
|
||||
if(pinst && pinst->IsWeapon()) {
|
||||
|
||||
+8
-8
@@ -184,7 +184,7 @@ public:
|
||||
virtual void RangedAttack(Mob* other) { }
|
||||
virtual void ThrowingAttack(Mob* other) { }
|
||||
// 13 = Primary (default), 14 = secondary
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) = 0;
|
||||
void DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts = nullptr);
|
||||
int MonkSpecialAttack(Mob* other, uint8 skill_used);
|
||||
@@ -675,7 +675,7 @@ public:
|
||||
inline AuraMgr &GetAuraMgr() { return aura_mgr; } // mainly used for zone db loading/saving
|
||||
|
||||
//Procs
|
||||
void TriggerDefensiveProcs(Mob *on, uint16 hand = EQEmu::inventory::slotPrimary, bool FromSkillProc = false, int damage = 0);
|
||||
void TriggerDefensiveProcs(Mob *on, uint16 hand = EQEmu::invslot::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;
|
||||
@@ -1286,13 +1286,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 = EQEmu::inventory::slotPrimary);
|
||||
void TryWeaponProc(const EQEmu::ItemInstance* inst, const EQEmu::ItemData* weapon, Mob *on, uint16 hand = EQEmu::inventory::slotPrimary);
|
||||
void TrySpellProc(const EQEmu::ItemInstance* inst, const EQEmu::ItemData* weapon, Mob *on, uint16 hand = EQEmu::inventory::slotPrimary);
|
||||
void TryWeaponProc(const EQEmu::ItemInstance* weapon, Mob *on, uint16 hand = EQEmu::inventory::slotPrimary);
|
||||
void TryDefensiveProc(Mob *on, uint16 hand = EQEmu::invslot::slotPrimary);
|
||||
void TryWeaponProc(const EQEmu::ItemInstance* inst, const EQEmu::ItemData* weapon, Mob *on, uint16 hand = EQEmu::invslot::slotPrimary);
|
||||
void TrySpellProc(const EQEmu::ItemInstance* inst, const EQEmu::ItemData* weapon, Mob *on, uint16 hand = EQEmu::invslot::slotPrimary);
|
||||
void TryWeaponProc(const EQEmu::ItemInstance* weapon, Mob *on, uint16 hand = EQEmu::invslot::slotPrimary);
|
||||
void ExecWeaponProc(const EQEmu::ItemInstance* weapon, uint16 spell_id, Mob *on, int level_override = -1);
|
||||
virtual float GetProcChances(float ProcBonus, uint16 hand = EQEmu::inventory::slotPrimary);
|
||||
virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = EQEmu::inventory::slotPrimary, Mob *on = nullptr);
|
||||
virtual float GetProcChances(float ProcBonus, uint16 hand = EQEmu::invslot::slotPrimary);
|
||||
virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = EQEmu::invslot::slotPrimary, Mob *on = nullptr);
|
||||
virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm?
|
||||
uint16 GetWeaponSpeedbyHand(uint16 hand);
|
||||
#ifdef BOTS
|
||||
|
||||
+4
-4
@@ -861,7 +861,7 @@ void Client::AI_Process()
|
||||
if (GetTarget() && !IsStunned() && !IsMezzed() && !GetFeigned()) {
|
||||
if (attack_timer.Check()) {
|
||||
// Should charmed clients not be procing?
|
||||
DoAttackRounds(GetTarget(), EQEmu::inventory::slotPrimary);
|
||||
DoAttackRounds(GetTarget(), EQEmu::invslot::slotPrimary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -869,7 +869,7 @@ void Client::AI_Process()
|
||||
if (attack_dw_timer.Check()) {
|
||||
if (CheckDualWield()) {
|
||||
// Should charmed clients not be procing?
|
||||
DoAttackRounds(GetTarget(), EQEmu::inventory::slotSecondary);
|
||||
DoAttackRounds(GetTarget(), EQEmu::invslot::slotSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1275,7 +1275,7 @@ void Mob::AI_Process() {
|
||||
//try main hand first
|
||||
if (attack_timer.Check()) {
|
||||
DoMainHandAttackRounds(target);
|
||||
TriggerDefensiveProcs(target, EQEmu::inventory::slotPrimary, false);
|
||||
TriggerDefensiveProcs(target, EQEmu::invslot::slotPrimary, false);
|
||||
|
||||
bool specialed = false; // NPCs can only do one of these a round
|
||||
if (GetSpecialAbility(SPECATK_FLURRY)) {
|
||||
@@ -2154,7 +2154,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, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::invslot::slotPrimary, false, false, false, opts);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-2
@@ -837,8 +837,8 @@ void NPC::UpdateEquipmentLight()
|
||||
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
|
||||
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
|
||||
|
||||
for (int index = EQEmu::inventory::slotBegin; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
|
||||
if (index == EQEmu::inventory::slotAmmo) { continue; }
|
||||
for (int index = EQEmu::invslot::EQUIPMENT_BEGIN; index <= EQEmu::invslot::EQUIPMENT_END; ++index) {
|
||||
if (index == EQEmu::invslot::slotAmmo) { continue; }
|
||||
|
||||
auto item = database.GetItem(equipment[index]);
|
||||
if (item == nullptr) { continue; }
|
||||
|
||||
+2
-2
@@ -113,7 +113,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr);
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return false; }
|
||||
@@ -534,7 +534,7 @@ protected:
|
||||
|
||||
uint16 skills[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||
|
||||
uint32 equipment[EQEmu::legacy::EQUIPMENT_SIZE]; //this is an array of item IDs
|
||||
uint32 equipment[EQEmu::invslot::EQUIPMENT_COUNT]; //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
@@ -328,7 +328,7 @@ void Object::Delete(bool reset_state)
|
||||
}
|
||||
|
||||
const EQEmu::ItemInstance* Object::GetItem(uint8 index) {
|
||||
if (index < EQEmu::legacy::TYPE_WORLD_SIZE) {
|
||||
if (index < EQEmu::invtype::WORLD_SIZE) {
|
||||
return m_inst->GetItem(index);
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ void Object::Close() {
|
||||
EQEmu::ItemInstance* container = this->m_inst;
|
||||
if(container != nullptr)
|
||||
{
|
||||
for (uint8 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++)
|
||||
for (uint8 i = EQEmu::invbag::SLOT_BEGIN; i <= EQEmu::invbag::SLOT_END; i++)
|
||||
{
|
||||
EQEmu::ItemInstance* inst = container->PopItem(i);
|
||||
if(inst != nullptr)
|
||||
@@ -522,11 +522,11 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
|
||||
|
||||
// Transfer item to client
|
||||
sender->PutItemInInventory(EQEmu::inventory::slotCursor, *m_inst, false);
|
||||
sender->SendItemPacket(EQEmu::inventory::slotCursor, m_inst, ItemPacketTrade);
|
||||
sender->PutItemInInventory(EQEmu::invslot::slotCursor, *m_inst, false);
|
||||
sender->SendItemPacket(EQEmu::invslot::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(EQEmu::inventory::slotCursor);
|
||||
sender->DeleteItemInInventory(EQEmu::invslot::slotCursor);
|
||||
|
||||
if(!m_ground_spawn)
|
||||
safe_delete(m_inst);
|
||||
@@ -603,7 +603,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
auto outapp = new EQApplicationPacket(OP_ClientReady, 0);
|
||||
sender->QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
for (uint8 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
|
||||
for (uint8 i = EQEmu::invbag::SLOT_BEGIN; i <= EQEmu::invbag::SLOT_END; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inst->GetItem(i);
|
||||
if (inst) {
|
||||
//sender->GetInv().PutItem(i+4000,inst);
|
||||
|
||||
+5
-5
@@ -385,12 +385,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::legacy::EQUIPMENT_SIZE];
|
||||
uint32 petinv[EQEmu::invslot::EQUIPMENT_COUNT];
|
||||
memset(petinv, 0, sizeof(petinv));
|
||||
const EQEmu::ItemData *item = nullptr;
|
||||
|
||||
if (database.GetBasePetItems(record.equipmentset, petinv)) {
|
||||
for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++)
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; i++)
|
||||
if (petinv[i]) {
|
||||
item = database.GetItem(petinv[i]);
|
||||
npc->AddLootDrop(item, &npc->itemlist, 0, 1, 127, true, true);
|
||||
@@ -524,7 +524,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::legacy::EQUIPMENT_SIZE);
|
||||
memcpy(items, equipment, sizeof(uint32) * EQEmu::invslot::EQUIPMENT_COUNT);
|
||||
|
||||
//save their buffs.
|
||||
for (int i=0; i < GetPetMaxTotalSlots(); i++) {
|
||||
@@ -612,7 +612,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) {
|
||||
}
|
||||
|
||||
//restore their equipment...
|
||||
for (i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++) {
|
||||
for (i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; i++) {
|
||||
if(items[i] == 0)
|
||||
continue;
|
||||
|
||||
@@ -679,7 +679,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) {
|
||||
{
|
||||
slot = atoi(row[0]);
|
||||
|
||||
if (slot >= EQEmu::legacy::EQUIPMENT_SIZE)
|
||||
if (slot > EQEmu::invslot::EQUIPMENT_END)
|
||||
continue;
|
||||
|
||||
if (items[slot] == 0)
|
||||
|
||||
+2
-2
@@ -2478,12 +2478,12 @@ int QuestManager::collectitems(uint32 item_id, bool remove)
|
||||
int quantity = 0;
|
||||
int slot_id;
|
||||
|
||||
for (slot_id = EQEmu::legacy::GENERAL_BEGIN; slot_id <= EQEmu::legacy::GENERAL_END; ++slot_id)
|
||||
for (slot_id = EQEmu::invslot::GENERAL_BEGIN; slot_id <= EQEmu::invslot::GENERAL_END; ++slot_id)
|
||||
{
|
||||
quantity += collectitems_processSlot(slot_id, item_id, remove);
|
||||
}
|
||||
|
||||
for (slot_id = EQEmu::legacy::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::legacy::GENERAL_BAGS_END; ++slot_id)
|
||||
for (slot_id = EQEmu::invbag::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::invbag::GENERAL_BAGS_END; ++slot_id)
|
||||
{
|
||||
quantity += collectitems_processSlot(slot_id, item_id, remove);
|
||||
}
|
||||
|
||||
+56
-56
@@ -48,7 +48,7 @@ int Mob::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
base++;
|
||||
return base;
|
||||
case EQEmu::skills::SkillFrenzy:
|
||||
if (IsClient() && CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary)) {
|
||||
if (IsClient() && CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary)) {
|
||||
if (GetLevel() > 15)
|
||||
base += GetLevel() - 15;
|
||||
if (base > 23)
|
||||
@@ -65,7 +65,7 @@ int Mob::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
float skill_bonus = skill_level / 9.0f;
|
||||
float ac_bonus = 0.0f;
|
||||
if (IsClient()) {
|
||||
auto inst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotFeet);
|
||||
auto inst = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotFeet);
|
||||
if (inst)
|
||||
ac_bonus = inst->GetItemArmorClass(true) / 25.0f;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ int Mob::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
float skill_bonus = skill_level / 10.0f;
|
||||
float ac_bonus = 0.0f;
|
||||
if (IsClient()) {
|
||||
auto inst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotFeet);
|
||||
auto inst = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotFeet);
|
||||
if (inst)
|
||||
ac_bonus = inst->GetItemArmorClass(true) / 25.0f;
|
||||
}
|
||||
@@ -92,9 +92,9 @@ int Mob::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
const EQEmu::ItemInstance *inst = nullptr;
|
||||
if (IsClient()) {
|
||||
if (HasShieldEquiped())
|
||||
inst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
inst = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
else if (HasTwoHanderEquipped())
|
||||
inst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
inst = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
}
|
||||
if (inst)
|
||||
ac_bonus = inst->GetItemArmorClass(true) / 25.0f;
|
||||
@@ -109,7 +109,7 @@ int Mob::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
base = 3; // There seems to be a base 3 for NPCs or some how BS w/o weapon?
|
||||
// until we get a better inv system for NPCs they get nerfed!
|
||||
if (IsClient()) {
|
||||
auto *inst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
auto *inst = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
if (inst && inst->GetItem() && inst->GetItem()->ItemType == EQEmu::item::ItemType1HPiercing) {
|
||||
base = inst->GetItemBackstabDamage(true);
|
||||
if (!inst->GetItemBackstabDamage())
|
||||
@@ -168,7 +168,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
|
||||
|
||||
if (skill == EQEmu::skills::SkillBash) {
|
||||
if (IsClient()) {
|
||||
EQEmu::ItemInstance *item = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
EQEmu::ItemInstance *item = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (item) {
|
||||
if (item->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
hate += item->GetItem()->AC;
|
||||
@@ -185,10 +185,10 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
|
||||
my_hit.offense = offense(my_hit.skill);
|
||||
my_hit.tohit = GetTotalToHit(my_hit.skill, 0);
|
||||
|
||||
my_hit.hand = EQEmu::inventory::slotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should
|
||||
my_hit.hand = EQEmu::invslot::slotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should
|
||||
// work for most
|
||||
if (skill == EQEmu::skills::SkillThrowing || skill == EQEmu::skills::SkillArchery)
|
||||
my_hit.hand = EQEmu::inventory::slotRange;
|
||||
my_hit.hand = EQEmu::invslot::slotRange;
|
||||
|
||||
DoAttack(who, my_hit);
|
||||
|
||||
@@ -259,7 +259,7 @@ void Client::OPCombatAbility(const CombatAbility_Struct *ca_atk)
|
||||
// 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 == EQEmu::inventory::slotRange) {
|
||||
if (ca_atk->m_atk == EQEmu::invslot::slotRange) {
|
||||
if (ca_atk->m_skill == EQEmu::skills::SkillThrowing) {
|
||||
SetAttackTimer();
|
||||
ThrowingAttack(GetTarget());
|
||||
@@ -309,8 +309,8 @@ void Client::OPCombatAbility(const CombatAbility_Struct *ca_atk)
|
||||
DoAnim(animTailRake, 0, false);
|
||||
|
||||
int32 ht = 0;
|
||||
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::inventory::slotSecondary)) <= 0 &&
|
||||
GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::inventory::slotShoulders)) <= 0)
|
||||
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::invslot::slotSecondary)) <= 0 &&
|
||||
GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::invslot::slotShoulders)) <= 0)
|
||||
dmg = -5;
|
||||
else
|
||||
ht = dmg = GetBaseSkillDamage(EQEmu::skills::SkillBash, GetTarget());
|
||||
@@ -366,7 +366,7 @@ void Client::OPCombatAbility(const CombatAbility_Struct *ca_atk)
|
||||
DoAnim(animKick, 0, false);
|
||||
|
||||
int32 ht = 0;
|
||||
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::inventory::slotFeet)) <= 0)
|
||||
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::invslot::slotFeet)) <= 0)
|
||||
dmg = -5;
|
||||
else
|
||||
ht = dmg = GetBaseSkillDamage(EQEmu::skills::SkillKick, GetTarget());
|
||||
@@ -445,7 +445,7 @@ int Mob::MonkSpecialAttack(Mob *other, uint8 unchecked_type)
|
||||
int32 min_dmg = 0;
|
||||
int reuse = 0;
|
||||
EQEmu::skills::SkillType skill_type; // to avoid casting... even though it "would work"
|
||||
uint8 itemslot = EQEmu::inventory::slotFeet;
|
||||
uint8 itemslot = EQEmu::invslot::slotFeet;
|
||||
if (IsNPC()) {
|
||||
auto *npc = CastToNPC();
|
||||
min_dmg = npc->GetMinDamage();
|
||||
@@ -462,21 +462,21 @@ int Mob::MonkSpecialAttack(Mob *other, uint8 unchecked_type)
|
||||
case EQEmu::skills::SkillDragonPunch:
|
||||
skill_type = EQEmu::skills::SkillDragonPunch;
|
||||
max_dmg = GetBaseSkillDamage(skill_type);
|
||||
itemslot = EQEmu::inventory::slotHands;
|
||||
itemslot = EQEmu::invslot::slotHands;
|
||||
DoAnim(animTailRake, 0, false);
|
||||
reuse = TailRakeReuseTime;
|
||||
break;
|
||||
case EQEmu::skills::SkillEagleStrike:
|
||||
skill_type = EQEmu::skills::SkillEagleStrike;
|
||||
max_dmg = GetBaseSkillDamage(skill_type);
|
||||
itemslot = EQEmu::inventory::slotHands;
|
||||
itemslot = EQEmu::invslot::slotHands;
|
||||
DoAnim(animEagleStrike, 0, false);
|
||||
reuse = EagleStrikeReuseTime;
|
||||
break;
|
||||
case EQEmu::skills::SkillTigerClaw:
|
||||
skill_type = EQEmu::skills::SkillTigerClaw;
|
||||
max_dmg = GetBaseSkillDamage(skill_type);
|
||||
itemslot = EQEmu::inventory::slotHands;
|
||||
itemslot = EQEmu::invslot::slotHands;
|
||||
DoAnim(animTigerClaw, 0, false);
|
||||
reuse = TigerClawReuseTime;
|
||||
break;
|
||||
@@ -528,7 +528,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
|
||||
|
||||
//make sure we have a proper weapon if we are a client.
|
||||
if(IsClient()) {
|
||||
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
if (!wpn || (wpn->GetItem()->ItemType != EQEmu::item::ItemType1HPiercing)){
|
||||
Message_StringID(13, BACKSTAB_WEAPON);
|
||||
return;
|
||||
@@ -583,7 +583,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
|
||||
m_specialattacks = eSpecialAttacks::None;
|
||||
}
|
||||
else { //We do a single regular attack if we attack from the front without chaotic stab
|
||||
Attack(other, EQEmu::inventory::slotPrimary);
|
||||
Attack(other, EQEmu::invslot::slotPrimary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
|
||||
|
||||
// make sure we can hit (bane, magical, etc)
|
||||
if (IsClient()) {
|
||||
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
if (!GetWeaponDamage(other, wpn))
|
||||
return;
|
||||
} else if (!GetWeaponDamage(other, (const EQEmu::ItemData*)nullptr)){
|
||||
@@ -616,7 +616,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(EQEmu::inventory::slotPrimary) : (const EQEmu::ItemInstance*)nullptr) > 0){
|
||||
if (GetWeaponDamage(other, IsClient() ? CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary) : (const EQEmu::ItemInstance*)nullptr) > 0){
|
||||
other->Damage(this, 32000, SPELL_UNKNOWN, EQEmu::skills::SkillBackstab);
|
||||
}else{
|
||||
other->Damage(this, -5, SPELL_UNKNOWN, EQEmu::skills::SkillBackstab);
|
||||
@@ -636,20 +636,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 EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::inventory::slotRange];
|
||||
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::invslot::slotRange];
|
||||
|
||||
//locate ammo
|
||||
int ammo_slot = EQEmu::inventory::slotAmmo;
|
||||
const EQEmu::ItemInstance* Ammo = m_inv[EQEmu::inventory::slotAmmo];
|
||||
int ammo_slot = EQEmu::invslot::slotAmmo;
|
||||
const EQEmu::ItemInstance* Ammo = m_inv[EQEmu::invslot::slotAmmo];
|
||||
|
||||
if (!RangeWeapon || !RangeWeapon->IsClassCommon()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::inventory::slotRange), EQEmu::inventory::slotRange);
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(EQEmu::inventory::slotRange));
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::invslot::slotRange), EQEmu::invslot::slotRange);
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(EQEmu::invslot::slotRange));
|
||||
return;
|
||||
}
|
||||
if (!Ammo || !Ammo->IsClassCommon()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(EQEmu::inventory::slotAmmo), EQEmu::inventory::slotAmmo);
|
||||
Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(EQEmu::inventory::slotAmmo));
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(EQEmu::invslot::slotAmmo), EQEmu::invslot::slotAmmo);
|
||||
Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(EQEmu::invslot::slotAmmo));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -674,7 +674,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
||||
//first look for quivers
|
||||
int r;
|
||||
bool found = false;
|
||||
for (r = EQEmu::legacy::GENERAL_BEGIN; r <= EQEmu::legacy::GENERAL_END; r++) {
|
||||
for (r = EQEmu::invslot::GENERAL_BEGIN; r <= EQEmu::invslot::GENERAL_END; r++) {
|
||||
const EQEmu::ItemInstance *pi = m_inv[r];
|
||||
if (pi == nullptr || !pi->IsClassBag())
|
||||
continue;
|
||||
@@ -791,7 +791,7 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon,
|
||||
|
||||
if (!RangeWeapon && !Ammo && range_id && ammo_id) {
|
||||
if (IsClient()) {
|
||||
_RangeWeapon = CastToClient()->m_inv[EQEmu::inventory::slotRange];
|
||||
_RangeWeapon = CastToClient()->m_inv[EQEmu::invslot::slotRange];
|
||||
if (_RangeWeapon && _RangeWeapon->GetItem() &&
|
||||
_RangeWeapon->GetItem()->ID == range_id)
|
||||
RangeWeapon = _RangeWeapon;
|
||||
@@ -859,7 +859,7 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon,
|
||||
my_hit.skill = EQEmu::skills::SkillArchery;
|
||||
my_hit.offense = offense(my_hit.skill);
|
||||
my_hit.tohit = GetTotalToHit(my_hit.skill, chance_mod);
|
||||
my_hit.hand = EQEmu::inventory::slotRange;
|
||||
my_hit.hand = EQEmu::invslot::slotRange;
|
||||
|
||||
DoAttack(other, my_hit);
|
||||
TotalDmg = my_hit.damage_done;
|
||||
@@ -877,7 +877,7 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon,
|
||||
if (ReuseTime)
|
||||
TrySkillProc(other, EQEmu::skills::SkillArchery, ReuseTime);
|
||||
else
|
||||
TrySkillProc(other, EQEmu::skills::SkillArchery, 0, true, EQEmu::inventory::slotRange);
|
||||
TrySkillProc(other, EQEmu::skills::SkillArchery, 0, true, EQEmu::invslot::slotRange);
|
||||
}
|
||||
// end of old fuck
|
||||
|
||||
@@ -886,20 +886,20 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon,
|
||||
|
||||
// Weapon Proc
|
||||
if (RangeWeapon && other && !other->HasDied())
|
||||
TryWeaponProc(RangeWeapon, other, EQEmu::inventory::slotRange);
|
||||
TryWeaponProc(RangeWeapon, other, EQEmu::invslot::slotRange);
|
||||
|
||||
// Ammo Proc
|
||||
if (ammo_lost)
|
||||
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::inventory::slotRange);
|
||||
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::invslot::slotRange);
|
||||
else if (Ammo && other && !other->HasDied())
|
||||
TryWeaponProc(Ammo, other, EQEmu::inventory::slotRange);
|
||||
TryWeaponProc(Ammo, other, EQEmu::invslot::slotRange);
|
||||
|
||||
// Skill Proc
|
||||
if (HasSkillProcs() && other && !other->HasDied()) {
|
||||
if (ReuseTime)
|
||||
TrySkillProc(other, EQEmu::skills::SkillArchery, ReuseTime);
|
||||
else
|
||||
TrySkillProc(other, EQEmu::skills::SkillArchery, 0, false, EQEmu::inventory::slotRange);
|
||||
TrySkillProc(other, EQEmu::skills::SkillArchery, 0, false, EQEmu::invslot::slotRange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1190,7 +1190,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
|
||||
my_hit.skill = skill;
|
||||
my_hit.offense = offense(my_hit.skill);
|
||||
my_hit.tohit = GetTotalToHit(my_hit.skill, chance_mod);
|
||||
my_hit.hand = EQEmu::inventory::slotRange;
|
||||
my_hit.hand = EQEmu::invslot::slotRange;
|
||||
|
||||
DoAttack(other, my_hit);
|
||||
|
||||
@@ -1206,14 +1206,14 @@ 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, EQEmu::inventory::slotRange);
|
||||
TrySkillProc(other, skillInUse, 0, true, EQEmu::invslot::slotRange);
|
||||
|
||||
//try proc on hits and misses
|
||||
if(other && !other->HasDied())
|
||||
TrySpellProc(nullptr, (const EQEmu::ItemData*)nullptr, other, EQEmu::inventory::slotRange);
|
||||
TrySpellProc(nullptr, (const EQEmu::ItemData*)nullptr, other, EQEmu::invslot::slotRange);
|
||||
|
||||
if (HasSkillProcs() && other && !other->HasDied())
|
||||
TrySkillProc(other, skillInUse, 0, false, EQEmu::inventory::slotRange);
|
||||
TrySkillProc(other, skillInUse, 0, false, EQEmu::invslot::slotRange);
|
||||
}
|
||||
|
||||
void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
||||
@@ -1229,19 +1229,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
||||
return;
|
||||
}
|
||||
|
||||
int ammo_slot = EQEmu::inventory::slotRange;
|
||||
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::inventory::slotRange];
|
||||
int ammo_slot = EQEmu::invslot::slotRange;
|
||||
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::invslot::slotRange];
|
||||
|
||||
if (!RangeWeapon || !RangeWeapon->IsClassCommon()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::inventory::slotRange), EQEmu::inventory::slotRange);
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(EQEmu::inventory::slotRange));
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::invslot::slotRange), EQEmu::invslot::slotRange);
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(EQEmu::invslot::slotRange));
|
||||
return;
|
||||
}
|
||||
|
||||
const EQEmu::ItemData* item = RangeWeapon->GetItem();
|
||||
if (item->ItemType != EQEmu::item::ItemTypeLargeThrowing && item->ItemType != EQEmu::item::ItemTypeSmallThrowing) {
|
||||
Log(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(EQEmu::inventory::slotRange));
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(EQEmu::invslot::slotRange));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1249,11 +1249,11 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
||||
|
||||
if(RangeWeapon->GetCharges() == 1) {
|
||||
//first check ammo
|
||||
const EQEmu::ItemInstance* AmmoItem = m_inv[EQEmu::inventory::slotAmmo];
|
||||
const EQEmu::ItemInstance* AmmoItem = m_inv[EQEmu::invslot::slotAmmo];
|
||||
if(AmmoItem != nullptr && AmmoItem->GetID() == RangeWeapon->GetID()) {
|
||||
//more in the ammo slot, use it
|
||||
RangeWeapon = AmmoItem;
|
||||
ammo_slot = EQEmu::inventory::slotAmmo;
|
||||
ammo_slot = EQEmu::invslot::slotAmmo;
|
||||
Log(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
|
||||
@@ -1371,7 +1371,7 @@ void Mob::DoThrowingAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon
|
||||
my_hit.skill = EQEmu::skills::SkillThrowing;
|
||||
my_hit.offense = offense(my_hit.skill);
|
||||
my_hit.tohit = GetTotalToHit(my_hit.skill, chance_mod);
|
||||
my_hit.hand = EQEmu::inventory::slotRange;
|
||||
my_hit.hand = EQEmu::invslot::slotRange;
|
||||
|
||||
DoAttack(other, my_hit);
|
||||
TotalDmg = my_hit.damage_done;
|
||||
@@ -1390,7 +1390,7 @@ void Mob::DoThrowingAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon
|
||||
if (ReuseTime)
|
||||
TrySkillProc(other, EQEmu::skills::SkillThrowing, ReuseTime);
|
||||
else
|
||||
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, true, EQEmu::inventory::slotRange);
|
||||
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, true, EQEmu::invslot::slotRange);
|
||||
}
|
||||
// end old shit
|
||||
|
||||
@@ -1399,15 +1399,15 @@ void Mob::DoThrowingAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon
|
||||
|
||||
// Throwing item Proc
|
||||
if (ammo_lost)
|
||||
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::inventory::slotRange);
|
||||
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::invslot::slotRange);
|
||||
else if (RangeWeapon && other && !other->HasDied())
|
||||
TryWeaponProc(RangeWeapon, other, EQEmu::inventory::slotRange);
|
||||
TryWeaponProc(RangeWeapon, other, EQEmu::invslot::slotRange);
|
||||
|
||||
if (HasSkillProcs() && other && !other->HasDied()) {
|
||||
if (ReuseTime)
|
||||
TrySkillProc(other, EQEmu::skills::SkillThrowing, ReuseTime);
|
||||
else
|
||||
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, false, EQEmu::inventory::slotRange);
|
||||
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, false, EQEmu::invslot::slotRange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1766,7 +1766,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
|
||||
if (ca_target!=this) {
|
||||
DoAnim(animTailRake, 0, false);
|
||||
|
||||
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::inventory::slotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::inventory::slotShoulders)) <= 0)
|
||||
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::invslot::slotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::invslot::slotShoulders)) <= 0)
|
||||
dmg = DMG_INVULNERABLE;
|
||||
|
||||
ReuseTime = (BashReuseTime - 1) / HasteMod;
|
||||
@@ -1812,7 +1812,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
|
||||
if(ca_target!=this){
|
||||
DoAnim(animKick, 0, false);
|
||||
|
||||
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::inventory::slotFeet)) <= 0)
|
||||
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::invslot::slotFeet)) <= 0)
|
||||
dmg = DMG_INVULNERABLE;
|
||||
|
||||
ReuseTime = KickReuseTime-1;
|
||||
@@ -2111,7 +2111,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob *other, uint16 weapon_damage, EQEmu::skills:
|
||||
if (skillinuse == EQEmu::skills::SkillBash) {
|
||||
if (IsClient()) {
|
||||
EQEmu::ItemInstance *item =
|
||||
CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
CastToClient()->GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (item) {
|
||||
if (item->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
hate += item->GetItem()->AC;
|
||||
@@ -2131,7 +2131,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob *other, uint16 weapon_damage, EQEmu::skills:
|
||||
my_hit.offense = offense(my_hit.skill);
|
||||
my_hit.tohit = GetTotalToHit(my_hit.skill, chance_mod);
|
||||
// slot range exclude ripe etc ...
|
||||
my_hit.hand = CanRiposte ? EQEmu::inventory::slotRange : EQEmu::inventory::slotPrimary;
|
||||
my_hit.hand = CanRiposte ? EQEmu::invslot::slotRange : EQEmu::invslot::slotPrimary;
|
||||
|
||||
if (IsNPC())
|
||||
my_hit.min_damage = CastToNPC()->GetMinDamage();
|
||||
|
||||
+11
-11
@@ -624,7 +624,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
snprintf(effect_desc, _EDLEN, "Flesh To Bone");
|
||||
#endif
|
||||
if(IsClient()){
|
||||
EQEmu::ItemInstance* transI = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotCursor);
|
||||
EQEmu::ItemInstance* transI = CastToClient()->GetInv().GetItem(EQEmu::invslot::slotCursor);
|
||||
if (transI && transI->IsClassCommon() && transI->IsStackable()){
|
||||
uint32 fcharges = transI->GetCharges();
|
||||
//Does it sound like meat... maybe should check if it looks like meat too...
|
||||
@@ -634,7 +634,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(EQEmu::inventory::slotCursor, fcharges, true);
|
||||
CastToClient()->DeleteItemInInventory(EQEmu::invslot::slotCursor, fcharges, true);
|
||||
CastToClient()->SummonItem(13073, fcharges);
|
||||
}
|
||||
else{
|
||||
@@ -1176,7 +1176,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
|
||||
if (SummonedItem) {
|
||||
c->PushItemOnCursor(*SummonedItem);
|
||||
c->SendItemPacket(EQEmu::inventory::slotCursor, SummonedItem, ItemPacketLimbo);
|
||||
c->SendItemPacket(EQEmu::invslot::slotCursor, SummonedItem, ItemPacketLimbo);
|
||||
safe_delete(SummonedItem);
|
||||
}
|
||||
SummonedItem = database.CreateItem(spell.base[i], charges);
|
||||
@@ -2213,7 +2213,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, EQEmu::inventory::slotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal
|
||||
entity_list.AEAttack(caster, 30, EQEmu::invslot::slotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -3015,7 +3015,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
if (SummonedItem) {
|
||||
Client *c=CastToClient();
|
||||
c->PushItemOnCursor(*SummonedItem);
|
||||
c->SendItemPacket(EQEmu::inventory::slotCursor, SummonedItem, ItemPacketLimbo);
|
||||
c->SendItemPacket(EQEmu::invslot::slotCursor, SummonedItem, ItemPacketLimbo);
|
||||
safe_delete(SummonedItem);
|
||||
}
|
||||
|
||||
@@ -5169,7 +5169,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
|
||||
|
||||
const EQEmu::ItemData* TempItem = nullptr;
|
||||
|
||||
for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++)
|
||||
for (int x = EQEmu::invslot::EQUIPMENT_BEGIN; x <= EQEmu::invslot::EQUIPMENT_END; x++)
|
||||
{
|
||||
if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS)
|
||||
continue;
|
||||
@@ -5189,7 +5189,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = EQEmu::inventory::socketBegin; y < EQEmu::inventory::SocketCount; ++y)
|
||||
for (int y = EQEmu::invaug::SOCKET_BEGIN; y <= EQEmu::invaug::SOCKET_END; ++y)
|
||||
{
|
||||
if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS)
|
||||
continue;
|
||||
@@ -5304,7 +5304,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
|
||||
int16 focus_max_real = 0;
|
||||
|
||||
//item focus
|
||||
for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++)
|
||||
for (int x = EQEmu::invslot::EQUIPMENT_BEGIN; x <= EQEmu::invslot::EQUIPMENT_END; x++)
|
||||
{
|
||||
TempItem = nullptr;
|
||||
EQEmu::ItemInstance* ins = GetInv().GetItem(x);
|
||||
@@ -5338,7 +5338,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = EQEmu::inventory::socketBegin; y < EQEmu::inventory::SocketCount; ++y)
|
||||
for (int y = EQEmu::invaug::SOCKET_BEGIN; y <= EQEmu::invaug::SOCKET_END; ++y)
|
||||
{
|
||||
EQEmu::ItemInstance *aug = nullptr;
|
||||
aug = ins->GetAugment(y);
|
||||
@@ -5376,7 +5376,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
|
||||
}
|
||||
|
||||
//Tribute Focus
|
||||
for (int x = EQEmu::legacy::TRIBUTE_BEGIN; x <= EQEmu::legacy::TRIBUTE_END; ++x)
|
||||
for (int x = EQEmu::invslot::TRIBUTE_BEGIN; x <= EQEmu::invslot::TRIBUTE_END; ++x)
|
||||
{
|
||||
TempItem = nullptr;
|
||||
EQEmu::ItemInstance* ins = GetInv().GetItem(x);
|
||||
@@ -5576,7 +5576,7 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) {
|
||||
int16 focus_max_real = 0;
|
||||
|
||||
//item focus
|
||||
for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++){
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; i++){
|
||||
const EQEmu::ItemData *cur = database.GetItem(equipment[i]);
|
||||
|
||||
if(!cur)
|
||||
|
||||
+2
-2
@@ -281,7 +281,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
if (itm && (itm->GetItem()->Click.Type == EQEmu::item::ItemEffectEquipClick) && !(item_slot <= EQEmu::inventory::slotAmmo || item_slot == EQEmu::inventory::slotPowerSource)){
|
||||
if (itm && (itm->GetItem()->Click.Type == EQEmu::item::ItemEffectEquipClick) && !(item_slot <= EQEmu::invslot::slotAmmo || item_slot == EQEmu::invslot::SLOT_POWER_SOURCE)){
|
||||
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
|
||||
// They are attempting to cast a must equip clicky without having it equipped
|
||||
Log(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);
|
||||
@@ -1294,7 +1294,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
if (inst == nullptr)
|
||||
break;
|
||||
|
||||
for (int r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
|
||||
for (int r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
|
||||
const EQEmu::ItemInstance* aug_i = inst->GetAugment(r);
|
||||
|
||||
if (!aug_i)
|
||||
|
||||
@@ -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 = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++)
|
||||
for (uint8 i = EQEmu::invbag::SLOT_BEGIN; i < EQEmu::invtype::WORLD_SIZE; i++)
|
||||
{
|
||||
const EQEmu::ItemInstance* 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 = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++)
|
||||
for (uint8 i = EQEmu::invbag::SLOT_BEGIN; i < EQEmu::invtype::WORLD_SIZE; i++)
|
||||
{
|
||||
const EQEmu::ItemInstance* inst = container->GetItem(i);
|
||||
if (inst)
|
||||
@@ -303,7 +303,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
|
||||
const EQEmu::ItemData* new_weapon = inst->GetItem();
|
||||
user->DeleteItemInInventory(EQEmu::InventoryProfile::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(), EQEmu::inventory::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::invslot::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);
|
||||
@@ -323,7 +323,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
|
||||
const EQEmu::ItemData* new_weapon = inst->GetItem();
|
||||
user->DeleteItemInInventory(EQEmu::InventoryProfile::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(), EQEmu::inventory::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::invslot::slotCursor, 0, 0);
|
||||
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
|
||||
}
|
||||
else if (inst) {
|
||||
@@ -407,7 +407,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 = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++) {
|
||||
for (uint8 i = EQEmu::invbag::SLOT_BEGIN; i < EQEmu::invtype::WORLD_SIZE; i++) {
|
||||
const EQEmu::ItemInstance* inst = container->GetItem(i);
|
||||
if (inst) {
|
||||
user->DeleteItemInInventory(EQEmu::InventoryProfile::CalcSlotId(in_combine->container_slot, i), 0, true);
|
||||
@@ -1243,7 +1243,7 @@ bool ZoneDatabase::GetTradeRecipe(const EQEmu::ItemInstance* container, uint8 c_
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
int ccnt = 0;
|
||||
|
||||
for (int x = EQEmu::inventory::slotBegin; x < EQEmu::legacy::TYPE_WORLD_SIZE; x++) {
|
||||
for (int x = EQEmu::invbag::SLOT_BEGIN; x < EQEmu::invtype::WORLD_SIZE; x++) {
|
||||
const EQEmu::ItemInstance* inst = container->GetItem(x);
|
||||
if(!inst)
|
||||
continue;
|
||||
|
||||
+43
-43
@@ -99,7 +99,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
|
||||
|
||||
// Item always goes into trade bucket from cursor
|
||||
Client* client = owner->CastToClient();
|
||||
EQEmu::ItemInstance* inst = client->GetInv().GetItem(EQEmu::inventory::slotCursor);
|
||||
EQEmu::ItemInstance* inst = client->GetInv().GetItem(EQEmu::invslot::slotCursor);
|
||||
|
||||
if (!inst) {
|
||||
client->Message(13, "Error: Could not find item on your cursor!");
|
||||
@@ -132,7 +132,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
|
||||
if (_stack_size > 0)
|
||||
inst->SetCharges(_stack_size);
|
||||
else
|
||||
client->DeleteItemInInventory(EQEmu::inventory::slotCursor);
|
||||
client->DeleteItemInInventory(EQEmu::invslot::slotCursor);
|
||||
|
||||
SendItemData(inst2, trade_slot_id);
|
||||
}
|
||||
@@ -147,7 +147,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
|
||||
Log(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(EQEmu::inventory::slotCursor);
|
||||
client->DeleteItemInInventory(EQEmu::invslot::slotCursor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,13 +172,13 @@ void Trade::SendItemData(const EQEmu::ItemInstance* inst, int16 dest_slot_id)
|
||||
Client* with = mob->CastToClient();
|
||||
Client* trader = owner->CastToClient();
|
||||
if (with && with->IsClient()) {
|
||||
with->SendItemPacket(dest_slot_id - EQEmu::legacy::TRADE_BEGIN, inst, ItemPacketTradeView);
|
||||
with->SendItemPacket(dest_slot_id - EQEmu::invslot::TRADE_BEGIN, inst, ItemPacketTradeView);
|
||||
if (inst->GetItem()->ItemClass == 1) {
|
||||
for (uint16 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
|
||||
for (uint16 i = EQEmu::invbag::SLOT_BEGIN; i <= EQEmu::invbag::SLOT_END; i++) {
|
||||
uint16 bagslot_id = EQEmu::InventoryProfile::CalcSlotId(dest_slot_id, i);
|
||||
const EQEmu::ItemInstance* bagitem = trader->GetInv().GetItem(bagslot_id);
|
||||
if (bagitem) {
|
||||
with->SendItemPacket(bagslot_id - EQEmu::legacy::TRADE_BEGIN, bagitem, ItemPacketTradeView);
|
||||
with->SendItemPacket(bagslot_id - EQEmu::invslot::TRADE_BEGIN, bagitem, ItemPacketTradeView);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,7 @@ void Trade::LogTrade()
|
||||
uint8 item_count = 0;
|
||||
|
||||
if (zone->tradevar != 0) {
|
||||
for (uint16 i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_END; i++) {
|
||||
for (uint16 i = EQEmu::invslot::TRADE_BEGIN; i <= EQEmu::invslot::TRADE_END; i++) {
|
||||
if (trader->GetInv().GetItem(i))
|
||||
item_count++;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ void Trade::LogTrade()
|
||||
if (item_count > 0) {
|
||||
strcat(logtext, "items {");
|
||||
|
||||
for (uint16 i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_END; i++) {
|
||||
for (uint16 i = EQEmu::invslot::TRADE_BEGIN; i <= EQEmu::invslot::TRADE_END; i++) {
|
||||
const EQEmu::ItemInstance* inst = trader->GetInv().GetItem(i);
|
||||
|
||||
if (!comma)
|
||||
@@ -268,7 +268,7 @@ void Trade::LogTrade()
|
||||
strcat(logtext, item_num);
|
||||
|
||||
if (inst->IsClassBag()) {
|
||||
for (uint8 j = EQEmu::inventory::containerBegin; j < EQEmu::inventory::ContainerCount; j++) {
|
||||
for (uint8 j = EQEmu::invbag::SLOT_BEGIN; j <= EQEmu::invbag::SLOT_END; j++) {
|
||||
inst = trader->GetInv().GetItem(i, j);
|
||||
if (inst) {
|
||||
strcat(logtext, ",");
|
||||
@@ -304,7 +304,7 @@ void Trade::DumpTrade()
|
||||
return;
|
||||
|
||||
Client* trader = owner->CastToClient();
|
||||
for (uint16 i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_END; i++) {
|
||||
for (uint16 i = EQEmu::invslot::TRADE_BEGIN; i <= EQEmu::invslot::TRADE_END; i++) {
|
||||
const EQEmu::ItemInstance* inst = trader->GetInv().GetItem(i);
|
||||
|
||||
if (inst) {
|
||||
@@ -313,7 +313,7 @@ void Trade::DumpTrade()
|
||||
i, ((inst->IsClassBag()) ? "True" : "False"));
|
||||
|
||||
if (inst->IsClassBag()) {
|
||||
for (uint8 j = EQEmu::inventory::containerBegin; j < EQEmu::inventory::ContainerCount; j++) {
|
||||
for (uint8 j = EQEmu::invbag::SLOT_BEGIN; j <= EQEmu::invbag::SLOT_END; j++) {
|
||||
inst = trader->GetInv().GetItem(i, j);
|
||||
if (inst) {
|
||||
Log(Logs::Detail, Logs::Trading, "\tBagItem %i (Charges=%i, Slot=%i)",
|
||||
@@ -333,7 +333,7 @@ void Client::ResetTrade() {
|
||||
AddMoneyToPP(trade->cp, trade->sp, trade->gp, trade->pp, true);
|
||||
|
||||
// step 1: process bags
|
||||
for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
|
||||
for (int16 trade_slot = EQEmu::invslot::TRADE_BEGIN; trade_slot <= EQEmu::invslot::TRADE_END; ++trade_slot) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[trade_slot];
|
||||
|
||||
if (inst && inst->IsClassBag()) {
|
||||
@@ -352,7 +352,7 @@ void Client::ResetTrade() {
|
||||
}
|
||||
|
||||
// step 2a: process stackables
|
||||
for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
|
||||
for (int16 trade_slot = EQEmu::invslot::TRADE_BEGIN; trade_slot <= EQEmu::invslot::TRADE_END; ++trade_slot) {
|
||||
EQEmu::ItemInstance* inst = GetInv().GetItem(trade_slot);
|
||||
|
||||
if (inst && inst->IsStackable()) {
|
||||
@@ -360,7 +360,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 == EQEmu::inventory::slotCursor) || (free_slot == INVALID_INDEX))
|
||||
if ((free_slot == EQEmu::invslot::slotCursor) || (free_slot == INVALID_INDEX))
|
||||
break;
|
||||
|
||||
EQEmu::ItemInstance* partial_inst = GetInv().GetItem(free_slot);
|
||||
@@ -399,11 +399,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::legacy::TRADE_END; trade_slot >= EQEmu::legacy::TRADE_BEGIN; --trade_slot) {
|
||||
for (int16 trade_slot = EQEmu::invslot::TRADE_END; trade_slot >= EQEmu::invslot::TRADE_BEGIN; --trade_slot) {
|
||||
EQEmu::ItemInstance* inst = GetInv().GetItem(trade_slot);
|
||||
|
||||
if (inst && inst->IsStackable()) {
|
||||
for (int16 bias_slot = EQEmu::legacy::TRADE_BEGIN; bias_slot <= EQEmu::legacy::TRADE_END; ++bias_slot) {
|
||||
for (int16 bias_slot = EQEmu::invslot::TRADE_BEGIN; bias_slot <= EQEmu::invslot::TRADE_END; ++bias_slot) {
|
||||
if (bias_slot >= trade_slot)
|
||||
break;
|
||||
|
||||
@@ -433,7 +433,7 @@ void Client::ResetTrade() {
|
||||
}
|
||||
|
||||
// step 3: process everything else
|
||||
for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
|
||||
for (int16 trade_slot = EQEmu::invslot::TRADE_BEGIN; trade_slot <= EQEmu::invslot::TRADE_END; ++trade_slot) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[trade_slot];
|
||||
|
||||
if (inst) {
|
||||
@@ -488,7 +488,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
}
|
||||
|
||||
// step 1: process bags
|
||||
for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
|
||||
for (int16 trade_slot = EQEmu::invslot::TRADE_BEGIN; trade_slot <= EQEmu::invslot::TRADE_END; ++trade_slot) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[trade_slot];
|
||||
|
||||
if (inst && inst->IsClassBag()) {
|
||||
@@ -523,7 +523,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
else
|
||||
qs_audit->char1_count += detail->charges;
|
||||
|
||||
for (uint8 sub_slot = EQEmu::inventory::containerBegin; (sub_slot < EQEmu::inventory::ContainerCount); ++sub_slot) { // this is to catch ALL items
|
||||
for (uint8 sub_slot = EQEmu::invbag::SLOT_BEGIN; (sub_slot <= EQEmu::invbag::SLOT_END); ++sub_slot) { // this is to catch ALL items
|
||||
const EQEmu::ItemInstance* 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::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
|
||||
for (int16 trade_slot = EQEmu::invslot::TRADE_BEGIN; trade_slot <= EQEmu::invslot::TRADE_END; ++trade_slot) {
|
||||
EQEmu::ItemInstance* 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 == EQEmu::inventory::slotCursor) || (partial_slot == INVALID_INDEX))
|
||||
if ((partial_slot == EQEmu::invslot::slotCursor) || (partial_slot == INVALID_INDEX))
|
||||
break;
|
||||
|
||||
EQEmu::ItemInstance* 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::legacy::TRADE_END; trade_slot >= EQEmu::legacy::TRADE_BEGIN; --trade_slot) {
|
||||
for (int16 trade_slot = EQEmu::invslot::TRADE_END; trade_slot >= EQEmu::invslot::TRADE_BEGIN; --trade_slot) {
|
||||
EQEmu::ItemInstance* inst = GetInv().GetItem(trade_slot);
|
||||
|
||||
if (inst && inst->IsStackable()) {
|
||||
for (int16 bias_slot = EQEmu::legacy::TRADE_BEGIN; bias_slot <= EQEmu::legacy::TRADE_END; ++bias_slot) {
|
||||
for (int16 bias_slot = EQEmu::invslot::TRADE_BEGIN; bias_slot <= EQEmu::invslot::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::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
|
||||
for (int16 trade_slot = EQEmu::invslot::TRADE_BEGIN; trade_slot <= EQEmu::invslot::TRADE_END; ++trade_slot) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[trade_slot];
|
||||
|
||||
if (inst) {
|
||||
@@ -742,7 +742,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
qs_audit->char1_count += detail->charges;
|
||||
|
||||
// 'step 3' should never really see containers..but, just in case...
|
||||
for (uint8 sub_slot = EQEmu::inventory::containerBegin; (sub_slot < EQEmu::inventory::ContainerCount); ++sub_slot) { // this is to catch ALL items
|
||||
for (uint8 sub_slot = EQEmu::invbag::SLOT_BEGIN; (sub_slot <= EQEmu::invbag::SLOT_END); ++sub_slot) { // this is to catch ALL items
|
||||
const EQEmu::ItemInstance* bag_inst = inst->GetItem(sub_slot);
|
||||
|
||||
if (bag_inst) {
|
||||
@@ -819,7 +819,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::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_NPC_END; ++trade_slot) {
|
||||
for (int16 trade_slot = EQEmu::invslot::TRADE_BEGIN; trade_slot <= EQEmu::invslot::TRADE_NPC_END; ++trade_slot) {
|
||||
const EQEmu::ItemInstance* trade_inst = m_inv[trade_slot];
|
||||
|
||||
if(trade_inst) {
|
||||
@@ -840,7 +840,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
qs_audit->char_count += detail->charges;
|
||||
|
||||
if (trade_inst->IsClassBag()) {
|
||||
for (uint8 sub_slot = EQEmu::inventory::containerBegin; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
|
||||
for (uint8 sub_slot = EQEmu::invbag::SLOT_BEGIN; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
|
||||
const EQEmu::ItemInstance* trade_baginst = trade_inst->GetItem(sub_slot);
|
||||
|
||||
if(trade_baginst) {
|
||||
@@ -874,7 +874,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
|
||||
std::vector<EQEmu::Any> item_list;
|
||||
std::list<EQEmu::ItemInstance*> items;
|
||||
for (int i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_NPC_END; ++i) {
|
||||
for (int i = EQEmu::invslot::TRADE_BEGIN; i <= EQEmu::invslot::TRADE_NPC_END; ++i) {
|
||||
EQEmu::ItemInstance *inst = m_inv.GetItem(i);
|
||||
if(inst) {
|
||||
items.push_back(inst);
|
||||
@@ -894,7 +894,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
(item->NoDrop != 0 || isPetAndCanHaveNoDrop))) {
|
||||
// pets need to look inside bags and try to equip items found there
|
||||
if (item->IsClassBag() && item->BagSlots > 0) {
|
||||
for (int16 bslot = EQEmu::inventory::containerBegin; bslot < item->BagSlots; bslot++) {
|
||||
for (int16 bslot = EQEmu::invbag::SLOT_BEGIN; bslot < item->BagSlots; bslot++) {
|
||||
const EQEmu::ItemInstance* baginst = inst->GetItem(bslot);
|
||||
if (baginst) {
|
||||
const EQEmu::ItemData* bagitem = baginst->GetItem();
|
||||
@@ -951,8 +951,8 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance *insts[4] = { 0 };
|
||||
for (int i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_NPC_END; ++i) {
|
||||
insts[i - EQEmu::legacy::TRADE_BEGIN] = m_inv.PopItem(i);
|
||||
for (int i = EQEmu::invslot::TRADE_BEGIN; i <= EQEmu::invslot::TRADE_NPC_END; ++i) {
|
||||
insts[i - EQEmu::invslot::TRADE_BEGIN] = m_inv.PopItem(i);
|
||||
database.SaveInventory(CharacterID(), nullptr, i);
|
||||
}
|
||||
|
||||
@@ -971,7 +971,7 @@ bool Client::CheckTradeLoreConflict(Client* other)
|
||||
if (!other)
|
||||
return true;
|
||||
|
||||
for (int16 index = EQEmu::legacy::TRADE_BEGIN; index <= EQEmu::legacy::TRADE_END; ++index) {
|
||||
for (int16 index = EQEmu::invslot::TRADE_BEGIN; index <= EQEmu::invslot::TRADE_END; ++index) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[index];
|
||||
if (!inst || !inst->GetItem())
|
||||
continue;
|
||||
@@ -980,7 +980,7 @@ bool Client::CheckTradeLoreConflict(Client* other)
|
||||
return true;
|
||||
}
|
||||
|
||||
for (int16 index = EQEmu::legacy::TRADE_BAGS_BEGIN; index <= EQEmu::legacy::TRADE_BAGS_END; ++index) {
|
||||
for (int16 index = EQEmu::invbag::TRADE_BAGS_BEGIN; index <= EQEmu::invbag::TRADE_BAGS_END; ++index) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[index];
|
||||
if (!inst || !inst->GetItem())
|
||||
continue;
|
||||
@@ -994,7 +994,7 @@ bool Client::CheckTradeLoreConflict(Client* other)
|
||||
|
||||
bool Client::CheckTradeNonDroppable()
|
||||
{
|
||||
for (int16 index = EQEmu::legacy::TRADE_BEGIN; index <= EQEmu::legacy::TRADE_END; ++index){
|
||||
for (int16 index = EQEmu::invslot::TRADE_BEGIN; index <= EQEmu::invslot::TRADE_END; ++index){
|
||||
const EQEmu::ItemInstance* inst = m_inv[index];
|
||||
if (!inst)
|
||||
continue;
|
||||
@@ -1213,7 +1213,7 @@ void Client::BulkSendTraderInventory(uint32 char_id) {
|
||||
|
||||
TraderCharges_Struct* TraderItems = database.LoadTraderItemWithCharges(char_id);
|
||||
|
||||
for (uint8 i = 0;i < 80; i++) {
|
||||
for (uint8 i = 0;i < 80; i++) { // need to transition away from 'magic number'
|
||||
if((TraderItems->ItemID[i] == 0) || (TraderItems->ItemCost[i] <= 0)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1249,10 +1249,10 @@ uint32 Client::FindTraderItemSerialNumber(int32 ItemID) {
|
||||
|
||||
EQEmu::ItemInstance* item = nullptr;
|
||||
uint16 SlotID = 0;
|
||||
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++){
|
||||
for (int i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::GENERAL_END; i++){
|
||||
item = this->GetInv().GetItem(i);
|
||||
if (item && item->GetItem()->ID == 17899){ //Traders Satchel
|
||||
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++) {
|
||||
for (int x = EQEmu::invbag::SLOT_BEGIN; x <= EQEmu::invbag::SLOT_END; x++) {
|
||||
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
|
||||
SlotID = EQEmu::InventoryProfile::CalcSlotId(i, x);
|
||||
item = this->GetInv().GetItem(SlotID);
|
||||
@@ -1272,10 +1272,10 @@ EQEmu::ItemInstance* Client::FindTraderItemBySerialNumber(int32 SerialNumber){
|
||||
|
||||
EQEmu::ItemInstance* item = nullptr;
|
||||
uint16 SlotID = 0;
|
||||
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++){
|
||||
for (int i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::GENERAL_END; i++){
|
||||
item = this->GetInv().GetItem(i);
|
||||
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
|
||||
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++) {
|
||||
for (int x = EQEmu::invbag::SLOT_BEGIN; x <= EQEmu::invbag::SLOT_END; x++) {
|
||||
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
|
||||
SlotID = EQEmu::InventoryProfile::CalcSlotId(i, x);
|
||||
item = this->GetInv().GetItem(SlotID);
|
||||
@@ -1303,10 +1303,10 @@ GetItems_Struct* Client::GetTraderItems(){
|
||||
|
||||
uint8 ndx = 0;
|
||||
|
||||
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
|
||||
for (int i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::GENERAL_END; i++) {
|
||||
item = this->GetInv().GetItem(i);
|
||||
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
|
||||
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++) {
|
||||
for (int x = EQEmu::invbag::SLOT_BEGIN; x <= EQEmu::invbag::SLOT_END; x++) {
|
||||
SlotID = EQEmu::InventoryProfile::CalcSlotId(i, x);
|
||||
|
||||
item = this->GetInv().GetItem(SlotID);
|
||||
@@ -1327,10 +1327,10 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){
|
||||
|
||||
const EQEmu::ItemInstance* item= nullptr;
|
||||
uint16 SlotID = 0;
|
||||
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
|
||||
for (int i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::GENERAL_END; i++) {
|
||||
item = this->GetInv().GetItem(i);
|
||||
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
|
||||
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++){
|
||||
for (int x = EQEmu::invbag::SLOT_BEGIN; x <= EQEmu::invbag::SLOT_END; x++){
|
||||
SlotID = EQEmu::InventoryProfile::CalcSlotId(i, x);
|
||||
|
||||
item = this->GetInv().GetItem(SlotID);
|
||||
|
||||
+15
-15
@@ -66,7 +66,7 @@ void Client::ToggleTribute(bool enabled) {
|
||||
int r;
|
||||
uint32 cost = 0;
|
||||
uint32 level = GetLevel();
|
||||
for (r = 0; r < EQEmu::legacy::TRIBUTE_SIZE; r++) {
|
||||
for (r = 0; r < EQEmu::invtype::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::legacy::TRIBUTE_SIZE; r++) {
|
||||
for (r = 0; r < EQEmu::invtype::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::legacy::TRIBUTE_SIZE; r++) {
|
||||
for (r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++) {
|
||||
uint32 tid = m_pp.tributes[r].tribute;
|
||||
if(tid == TRIBUTE_NONE) {
|
||||
if (m_inv[EQEmu::legacy::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EQEmu::legacy::TRIBUTE_BEGIN + r, 0, false);
|
||||
if (m_inv[EQEmu::invslot::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EQEmu::invslot::TRIBUTE_BEGIN + r, 0, false);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(tribute_list.count(tid) != 1) {
|
||||
if (m_inv[EQEmu::legacy::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EQEmu::legacy::TRIBUTE_BEGIN + r, 0, false);
|
||||
if (m_inv[EQEmu::invslot::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EQEmu::invslot::TRIBUTE_BEGIN + r, 0, false);
|
||||
continue;
|
||||
}
|
||||
|
||||
//sanity check
|
||||
if(m_pp.tributes[r].tier >= MAX_TRIBUTE_TIERS) {
|
||||
if (m_inv[EQEmu::legacy::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EQEmu::legacy::TRIBUTE_BEGIN + r, 0, false);
|
||||
if (m_inv[EQEmu::invslot::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EQEmu::invslot::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::legacy::TRIBUTE_BEGIN + r, *inst, false);
|
||||
SendItemPacket(EQEmu::legacy::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem);
|
||||
PutItemInInventory(EQEmu::invslot::TRIBUTE_BEGIN + r, *inst, false);
|
||||
SendItemPacket(EQEmu::invslot::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem);
|
||||
safe_delete(inst);
|
||||
}
|
||||
} else {
|
||||
//unequip tribute items...
|
||||
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);
|
||||
for (r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++) {
|
||||
if (m_inv[EQEmu::invslot::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EQEmu::invslot::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::legacy::TRIBUTE_SIZE; r++) {
|
||||
for (r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++) {
|
||||
|
||||
m_pp.tributes[r].tribute = TRIBUTE_NONE;
|
||||
|
||||
|
||||
+21
-21
@@ -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 = EQEmu::inventory::slotPrimary;
|
||||
int Hand = EQEmu::invslot::slotPrimary;
|
||||
|
||||
if (!other)
|
||||
return 0;
|
||||
|
||||
EQEmu::ItemInstance* weapon;
|
||||
weapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
weapon = GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
|
||||
if(weapon != nullptr) {
|
||||
if (!weapon->IsWeapon()) {
|
||||
@@ -627,7 +627,7 @@ int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage)
|
||||
|
||||
int ucDamageBonus = 0;
|
||||
|
||||
if (Hand == EQEmu::inventory::slotPrimary && GetLevel() >= 28 && IsWarriorClass())
|
||||
if (Hand == EQEmu::invslot::slotPrimary && GetLevel() >= 28 && IsWarriorClass())
|
||||
{
|
||||
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr);
|
||||
|
||||
@@ -661,24 +661,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.
|
||||
EQEmu::ItemInstance* weapon;
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
|
||||
if(weapon && weapon->IsWeapon()){
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::inventory::slotPrimary, weapon);
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::invslot::slotPrimary, weapon);
|
||||
}
|
||||
else {
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (weapon && weapon->IsWeapon())
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::inventory::slotSecondary, weapon);
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::invslot::slotSecondary, weapon);
|
||||
else {
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotRange);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::invslot::slotRange);
|
||||
if (weapon && weapon->IsWeapon())
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::inventory::slotRange, weapon);
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::invslot::slotRange, weapon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, 0, 0, avoid_override);
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::invslot::slotPrimary, 0, 0, 0, avoid_override);
|
||||
|
||||
|
||||
Message(0, "#Tune - Begin Parse [Interval %i Max Loop Iterations %i]", interval, max_loop);
|
||||
@@ -690,7 +690,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, EQEmu::inventory::slotPrimary, 0, false, 0, avoid_override, add_acc);
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::invslot::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);
|
||||
@@ -705,7 +705,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
|
||||
|
||||
if (end){
|
||||
|
||||
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, Msg, 0, avoid_override);//Display Stat Report
|
||||
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::invslot::slotPrimary, 0, Msg, 0, avoid_override);//Display Stat Report
|
||||
|
||||
Message(0, " ");
|
||||
|
||||
@@ -741,24 +741,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.
|
||||
EQEmu::ItemInstance* weapon;
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::invslot::slotPrimary);
|
||||
|
||||
if(weapon && weapon->IsWeapon()){
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::inventory::slotPrimary, weapon);
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::invslot::slotPrimary, weapon);
|
||||
}
|
||||
else {
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::invslot::slotSecondary);
|
||||
if (weapon && weapon->IsWeapon())
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::inventory::slotSecondary, weapon);
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::invslot::slotSecondary, weapon);
|
||||
else {
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotRange);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::invslot::slotRange);
|
||||
if (weapon && weapon->IsWeapon())
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::inventory::slotRange, weapon);
|
||||
skillinuse = attacker->CastToClient()->AttackAnimation(EQEmu::invslot::slotRange, weapon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, 0, acc_override, 0);
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::invslot::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);
|
||||
@@ -768,7 +768,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, EQEmu::inventory::slotPrimary, 0, 0, acc_override, 0, 0, add_avoid);
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::invslot::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);
|
||||
@@ -783,7 +783,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
|
||||
|
||||
if (end){
|
||||
|
||||
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, Msg, acc_override, 0);//Display Stat Report
|
||||
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::invslot::slotPrimary, 0, Msg, acc_override, 0);//Display Stat Report
|
||||
|
||||
Message(0, " ");
|
||||
|
||||
|
||||
+15
-15
@@ -673,7 +673,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, EQEmu::ItemInstance* cont
|
||||
uint8 index = (uint8)atoi(row[0]);
|
||||
uint32 item_id = (uint32)atoi(row[1]);
|
||||
int8 charges = (int8)atoi(row[2]);
|
||||
uint32 aug[EQEmu::inventory::SocketCount];
|
||||
uint32 aug[EQEmu::invaug::SOCKET_COUNT];
|
||||
aug[0] = (uint32)atoi(row[3]);
|
||||
aug[1] = (uint32)atoi(row[4]);
|
||||
aug[2] = (uint32)atoi(row[5]);
|
||||
@@ -683,7 +683,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, EQEmu::ItemInstance* cont
|
||||
|
||||
EQEmu::ItemInstance* inst = database.CreateItem(item_id, charges);
|
||||
if (inst && inst->GetItem()->IsClassCommon()) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++)
|
||||
if (aug[i])
|
||||
inst->PutAugment(&database, i, aug[i]);
|
||||
// Put item inside world container
|
||||
@@ -706,17 +706,17 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const EQ
|
||||
DeleteWorldContainer(parent_id,zone_id);
|
||||
|
||||
// Save all 10 items, if they exist
|
||||
for (uint8 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; index++) {
|
||||
for (uint8 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; index++) {
|
||||
|
||||
EQEmu::ItemInstance* inst = container->GetItem(index);
|
||||
if (!inst)
|
||||
continue;
|
||||
|
||||
uint32 item_id = inst->GetItem()->ID;
|
||||
uint32 augslot[EQEmu::inventory::SocketCount] = { 0, 0, 0, 0, 0, 0 };
|
||||
uint32 augslot[EQEmu::invaug::SOCKET_COUNT] = { 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
if (inst->IsType(EQEmu::item::ItemClassCommon)) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
for (int i = EQEmu::invaug::SOCKET_BEGIN; i <= EQEmu::invaug::SOCKET_END; i++) {
|
||||
EQEmu::ItemInstance *auginst=inst->GetAugment(i);
|
||||
augslot[i]=(auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
|
||||
}
|
||||
@@ -1367,11 +1367,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::legacy::BANDOLIERS_SIZE);
|
||||
character_id, EQEmu::profile::BANDOLIERS_SIZE);
|
||||
auto results = database.QueryDatabase(query); int i = 0; int r = 0; int si = 0;
|
||||
for (i = 0; i < EQEmu::legacy::BANDOLIERS_SIZE; i++) {
|
||||
for (i = 0; i < EQEmu::profile::BANDOLIERS_SIZE; i++) {
|
||||
pp->bandoliers[i].Name[0] = '\0';
|
||||
for (int si = 0; si < EQEmu::legacy::BANDOLIER_ITEM_COUNT; si++) {
|
||||
for (int si = 0; si < EQEmu::profile::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';
|
||||
@@ -1405,7 +1405,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::legacy::TRIBUTE_SIZE; i++){
|
||||
for (i = 0; i < EQEmu::invtype::TRIBUTE_SIZE; i++){
|
||||
pp->tributes[i].tribute = 0xFFFFFFFF;
|
||||
pp->tributes[i].tier = 0;
|
||||
}
|
||||
@@ -1424,10 +1424,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::legacy::POTION_BELT_ITEM_COUNT);
|
||||
character_id, EQEmu::profile::POTION_BELT_SIZE);
|
||||
auto results = database.QueryDatabase(query);
|
||||
int i = 0;
|
||||
for (i = 0; i < EQEmu::legacy::POTION_BELT_ITEM_COUNT; i++) {
|
||||
for (i = 0; i < EQEmu::profile::POTION_BELT_SIZE; i++) {
|
||||
pp->potionbelt.Items[i].Icon = 0;
|
||||
pp->potionbelt.Items[i].ID = 0;
|
||||
pp->potionbelt.Items[i].Name[0] = '\0';
|
||||
@@ -1525,7 +1525,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::legacy::TRIBUTE_SIZE; i++){
|
||||
for (int i = 0; i < EQEmu::invtype::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);
|
||||
@@ -2906,7 +2906,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) {
|
||||
|
||||
int itemCount = 0;
|
||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||
if (itemCount == EQEmu::legacy::EQUIPMENT_SIZE)
|
||||
if (itemCount == EQEmu::invslot::EQUIPMENT_COUNT)
|
||||
break;
|
||||
|
||||
if(atoi(row[0]) == 0)
|
||||
@@ -3456,7 +3456,7 @@ void ZoneDatabase::SavePetInfo(Client *client)
|
||||
query.clear();
|
||||
|
||||
// pet inventory!
|
||||
for (int index = EQEmu::legacy::EQUIPMENT_BEGIN; index <= EQEmu::legacy::EQUIPMENT_END; index++) {
|
||||
for (int index = EQEmu::invslot::EQUIPMENT_BEGIN; index <= EQEmu::invslot::EQUIPMENT_END; index++) {
|
||||
if (!petinfo->Items[index])
|
||||
continue;
|
||||
|
||||
@@ -3588,7 +3588,7 @@ void ZoneDatabase::LoadPetInfo(Client *client)
|
||||
continue;
|
||||
|
||||
int slot = atoi(row[1]);
|
||||
if (slot < EQEmu::legacy::EQUIPMENT_BEGIN || slot > EQEmu::legacy::EQUIPMENT_END)
|
||||
if (slot < EQEmu::invslot::EQUIPMENT_BEGIN || slot > EQEmu::invslot::EQUIPMENT_END)
|
||||
continue;
|
||||
|
||||
pi->Items[slot] = atoul(row[2]);
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ struct PetInfo {
|
||||
uint32 Mana;
|
||||
float size;
|
||||
SpellBuff_Struct Buffs[PET_BUFF_COUNT];
|
||||
uint32 Items[EQEmu::legacy::EQUIPMENT_SIZE];
|
||||
uint32 Items[EQEmu::invslot::EQUIPMENT_COUNT];
|
||||
char Name[64];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user