mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Added class EQEmu::InventorySlot
This commit is contained in:
+53
-53
@@ -132,7 +132,7 @@ bool Mob::AttackAnimation(EQEmu::skills::SkillType &skillinuse, int Hand, const
|
||||
}
|
||||
|
||||
// If we're attacking with the secondary hand, play the dual wield anim
|
||||
if (Hand == EQEmu::legacy::SlotSecondary) // DW anim
|
||||
if (Hand == EQEmu::inventory::slotSecondary) // DW anim
|
||||
type = animDualWield;
|
||||
|
||||
DoAnim(type);
|
||||
@@ -373,7 +373,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
|
||||
// riposte -- it may seem crazy, but if the attacker has SPA 173 on them, they are immune to Ripo
|
||||
bool ImmuneRipo = attacker->aabonuses.RiposteChance || attacker->spellbonuses.RiposteChance || attacker->itembonuses.RiposteChance;
|
||||
// Need to check if we have something in MainHand to actually attack with (or fists)
|
||||
if (hand != EQEmu::legacy::SlotRange && (CanThisClassRiposte() || IsEnraged()) && InFront && !ImmuneRipo) {
|
||||
if (hand != EQEmu::inventory::slotRange && (CanThisClassRiposte() || IsEnraged()) && InFront && !ImmuneRipo) {
|
||||
if (IsEnraged()) {
|
||||
damage = -3;
|
||||
Log.Out(Logs::Detail, Logs::Combat, "I am enraged, riposting frontal attack.");
|
||||
@@ -395,7 +395,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
|
||||
chance -= chance * counter;
|
||||
}
|
||||
// AA Slippery Attacks
|
||||
if (hand == EQEmu::legacy::SlotSecondary) {
|
||||
if (hand == EQEmu::inventory::slotSecondary) {
|
||||
int slip = aabonuses.OffhandRiposteFail + itembonuses.OffhandRiposteFail + spellbonuses.OffhandRiposteFail;
|
||||
chance += chance * slip / 100;
|
||||
}
|
||||
@@ -440,7 +440,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
|
||||
}
|
||||
|
||||
// parry
|
||||
if (CanThisClassParry() && InFront && hand != EQEmu::legacy::SlotRange) {
|
||||
if (CanThisClassParry() && InFront && hand != EQEmu::inventory::slotRange) {
|
||||
if (IsClient())
|
||||
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillParry, other, -10);
|
||||
// check auto discs ... I guess aa/items too :P
|
||||
@@ -927,7 +927,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::legacy::SlotHands);
|
||||
const EQEmu::ItemInstance *gloves = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotHands);
|
||||
if (gloves)
|
||||
MagicGloves = gloves->GetItemMagical(true);
|
||||
}
|
||||
@@ -1036,12 +1036,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;
|
||||
if (Hand == EQEmu::legacy::SlotSecondary){ // Kaiyodo - Pick weapon from the attacking hand
|
||||
weapon = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
|
||||
if (Hand == EQEmu::inventory::slotSecondary){ // Kaiyodo - Pick weapon from the attacking hand
|
||||
weapon = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
OffHandAtk(true);
|
||||
}
|
||||
else{
|
||||
weapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary);
|
||||
weapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
OffHandAtk(false);
|
||||
}
|
||||
|
||||
@@ -1109,7 +1109,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
|
||||
int ucDamageBonus = 0;
|
||||
|
||||
if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass())
|
||||
if (Hand == EQEmu::inventory::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.
|
||||
@@ -1122,7 +1122,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::legacy::SlotSecondary) {
|
||||
if (Hand == EQEmu::inventory::slotSecondary) {
|
||||
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
|
||||
|
||||
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr, true);
|
||||
@@ -1583,28 +1583,28 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
FaceTarget(GetTarget());
|
||||
|
||||
EQEmu::skills::SkillType skillinuse = EQEmu::skills::SkillHandtoHand;
|
||||
if (Hand == EQEmu::legacy::SlotPrimary) {
|
||||
if (Hand == EQEmu::inventory::slotPrimary) {
|
||||
skillinuse = static_cast<EQEmu::skills::SkillType>(GetPrimSkill());
|
||||
OffHandAtk(false);
|
||||
}
|
||||
if (Hand == EQEmu::legacy::SlotSecondary) {
|
||||
if (Hand == EQEmu::inventory::slotSecondary) {
|
||||
skillinuse = 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::legacy::SlotPrimary && equipment[EQEmu::legacy::SlotPrimary] > 0)
|
||||
weapon = database.GetItem(equipment[EQEmu::legacy::SlotPrimary]);
|
||||
else if (equipment[EQEmu::legacy::SlotSecondary])
|
||||
weapon = database.GetItem(equipment[EQEmu::legacy::SlotSecondary]);
|
||||
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]);
|
||||
|
||||
//We dont factor much from the weapon into the attack.
|
||||
//Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons
|
||||
if(weapon) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID);
|
||||
|
||||
if (Hand == EQEmu::legacy::SlotSecondary && weapon->ItemType == EQEmu::item::ItemTypeShield){
|
||||
if (Hand == EQEmu::inventory::slotSecondary && weapon->ItemType == EQEmu::item::ItemTypeShield){
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attack with shield canceled.");
|
||||
return false;
|
||||
}
|
||||
@@ -3501,7 +3501,7 @@ void Mob::TryDefensiveProc(Mob *on, uint16 hand) {
|
||||
float ProcChance, ProcBonus;
|
||||
on->GetDefensiveProcChances(ProcBonus, ProcChance, hand , this);
|
||||
|
||||
if (hand != EQEmu::legacy::SlotPrimary)
|
||||
if (hand != EQEmu::inventory::slotPrimary)
|
||||
ProcChance /= 2;
|
||||
|
||||
int level_penalty = 0;
|
||||
@@ -3574,7 +3574,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::legacy::SlotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
if (hand != EQEmu::inventory::slotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
ProcChance /= 2;
|
||||
|
||||
// Try innate proc on weapon
|
||||
@@ -3611,7 +3611,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
|
||||
proced = false;
|
||||
|
||||
if (!proced && inst) {
|
||||
for (int r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) {
|
||||
for (int r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
|
||||
const EQEmu::ItemInstance *aug_i = inst->GetAugment(r);
|
||||
if (!aug_i) // no aug, try next slot!
|
||||
continue;
|
||||
@@ -3652,11 +3652,11 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
float ProcChance = 0.0f;
|
||||
ProcChance = GetProcChances(ProcBonus, hand);
|
||||
|
||||
if (hand != EQEmu::legacy::SlotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
if (hand != EQEmu::inventory::slotPrimary) //Is Archery intened to proc at 50% rate?
|
||||
ProcChance /= 2;
|
||||
|
||||
bool rangedattk = false;
|
||||
if (weapon && hand == EQEmu::legacy::SlotRange) {
|
||||
if (weapon && hand == EQEmu::inventory::slotRange) {
|
||||
if (weapon->ItemType == EQEmu::item::ItemTypeArrow ||
|
||||
weapon->ItemType == EQEmu::item::ItemTypeLargeThrowing ||
|
||||
weapon->ItemType == EQEmu::item::ItemTypeSmallThrowing ||
|
||||
@@ -3665,11 +3665,11 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
}
|
||||
}
|
||||
|
||||
if (!weapon && hand == EQEmu::legacy::SlotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
|
||||
if (!weapon && hand == EQEmu::inventory::slotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
|
||||
rangedattk = true;
|
||||
|
||||
for (uint32 i = 0; i < MAX_PROCS; i++) {
|
||||
if (IsPet() && hand != EQEmu::legacy::SlotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
|
||||
if (IsPet() && hand != EQEmu::inventory::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
|
||||
@@ -3732,7 +3732,7 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
}
|
||||
}
|
||||
|
||||
if (HasSkillProcs() && hand != EQEmu::legacy::SlotRange){ //We check ranged skill procs within the attack functions.
|
||||
if (HasSkillProcs() && hand != EQEmu::inventory::slotRange){ //We check ranged skill procs within the attack functions.
|
||||
uint16 skillinuse = 28;
|
||||
if (weapon)
|
||||
skillinuse = GetSkillByItemType(weapon->ItemType);
|
||||
@@ -3980,7 +3980,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
if (!defender)
|
||||
return;
|
||||
|
||||
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
|
||||
@@ -3991,7 +3991,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
"Preforming a double riposted from SE_DoubleRiposte (%d percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
}
|
||||
@@ -4004,7 +4004,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
"Preforming a double riposted from SE_GiveDoubleRiposte base1 == 0 (%d percent chance)",
|
||||
DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
}
|
||||
@@ -4288,7 +4288,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::legacy::SlotPrimary)
|
||||
if (hand != EQEmu::inventory::slotPrimary)
|
||||
ProcChance /= 2;
|
||||
}
|
||||
|
||||
@@ -4478,13 +4478,13 @@ void Client::SetAttackTimer()
|
||||
|
||||
Timer *TimerToUse = nullptr;
|
||||
|
||||
for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) {
|
||||
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
|
||||
//pick a timer
|
||||
if (i == EQEmu::legacy::SlotPrimary)
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
TimerToUse = &attack_timer;
|
||||
else if (i == EQEmu::legacy::SlotRange)
|
||||
else if (i == EQEmu::inventory::slotRange)
|
||||
TimerToUse = &ranged_timer;
|
||||
else if (i == EQEmu::legacy::SlotSecondary)
|
||||
else if (i == EQEmu::inventory::slotSecondary)
|
||||
TimerToUse = &attack_dw_timer;
|
||||
else //invalid slot (hands will always hit this)
|
||||
continue;
|
||||
@@ -4497,7 +4497,7 @@ void Client::SetAttackTimer()
|
||||
ItemToUse = ci->GetItem();
|
||||
|
||||
//special offhand stuff
|
||||
if (i == EQEmu::legacy::SlotSecondary) {
|
||||
if (i == EQEmu::inventory::slotSecondary) {
|
||||
//if we cant dual wield, skip it
|
||||
if (!CanThisClassDualWield() || HasTwoHanderEquipped()) {
|
||||
attack_dw_timer.Disable();
|
||||
@@ -4571,19 +4571,19 @@ void NPC::SetAttackTimer()
|
||||
else
|
||||
speed = static_cast<int>(((attack_delay / haste_mod) + ((hhe / 100.0f) * attack_delay)) * 100);
|
||||
|
||||
for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) {
|
||||
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
|
||||
//pick a timer
|
||||
if (i == EQEmu::legacy::SlotPrimary)
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
TimerToUse = &attack_timer;
|
||||
else if (i == EQEmu::legacy::SlotRange)
|
||||
else if (i == EQEmu::inventory::slotRange)
|
||||
TimerToUse = &ranged_timer;
|
||||
else if (i == EQEmu::legacy::SlotSecondary)
|
||||
else if (i == EQEmu::inventory::slotSecondary)
|
||||
TimerToUse = &attack_dw_timer;
|
||||
else //invalid slot (hands will always hit this)
|
||||
continue;
|
||||
|
||||
//special offhand stuff
|
||||
if (i == EQEmu::legacy::SlotSecondary) {
|
||||
if (i == EQEmu::inventory::slotSecondary) {
|
||||
// SPECATK_QUAD is uncheesable
|
||||
if(!CanThisClassDualWield() || (HasTwoHanderEquipped() && !GetSpecialAbility(SPECATK_QUAD))) {
|
||||
attack_dw_timer.Disable();
|
||||
@@ -4605,7 +4605,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::legacy::SlotSecondary)
|
||||
if (candouble && hand == EQEmu::inventory::slotSecondary)
|
||||
candouble = GetSkill(EQEmu::skills::SkillDoubleAttack) > 149 || (aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack) > 0;
|
||||
|
||||
if (candouble) {
|
||||
@@ -4613,7 +4613,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
|
||||
if (CheckDoubleAttack()) {
|
||||
Attack(target, hand, false, false, IsFromSpell);
|
||||
// you can only triple from the main hand
|
||||
if (hand == EQEmu::legacy::SlotPrimary && CanThisClassTripleAttack()) {
|
||||
if (hand == EQEmu::inventory::slotPrimary && CanThisClassTripleAttack()) {
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillTripleAttack, target, -10);
|
||||
if (CheckTripleAttack())
|
||||
Attack(target, hand, false, false, IsFromSpell);
|
||||
@@ -4621,7 +4621,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
|
||||
}
|
||||
}
|
||||
|
||||
if (hand == EQEmu::legacy::SlotPrimary) {
|
||||
if (hand == EQEmu::inventory::slotPrimary) {
|
||||
// According to http://www.monkly-business.net/forums/showpost.php?p=312095&postcount=168 a dev told them flurry isn't dependant on triple attack
|
||||
// the parses kind of back that up and all of my parses seemed to be 4 or 5 attacks in the round which would work out to be
|
||||
// doubles or triples with 2 from flurries or triple with 1 or 2 flurries ... Going with the "dev quote" I guess like we've always had it
|
||||
@@ -4674,9 +4674,9 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec
|
||||
if (RuleB(Combat, UseLiveCombatRounds)) {
|
||||
// A "quad" on live really is just a successful dual wield where both double attack
|
||||
// The mobs that could triple lost the ability to when the triple attack skill was added in
|
||||
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
|
||||
if (CanThisClassDoubleAttack() && CheckDoubleAttack()){
|
||||
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
|
||||
|
||||
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){
|
||||
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
|
||||
@@ -4690,14 +4690,14 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec
|
||||
if (IsNPC()) {
|
||||
int16 n_atk = CastToNPC()->GetNumberOfAttacks();
|
||||
if (n_atk <= 1) {
|
||||
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
|
||||
} else {
|
||||
for (int i = 0; i < n_atk; ++i) {
|
||||
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
|
||||
}
|
||||
|
||||
// we use this random value in three comparisons with different
|
||||
@@ -4708,15 +4708,15 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec
|
||||
// check double attack, this is NOT the same rules that clients use...
|
||||
&&
|
||||
RandRoll < (GetLevel() + NPCDualAttackModifier)) {
|
||||
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
|
||||
// lets see if we can do a triple attack with the main hand
|
||||
// pets are excluded from triple and quads...
|
||||
if ((GetSpecialAbility(SPECATK_TRIPLE) || GetSpecialAbility(SPECATK_QUAD)) && !IsPet() &&
|
||||
RandRoll < (GetLevel() + NPCTripleAttackModifier)) {
|
||||
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
|
||||
// now lets check the quad attack
|
||||
if (GetSpecialAbility(SPECATK_QUAD) && RandRoll < (GetLevel() + NPCQuadAttackModifier)) {
|
||||
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special);
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts, special);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4730,11 +4730,11 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int speci
|
||||
// For now, SPECATK_QUAD means innate DW when Combat:UseLiveCombatRounds is true
|
||||
if ((GetSpecialAbility(SPECATK_INNATE_DW) ||
|
||||
(RuleB(Combat, UseLiveCombatRounds) && GetSpecialAbility(SPECATK_QUAD))) ||
|
||||
GetEquipment(EQEmu::textures::TextureSecondary) != 0) {
|
||||
GetEquipment(EQEmu::textures::weaponSecondary) != 0) {
|
||||
if (CheckDualWield()) {
|
||||
Attack(target, EQEmu::legacy::SlotSecondary, false, false, false, opts, special);
|
||||
Attack(target, EQEmu::inventory::slotSecondary, false, false, false, opts, special);
|
||||
if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()){
|
||||
Attack(target, EQEmu::legacy::SlotSecondary, false, false, false, opts, special);
|
||||
Attack(target, EQEmu::inventory::slotSecondary, false, false, false, opts, special);
|
||||
|
||||
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){
|
||||
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
|
||||
|
||||
+1
-1
@@ -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, int special = 0) { return; }
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return false; }
|
||||
|
||||
+17
-17
@@ -145,28 +145,28 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
|
||||
|
||||
unsigned int i;
|
||||
// Update: MainAmmo should only calc skill mods (TODO: Check for other cases)
|
||||
for (i = EQEmu::legacy::SlotCharm; i <= EQEmu::legacy::SlotAmmo; i++) {
|
||||
for (i = EQEmu::inventory::slotCharm; i <= EQEmu::inventory::slotAmmo; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::legacy::SlotAmmo));
|
||||
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::inventory::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::legacy::SlotSecondary && (item && item->ItemType == EQEmu::item::ItemTypeShield))
|
||||
if (i == EQEmu::inventory::slotSecondary && (item && item->ItemType == EQEmu::item::ItemTypeShield))
|
||||
SetShieldEquiped(true);
|
||||
else if (i == EQEmu::legacy::SlotPrimary && (item && item->ItemType == EQEmu::item::ItemType2HBlunt)) {
|
||||
else if (i == EQEmu::inventory::slotPrimary && (item && item->ItemType == EQEmu::item::ItemType2HBlunt)) {
|
||||
SetTwoHandBluntEquiped(true);
|
||||
SetTwoHanderEquipped(true);
|
||||
}
|
||||
else if (i == EQEmu::legacy::SlotPrimary && (item && (item->ItemType == EQEmu::item::ItemType2HSlash || item->ItemType == EQEmu::item::ItemType2HPiercing)))
|
||||
else if (i == EQEmu::inventory::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::legacy::SlotPowerSource];
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotPowerSource];
|
||||
if(inst)
|
||||
AddItemBonuses(inst, newbon);
|
||||
}
|
||||
@@ -181,7 +181,7 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
|
||||
|
||||
//Optional ability to have worn effects calculate as an addititive bonus instead of highest value
|
||||
if (RuleI(Spells, AdditiveBonusWornType) && RuleI(Spells, AdditiveBonusWornType) != EQEmu::item::ItemEffectWorn){
|
||||
for (i = EQEmu::legacy::SlotCharm; i < EQEmu::legacy::SlotAmmo; i++) {
|
||||
for (i = EQEmu::inventory::slotCharm; i < EQEmu::inventory::slotAmmo; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
@@ -527,7 +527,7 @@ void Client::AddItemBonuses(const EQEmu::ItemInstance *inst, StatBonuses *newbon
|
||||
}
|
||||
|
||||
if (!isAug) {
|
||||
for (int i = 0; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++)
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
|
||||
AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item);
|
||||
}
|
||||
}
|
||||
@@ -565,7 +565,7 @@ void Client::AdditiveWornBonuses(const EQEmu::ItemInstance *inst, StatBonuses* n
|
||||
if (!isAug)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
|
||||
for (i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
AdditiveWornBonuses(inst->GetAugment(i),newbon,true);
|
||||
}
|
||||
}
|
||||
@@ -3299,7 +3299,7 @@ void Client::CalcItemScale() {
|
||||
//Power Source Slot
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
{
|
||||
if (CalcItemScale(EQEmu::legacy::SlotPowerSource, EQEmu::legacy::SlotPowerSource))
|
||||
if (CalcItemScale(EQEmu::inventory::slotPowerSource, EQEmu::inventory::slotPowerSource))
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -3314,7 +3314,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::legacy::SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
if (i == EQEmu::inventory::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);
|
||||
@@ -3344,7 +3344,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
|
||||
}
|
||||
|
||||
//iterate all augments
|
||||
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst)
|
||||
@@ -3393,7 +3393,7 @@ void Client::DoItemEnterZone() {
|
||||
//Power Source Slot
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
{
|
||||
if (DoItemEnterZone(EQEmu::legacy::SlotPowerSource, EQEmu::legacy::SlotPowerSource))
|
||||
if (DoItemEnterZone(EQEmu::inventory::slotPowerSource, EQEmu::inventory::slotPowerSource))
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -3407,7 +3407,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::legacy::SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
if (i == EQEmu::inventory::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);
|
||||
@@ -3429,7 +3429,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::legacy::SlotAmmo || i == EQEmu::legacy::SlotPowerSource) {
|
||||
if (i <= EQEmu::inventory::slotAmmo || i == EQEmu::inventory::slotPowerSource) {
|
||||
parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i);
|
||||
}
|
||||
|
||||
@@ -3439,7 +3439,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
update_slot = true;
|
||||
}
|
||||
} else {
|
||||
if (i <= EQEmu::legacy::SlotAmmo || i == EQEmu::legacy::SlotPowerSource) {
|
||||
if (i <= EQEmu::inventory::slotAmmo || i == EQEmu::inventory::slotPowerSource) {
|
||||
parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i);
|
||||
}
|
||||
|
||||
@@ -3447,7 +3447,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
}
|
||||
|
||||
//iterate all augments
|
||||
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance *a_inst = inst->GetAugment(x);
|
||||
if(!a_inst)
|
||||
|
||||
+115
-115
@@ -229,8 +229,8 @@ void Bot::SetBotSpellID(uint32 newSpellID) {
|
||||
}
|
||||
|
||||
uint32 Bot::GetBotArcheryRange() {
|
||||
const EQEmu::ItemInstance *range_inst = GetBotItem(EQEmu::legacy::SlotRange);
|
||||
const EQEmu::ItemInstance *ammo_inst = GetBotItem(EQEmu::legacy::SlotAmmo);
|
||||
const EQEmu::ItemInstance *range_inst = GetBotItem(EQEmu::inventory::slotRange);
|
||||
const EQEmu::ItemInstance *ammo_inst = GetBotItem(EQEmu::inventory::slotAmmo);
|
||||
if (!range_inst || !ammo_inst)
|
||||
return 0;
|
||||
|
||||
@@ -246,15 +246,15 @@ uint32 Bot::GetBotArcheryRange() {
|
||||
void Bot::ChangeBotArcherWeapons(bool isArcher) {
|
||||
if((GetClass()==WARRIOR) || (GetClass()==PALADIN) || (GetClass()==RANGER) || (GetClass()==SHADOWKNIGHT) || (GetClass()==ROGUE)) {
|
||||
if(!isArcher) {
|
||||
BotAddEquipItem(EQEmu::legacy::SlotPrimary, GetBotItemBySlot(EQEmu::legacy::SlotPrimary));
|
||||
BotAddEquipItem(EQEmu::legacy::SlotSecondary, GetBotItemBySlot(EQEmu::legacy::SlotSecondary));
|
||||
BotAddEquipItem(EQEmu::inventory::slotPrimary, GetBotItemBySlot(EQEmu::inventory::slotPrimary));
|
||||
BotAddEquipItem(EQEmu::inventory::slotSecondary, GetBotItemBySlot(EQEmu::inventory::slotSecondary));
|
||||
SetAttackTimer();
|
||||
BotGroupSay(this, "My blade is ready");
|
||||
} else {
|
||||
BotRemoveEquipItem(EQEmu::legacy::SlotPrimary);
|
||||
BotRemoveEquipItem(EQEmu::legacy::SlotSecondary);
|
||||
BotAddEquipItem(EQEmu::legacy::SlotAmmo, GetBotItemBySlot(EQEmu::legacy::SlotAmmo));
|
||||
BotAddEquipItem(EQEmu::legacy::SlotSecondary, GetBotItemBySlot(EQEmu::legacy::SlotRange));
|
||||
BotRemoveEquipItem(EQEmu::inventory::slotPrimary);
|
||||
BotRemoveEquipItem(EQEmu::inventory::slotSecondary);
|
||||
BotAddEquipItem(EQEmu::inventory::slotAmmo, GetBotItemBySlot(EQEmu::inventory::slotAmmo));
|
||||
BotAddEquipItem(EQEmu::inventory::slotSecondary, GetBotItemBySlot(EQEmu::inventory::slotRange));
|
||||
SetAttackTimer();
|
||||
BotGroupSay(this, "My bow is true and ready");
|
||||
}
|
||||
@@ -1175,11 +1175,11 @@ void Bot::GenerateArmorClass() {
|
||||
|
||||
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::legacy::SlotPrimary);
|
||||
bool equiped = m_inv.GetItem(EQEmu::inventory::slotPrimary);
|
||||
if(!equiped)
|
||||
skill = EQEmu::skills::SkillHandtoHand;
|
||||
else {
|
||||
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
uint8 type = m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
switch(type) {
|
||||
case EQEmu::item::ItemType1HSlash:
|
||||
skill = EQEmu::skills::Skill1HSlashing;
|
||||
@@ -1900,12 +1900,12 @@ void Bot::BotRangedAttack(Mob* other) {
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance* rangedItem = GetBotItem(EQEmu::legacy::SlotRange);
|
||||
EQEmu::ItemInstance* rangedItem = GetBotItem(EQEmu::inventory::slotRange);
|
||||
const EQEmu::ItemData* RangeWeapon = 0;
|
||||
if(rangedItem)
|
||||
RangeWeapon = rangedItem->GetItem();
|
||||
|
||||
EQEmu::ItemInstance* ammoItem = GetBotItem(EQEmu::legacy::SlotAmmo);
|
||||
EQEmu::ItemInstance* ammoItem = GetBotItem(EQEmu::inventory::slotAmmo);
|
||||
const EQEmu::ItemData* Ammo = 0;
|
||||
if(ammoItem)
|
||||
Ammo = ammoItem->GetItem();
|
||||
@@ -2002,7 +2002,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
|
||||
|
||||
int damage = 0;
|
||||
uint32 hate = 0;
|
||||
int Hand = EQEmu::legacy::SlotPrimary;
|
||||
int Hand = EQEmu::inventory::slotPrimary;
|
||||
if (hate == 0 && weapon_damage > 1)
|
||||
hate = weapon_damage;
|
||||
|
||||
@@ -2031,7 +2031,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
|
||||
else
|
||||
damage = zone->random.Int(min_hit, max_hit);
|
||||
|
||||
if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::legacy::SlotRange : EQEmu::legacy::SlotPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior
|
||||
if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::inventory::slotRange : EQEmu::inventory::slotPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior
|
||||
if (damage == -3) {
|
||||
DoRiposte(other);
|
||||
if (HasDied())
|
||||
@@ -2056,7 +2056,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
|
||||
damage = -5;
|
||||
|
||||
if (skillinuse == EQEmu::skills::SkillBash){
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemData* botweapon = 0;
|
||||
if(inst)
|
||||
botweapon = inst->GetItem();
|
||||
@@ -2103,15 +2103,15 @@ 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::legacy::SlotFeet;
|
||||
item_slot = EQEmu::inventory::slotFeet;
|
||||
break;
|
||||
case EQEmu::skills::SkillBash:
|
||||
item_slot = EQEmu::legacy::SlotSecondary;
|
||||
item_slot = EQEmu::inventory::slotSecondary;
|
||||
break;
|
||||
case EQEmu::skills::SkillDragonPunch:
|
||||
case EQEmu::skills::SkillEagleStrike:
|
||||
case EQEmu::skills::SkillTigerClaw:
|
||||
item_slot = EQEmu::legacy::SlotHands;
|
||||
item_slot = EQEmu::inventory::slotHands;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2449,23 +2449,23 @@ void Bot::AI_Process() {
|
||||
// First, special attack per class (kick, backstab etc..)
|
||||
DoClassAttacks(GetTarget());
|
||||
if(attack_timer.Check()) {
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary);
|
||||
TriggerDefensiveProcs(GetTarget(), EQEmu::legacy::SlotPrimary, false);
|
||||
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::legacy::SlotPrimary);
|
||||
TryWeaponProc(wpn, GetTarget(), EQEmu::legacy::SlotPrimary);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary);
|
||||
TriggerDefensiveProcs(GetTarget(), EQEmu::inventory::slotPrimary, false);
|
||||
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
TryWeaponProc(wpn, GetTarget(), EQEmu::inventory::slotPrimary);
|
||||
bool tripleSuccess = false;
|
||||
if(BotOwner && GetTarget() && CanThisClassDoubleAttack()) {
|
||||
if(BotOwner && CheckBotDoubleAttack())
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
|
||||
|
||||
if(BotOwner && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE) && CheckBotDoubleAttack(true)) {
|
||||
tripleSuccess = true;
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
|
||||
}
|
||||
|
||||
//quad attack, does this belong here??
|
||||
if(BotOwner && GetTarget() && GetSpecialAbility(SPECATK_QUAD) && CheckBotDoubleAttack(true))
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
|
||||
}
|
||||
|
||||
//Live AA - Flurry, Rapid Strikes ect (Flurry does not require Triple Attack).
|
||||
@@ -2473,18 +2473,18 @@ void Bot::AI_Process() {
|
||||
if (GetTarget() && flurrychance) {
|
||||
if(zone->random.Int(0, 100) < flurrychance) {
|
||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
int32 ExtraAttackChanceBonus = (spellbonuses.ExtraAttackChance + itembonuses.ExtraAttackChance + aabonuses.ExtraAttackChance);
|
||||
if (GetTarget() && ExtraAttackChanceBonus) {
|
||||
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::legacy::SlotPrimary);
|
||||
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
if(wpn) {
|
||||
if (wpn->GetItem()->IsType2HWeapon()) {
|
||||
if(zone->random.Int(0, 100) < ExtraAttackChanceBonus)
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2504,7 +2504,7 @@ void Bot::AI_Process() {
|
||||
|
||||
//now off hand
|
||||
if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) {
|
||||
const EQEmu::ItemInstance* instweapon = GetBotItem(EQEmu::legacy::SlotSecondary);
|
||||
const EQEmu::ItemInstance* instweapon = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemData* weapon = 0;
|
||||
//can only dual wield without a weapon if you're a monk
|
||||
if(instweapon || (botClass == MONK)) {
|
||||
@@ -2526,12 +2526,12 @@ void Bot::AI_Process() {
|
||||
DualWieldProbability += (DualWieldProbability * float(DWBonus) / 100.0f);
|
||||
float random = zone->random.Real(0, 1);
|
||||
if (random < DualWieldProbability){ // Max 78% of DW
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
|
||||
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::legacy::SlotSecondary);
|
||||
TryWeaponProc(wpn, GetTarget(), EQEmu::legacy::SlotSecondary);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotSecondary); // Single attack with offhand
|
||||
EQEmu::ItemInstance *wpn = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
TryWeaponProc(wpn, GetTarget(), EQEmu::inventory::slotSecondary);
|
||||
if( CanThisClassDoubleAttack() && CheckBotDoubleAttack()) {
|
||||
if(GetTarget() && GetTarget()->GetHP() > -10)
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
|
||||
Attack(GetTarget(), EQEmu::inventory::slotSecondary); // Single attack with offhand
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2702,12 +2702,12 @@ void Bot::PetAIProcess() {
|
||||
if(!botPet->BehindMob(botPet->GetTarget(), botPet->GetX(), botPet->GetY()) && botPet->GetTarget()->IsEnraged())
|
||||
return;
|
||||
|
||||
if (botPet->Attack(GetTarget(), EQEmu::legacy::SlotPrimary)) // try the main hand
|
||||
if (botPet->Attack(GetTarget(), EQEmu::inventory::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::legacy::SlotPrimary)) {}
|
||||
if (botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotPrimary)) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2745,11 +2745,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::legacy::SlotSecondary);
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotSecondary);
|
||||
if (botPet->CanThisClassDoubleAttack()) {
|
||||
int32 RandRoll = zone->random.Int(0, 99);
|
||||
if (RandRoll < (botPet->GetLevel() + 20))
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotSecondary);
|
||||
botPet->Attack(botPet->GetTarget(), EQEmu::inventory::slotSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2956,14 +2956,14 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
const EQEmu::ItemInstance* inst = 0;
|
||||
uint32 spawnedbotid = 0;
|
||||
spawnedbotid = this->GetBotID();
|
||||
for (int i = 0; i < EQEmu::textures::TexturePrimary; i++) {
|
||||
for (int i = EQEmu::textures::textureBegin; i < EQEmu::textures::weaponPrimary; i++) {
|
||||
inst = GetBotItem(i);
|
||||
if (inst) {
|
||||
item = inst->GetItem();
|
||||
if (item != 0) {
|
||||
ns->spawn.equipment.Slot[i].Material = item->Material;
|
||||
ns->spawn.equipment.Slot[i].EliteMaterial = item->EliteMaterial;
|
||||
ns->spawn.equipment.Slot[i].HeroForgeModel = item->HerosForgeModel;
|
||||
ns->spawn.equipment.Slot[i].EliteModel = item->EliteMaterial;
|
||||
ns->spawn.equipment.Slot[i].HeroicModel = item->HerosForgeModel;
|
||||
if (armor_tint.Slot[i].Color)
|
||||
ns->spawn.equipment_tint.Slot[i].Color = armor_tint.Slot[i].Color;
|
||||
else
|
||||
@@ -2975,25 +2975,25 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = GetBotItem(EQEmu::legacy::SlotPrimary);
|
||||
inst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
if(strlen(item->IDFile) > 2)
|
||||
ns->spawn.equipment.Primary.Material = atoi(&item->IDFile[2]);
|
||||
|
||||
ns->spawn.equipment_tint.Primary.Color = GetEquipmentColor(EQEmu::textures::TexturePrimary);
|
||||
ns->spawn.equipment_tint.Primary.Color = GetEquipmentColor(EQEmu::textures::weaponPrimary);
|
||||
}
|
||||
}
|
||||
|
||||
inst = GetBotItem(EQEmu::legacy::SlotSecondary);
|
||||
inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
if(strlen(item->IDFile) > 2)
|
||||
ns->spawn.equipment.Secondary.Material = atoi(&item->IDFile[2]);
|
||||
|
||||
ns->spawn.equipment_tint.Secondary.Color = GetEquipmentColor(EQEmu::textures::TextureSecondary);
|
||||
ns->spawn.equipment_tint.Secondary.Color = GetEquipmentColor(EQEmu::textures::weaponSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3237,7 +3237,7 @@ void Bot::BotAddEquipItem(int slot, uint32 id) {
|
||||
if(slot > 0 && id > 0) {
|
||||
uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot);
|
||||
|
||||
if (materialFromSlot != EQEmu::textures::TextureInvalid) {
|
||||
if (materialFromSlot != EQEmu::textures::materialInvalid) {
|
||||
equipment[slot] = id; // npc has more than just material slots. Valid material should mean valid inventory index
|
||||
SendWearChange(materialFromSlot);
|
||||
}
|
||||
@@ -3253,11 +3253,11 @@ void Bot::BotRemoveEquipItem(int slot) {
|
||||
if(slot > 0) {
|
||||
uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot);
|
||||
|
||||
if (materialFromSlot != EQEmu::textures::TextureInvalid) {
|
||||
if (materialFromSlot != EQEmu::textures::materialInvalid) {
|
||||
equipment[slot] = 0; // npc has more than just material slots. Valid material should mean valid inventory index
|
||||
SendWearChange(materialFromSlot);
|
||||
if (materialFromSlot == EQEmu::textures::TextureChest)
|
||||
SendWearChange(EQEmu::textures::TextureArms);
|
||||
if (materialFromSlot == EQEmu::textures::armorChest)
|
||||
SendWearChange(EQEmu::textures::armorArms);
|
||||
}
|
||||
|
||||
UpdateEquipmentLight();
|
||||
@@ -3360,7 +3360,7 @@ void Bot::FinishTrade(Client* client, BotTradeType tradeType) {
|
||||
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::legacy::SlotCursor, EQEmu::legacy::SlotCursor, client);
|
||||
PerformTradeWithClient(EQEmu::inventory::slotCursor, EQEmu::inventory::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);
|
||||
@@ -3389,7 +3389,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
charges[i] = inst->GetCharges();
|
||||
}
|
||||
|
||||
if (i == EQEmu::legacy::SlotCursor)
|
||||
if (i == EQEmu::inventory::slotCursor)
|
||||
UpdateClient = true;
|
||||
|
||||
//EQoffline: will give the items to the bots and change the bot stats
|
||||
@@ -3397,7 +3397,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
std::string TempErrorMessage;
|
||||
const EQEmu::ItemData* mWeaponItem = inst->GetItem();
|
||||
bool failedLoreCheck = false;
|
||||
for (int m = AUG_INDEX_BEGIN; m < EQEmu::legacy::ITEM_COMMON_SIZE; ++m) {
|
||||
for (int m = EQEmu::inventory::socketBegin; m < EQEmu::inventory::SocketCount; ++m) {
|
||||
EQEmu::ItemInstance *itm = inst->GetAugment(m);
|
||||
if(itm)
|
||||
{
|
||||
@@ -3429,17 +3429,17 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
|
||||
how_many_slots++;
|
||||
if(!GetBotItem(j)) {
|
||||
if (j == EQEmu::legacy::SlotPrimary) {
|
||||
if (j == EQEmu::inventory::slotPrimary) {
|
||||
if (mWeaponItem->IsType2HWeapon()) {
|
||||
if (GetBotItem(EQEmu::legacy::SlotSecondary)) {
|
||||
if (GetBotItem(EQEmu::inventory::slotSecondary)) {
|
||||
if (mWeaponItem && mWeaponItem->IsType2HWeapon()) {
|
||||
if (client->CheckLoreConflict(GetBotItem(EQEmu::legacy::SlotSecondary)->GetItem())) {
|
||||
if (client->CheckLoreConflict(GetBotItem(EQEmu::inventory::slotSecondary)->GetItem())) {
|
||||
failedLoreCheck = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::legacy::SlotSecondary);
|
||||
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
|
||||
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
BotTradeSwapItem(client, EQEmu::inventory::slotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3449,7 +3449,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (j == EQEmu::legacy::SlotSecondary) {
|
||||
else if (j == EQEmu::inventory::slotSecondary) {
|
||||
if(inst->IsWeapon()) {
|
||||
if(CanThisClassDualWield()) {
|
||||
BotTradeAddItem(mWeaponItem->ID, inst, inst->GetCharges(), mWeaponItem->Slots, j, &TempErrorMessage);
|
||||
@@ -3465,10 +3465,10 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
success = true;
|
||||
}
|
||||
if(success) {
|
||||
if (GetBotItem(EQEmu::legacy::SlotPrimary)) {
|
||||
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::legacy::SlotPrimary);
|
||||
if (GetBotItem(EQEmu::inventory::slotPrimary)) {
|
||||
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
if (remove_item->GetItem()->IsType2HWeapon()) {
|
||||
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
|
||||
BotTradeSwapItem(client, EQEmu::inventory::slotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3490,7 +3490,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
|
||||
swap_item = GetBotItem(j);
|
||||
failedLoreCheck = false;
|
||||
for (int k = AUG_INDEX_BEGIN; k < EQEmu::legacy::ITEM_COMMON_SIZE; ++k) {
|
||||
for (int k = EQEmu::inventory::socketBegin; k < EQEmu::inventory::SocketCount; ++k) {
|
||||
EQEmu::ItemInstance *itm = swap_item->GetAugment(k);
|
||||
if(itm)
|
||||
{
|
||||
@@ -3503,28 +3503,28 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
failedLoreCheck = true;
|
||||
}
|
||||
if(!failedLoreCheck) {
|
||||
if (j == EQEmu::legacy::SlotPrimary) {
|
||||
if (j == EQEmu::inventory::slotPrimary) {
|
||||
if (mWeaponItem->IsType2HWeapon()) {
|
||||
if (GetBotItem(EQEmu::legacy::SlotSecondary)) {
|
||||
if (client->CheckLoreConflict(GetBotItem(EQEmu::legacy::SlotSecondary)->GetItem())) {
|
||||
if (GetBotItem(EQEmu::inventory::slotSecondary)) {
|
||||
if (client->CheckLoreConflict(GetBotItem(EQEmu::inventory::slotSecondary)->GetItem())) {
|
||||
failedLoreCheck = true;
|
||||
}
|
||||
else {
|
||||
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::legacy::SlotSecondary);
|
||||
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
|
||||
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
BotTradeSwapItem(client, EQEmu::inventory::slotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!failedLoreCheck) {
|
||||
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
|
||||
BotTradeSwapItem(client, EQEmu::inventory::slotPrimary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
|
||||
success = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (j == EQEmu::legacy::SlotSecondary) {
|
||||
else if (j == EQEmu::inventory::slotSecondary) {
|
||||
if(inst->IsWeapon()) {
|
||||
if(CanThisClassDualWield()) {
|
||||
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
|
||||
BotTradeSwapItem(client, EQEmu::inventory::slotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
|
||||
success = true;
|
||||
}
|
||||
else {
|
||||
@@ -3533,13 +3533,13 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
||||
}
|
||||
}
|
||||
else {
|
||||
BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
|
||||
BotTradeSwapItem(client, EQEmu::inventory::slotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage);
|
||||
success = true;
|
||||
}
|
||||
if (success && GetBotItem(EQEmu::legacy::SlotPrimary)) {
|
||||
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::legacy::SlotPrimary);
|
||||
if (success && GetBotItem(EQEmu::inventory::slotPrimary)) {
|
||||
EQEmu::ItemInstance* remove_item = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
if (remove_item->GetItem()->IsType2HWeapon()) {
|
||||
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
|
||||
BotTradeSwapItem(client, EQEmu::inventory::slotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3739,13 +3739,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
|
||||
FaceTarget(GetTarget());
|
||||
EQEmu::ItemInstance* weapon = nullptr;
|
||||
if (Hand == EQEmu::legacy::SlotPrimary) {
|
||||
weapon = GetBotItem(EQEmu::legacy::SlotPrimary);
|
||||
if (Hand == EQEmu::inventory::slotPrimary) {
|
||||
weapon = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
OffHandAtk(false);
|
||||
}
|
||||
|
||||
if (Hand == EQEmu::legacy::SlotSecondary) {
|
||||
weapon = GetBotItem(EQEmu::legacy::SlotSecondary);
|
||||
if (Hand == EQEmu::inventory::slotSecondary) {
|
||||
weapon = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
OffHandAtk(true);
|
||||
}
|
||||
|
||||
@@ -3810,7 +3810,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::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass()) {
|
||||
if (Hand == EQEmu::inventory::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);
|
||||
@@ -3820,7 +3820,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::legacy::SlotSecondary) {
|
||||
if (Hand == EQEmu::inventory::slotSecondary) {
|
||||
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
|
||||
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr);
|
||||
min_hit += (int) ucDamageBonus;
|
||||
@@ -4313,7 +4313,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::ITEM_COMMON_SIZE; ++y) {
|
||||
for (int y = EQEmu::inventory::socketBegin; y < EQEmu::inventory::SocketCount; ++y) {
|
||||
EQEmu::ItemInstance *aug = nullptr;
|
||||
aug = ins->GetAugment(y);
|
||||
if(aug) {
|
||||
@@ -4749,13 +4749,13 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) {
|
||||
float ProcChance = 0.0f;
|
||||
uint32 weapon_speed = 0;
|
||||
switch (hand) {
|
||||
case EQEmu::legacy::SlotPrimary:
|
||||
case EQEmu::inventory::slotPrimary:
|
||||
weapon_speed = attack_timer.GetDuration();
|
||||
break;
|
||||
case EQEmu::legacy::SlotSecondary:
|
||||
case EQEmu::inventory::slotSecondary:
|
||||
weapon_speed = attack_dw_timer.GetDuration();
|
||||
break;
|
||||
case EQEmu::legacy::SlotRange:
|
||||
case EQEmu::inventory::slotRange:
|
||||
weapon_speed = ranged_timer.GetDuration();
|
||||
break;
|
||||
}
|
||||
@@ -4781,7 +4781,7 @@ int Bot::GetHandToHandDamage(void) {
|
||||
// everyone uses this in the revamp!
|
||||
int skill = GetSkill(EQEmu::skills::SkillHandtoHand);
|
||||
int epic = 0;
|
||||
if (CastToNPC()->GetEquipment(EQEmu::textures::TextureHands) == 10652 && GetLevel() > 46)
|
||||
if (CastToNPC()->GetEquipment(EQEmu::textures::armorHands) == 10652 && GetLevel() > 46)
|
||||
epic = 280;
|
||||
if (epic > skill)
|
||||
skill = epic;
|
||||
@@ -4803,7 +4803,7 @@ int Bot::GetHandToHandDamage(void) {
|
||||
9, 9, 9, 9, 9, 10, 10, 10, 10, 10, // 31-40
|
||||
10, 11, 11, 11, 11, 11, 11, 12, 12}; // 41-49
|
||||
if (GetClass() == MONK) {
|
||||
if (CastToNPC()->GetEquipment(EQEmu::textures::TextureHands) == 10652 && GetLevel() > 50)
|
||||
if (CastToNPC()->GetEquipment(EQEmu::textures::armorHands) == 10652 && GetLevel() > 50)
|
||||
return 9;
|
||||
if (level > 62)
|
||||
return 15;
|
||||
@@ -4842,11 +4842,11 @@ void Bot::DoRiposte(Mob* defender) {
|
||||
if (!defender)
|
||||
return;
|
||||
|
||||
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
int32 DoubleRipChance = (defender->GetAABonuses().GiveDoubleRiposte[0] + defender->GetSpellBonuses().GiveDoubleRiposte[0] + defender->GetItemBonuses().GiveDoubleRiposte[0]);
|
||||
if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::legacy::SlotPrimary, true);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
}
|
||||
|
||||
DoubleRipChance = defender->GetAABonuses().GiveDoubleRiposte[1];
|
||||
@@ -4864,7 +4864,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::legacy::SlotSecondary);
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemData* botweapon = 0;
|
||||
if(inst)
|
||||
botweapon = inst->GetItem();
|
||||
@@ -4878,14 +4878,14 @@ void Bot::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
|
||||
}
|
||||
|
||||
min_damage += (min_damage * GetMeleeMinDamageMod_SE(skill) / 100);
|
||||
int hand = EQEmu::legacy::SlotPrimary;
|
||||
int hand = EQEmu::inventory::slotPrimary;
|
||||
if (skill == EQEmu::skills::SkillThrowing || skill == EQEmu::skills::SkillArchery)
|
||||
hand = EQEmu::legacy::SlotRange;
|
||||
hand = EQEmu::inventory::slotRange;
|
||||
if (who->AvoidDamage(this, max_damage, hand)) {
|
||||
if (max_damage == -3)
|
||||
DoRiposte(who);
|
||||
} else {
|
||||
if (HitChance || who->CheckHitChance(this, skill, EQEmu::legacy::SlotPrimary)) {
|
||||
if (HitChance || who->CheckHitChance(this, skill, EQEmu::inventory::slotPrimary)) {
|
||||
who->MeleeMitigation(this, max_damage, min_damage);
|
||||
ApplyMeleeDamageBonus(skill, max_damage);
|
||||
max_damage += who->GetFcDamageAmtIncoming(this, 0, true, skill);
|
||||
@@ -4929,7 +4929,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
||||
|
||||
bool bIsBehind = false;
|
||||
bool bCanFrontalBS = false;
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::legacy::SlotPrimary);
|
||||
const EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
const EQEmu::ItemData* botpiercer = nullptr;
|
||||
if(inst)
|
||||
botpiercer = inst->GetItem();
|
||||
@@ -4979,7 +4979,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
||||
}
|
||||
}
|
||||
else
|
||||
Attack(other, EQEmu::legacy::SlotPrimary);
|
||||
Attack(other, EQEmu::inventory::slotPrimary);
|
||||
}
|
||||
|
||||
void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
|
||||
@@ -4989,11 +4989,11 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
|
||||
int32 hate = 0;
|
||||
int32 primaryweapondamage = 0;
|
||||
int32 backstab_dmg = 0;
|
||||
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::legacy::SlotPrimary);
|
||||
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
if(botweaponInst) {
|
||||
primaryweapondamage = GetWeaponDamage(other, botweaponInst);
|
||||
backstab_dmg = botweaponInst->GetItem()->BackstabDmg;
|
||||
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; ++i) {
|
||||
EQEmu::ItemInstance *aug = botweaponInst->GetAugment(i);
|
||||
if(aug)
|
||||
backstab_dmg += aug->GetItem()->BackstabDmg;
|
||||
@@ -5037,7 +5037,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
|
||||
}
|
||||
|
||||
void Bot::RogueAssassinate(Mob* other) {
|
||||
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::legacy::SlotPrimary);
|
||||
EQEmu::ItemInstance* botweaponInst = GetBotItem(EQEmu::inventory::slotPrimary);
|
||||
if(botweaponInst) {
|
||||
if(GetWeaponDamage(other, botweaponInst))
|
||||
other->Damage(this, 32000, SPELL_UNKNOWN, EQEmu::skills::SkillBackstab);
|
||||
@@ -5103,7 +5103,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::legacy::SlotSecondary) && m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||
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))
|
||||
canBash = true;
|
||||
|
||||
if(!canBash || zone->random.Int(0, 100) > 25)
|
||||
@@ -5122,7 +5122,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::legacy::SlotSecondary) && m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||
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))
|
||||
skill_to_use = EQEmu::skills::SkillBash;
|
||||
}
|
||||
break;
|
||||
@@ -5151,7 +5151,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::legacy::SlotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotShoulders)) <= 0)
|
||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotShoulders)) <= 0)
|
||||
dmg = -5;
|
||||
else {
|
||||
if (!target->CheckHitChance(this, EQEmu::skills::SkillBash, 0))
|
||||
@@ -5201,7 +5201,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::legacy::SlotFeet)) <= 0)
|
||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::inventory::slotFeet)) <= 0)
|
||||
dmg = -5;
|
||||
else {
|
||||
if (!target->CheckHitChance(this, EQEmu::skills::SkillKick, 0))
|
||||
@@ -5495,12 +5495,12 @@ void Bot::SetAttackTimer() {
|
||||
attack_timer.SetAtTrigger(4000, true);
|
||||
Timer* TimerToUse = nullptr;
|
||||
const EQEmu::ItemData* PrimaryWeapon = nullptr;
|
||||
for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) {
|
||||
if (i == EQEmu::legacy::SlotPrimary)
|
||||
for (int i = EQEmu::inventory::slotRange; i <= EQEmu::inventory::slotSecondary; i++) {
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
TimerToUse = &attack_timer;
|
||||
else if (i == EQEmu::legacy::SlotRange)
|
||||
else if (i == EQEmu::inventory::slotRange)
|
||||
TimerToUse = &ranged_timer;
|
||||
else if (i == EQEmu::legacy::SlotSecondary)
|
||||
else if (i == EQEmu::inventory::slotSecondary)
|
||||
TimerToUse = &attack_dw_timer;
|
||||
else
|
||||
continue;
|
||||
@@ -5510,7 +5510,7 @@ void Bot::SetAttackTimer() {
|
||||
if (ci)
|
||||
ItemToUse = ci->GetItem();
|
||||
|
||||
if (i == EQEmu::legacy::SlotSecondary) {
|
||||
if (i == EQEmu::inventory::slotSecondary) {
|
||||
if (PrimaryWeapon != nullptr) {
|
||||
if (PrimaryWeapon->IsClassCommon() && PrimaryWeapon->IsType2HWeapon()) {
|
||||
attack_dw_timer.Disable();
|
||||
@@ -5541,7 +5541,7 @@ void Bot::SetAttackTimer() {
|
||||
speed = (RuleB(Spells, Jun182014HundredHandsRevamp) ? static_cast<int>(((delay / haste_mod) + ((hhe / 1000.0f) * (delay / haste_mod))) * 100) : static_cast<int>(((delay / haste_mod) + ((hhe / 100.0f) * delay)) * 100));
|
||||
TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true);
|
||||
|
||||
if (i == EQEmu::legacy::SlotPrimary)
|
||||
if (i == EQEmu::inventory::slotPrimary)
|
||||
PrimaryWeapon = ItemToUse;
|
||||
}
|
||||
}
|
||||
@@ -7186,7 +7186,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::legacy::SlotWaist; L++) {
|
||||
for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::inventory::slotWaist; L++) {
|
||||
inst = inspectedBot->GetBotItem(L);
|
||||
|
||||
if(inst) {
|
||||
@@ -7200,7 +7200,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = inspectedBot->GetBotItem(EQEmu::legacy::SlotPowerSource);
|
||||
inst = inspectedBot->GetBotItem(EQEmu::inventory::slotPowerSource);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
@@ -7212,7 +7212,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
|
||||
insr->itemicons[SoF::invslot::PossessionsPowerSource] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
inst = inspectedBot->GetBotItem(EQEmu::legacy::SlotAmmo);
|
||||
inst = inspectedBot->GetBotItem(EQEmu::inventory::slotAmmo);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
@@ -7547,7 +7547,7 @@ void Bot::AddItemBonuses(const EQEmu::ItemInstance *inst, StatBonuses* newbon, b
|
||||
|
||||
if (!isAug)
|
||||
{
|
||||
for (int i = 0; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++)
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
|
||||
AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level);
|
||||
}
|
||||
|
||||
@@ -8036,12 +8036,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::legacy::SlotSecondary);
|
||||
EQEmu::ItemInstance* inst = GetBotItem(EQEmu::inventory::slotSecondary);
|
||||
if(inst) {
|
||||
if (inst->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
ac -= inst->GetItem()->AC;
|
||||
shield_ac = inst->GetItem()->AC;
|
||||
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
|
||||
for (uint8 i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
if(inst->GetAugment(i)) {
|
||||
ac -= inst->GetAugment(i)->GetItem()->AC;
|
||||
shield_ac += inst->GetAugment(i)->GetItem()->AC;
|
||||
@@ -8433,7 +8433,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag)
|
||||
if (slot_id != INVALID_INDEX)
|
||||
return false;
|
||||
|
||||
for (uint8 i = 0; i < EQEmu::textures::TexturePrimary; ++i) {
|
||||
for (uint8 i = EQEmu::textures::textureBegin; i < EQEmu::textures::weaponPrimary; ++i) {
|
||||
uint8 inv_slot = Inventory::CalcSlotFromMaterial(i);
|
||||
EQEmu::ItemInstance* inst = m_inv.GetItem(inv_slot);
|
||||
if (!inst)
|
||||
@@ -8445,7 +8445,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag)
|
||||
}
|
||||
else {
|
||||
uint8 mat_slot = Inventory::CalcMaterialFromSlot(slot_id);
|
||||
if (mat_slot == EQEmu::textures::TextureInvalid || mat_slot >= EQEmu::textures::TexturePrimary)
|
||||
if (mat_slot == EQEmu::textures::materialInvalid || mat_slot >= EQEmu::textures::weaponPrimary)
|
||||
return false;
|
||||
|
||||
EQEmu::ItemInstance* inst = m_inv.GetItem(slot_id);
|
||||
|
||||
+2
-2
@@ -77,7 +77,7 @@ 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::legacy::SlotPowerSource) ? (22) : (23)))
|
||||
#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::legacy::EQUIPMENT_BEGIN && x <= EQEmu::legacy::EQUIPMENT_END) ? (x) : ((x == EQEmu::inventory::slotPowerSource) ? (22) : (23)))
|
||||
|
||||
static std::string bot_equip_slot_name[EQEmu::legacy::EQUIPMENT_SIZE + 2] =
|
||||
{
|
||||
@@ -207,7 +207,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, int special = 0);
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr, int special = 0);
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
|
||||
+36
-36
@@ -4358,7 +4358,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
|
||||
// TODO: Trouble-shoot model update issue
|
||||
|
||||
const std::string msg_matslot = StringFormat("mat_slot: %c(All), %i(Head), %i(Chest), %i(Arms), %i(Wrists), %i(Hands), %i(Legs), %i(Feet)",
|
||||
'*', EQEmu::textures::TextureHead, EQEmu::textures::TextureChest, EQEmu::textures::TextureArms, EQEmu::textures::TextureWrist, EQEmu::textures::TextureHands, EQEmu::textures::TextureLegs, EQEmu::textures::TextureFeet);
|
||||
'*', EQEmu::textures::armorHead, EQEmu::textures::armorChest, EQEmu::textures::armorArms, EQEmu::textures::armorWrist, EQEmu::textures::armorHands, EQEmu::textures::armorLegs, EQEmu::textures::armorFeet);
|
||||
|
||||
if (helper_command_alias_fail(c, "bot_subcommand_bot_dye_armor", sep->arg[0], "botdyearmor"))
|
||||
return;
|
||||
@@ -4369,7 +4369,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
|
||||
}
|
||||
const int ab_mask = ActionableBots::ABM_NoFilter;
|
||||
|
||||
uint8 material_slot = EQEmu::textures::TextureInvalid;
|
||||
uint8 material_slot = EQEmu::textures::materialInvalid;
|
||||
int16 slot_id = INVALID_INDEX;
|
||||
|
||||
bool dye_all = (sep->arg[1][0] == '*');
|
||||
@@ -4377,7 +4377,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
|
||||
material_slot = atoi(sep->arg[1]);
|
||||
slot_id = Inventory::CalcSlotFromMaterial(material_slot);
|
||||
|
||||
if (!sep->IsNumber(1) || slot_id == INVALID_INDEX || material_slot > EQEmu::textures::TextureFeet) {
|
||||
if (!sep->IsNumber(1) || slot_id == INVALID_INDEX || material_slot > EQEmu::textures::LastTintableTexture) {
|
||||
c->Message(m_fail, "Valid [mat_slot]s for this command are:");
|
||||
c->Message(m_fail, msg_matslot.c_str());
|
||||
return;
|
||||
@@ -7072,23 +7072,23 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
|
||||
|
||||
uint32 inventory_count = 0;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
|
||||
if ((i == EQEmu::legacy::SlotSecondary) && is2Hweapon)
|
||||
if ((i == EQEmu::inventory::slotSecondary) && is2Hweapon)
|
||||
continue;
|
||||
|
||||
inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::legacy::SlotPowerSource : i);
|
||||
inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::inventory::slotPowerSource : i);
|
||||
if (!inst || !inst->GetItem()) {
|
||||
c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? EQEmu::legacy::SlotPowerSource : i));
|
||||
c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? EQEmu::inventory::slotPowerSource : i));
|
||||
continue;
|
||||
}
|
||||
|
||||
item = inst->GetItem();
|
||||
if ((i == EQEmu::legacy::SlotPrimary) && item->IsType2HWeapon()) {
|
||||
if ((i == EQEmu::inventory::slotPrimary) && item->IsType2HWeapon()) {
|
||||
is2Hweapon = true;
|
||||
}
|
||||
|
||||
linker.SetItemInst(inst);
|
||||
item_link = linker.GenerateLink();
|
||||
c->Message(m_message, "Using %s in my %s (slot %i)", item_link.c_str(), GetBotEquipSlotName(i), (i == 22 ? EQEmu::legacy::SlotPowerSource : i));
|
||||
c->Message(m_message, "Using %s in my %s (slot %i)", item_link.c_str(), GetBotEquipSlotName(i), (i == 22 ? EQEmu::inventory::slotPowerSource : i));
|
||||
|
||||
++inventory_count;
|
||||
}
|
||||
@@ -7127,7 +7127,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::legacy::SlotPowerSource)) {
|
||||
if (!sep->IsNumber(1) || ((slotId > EQEmu::legacy::EQUIPMENT_END || slotId < EQEmu::legacy::EQUIPMENT_BEGIN) && slotId != EQEmu::inventory::slotPowerSource)) {
|
||||
c->Message(m_fail, "Valid slots are 0-21 or 9999");
|
||||
return;
|
||||
}
|
||||
@@ -7142,7 +7142,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
for (int m = AUG_INDEX_BEGIN; m < EQEmu::legacy::ITEM_COMMON_SIZE; ++m) {
|
||||
for (int m = EQEmu::inventory::socketBegin; m < EQEmu::inventory::SocketCount; ++m) {
|
||||
if (!itminst)
|
||||
break;
|
||||
|
||||
@@ -7159,7 +7159,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
std::string error_message;
|
||||
if (itm) {
|
||||
c->PushItemOnCursor(*itminst, true);
|
||||
if ((slotId == EQEmu::legacy::SlotRange) || (slotId == EQEmu::legacy::SlotAmmo) || (slotId == EQEmu::legacy::SlotPrimary) || (slotId == EQEmu::legacy::SlotSecondary))
|
||||
if ((slotId == EQEmu::inventory::slotRange) || (slotId == EQEmu::inventory::slotAmmo) || (slotId == EQEmu::inventory::slotPrimary) || (slotId == EQEmu::inventory::slotSecondary))
|
||||
my_bot->SetBotArcher(false);
|
||||
|
||||
my_bot->RemoveBotItemBySlot(slotId, &error_message);
|
||||
@@ -7173,31 +7173,31 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
switch (slotId) {
|
||||
case EQEmu::legacy::SlotCharm:
|
||||
case EQEmu::legacy::SlotEar1:
|
||||
case EQEmu::legacy::SlotHead:
|
||||
case EQEmu::legacy::SlotFace:
|
||||
case EQEmu::legacy::SlotEar2:
|
||||
case EQEmu::legacy::SlotNeck:
|
||||
case EQEmu::legacy::SlotBack:
|
||||
case EQEmu::legacy::SlotWrist1:
|
||||
case EQEmu::legacy::SlotWrist2:
|
||||
case EQEmu::legacy::SlotRange:
|
||||
case EQEmu::legacy::SlotPrimary:
|
||||
case EQEmu::legacy::SlotSecondary:
|
||||
case EQEmu::legacy::SlotFinger1:
|
||||
case EQEmu::legacy::SlotFinger2:
|
||||
case EQEmu::legacy::SlotChest:
|
||||
case EQEmu::legacy::SlotWaist:
|
||||
case EQEmu::legacy::SlotPowerSource:
|
||||
case EQEmu::legacy::SlotAmmo:
|
||||
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:
|
||||
c->Message(m_message, "My %s is %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already")));
|
||||
break;
|
||||
case EQEmu::legacy::SlotShoulders:
|
||||
case EQEmu::legacy::SlotArms:
|
||||
case EQEmu::legacy::SlotHands:
|
||||
case EQEmu::legacy::SlotLegs:
|
||||
case EQEmu::legacy::SlotFeet:
|
||||
case EQEmu::inventory::slotShoulders:
|
||||
case EQEmu::inventory::slotArms:
|
||||
case EQEmu::inventory::slotHands:
|
||||
case EQEmu::inventory::slotLegs:
|
||||
case EQEmu::inventory::slotFeet:
|
||||
c->Message(m_message, "My %s are %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already")));
|
||||
break;
|
||||
default:
|
||||
@@ -7236,12 +7236,12 @@ void bot_subcommand_inventory_window(Client *c, const Seperator *sep)
|
||||
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
|
||||
const EQEmu::ItemData* item = nullptr;
|
||||
const EQEmu::ItemInstance* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::legacy::SlotPowerSource : i);
|
||||
const EQEmu::ItemInstance* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::inventory::slotPowerSource : i);
|
||||
if (inst)
|
||||
item = inst->GetItem();
|
||||
|
||||
window_text.append("<c \"#FFFFFF\">");
|
||||
window_text.append(GetBotEquipSlotName(i == 22 ? EQEmu::legacy::SlotPowerSource : i));
|
||||
window_text.append(GetBotEquipSlotName(i == 22 ? EQEmu::inventory::slotPowerSource : i));
|
||||
window_text.append(": ");
|
||||
if (item) {
|
||||
//window_text.append("</c>");
|
||||
|
||||
+11
-11
@@ -1058,7 +1058,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, Inventory& inventory_inst)
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
int16 slot_id = atoi(row[0]);
|
||||
if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::legacy::SlotPowerSource)
|
||||
if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::inventory::slotPowerSource)
|
||||
continue;
|
||||
|
||||
uint32 item_id = atoi(row[1]);
|
||||
@@ -1093,7 +1093,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, Inventory& inventory_inst)
|
||||
if (item_inst->GetItem()->Attuneable) {
|
||||
if (atoi(row[4]))
|
||||
item_inst->SetAttuned(true);
|
||||
else if (((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || slot_id == EQEmu::legacy::SlotPowerSource))
|
||||
else if (((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || slot_id == EQEmu::inventory::slotPowerSource))
|
||||
item_inst->SetAttuned(true);
|
||||
}
|
||||
|
||||
@@ -1161,7 +1161,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::legacy::SlotPowerSource))
|
||||
if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
|
||||
return false;
|
||||
|
||||
query = StringFormat("SELECT `item_id` FROM `bot_inventories` WHERE `bot_id` = '%i' AND `slot_id` = '%i' LIMIT 1", bot_id, slot_id);
|
||||
@@ -1179,7 +1179,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::legacy::SlotPowerSource))
|
||||
if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
|
||||
return false;
|
||||
|
||||
if (!DeleteItemBySlot(bot_inst->GetBotID(), slot_id))
|
||||
@@ -1188,8 +1188,8 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQEm
|
||||
if (!item_inst || !item_inst->GetID())
|
||||
return true;
|
||||
|
||||
uint32 augment_id[] = { 0, 0, 0, 0, 0, 0 };
|
||||
for (int augment_iter = 0; augment_iter < EQEmu::legacy::ITEM_COMMON_SIZE; ++augment_iter)
|
||||
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)
|
||||
augment_id[augment_iter] = item_inst->GetAugmentItemID(augment_iter);
|
||||
|
||||
uint16 item_charges = 0;
|
||||
@@ -1263,7 +1263,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::legacy::SlotPowerSource))
|
||||
if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::inventory::slotPowerSource))
|
||||
return false;
|
||||
|
||||
query = StringFormat("DELETE FROM `bot_inventories` WHERE `bot_id` = '%u' AND `slot_id` = '%u'", bot_id, slot_id);
|
||||
@@ -1302,12 +1302,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::legacy::SlotPowerSource && !all_flag)
|
||||
if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::inventory::slotPowerSource && !all_flag)
|
||||
return false;
|
||||
|
||||
std::string where_clause;
|
||||
if (all_flag)
|
||||
where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", EQEmu::legacy::SlotHead, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet);
|
||||
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);
|
||||
else
|
||||
where_clause = StringFormat(" AND `slot_id` = '%u'", slot_id);
|
||||
|
||||
@@ -1752,7 +1752,7 @@ bool BotDatabase::SaveAllArmorColorBySlot(const uint32 owner_id, const int16 slo
|
||||
" AND bi.`slot_id` = '%i'",
|
||||
owner_id,
|
||||
rgb_value,
|
||||
EQEmu::legacy::SlotHead, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotWrist2, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet,
|
||||
EQEmu::inventory::slotHead, EQEmu::inventory::slotChest, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotWrist2, EQEmu::inventory::slotHands, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet,
|
||||
slot_id
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
@@ -1776,7 +1776,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::legacy::SlotHead, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotWrist2, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet
|
||||
EQEmu::inventory::slotHead, EQEmu::inventory::slotChest, EQEmu::inventory::slotArms, EQEmu::inventory::slotWrist1, EQEmu::inventory::slotWrist2, EQEmu::inventory::slotHands, EQEmu::inventory::slotLegs, EQEmu::inventory::slotFeet
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
|
||||
+47
-47
@@ -2800,7 +2800,7 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) {
|
||||
if (item && item->IsClassCommon())
|
||||
{
|
||||
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
|
||||
if (matslot != EQEmu::textures::TextureInvalid)
|
||||
if (matslot != EQEmu::textures::materialInvalid)
|
||||
{
|
||||
m_pp.item_material.Slot[matslot].Material = GetEquipmentMaterial(matslot);
|
||||
}
|
||||
@@ -3132,17 +3132,17 @@ void Client::Tell_StringID(uint32 string_id, const char *who, const char *messag
|
||||
}
|
||||
|
||||
void Client::SetTint(int16 in_slot, uint32 color) {
|
||||
EQEmu::Tint_Struct new_color;
|
||||
EQEmu::textures::Tint_Struct new_color;
|
||||
new_color.Color = color;
|
||||
SetTint(in_slot, new_color);
|
||||
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color);
|
||||
}
|
||||
|
||||
// Still need to reconcile bracer01 versus bracer02
|
||||
void Client::SetTint(int16 in_slot, EQEmu::Tint_Struct& color) {
|
||||
void Client::SetTint(int16 in_slot, EQEmu::textures::Tint_Struct& color) {
|
||||
|
||||
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
|
||||
if (matslot != EQEmu::textures::TextureInvalid)
|
||||
if (matslot != EQEmu::textures::materialInvalid)
|
||||
{
|
||||
m_pp.item_tint.Slot[matslot].Color = color.Color;
|
||||
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.Color);
|
||||
@@ -3219,28 +3219,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::legacy::SlotWrist2;
|
||||
return EQEmu::inventory::slotWrist2;
|
||||
switch(slot) {
|
||||
case EQEmu::textures::TextureHead:
|
||||
slot2 = EQEmu::legacy::SlotHead;
|
||||
case EQEmu::textures::armorHead:
|
||||
slot2 = EQEmu::inventory::slotHead;
|
||||
break;
|
||||
case EQEmu::textures::TextureChest:
|
||||
slot2 = EQEmu::legacy::SlotChest;
|
||||
case EQEmu::textures::armorChest:
|
||||
slot2 = EQEmu::inventory::slotChest;
|
||||
break;
|
||||
case EQEmu::textures::TextureArms:
|
||||
slot2 = EQEmu::legacy::SlotArms;
|
||||
case EQEmu::textures::armorArms:
|
||||
slot2 = EQEmu::inventory::slotArms;
|
||||
break;
|
||||
case EQEmu::textures::TextureWrist:
|
||||
slot2 = EQEmu::legacy::SlotWrist1;
|
||||
case EQEmu::textures::armorWrist:
|
||||
slot2 = EQEmu::inventory::slotWrist1;
|
||||
break;
|
||||
case EQEmu::textures::TextureHands:
|
||||
slot2 = EQEmu::legacy::SlotHands;
|
||||
case EQEmu::textures::armorHands:
|
||||
slot2 = EQEmu::inventory::slotHands;
|
||||
break;
|
||||
case EQEmu::textures::TextureLegs:
|
||||
slot2 = EQEmu::legacy::SlotLegs;
|
||||
case EQEmu::textures::armorLegs:
|
||||
slot2 = EQEmu::inventory::slotLegs;
|
||||
break;
|
||||
case EQEmu::textures::TextureFeet:
|
||||
slot2 = EQEmu::legacy::SlotFeet;
|
||||
case EQEmu::textures::armorFeet:
|
||||
slot2 = EQEmu::inventory::slotFeet;
|
||||
break;
|
||||
}
|
||||
return slot2;
|
||||
@@ -3249,26 +3249,26 @@ uint8 Client::SlotConvert(uint8 slot,bool bracer){
|
||||
uint8 Client::SlotConvert2(uint8 slot){
|
||||
uint8 slot2 = 0; // same as above...
|
||||
switch(slot){
|
||||
case EQEmu::legacy::SlotHead:
|
||||
slot2 = EQEmu::textures::TextureHead;
|
||||
case EQEmu::inventory::slotHead:
|
||||
slot2 = EQEmu::textures::armorHead;
|
||||
break;
|
||||
case EQEmu::legacy::SlotChest:
|
||||
slot2 = EQEmu::textures::TextureChest;
|
||||
case EQEmu::inventory::slotChest:
|
||||
slot2 = EQEmu::textures::armorChest;
|
||||
break;
|
||||
case EQEmu::legacy::SlotArms:
|
||||
slot2 = EQEmu::textures::TextureArms;
|
||||
case EQEmu::inventory::slotArms:
|
||||
slot2 = EQEmu::textures::armorArms;
|
||||
break;
|
||||
case EQEmu::legacy::SlotWrist1:
|
||||
slot2 = EQEmu::textures::TextureWrist;
|
||||
case EQEmu::inventory::slotWrist1:
|
||||
slot2 = EQEmu::textures::armorWrist;
|
||||
break;
|
||||
case EQEmu::legacy::SlotHands:
|
||||
slot2 = EQEmu::textures::TextureHands;
|
||||
case EQEmu::inventory::slotHands:
|
||||
slot2 = EQEmu::textures::armorHands;
|
||||
break;
|
||||
case EQEmu::legacy::SlotLegs:
|
||||
slot2 = EQEmu::textures::TextureLegs;
|
||||
case EQEmu::inventory::slotLegs:
|
||||
slot2 = EQEmu::textures::armorLegs;
|
||||
break;
|
||||
case EQEmu::legacy::SlotFeet:
|
||||
slot2 = EQEmu::textures::TextureFeet;
|
||||
case EQEmu::inventory::slotFeet:
|
||||
slot2 = EQEmu::textures::armorFeet;
|
||||
break;
|
||||
}
|
||||
return slot2;
|
||||
@@ -4268,14 +4268,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::legacy::SlotPrimary);
|
||||
bool equiped = m_inv.GetItem(EQEmu::inventory::slotPrimary);
|
||||
|
||||
if (!equiped)
|
||||
skill = EQEmu::skills::SkillHandtoHand;
|
||||
|
||||
else {
|
||||
|
||||
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
uint8 type = m_inv.GetItem(EQEmu::inventory::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
|
||||
switch (type) {
|
||||
case EQEmu::item::ItemType1HSlash: // 1H Slashing
|
||||
@@ -5785,7 +5785,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = requestee->GetInv().GetItem(EQEmu::legacy::SlotPowerSource);
|
||||
inst = requestee->GetInv().GetItem(EQEmu::inventory::slotPowerSource);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
@@ -5799,7 +5799,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||
insr->itemicons[SoF::invslot::PossessionsPowerSource] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
inst = requestee->GetInv().GetItem(EQEmu::legacy::SlotAmmo);
|
||||
inst = requestee->GetInv().GetItem(EQEmu::inventory::slotAmmo);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
@@ -6341,8 +6341,8 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
made_npc->Corrup = GetCorrup();
|
||||
made_npc->PhR = GetPhR();
|
||||
// looks
|
||||
made_npc->texture = GetEquipmentMaterial(EQEmu::textures::TextureChest);
|
||||
made_npc->helmtexture = GetEquipmentMaterial(EQEmu::textures::TextureHead);
|
||||
made_npc->texture = GetEquipmentMaterial(EQEmu::textures::armorChest);
|
||||
made_npc->helmtexture = GetEquipmentMaterial(EQEmu::textures::armorHead);
|
||||
made_npc->haircolor = GetHairColor();
|
||||
made_npc->beardcolor = GetBeardColor();
|
||||
made_npc->eyecolor1 = GetEyeColor1();
|
||||
@@ -6353,9 +6353,9 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
made_npc->drakkin_heritage = GetDrakkinHeritage();
|
||||
made_npc->drakkin_tattoo = GetDrakkinTattoo();
|
||||
made_npc->drakkin_details = GetDrakkinDetails();
|
||||
made_npc->d_melee_texture1 = GetEquipmentMaterial(EQEmu::textures::TexturePrimary);
|
||||
made_npc->d_melee_texture2 = GetEquipmentMaterial(EQEmu::textures::TextureSecondary);
|
||||
for (int i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTexture; i++) {
|
||||
made_npc->d_melee_texture1 = GetEquipmentMaterial(EQEmu::textures::weaponPrimary);
|
||||
made_npc->d_melee_texture2 = GetEquipmentMaterial(EQEmu::textures::weaponSecondary);
|
||||
for (int i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTexture; i++) {
|
||||
made_npc->armor_tint.Slot[i].Color = GetEquipmentColor(i);
|
||||
}
|
||||
made_npc->loottable_id = 0;
|
||||
@@ -8061,7 +8061,7 @@ void Client::TickItemCheck()
|
||||
TryItemTick(i);
|
||||
}
|
||||
//Scan main inventory + cursor
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++)
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
@@ -8092,7 +8092,7 @@ void Client::TryItemTick(int slot)
|
||||
//Only look at augs in main inventory
|
||||
if (slot > EQEmu::legacy::EQUIPMENT_END) { return; }
|
||||
|
||||
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst) { continue; }
|
||||
@@ -8118,7 +8118,7 @@ void Client::ItemTimerCheck()
|
||||
TryItemTimer(i);
|
||||
}
|
||||
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++)
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
@@ -8149,7 +8149,7 @@ void Client::TryItemTimer(int slot)
|
||||
return;
|
||||
}
|
||||
|
||||
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
|
||||
for (int x = EQEmu::inventory::socketBegin; x < EQEmu::inventory::SocketCount; ++x)
|
||||
{
|
||||
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst) {
|
||||
@@ -8482,7 +8482,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::legacy::SlotPowerSource);
|
||||
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, EQEmu::inventory::slotPowerSource);
|
||||
|
||||
if (faction)
|
||||
{
|
||||
|
||||
+3
-3
@@ -222,7 +222,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, int special = 0);
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr, int special = 0);
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
@@ -808,7 +808,7 @@ public:
|
||||
uint32 NukeItem(uint32 itemnum, uint8 where_to_check =
|
||||
(invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor));
|
||||
void SetTint(int16 slot_id, uint32 color);
|
||||
void SetTint(int16 slot_id, EQEmu::Tint_Struct& color);
|
||||
void SetTint(int16 slot_id, EQEmu::textures::Tint_Struct& color);
|
||||
void SetMaterial(int16 slot_id, uint32 item_id);
|
||||
void Undye();
|
||||
int32 GetItemIDAt(int16 slot_id);
|
||||
@@ -822,7 +822,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::legacy::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::inventory::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);
|
||||
|
||||
@@ -1074,9 +1074,9 @@ int32 Client::CalcAC()
|
||||
}
|
||||
// Shield AC bonus for HeroicSTR
|
||||
if (itembonuses.HeroicSTR) {
|
||||
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary);
|
||||
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::inventory::slotSecondary);
|
||||
if (equiped) {
|
||||
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType;
|
||||
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::inventory::slotSecondary)->GetItem()->ItemType;
|
||||
if (shield == EQEmu::item::ItemTypeShield) {
|
||||
displayed += itembonuses.HeroicSTR / 2;
|
||||
}
|
||||
@@ -1103,9 +1103,9 @@ int32 Client::GetACMit()
|
||||
}
|
||||
// Shield AC bonus for HeroicSTR
|
||||
if (itembonuses.HeroicSTR) {
|
||||
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary);
|
||||
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::inventory::slotSecondary);
|
||||
if (equiped) {
|
||||
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType;
|
||||
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::inventory::slotSecondary)->GetItem()->ItemType;
|
||||
if (shield == EQEmu::item::ItemTypeShield) {
|
||||
mitigation += itembonuses.HeroicSTR / 2;
|
||||
}
|
||||
@@ -1320,7 +1320,7 @@ uint32 Client::CalcCurrentWeight()
|
||||
EQEmu::ItemInstance* ins;
|
||||
uint32 Total = 0;
|
||||
int x;
|
||||
for (x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::SlotCursor; x++) { // include cursor or not?
|
||||
for (x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::inventory::slotCursor; x++) { // include cursor or not?
|
||||
TempItem = 0;
|
||||
ins = GetInv().GetItem(x);
|
||||
if (ins) {
|
||||
@@ -1343,7 +1343,7 @@ 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::legacy::SlotGeneral1;
|
||||
int bagslot = EQEmu::inventory::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?
|
||||
if (x >= m) {
|
||||
@@ -2219,12 +2219,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::legacy::SlotSecondary);
|
||||
const EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::inventory::slotSecondary);
|
||||
if (inst) {
|
||||
if (inst->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
ac -= inst->GetItem()->AC;
|
||||
shield_ac = inst->GetItem()->AC;
|
||||
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
|
||||
for (uint8 i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
if (inst->GetAugment(i)) {
|
||||
ac -= inst->GetAugment(i)->GetItem()->AC;
|
||||
shield_ac += inst->GetAugment(i)->GetItem()->AC;
|
||||
|
||||
+26
-26
@@ -1334,7 +1334,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
/* Set item material tint */
|
||||
for (int i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTexture; i++)
|
||||
for (int i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTexture; i++)
|
||||
{
|
||||
if (m_pp.item_tint.Slot[i].UseTint == 1 || m_pp.item_tint.Slot[i].UseTint == 255)
|
||||
{
|
||||
@@ -1691,7 +1691,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
if (iter == m_inv.cursor_cbegin())
|
||||
continue;
|
||||
const EQEmu::ItemInstance *inst = *iter;
|
||||
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2029,7 +2029,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
|
||||
EQEmu::ItemInstance *inst = database.CreateItem(item, charges);
|
||||
if (!AutoPutLootInInventory(*inst, true, true))
|
||||
{
|
||||
PutLootInInventory(EQEmu::legacy::SlotCursor, *inst);
|
||||
PutLootInInventory(EQEmu::inventory::slotCursor, *inst);
|
||||
}
|
||||
Save(1);
|
||||
}
|
||||
@@ -2554,7 +2554,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
|
||||
EQEmu::ItemInstance *inst = database.CreateItem(item, charges);
|
||||
if (!AutoPutLootInInventory(*inst, true, true))
|
||||
{
|
||||
PutLootInInventory(EQEmu::legacy::SlotCursor, *inst);
|
||||
PutLootInInventory(EQEmu::inventory::slotCursor, *inst);
|
||||
}
|
||||
|
||||
Save(1);
|
||||
@@ -2604,7 +2604,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::legacy::SlotCursor);
|
||||
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, EQEmu::inventory::slotCursor);
|
||||
AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count));
|
||||
}
|
||||
/* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */
|
||||
@@ -2816,8 +2816,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::legacy::SlotPrimary);
|
||||
const EQEmu::ItemInstance* SecondaryWeapon = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
|
||||
const EQEmu::ItemInstance* PrimaryWeapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
const EQEmu::ItemInstance* SecondaryWeapon = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
const EQEmu::ItemInstance* PoisonItemInstance = GetInv()[ApplyPoisonData->inventorySlot];
|
||||
|
||||
bool IsPoison = PoisonItemInstance && (PoisonItemInstance->GetItem()->ItemType == EQEmu::item::ItemTypePoison);
|
||||
@@ -2999,7 +2999,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
{
|
||||
case 0: // Adding an augment
|
||||
case 2: // Swapping augment
|
||||
new_aug = user_inv.GetItem(EQEmu::legacy::SlotCursor);
|
||||
new_aug = user_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
|
||||
if (!new_aug) // Shouldn't get the OP code without the augment on the user's cursor, but maybe it's h4x.
|
||||
{
|
||||
@@ -3057,7 +3057,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
if (itemOneToPush)
|
||||
{
|
||||
DeleteItemInInventory(item_slot, 0, true);
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotCursor, new_aug->IsStackable() ? 1 : 0, true);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor, new_aug->IsStackable() ? 1 : 0, true);
|
||||
|
||||
if (solvent)
|
||||
{
|
||||
@@ -3068,7 +3068,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::legacy::SlotCursor, *itemTwoToPush, true))
|
||||
if (!PutItemInInventory(EQEmu::inventory::slotCursor, *itemTwoToPush, true))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Problem returning old augment to player's cursor after augmentation swap.");
|
||||
Message(15, "Error: Failed to retrieve old augment after augmentation swap!");
|
||||
@@ -3081,7 +3081,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
|
||||
CalcBonuses();
|
||||
|
||||
if (mat != EQEmu::textures::TextureInvalid)
|
||||
if (mat != EQEmu::textures::materialInvalid)
|
||||
{
|
||||
SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed.
|
||||
}
|
||||
@@ -3146,13 +3146,13 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
|
||||
CalcBonuses();
|
||||
|
||||
if (mat != EQEmu::textures::TextureInvalid)
|
||||
if (mat != EQEmu::textures::materialInvalid)
|
||||
{
|
||||
SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed.
|
||||
}
|
||||
|
||||
// Drop the removed augment on the player's cursor
|
||||
if (!PutItemInInventory(EQEmu::legacy::SlotCursor, *itemTwoToPush, true))
|
||||
if (!PutItemInInventory(EQEmu::inventory::slotCursor, *itemTwoToPush, true))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Problem returning augment to player's cursor after safe removal.");
|
||||
Message(15, "Error: Failed to return augment after removal from item!");
|
||||
@@ -3201,7 +3201,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
|
||||
CalcBonuses();
|
||||
|
||||
if (mat != EQEmu::textures::TextureInvalid)
|
||||
if (mat != EQEmu::textures::materialInvalid)
|
||||
{
|
||||
SendWearChange(mat);
|
||||
}
|
||||
@@ -4070,7 +4070,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
|
||||
}
|
||||
else
|
||||
{
|
||||
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", EQEmu::legacy::SlotCursor, castspell->inventoryslot);
|
||||
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", EQEmu::inventory::slotCursor, castspell->inventoryslot);
|
||||
InterruptSpell(castspell->spell_id);
|
||||
}
|
||||
}
|
||||
@@ -4993,7 +4993,7 @@ void Client::Handle_OP_CrashDump(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_CreateObject(const EQApplicationPacket *app)
|
||||
{
|
||||
DropItem(EQEmu::legacy::SlotCursor);
|
||||
DropItem(EQEmu::inventory::slotCursor);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6919,7 +6919,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmu::ItemInstance *CursorItemInst = GetInv().GetItem(EQEmu::legacy::SlotCursor);
|
||||
EQEmu::ItemInstance *CursorItemInst = GetInv().GetItem(EQEmu::inventory::slotCursor);
|
||||
|
||||
bool Allowed = true;
|
||||
|
||||
@@ -6967,7 +6967,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
{
|
||||
GuildBankDepositAck(false, sentAction);
|
||||
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotCursor, 0, false);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor, 0, false);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -6988,7 +6988,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
|
||||
case GuildBankWithdraw:
|
||||
{
|
||||
if (GetInv()[EQEmu::legacy::SlotCursor])
|
||||
if (GetInv()[EQEmu::inventory::slotCursor])
|
||||
{
|
||||
Message_StringID(13, GUILD_BANK_EMPTY_HANDS);
|
||||
|
||||
@@ -7034,7 +7034,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
{
|
||||
PushItemOnCursor(*inst);
|
||||
|
||||
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
|
||||
GuildBanks->DeleteItem(GuildID(), gbwis->Area, gbwis->SlotID, gbwis->Quantity);
|
||||
}
|
||||
@@ -8016,7 +8016,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::legacy::SlotWaist; L++) {
|
||||
for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::inventory::slotWaist; L++) {
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(L);
|
||||
item = inst ? inst->GetItem() : nullptr;
|
||||
|
||||
@@ -8036,7 +8036,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
|
||||
else { insr->itemicons[L] = 0xFFFFFFFF; }
|
||||
}
|
||||
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::legacy::SlotAmmo);
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::inventory::slotAmmo);
|
||||
item = inst ? inst->GetItem() : nullptr;
|
||||
|
||||
if (item) {
|
||||
@@ -8498,7 +8498,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
||||
EQEmu::ItemInstance* clickaug = 0;
|
||||
EQEmu::ItemData* augitem = 0;
|
||||
|
||||
for (r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) {
|
||||
for (r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; r++) {
|
||||
const EQEmu::ItemInstance* aug_i = inst->GetAugment(r);
|
||||
if (!aug_i)
|
||||
continue;
|
||||
@@ -12031,7 +12031,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::legacy::SlotSecondary);
|
||||
EQEmu::ItemInstance* inst = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
if (!shield_target)
|
||||
return;
|
||||
if (inst)
|
||||
@@ -12243,8 +12243,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::legacy::SlotCursor) {
|
||||
if (m_inv.GetItem(EQEmu::legacy::SlotCursor) != nullptr) {
|
||||
if (freeslotid == EQEmu::inventory::slotCursor) {
|
||||
if (m_inv.GetItem(EQEmu::inventory::slotCursor) != nullptr) {
|
||||
Message(13, "You do not have room for any more items.");
|
||||
safe_delete(outapp);
|
||||
safe_delete(inst);
|
||||
|
||||
+13
-13
@@ -296,7 +296,7 @@ bool Client::Process() {
|
||||
}
|
||||
|
||||
if(AutoFireEnabled()){
|
||||
EQEmu::ItemInstance *ranged = GetInv().GetItem(EQEmu::legacy::SlotRange);
|
||||
EQEmu::ItemInstance *ranged = GetInv().GetItem(EQEmu::inventory::slotRange);
|
||||
if(ranged)
|
||||
{
|
||||
if (ranged->GetItem() && ranged->GetItem()->ItemType == EQEmu::item::ItemTypeBow){
|
||||
@@ -391,10 +391,10 @@ 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::legacy::SlotPrimary);
|
||||
TryWeaponProc(wpn, auto_attack_target, EQEmu::legacy::SlotPrimary);
|
||||
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
TryWeaponProc(wpn, auto_attack_target, EQEmu::inventory::slotPrimary);
|
||||
|
||||
DoAttackRounds(auto_attack_target, EQEmu::legacy::SlotPrimary);
|
||||
DoAttackRounds(auto_attack_target, EQEmu::inventory::slotPrimary);
|
||||
if (CheckAATimer(aaTimerRampage))
|
||||
entity_list.AEAttack(this, 30);
|
||||
}
|
||||
@@ -430,10 +430,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::legacy::SlotSecondary);
|
||||
TryWeaponProc(wpn, auto_attack_target, EQEmu::legacy::SlotSecondary);
|
||||
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
TryWeaponProc(wpn, auto_attack_target, EQEmu::inventory::slotSecondary);
|
||||
|
||||
DoAttackRounds(auto_attack_target, EQEmu::legacy::SlotSecondary);
|
||||
DoAttackRounds(auto_attack_target, EQEmu::inventory::slotSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -763,7 +763,7 @@ void Client::BulkSendInventoryItems()
|
||||
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
|
||||
|
||||
// Possessions items
|
||||
for (int16 slot_id = SLOT_BEGIN; slot_id < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; slot_id++) {
|
||||
for (int16 slot_id = EQEmu::inventory::slotBegin; slot_id < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; slot_id++) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[slot_id];
|
||||
if (!inst)
|
||||
continue;
|
||||
@@ -778,12 +778,12 @@ void Client::BulkSendInventoryItems()
|
||||
|
||||
// PowerSource item
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::legacy::SlotPowerSource];
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotPowerSource];
|
||||
if (inst) {
|
||||
inst->Serialize(ob, EQEmu::legacy::SlotPowerSource);
|
||||
inst->Serialize(ob, EQEmu::inventory::slotPowerSource);
|
||||
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::legacy::SlotPowerSource);
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::inventory::slotPowerSource);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@@ -1095,7 +1095,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
|
||||
switch(memspell->scribing)
|
||||
{
|
||||
case memSpellScribing: { // scribing spell to book
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::legacy::SlotCursor];
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotCursor];
|
||||
|
||||
if (inst && inst->IsClassCommon())
|
||||
{
|
||||
@@ -1109,7 +1109,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
|
||||
if(item && item->Scroll.Effect == (int32)(memspell->spell_id))
|
||||
{
|
||||
ScribeSpell(memspell->spell_id, memspell->slot);
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotCursor, 1, true);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor, 1, true);
|
||||
}
|
||||
else
|
||||
Message(0,"Scribing spell: inst exists but item does not or spell ids do not match.");
|
||||
|
||||
+19
-19
@@ -2417,14 +2417,14 @@ void command_texture(Client *c, const Seperator *sep)
|
||||
// Player Races Wear Armor, so Wearchange is sent instead
|
||||
int i;
|
||||
if (!c->GetTarget())
|
||||
for (i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTintableTexture; i++)
|
||||
for (i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTintableTexture; i++)
|
||||
{
|
||||
c->SendTextureWC(i, texture);
|
||||
}
|
||||
else if ((c->GetTarget()->GetRace() > 0 && c->GetTarget()->GetRace() <= 12) ||
|
||||
c->GetTarget()->GetRace() == 128 || c->GetTarget()->GetRace() == 130 ||
|
||||
c->GetTarget()->GetRace() == 330 || c->GetTarget()->GetRace() == 522) {
|
||||
for (i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTintableTexture; i++)
|
||||
for (i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTintableTexture; i++)
|
||||
{
|
||||
c->GetTarget()->SendTextureWC(i, texture);
|
||||
}
|
||||
@@ -2567,14 +2567,14 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if ((scopeWhere & peekWorn) && (targetClient->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)) {
|
||||
inst_main = targetClient->GetInv().GetItem(EQEmu::legacy::SlotPowerSource);
|
||||
inst_main = targetClient->GetInv().GetItem(EQEmu::inventory::slotPowerSource);
|
||||
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
|
||||
linker.SetItemInst(inst_main);
|
||||
|
||||
item_link = linker.GenerateLink();
|
||||
|
||||
c->Message((item_data == nullptr), "WornSlot: %i, Item: %i (%s), Charges: %i",
|
||||
EQEmu::legacy::SlotPowerSource, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
|
||||
EQEmu::inventory::slotPowerSource, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
|
||||
}
|
||||
|
||||
// inv
|
||||
@@ -2588,7 +2588,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
c->Message((item_data == nullptr), "InvSlot: %i, Item: %i (%s), Charges: %i",
|
||||
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
|
||||
|
||||
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
|
||||
for (uint8 indexSub = EQEmu::inventory::containerBegin; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
|
||||
inst_sub = inst_main->GetItem(indexSub);
|
||||
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
|
||||
linker.SetItemInst(inst_sub);
|
||||
@@ -2608,7 +2608,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
item_link = linker.GenerateLink();
|
||||
|
||||
c->Message(1, "CursorSlot: %i, Item: %i (%s), Charges: %i",
|
||||
EQEmu::legacy::SlotCursor, 0, item_link.c_str(), 0);
|
||||
EQEmu::inventory::slotCursor, 0, item_link.c_str(), 0);
|
||||
}
|
||||
else {
|
||||
int cursorDepth = 0;
|
||||
@@ -2620,9 +2620,9 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
item_link = linker.GenerateLink();
|
||||
|
||||
c->Message((item_data == nullptr), "CursorSlot: %i, Depth: %i, Item: %i (%s), Charges: %i",
|
||||
EQEmu::legacy::SlotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
|
||||
EQEmu::inventory::slotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
|
||||
|
||||
for (uint8 indexSub = SUB_INDEX_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
|
||||
for (uint8 indexSub = EQEmu::inventory::containerBegin; (cursorDepth == 0) && inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
|
||||
inst_sub = inst_main->GetItem(indexSub);
|
||||
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
|
||||
linker.SetItemInst(inst_sub);
|
||||
@@ -2630,7 +2630,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
item_link = linker.GenerateLink();
|
||||
|
||||
c->Message((item_data == nullptr), " CursorBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
|
||||
Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, indexSub), EQEmu::legacy::SlotCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
|
||||
Inventory::CalcSlotId(EQEmu::inventory::slotCursor, indexSub), EQEmu::inventory::slotCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2659,7 +2659,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
c->Message((item_data == nullptr), "BankSlot: %i, Item: %i (%s), Charges: %i",
|
||||
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
|
||||
|
||||
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
|
||||
for (uint8 indexSub = EQEmu::inventory::containerBegin; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
|
||||
inst_sub = inst_main->GetItem(indexSub);
|
||||
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
|
||||
linker.SetItemInst(inst_sub);
|
||||
@@ -2681,7 +2681,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
c->Message((item_data == nullptr), "SharedBankSlot: %i, Item: %i (%s), Charges: %i",
|
||||
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
|
||||
|
||||
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
|
||||
for (uint8 indexSub = EQEmu::inventory::containerBegin; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
|
||||
inst_sub = inst_main->GetItem(indexSub);
|
||||
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
|
||||
linker.SetItemInst(inst_sub);
|
||||
@@ -2704,7 +2704,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
c->Message((item_data == nullptr), "TradeSlot: %i, Item: %i (%s), Charges: %i",
|
||||
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
|
||||
|
||||
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
|
||||
for (uint8 indexSub = EQEmu::inventory::containerBegin; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
|
||||
inst_sub = inst_main->GetItem(indexSub);
|
||||
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
|
||||
linker.SetItemInst(inst_sub);
|
||||
@@ -2726,7 +2726,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
else {
|
||||
c->Message(0, "[WorldObject DBID: %i (entityid: %i)]", objectTradeskill->GetDBID(), objectTradeskill->GetID());
|
||||
|
||||
for (int16 indexMain = SLOT_BEGIN; indexMain < EQEmu::legacy::TYPE_WORLD_SIZE; ++indexMain) {
|
||||
for (int16 indexMain = EQEmu::inventory::slotBegin; indexMain < EQEmu::legacy::TYPE_WORLD_SIZE; ++indexMain) {
|
||||
inst_main = objectTradeskill->GetItem(indexMain);
|
||||
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
|
||||
linker.SetItemInst(inst_main);
|
||||
@@ -2736,7 +2736,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
c->Message((item_data == nullptr), "WorldSlot: %i, Item: %i (%s), Charges: %i",
|
||||
(EQEmu::legacy::WORLD_BEGIN + indexMain), ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
|
||||
|
||||
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(EQEmu::item::ItemClassBag) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
|
||||
for (uint8 indexSub = EQEmu::inventory::containerBegin; inst_main && inst_main->IsType(EQEmu::item::ItemClassBag) && (indexSub < EQEmu::inventory::ContainerCount); ++indexSub) {
|
||||
inst_sub = inst_main->GetItem(indexSub);
|
||||
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
|
||||
linker.SetItemInst(inst_sub);
|
||||
@@ -3145,8 +3145,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::legacy::SlotPowerSource))) {
|
||||
const EQEmu::ItemInstance* from_inst = c->GetInv().GetItem(EQEmu::legacy::SlotCursor);
|
||||
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);
|
||||
const EQEmu::ItemInstance* to_inst = c->GetInv().GetItem(slot_id); // added (desync issue when forcing stack to stack)
|
||||
bool partialmove = false;
|
||||
int16 movecount;
|
||||
@@ -3154,7 +3154,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::legacy::SlotCursor;
|
||||
mi->from_slot = EQEmu::inventory::slotCursor;
|
||||
mi->to_slot = slot_id;
|
||||
// mi->number_in_stack = from_inst->GetCharges(); // replaced with con check for stacking
|
||||
|
||||
@@ -4339,7 +4339,7 @@ void command_goto(Client *c, const Seperator *sep)
|
||||
|
||||
void command_iteminfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto inst = c->GetInv()[EQEmu::legacy::SlotCursor];
|
||||
auto inst = c->GetInv()[EQEmu::inventory::slotCursor];
|
||||
if (!inst) {
|
||||
c->Message(13, "Error: You need an item on your cursor for this command");
|
||||
return;
|
||||
@@ -7124,7 +7124,7 @@ void command_path(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
void Client::Undye() {
|
||||
for (int cur_slot = EQEmu::textures::TextureBegin; cur_slot <= EQEmu::textures::LastTexture; cur_slot++) {
|
||||
for (int cur_slot = EQEmu::textures::textureBegin; cur_slot <= EQEmu::textures::LastTexture; cur_slot++) {
|
||||
uint8 slot2=SlotConvert(cur_slot);
|
||||
EQEmu::ItemInstance* inst = m_inv.GetItem(slot2);
|
||||
|
||||
|
||||
+21
-21
@@ -323,12 +323,12 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
|
||||
// to go into the regular slots on the player, out of bags
|
||||
std::list<uint32> removed_list;
|
||||
|
||||
for (i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++i) {
|
||||
if (i == EQEmu::legacy::SlotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
|
||||
item = client->GetInv().GetItem(EQEmu::legacy::SlotPowerSource);
|
||||
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);
|
||||
if (item != nullptr) {
|
||||
if (!client->IsBecomeNPC() || (client->IsBecomeNPC() && !item->GetItem()->NoRent))
|
||||
MoveItemToCorpse(client, item, EQEmu::legacy::SlotPowerSource, removed_list);
|
||||
MoveItemToCorpse(client, item, EQEmu::inventory::slotPowerSource, removed_list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,9 +405,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::legacy::SlotCursor) { break; }
|
||||
if (equipSlot < EQEmu::legacy::GENERAL_BEGIN || equipSlot > EQEmu::inventory::slotCursor) { break; }
|
||||
|
||||
for (auto sub_index = SUB_INDEX_BEGIN; sub_index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++sub_index) {
|
||||
for (int16 sub_index = EQEmu::inventory::containerBegin; sub_index < EQEmu::inventory::ContainerCount; ++sub_index) {
|
||||
int16 real_bag_slot = Inventory::CalcSlotId(equipSlot, sub_index);
|
||||
auto bag_inst = client->GetInv().GetItem(real_bag_slot);
|
||||
if (bag_inst == nullptr) { continue; }
|
||||
@@ -685,7 +685,7 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct**
|
||||
}
|
||||
|
||||
if (sitem && bag_item_data && Inventory::SupportsContainers(sitem->equip_slot)) {
|
||||
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, SUB_INDEX_BEGIN);
|
||||
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, EQEmu::inventory::containerBegin);
|
||||
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
@@ -740,7 +740,7 @@ void Corpse::RemoveItem(ServerLootItem_Struct* item_data)
|
||||
itemlist.erase(iter);
|
||||
|
||||
uint8 material = Inventory::CalcMaterialFromSlot(sitem->equip_slot); // autos to unsigned char
|
||||
if (material != EQEmu::textures::TextureInvalid)
|
||||
if (material != EQEmu::textures::materialInvalid)
|
||||
SendWearChange(material);
|
||||
|
||||
UpdateEquipmentLight();
|
||||
@@ -999,7 +999,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
|
||||
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()))->InventoryTypeSize[EQEmu::legacy::TypeCorpse];
|
||||
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()))->InventoryTypeSize[EQEmu::inventory::typeCorpse];
|
||||
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* item_data = *cur;
|
||||
@@ -1008,7 +1008,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::legacy::SlotCursor || item_data->equip_slot == EQEmu::legacy::SlotPowerSource || Loot_Request_Type >= 3 ||
|
||||
if (!IsPlayerCorpse() || item_data->equip_slot <= EQEmu::inventory::slotCursor || item_data->equip_slot == EQEmu::inventory::slotPowerSource || Loot_Request_Type >= 3 ||
|
||||
(item_data->equip_slot >= 8000 && item_data->equip_slot <= 8999)) {
|
||||
if(i < corpselootlimit) {
|
||||
item = database.GetItem(item_data->item_id);
|
||||
@@ -1148,7 +1148,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
|
||||
}
|
||||
|
||||
if (inst->IsAugmented()) {
|
||||
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
EQEmu::ItemInstance *itm = inst->GetAugment(i);
|
||||
if (itm) {
|
||||
if (client->CheckLoreConflict(itm->GetItem())) {
|
||||
@@ -1190,10 +1190,10 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
|
||||
/* First add it to the looter - this will do the bag contents too */
|
||||
if (lootitem->auto_loot) {
|
||||
if (!client->AutoPutLootInInventory(*inst, true, true, bag_item_data))
|
||||
client->PutLootInInventory(EQEmu::legacy::SlotCursor, *inst, bag_item_data);
|
||||
client->PutLootInInventory(EQEmu::inventory::slotCursor, *inst, bag_item_data);
|
||||
}
|
||||
else {
|
||||
client->PutLootInInventory(EQEmu::legacy::SlotCursor, *inst, bag_item_data);
|
||||
client->PutLootInInventory(EQEmu::inventory::slotCursor, *inst, bag_item_data);
|
||||
}
|
||||
|
||||
/* Update any tasks that have an activity to loot this item */
|
||||
@@ -1210,7 +1210,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
|
||||
|
||||
/* Remove Bag Contents */
|
||||
if (item->IsClassBag() && (GetPlayerKillItem() != -1 || GetPlayerKillItem() != 1)) {
|
||||
for (int i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) {
|
||||
for (int i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
|
||||
if (bag_item_data[i]) {
|
||||
/* Delete needs to be before RemoveItem because its deletes the pointer for item_data/bag_item_data */
|
||||
database.DeleteItemOffCharacterCorpse(this->corpse_db_id, bag_item_data[i]->equip_slot, bag_item_data[i]->item_id);
|
||||
@@ -1294,7 +1294,7 @@ void Corpse::QueryLoot(Client* to) {
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
|
||||
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()))->InventoryTypeSize[EQEmu::legacy::TypeCorpse];
|
||||
int corpselootlimit = EQEmu::inventory::Lookup(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()))->InventoryTypeSize[EQEmu::inventory::typeCorpse];
|
||||
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* sitem = *cur;
|
||||
@@ -1403,12 +1403,12 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const {
|
||||
int16 invslot;
|
||||
|
||||
if (material_slot > EQEmu::textures::LastTexture) {
|
||||
return NO_ITEM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
invslot = Inventory::CalcSlotFromMaterial(material_slot);
|
||||
if(invslot == INVALID_INDEX) // GetWornItem() should be returning a NO_ITEM for any invalid index...
|
||||
return NO_ITEM;
|
||||
if(invslot == INVALID_INDEX) // GetWornItem() should be returning a 0 for any invalid index...
|
||||
return 0;
|
||||
|
||||
return GetWornItem(invslot);
|
||||
}
|
||||
@@ -1421,7 +1421,7 @@ uint32 Corpse::GetEquipmentColor(uint8 material_slot) const {
|
||||
}
|
||||
|
||||
item = database.GetItem(GetEquipment(material_slot));
|
||||
if(item != NO_ITEM) {
|
||||
if(item != 0) {
|
||||
return (item_tint.Slot[material_slot].UseTint ? item_tint.Slot[material_slot].Color : item->Color);
|
||||
}
|
||||
|
||||
@@ -1434,8 +1434,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::legacy::SlotPowerSource) { continue; }
|
||||
if ((*iter)->equip_slot == EQEmu::legacy::SlotAmmo) { continue; }
|
||||
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; }
|
||||
|
||||
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, int special = 0) { return; }
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return false; }
|
||||
virtual Raid* GetRaid() { return 0; }
|
||||
|
||||
+1
-1
@@ -188,7 +188,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
uint8 keepoffkeyring = GetNoKeyring();
|
||||
uint32 haskey = 0;
|
||||
uint32 playerkey = 0;
|
||||
const EQEmu::ItemInstance *lockpicks = sender->GetInv().GetItem(EQEmu::legacy::SlotCursor);
|
||||
const EQEmu::ItemInstance *lockpicks = sender->GetInv().GetItem(EQEmu::inventory::slotCursor);
|
||||
|
||||
haskey = sender->GetInv().HasItem(keyneeded, 1);
|
||||
|
||||
|
||||
+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, int special = 0) { return; }
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr, int special = 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -352,7 +352,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::legacy::SlotPrimary, int count = 0, bool IsFromSpell = false);
|
||||
void AEAttack(Mob *attacker, float dist, int Hand = EQEmu::inventory::slotPrimary, int count = 0, bool IsFromSpell = false);
|
||||
void AETaunt(Client *caster, float range=0, int32 bonus_hate=0);
|
||||
void AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true, int16 resist_adjust = 0);
|
||||
void MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true);
|
||||
|
||||
+6
-6
@@ -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::legacy::SlotPrimary];
|
||||
const EQEmu::ItemInstance* Pole = m_inv[EQEmu::inventory::slotPrimary];
|
||||
int32 bslot = m_inv.HasItemByUse(EQEmu::item::ItemTypeFishingBait, 1, invWhereWorn | invWherePersonal);
|
||||
const EQEmu::ItemInstance* Bait = nullptr;
|
||||
if (bslot != INVALID_INDEX)
|
||||
@@ -317,12 +317,12 @@ void Client::GoFish()
|
||||
else
|
||||
{
|
||||
PushItemOnCursor(*inst);
|
||||
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||
UpdateTasksForItem(ActivityFish, food_id);
|
||||
|
||||
safe_delete(inst);
|
||||
inst = m_inv.GetItem(EQEmu::legacy::SlotCursor);
|
||||
inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
}
|
||||
|
||||
if(inst) {
|
||||
@@ -354,7 +354,7 @@ void Client::GoFish()
|
||||
//and then swap out items in primary slot... too lazy to fix right now
|
||||
if (zone->random.Int(0, 49) == 1) {
|
||||
Message_StringID(MT_Skills, FISHING_POLE_BROKE); //Your fishing pole broke!
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotPrimary, 0, true);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotPrimary, 0, true);
|
||||
}
|
||||
|
||||
if (CheckIncreaseSkill(EQEmu::skills::SkillFishing, nullptr, 5))
|
||||
@@ -431,12 +431,12 @@ void Client::ForageItem(bool guarantee) {
|
||||
}
|
||||
else {
|
||||
PushItemOnCursor(*inst);
|
||||
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem))
|
||||
UpdateTasksForItem(ActivityForage, foragedfood);
|
||||
|
||||
safe_delete(inst);
|
||||
inst = m_inv.GetItem(EQEmu::legacy::SlotCursor);
|
||||
inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
}
|
||||
|
||||
if(inst) {
|
||||
|
||||
+114
-114
@@ -48,8 +48,8 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
}
|
||||
|
||||
if (GetItemIDAt(EQEmu::legacy::SlotPowerSource) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(EQEmu::legacy::SlotPowerSource) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(EQEmu::legacy::SlotPowerSource);
|
||||
if (GetItemIDAt(EQEmu::inventory::slotPowerSource) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(EQEmu::inventory::slotPowerSource) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(EQEmu::inventory::slotPowerSource);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
x += cur->GetCharges();
|
||||
} else {
|
||||
@@ -57,22 +57,22 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotPowerSource, 0, true);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotPowerSource, 0, true);
|
||||
else
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotPowerSource, 0, false); // Prevents Titanium crash
|
||||
DeleteItemInInventory(EQEmu::inventory::slotPowerSource, 0, false); // Prevents Titanium crash
|
||||
}
|
||||
}
|
||||
|
||||
if(where_to_check & invWhereCursor) {
|
||||
if (GetItemIDAt(EQEmu::legacy::SlotCursor) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(EQEmu::legacy::SlotCursor) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(EQEmu::legacy::SlotCursor);
|
||||
if (GetItemIDAt(EQEmu::inventory::slotCursor) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(EQEmu::inventory::slotCursor) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
x += cur->GetCharges();
|
||||
} else {
|
||||
x++;
|
||||
}
|
||||
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotCursor, 0, true);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor, 0, true);
|
||||
}
|
||||
|
||||
for (i = EQEmu::legacy::CURSOR_BAG_BEGIN; i <= EQEmu::legacy::CURSOR_BAG_END; i++) {
|
||||
@@ -236,7 +236,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
}
|
||||
*/
|
||||
|
||||
uint32 augments[EQEmu::legacy::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 };
|
||||
uint32 augments[EQEmu::inventory::SocketCount] = { aug1, aug2, aug3, aug4, aug5, aug6 };
|
||||
|
||||
uint32 classes = item->Classes;
|
||||
uint32 races = item->Races;
|
||||
@@ -246,7 +246,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
bool enforcerestr = RuleB(Inventory, EnforceAugmentRestriction);
|
||||
bool enforceusable = RuleB(Inventory, EnforceAugmentUsability);
|
||||
|
||||
for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::legacy::ITEM_COMMON_SIZE; ++iter) {
|
||||
for (int iter = EQEmu::inventory::socketBegin; iter < EQEmu::inventory::SocketCount; ++iter) {
|
||||
const EQEmu::ItemData* augtest = database.GetItem(augments[iter]);
|
||||
|
||||
if(augtest == nullptr) {
|
||||
@@ -540,7 +540,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
}
|
||||
|
||||
// add any validated augments
|
||||
for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::legacy::ITEM_COMMON_SIZE; ++iter) {
|
||||
for (int iter = EQEmu::inventory::socketBegin; iter < EQEmu::inventory::SocketCount; ++iter) {
|
||||
if(augments[iter])
|
||||
inst->PutAugment(&database, iter, augments[iter]);
|
||||
}
|
||||
@@ -554,22 +554,22 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
inst->SetOrnamentHeroModel(ornament_hero_model);
|
||||
|
||||
// check to see if item is usable in requested slot
|
||||
if (enforceusable && (((to_slot >= EQEmu::legacy::SlotCharm) && (to_slot <= EQEmu::legacy::SlotAmmo)) || (to_slot == EQEmu::legacy::SlotPowerSource))) {
|
||||
uint32 slottest = (to_slot == EQEmu::legacy::SlotPowerSource) ? 22 : to_slot; // can't change '22' just yet...
|
||||
if (enforceusable && (((to_slot >= EQEmu::inventory::slotCharm) && (to_slot <= EQEmu::inventory::slotAmmo)) || (to_slot == EQEmu::inventory::slotPowerSource))) {
|
||||
uint32 slottest = (to_slot == EQEmu::inventory::slotPowerSource) ? 22 : to_slot; // can't change '22' just yet...
|
||||
|
||||
if(!(slots & ((uint32)1 << slottest))) {
|
||||
Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||
GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||
|
||||
to_slot = EQEmu::legacy::SlotCursor;
|
||||
to_slot = EQEmu::inventory::slotCursor;
|
||||
}
|
||||
}
|
||||
|
||||
// put item into inventory
|
||||
if (to_slot == EQEmu::legacy::SlotCursor) {
|
||||
if (to_slot == EQEmu::inventory::slotCursor) {
|
||||
PushItemOnCursor(*inst);
|
||||
SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, inst, ItemPacketLimbo);
|
||||
}
|
||||
else {
|
||||
PutItemInInventory(to_slot, *inst, true);
|
||||
@@ -617,7 +617,7 @@ void Client::DropItem(int16 slot_id)
|
||||
}
|
||||
|
||||
// Save client inventory change to database
|
||||
if (slot_id == EQEmu::legacy::SlotCursor) {
|
||||
if (slot_id == EQEmu::inventory::slotCursor) {
|
||||
SendCursorBuffer();
|
||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
database.SaveCursor(CharacterID(), s, e);
|
||||
@@ -706,11 +706,11 @@ void Client::SendCursorBuffer()
|
||||
GetName(), test_item->Name, test_item->ID);
|
||||
Message_StringID(MT_LootMessages, 290);
|
||||
parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0);
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotCursor);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor);
|
||||
SendCursorBuffer();
|
||||
}
|
||||
else {
|
||||
SendItemPacket(EQEmu::legacy::SlotCursor, test_inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, test_inst, ItemPacketLimbo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -763,7 +763,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
|
||||
qsaudit->items[parent_offset].aug_5 = m_inv[slot_id]->GetAugmentItemID(5);
|
||||
|
||||
if (m_inv[slot_id]->IsClassBag()) {
|
||||
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) {
|
||||
for (uint8 bag_idx = EQEmu::inventory::containerBegin; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) {
|
||||
EQEmu::ItemInstance* bagitem = m_inv[slot_id]->GetItem(bag_idx);
|
||||
|
||||
if(bagitem) {
|
||||
@@ -790,7 +790,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
|
||||
bool isDeleted = m_inv.DeleteItem(slot_id, quantity);
|
||||
|
||||
const EQEmu::ItemInstance* inst = nullptr;
|
||||
if (slot_id == EQEmu::legacy::SlotCursor) {
|
||||
if (slot_id == EQEmu::inventory::slotCursor) {
|
||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
if(update_db)
|
||||
database.SaveCursor(character_id, s, e);
|
||||
@@ -842,7 +842,7 @@ bool Client::PushItemOnCursor(const EQEmu::ItemInstance& inst, bool client_updat
|
||||
m_inv.PushCursor(inst);
|
||||
|
||||
if (client_update) {
|
||||
SendItemPacket(EQEmu::legacy::SlotCursor, &inst, ItemPacketLimbo);
|
||||
SendItemPacket(EQEmu::inventory::slotCursor, &inst, ItemPacketLimbo);
|
||||
}
|
||||
|
||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
@@ -856,7 +856,7 @@ bool Client::PushItemOnCursor(const EQEmu::ItemInstance& inst, bool client_updat
|
||||
bool Client::PutItemInInventory(int16 slot_id, const EQEmu::ItemInstance& inst, bool client_update) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id);
|
||||
|
||||
if (slot_id == EQEmu::legacy::SlotCursor) { // don't trust macros before conditional statements...
|
||||
if (slot_id == EQEmu::inventory::slotCursor) { // don't trust macros before conditional statements...
|
||||
return PushItemOnCursor(inst, client_update);
|
||||
}
|
||||
else {
|
||||
@@ -865,11 +865,11 @@ bool Client::PutItemInInventory(int16 slot_id, const EQEmu::ItemInstance& inst,
|
||||
|
||||
if (client_update)
|
||||
{
|
||||
SendItemPacket(slot_id, &inst, ((slot_id == EQEmu::legacy::SlotCursor) ? ItemPacketLimbo : ItemPacketTrade));
|
||||
SendItemPacket(slot_id, &inst, ((slot_id == EQEmu::inventory::slotCursor) ? ItemPacketLimbo : ItemPacketTrade));
|
||||
//SendWearChange(Inventory::CalcMaterialFromSlot(slot_id));
|
||||
}
|
||||
|
||||
if (slot_id == EQEmu::legacy::SlotCursor) {
|
||||
if (slot_id == EQEmu::inventory::slotCursor) {
|
||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
return database.SaveCursor(this->CharacterID(), s, e);
|
||||
}
|
||||
@@ -887,7 +887,7 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
|
||||
|
||||
bool cursor_empty = m_inv.CursorEmpty();
|
||||
|
||||
if (slot_id == EQEmu::legacy::SlotCursor) {
|
||||
if (slot_id == EQEmu::inventory::slotCursor) {
|
||||
m_inv.PushCursor(inst);
|
||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
database.SaveCursor(this->CharacterID(), s, e);
|
||||
@@ -898,7 +898,7 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
|
||||
}
|
||||
|
||||
// Subordinate items in cursor buffer must be sent via ItemPacketSummonItem or we just overwrite the visible cursor and desync the client
|
||||
if (slot_id == EQEmu::legacy::SlotCursor && !cursor_empty) {
|
||||
if (slot_id == EQEmu::inventory::slotCursor && !cursor_empty) {
|
||||
// RoF+ currently has a specialized cursor handler
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
SendItemPacket(slot_id, &inst, ItemPacketLimbo);
|
||||
@@ -908,7 +908,7 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
|
||||
}
|
||||
|
||||
if (bag_item_data) {
|
||||
for (int index = 0; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++index) {
|
||||
for (int index = 0; index < EQEmu::inventory::ContainerCount; ++index) {
|
||||
if (bag_item_data[index] == nullptr)
|
||||
continue;
|
||||
|
||||
@@ -926,12 +926,12 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
|
||||
|
||||
// Dump bag contents to cursor in the event that owning bag is not the first cursor item
|
||||
// (This assumes that the data passed is correctly associated..no safety checks are implemented)
|
||||
if (slot_id == EQEmu::legacy::SlotCursor && !cursor_empty) {
|
||||
if (slot_id == EQEmu::inventory::slotCursor && !cursor_empty) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory,
|
||||
"Putting bag loot item %s (%d) into slot %d (non-empty cursor override)",
|
||||
inst.GetItem()->Name, inst.GetItem()->ID, EQEmu::legacy::SlotCursor);
|
||||
inst.GetItem()->Name, inst.GetItem()->ID, EQEmu::inventory::slotCursor);
|
||||
|
||||
PutLootInInventory(EQEmu::legacy::SlotCursor, *bagitem);
|
||||
PutLootInInventory(EQEmu::inventory::slotCursor, *bagitem);
|
||||
}
|
||||
else {
|
||||
auto bag_slot = Inventory::CalcSlotId(slot_id, index);
|
||||
@@ -965,7 +965,7 @@ bool Client::TryStacking(EQEmu::ItemInstance* item, uint8 type, bool try_worn, b
|
||||
}
|
||||
}
|
||||
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
|
||||
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) {
|
||||
for (uint8 j = EQEmu::inventory::containerBegin; j < EQEmu::inventory::ContainerCount; j++) {
|
||||
uint16 slotid = Inventory::CalcSlotId(i, j);
|
||||
EQEmu::ItemInstance* tmp_inst = m_inv.GetItem(slotid);
|
||||
|
||||
@@ -990,28 +990,28 @@ bool Client::AutoPutLootInInventory(EQEmu::ItemInstance& inst, bool try_worn, bo
|
||||
// #1: Try to auto equip
|
||||
if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel <= level && (!inst.GetItem()->Attuneable || inst.IsAttuned()) && inst.GetItem()->ItemType != EQEmu::item::ItemTypeAugmentation) {
|
||||
// too messy as-is... <watch>
|
||||
for (int16 i = EQEmu::legacy::EQUIPMENT_BEGIN; i < EQEmu::legacy::SlotPowerSource; i++) { // originally (i < 22)
|
||||
for (int16 i = EQEmu::legacy::EQUIPMENT_BEGIN; i < EQEmu::inventory::slotPowerSource; i++) { // originally (i < 22)
|
||||
if (i == EQEmu::legacy::GENERAL_BEGIN) {
|
||||
// added power source check for SoF+ clients
|
||||
if (this->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
i = EQEmu::legacy::SlotPowerSource;
|
||||
i = EQEmu::inventory::slotPowerSource;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (!m_inv[i]) {
|
||||
if (i == EQEmu::legacy::SlotPrimary && inst.IsWeapon()) { // If item is primary slot weapon
|
||||
if (i == EQEmu::inventory::slotPrimary && inst.IsWeapon()) { // If item is primary slot weapon
|
||||
if (inst.GetItem()->IsType2HWeapon()) { // and uses 2hs \ 2hb \ 2hp
|
||||
if (m_inv[EQEmu::legacy::SlotSecondary]) { // and if secondary slot is not empty
|
||||
if (m_inv[EQEmu::inventory::slotSecondary]) { // and if secondary slot is not empty
|
||||
continue; // Can't auto-equip
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i == EQEmu::legacy::SlotSecondary && m_inv[EQEmu::legacy::SlotPrimary]) { // check to see if primary slot is a two hander
|
||||
if (m_inv[EQEmu::legacy::SlotPrimary]->GetItem()->IsType2HWeapon())
|
||||
if (i == EQEmu::inventory::slotSecondary && m_inv[EQEmu::inventory::slotPrimary]) { // check to see if primary slot is a two hander
|
||||
if (m_inv[EQEmu::inventory::slotPrimary]->GetItem()->IsType2HWeapon())
|
||||
continue;
|
||||
}
|
||||
if (i == EQEmu::legacy::SlotSecondary && inst.IsWeapon() && !CanThisClassDualWield()) {
|
||||
if (i == EQEmu::inventory::slotSecondary && inst.IsWeapon() && !CanThisClassDualWield()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1019,7 +1019,7 @@ bool Client::AutoPutLootInInventory(EQEmu::ItemInstance& inst, bool try_worn, bo
|
||||
//send worn to everyone...
|
||||
PutLootInInventory(i, inst);
|
||||
uint8 worn_slot_material = Inventory::CalcMaterialFromSlot(i);
|
||||
if (worn_slot_material != EQEmu::textures::TextureInvalid) {
|
||||
if (worn_slot_material != EQEmu::textures::materialInvalid) {
|
||||
SendWearChange(worn_slot_material);
|
||||
}
|
||||
|
||||
@@ -1062,7 +1062,7 @@ void Client::MoveItemCharges(EQEmu::ItemInstance &from, int16 to_slot, uint8 typ
|
||||
tmp_inst->SetCharges(tmp_inst->GetCharges() + charges_to_move);
|
||||
from.SetCharges(from.GetCharges() - charges_to_move);
|
||||
SendLootItemInPacket(tmp_inst, to_slot);
|
||||
if (to_slot == EQEmu::legacy::SlotCursor) {
|
||||
if (to_slot == EQEmu::inventory::slotCursor) {
|
||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
database.SaveCursor(this->CharacterID(), s, e);
|
||||
}
|
||||
@@ -1319,7 +1319,7 @@ void Client::SendLootItemInPacket(const EQEmu::ItemInstance* inst, int16 slot_id
|
||||
|
||||
bool Client::IsValidSlot(uint32 slot) {
|
||||
if ((slot == (uint32)INVALID_INDEX) ||
|
||||
(slot >= SLOT_BEGIN && slot < EQEmu::legacy::TYPE_POSSESSIONS_SIZE) ||
|
||||
(slot >= EQEmu::inventory::slotBegin && slot < EQEmu::legacy::TYPE_POSSESSIONS_SIZE) ||
|
||||
(slot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot <= EQEmu::legacy::CURSOR_BAG_END) ||
|
||||
(slot >= EQEmu::legacy::TRIBUTE_BEGIN && slot <= EQEmu::legacy::TRIBUTE_END) ||
|
||||
(slot >= EQEmu::legacy::BANK_BEGIN && slot <= EQEmu::legacy::BANK_END) ||
|
||||
@@ -1328,7 +1328,7 @@ bool Client::IsValidSlot(uint32 slot) {
|
||||
(slot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::legacy::SHARED_BANK_BAGS_END) ||
|
||||
(slot >= EQEmu::legacy::TRADE_BEGIN && slot <= EQEmu::legacy::TRADE_END) ||
|
||||
(slot >= EQEmu::legacy::WORLD_BEGIN && slot <= EQEmu::legacy::WORLD_END) ||
|
||||
(slot == EQEmu::legacy::SlotPowerSource)
|
||||
(slot == EQEmu::inventory::slotPowerSource)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
@@ -1378,8 +1378,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF) { return true; } // Can't do RoF+
|
||||
|
||||
if (move_in->to_slot == EQEmu::legacy::SlotCursor) {
|
||||
auto test_inst = m_inv.GetItem(EQEmu::legacy::SlotCursor);
|
||||
if (move_in->to_slot == EQEmu::inventory::slotCursor) {
|
||||
auto test_inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
if (test_inst == nullptr) { return true; }
|
||||
auto test_item = test_inst->GetItem();
|
||||
if (test_item == nullptr) { return true; }
|
||||
@@ -1398,18 +1398,18 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
GetName(), test_item->Name, test_item->ID);
|
||||
Message_StringID(MT_LootMessages, 290);
|
||||
parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0);
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotCursor, 0, true);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor, 0, true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (move_in->to_slot == (uint32)INVALID_INDEX) {
|
||||
if (move_in->from_slot == (uint32)EQEmu::legacy::SlotCursor) {
|
||||
if (move_in->from_slot == (uint32)EQEmu::inventory::slotCursor) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot);
|
||||
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
|
||||
|
||||
EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::legacy::SlotCursor);
|
||||
EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
if(inst) {
|
||||
parse->EventItem(EVENT_DESTROY_ITEM, this, inst, nullptr, "", 0);
|
||||
}
|
||||
@@ -1426,9 +1426,9 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
return true; // Item deletion
|
||||
}
|
||||
}
|
||||
if (auto_attack && (move_in->from_slot == EQEmu::legacy::SlotPrimary || move_in->from_slot == EQEmu::legacy::SlotSecondary || move_in->from_slot == EQEmu::legacy::SlotRange))
|
||||
if (auto_attack && (move_in->from_slot == EQEmu::inventory::slotPrimary || move_in->from_slot == EQEmu::inventory::slotSecondary || move_in->from_slot == EQEmu::inventory::slotRange))
|
||||
SetAttackTimer();
|
||||
else if (auto_attack && (move_in->to_slot == EQEmu::legacy::SlotPrimary || move_in->to_slot == EQEmu::legacy::SlotSecondary || move_in->to_slot == EQEmu::legacy::SlotRange))
|
||||
else if (auto_attack && (move_in->to_slot == EQEmu::inventory::slotPrimary || move_in->to_slot == EQEmu::inventory::slotSecondary || move_in->to_slot == EQEmu::inventory::slotRange))
|
||||
SetAttackTimer();
|
||||
// Step 1: Variables
|
||||
int16 src_slot_id = (int16)move_in->from_slot;
|
||||
@@ -1516,7 +1516,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
return(false);
|
||||
}
|
||||
if (src_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::legacy::SHARED_BANK_END && src_inst->IsClassBag()){
|
||||
for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) {
|
||||
for (uint8 idx = EQEmu::inventory::containerBegin; idx < EQEmu::inventory::ContainerCount; idx++) {
|
||||
const EQEmu::ItemInstance* baginst = src_inst->GetItem(idx);
|
||||
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(src_slot_id, idx), baginst)){
|
||||
DeleteItemInInventory(Inventory::CalcSlotId(src_slot_id, idx),0,false);
|
||||
@@ -1531,7 +1531,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
return(false);
|
||||
}
|
||||
if (dst_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::legacy::SHARED_BANK_END && dst_inst->IsClassBag()){
|
||||
for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) {
|
||||
for (uint8 idx = EQEmu::inventory::containerBegin; idx < EQEmu::inventory::ContainerCount; idx++) {
|
||||
const EQEmu::ItemInstance* baginst = dst_inst->GetItem(idx);
|
||||
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(dst_slot_id, idx), baginst)){
|
||||
DeleteItemInInventory(Inventory::CalcSlotId(dst_slot_id, idx),0,false);
|
||||
@@ -1638,7 +1638,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
|
||||
safe_delete(world_inst);
|
||||
if (src_slot_id == EQEmu::legacy::SlotCursor)
|
||||
if (src_slot_id == EQEmu::inventory::slotCursor)
|
||||
{
|
||||
if (dstitemid == 0)
|
||||
{
|
||||
@@ -1660,14 +1660,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
|
||||
// Step 4: Check for entity trade
|
||||
if (dst_slot_id >= EQEmu::legacy::TRADE_BEGIN && dst_slot_id <= EQEmu::legacy::TRADE_END) {
|
||||
if (src_slot_id != EQEmu::legacy::SlotCursor) {
|
||||
if (src_slot_id != EQEmu::inventory::slotCursor) {
|
||||
Kick();
|
||||
return false;
|
||||
}
|
||||
if (with) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName());
|
||||
// Fill Trade list with items from cursor
|
||||
if (!m_inv[EQEmu::legacy::SlotCursor]) {
|
||||
if (!m_inv[EQEmu::inventory::slotCursor]) {
|
||||
Message(13, "Error: Cursor item not located on server!");
|
||||
return false;
|
||||
}
|
||||
@@ -1687,7 +1687,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
|
||||
|
||||
SummonItem(src_inst->GetID(), src_inst->GetCharges());
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotCursor);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotCursor);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1752,12 +1752,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
else {
|
||||
// Not dealing with charges - just do direct swap
|
||||
if (src_inst && (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END || dst_slot_id == EQEmu::legacy::SlotPowerSource) && dst_slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) {
|
||||
if (src_inst && (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END || dst_slot_id == EQEmu::inventory::slotPowerSource) && dst_slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) {
|
||||
if (src_inst->GetItem()->Attuneable) {
|
||||
src_inst->SetAttuned(true);
|
||||
}
|
||||
if (src_inst->IsAugmented()) {
|
||||
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
if (src_inst->GetAugment(i)) {
|
||||
if (src_inst->GetAugment(i)->GetItem()->Attuneable) {
|
||||
src_inst->GetAugment(i)->SetAttuned(true);
|
||||
@@ -1770,7 +1770,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; }
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id);
|
||||
|
||||
if (src_slot_id <= EQEmu::legacy::EQUIPMENT_END || src_slot_id == EQEmu::legacy::SlotPowerSource) {
|
||||
if (src_slot_id <= EQEmu::legacy::EQUIPMENT_END || src_slot_id == EQEmu::inventory::slotPowerSource) {
|
||||
if(src_inst) {
|
||||
parse->EventItem(EVENT_UNEQUIP_ITEM, this, src_inst, nullptr, "", src_slot_id);
|
||||
}
|
||||
@@ -1780,7 +1780,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
}
|
||||
|
||||
if (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END || dst_slot_id == EQEmu::legacy::SlotPowerSource) {
|
||||
if (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END || dst_slot_id == EQEmu::inventory::slotPowerSource) {
|
||||
if(dst_inst) {
|
||||
parse->EventItem(EVENT_UNEQUIP_ITEM, this, dst_inst, nullptr, "", dst_slot_id);
|
||||
}
|
||||
@@ -1792,12 +1792,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
|
||||
int matslot = SlotConvert2(dst_slot_id);
|
||||
if (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END && matslot != EQEmu::textures::TextureHead) { // think this is to allow the client to update with /showhelm
|
||||
if (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END && matslot != EQEmu::textures::armorHead) { // think this is to allow the client to update with /showhelm
|
||||
SendWearChange(matslot);
|
||||
}
|
||||
|
||||
// Step 7: Save change to the database
|
||||
if (src_slot_id == EQEmu::legacy::SlotCursor) {
|
||||
if (src_slot_id == EQEmu::inventory::slotCursor) {
|
||||
// If not swapping another item to cursor and stacking items were depleted
|
||||
if (dstitemid == 0 || all_to_stack == true)
|
||||
{
|
||||
@@ -1810,7 +1810,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
database.SaveInventory(character_id, m_inv.GetItem(src_slot_id), src_slot_id);
|
||||
}
|
||||
|
||||
if (dst_slot_id == EQEmu::legacy::SlotCursor) {
|
||||
if (dst_slot_id == EQEmu::inventory::slotCursor) {
|
||||
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
|
||||
database.SaveCursor(character_id, s, e);
|
||||
}
|
||||
@@ -1834,7 +1834,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot);
|
||||
Message(15, "Inventory Desyncronization detected: Resending slot data...");
|
||||
|
||||
if ((move_slots->from_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->from_slot == EQEmu::legacy::SlotPowerSource) {
|
||||
if ((move_slots->from_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->from_slot == EQEmu::inventory::slotPowerSource) {
|
||||
int16 resync_slot = (Inventory::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : Inventory::CalcSlotId(move_slots->from_slot);
|
||||
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
|
||||
// This prevents the client from crashing when closing any 'phantom' bags
|
||||
@@ -1877,7 +1877,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
|
||||
else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); }
|
||||
}
|
||||
|
||||
if ((move_slots->to_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->to_slot == EQEmu::legacy::SlotPowerSource) {
|
||||
if ((move_slots->to_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->to_slot == EQEmu::inventory::slotPowerSource) {
|
||||
int16 resync_slot = (Inventory::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : Inventory::CalcSlotId(move_slots->to_slot);
|
||||
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
|
||||
const EQEmu::ItemData* token_struct = database.GetItem(22292); // 'Copper Coin'
|
||||
@@ -1959,7 +1959,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
|
||||
qsaudit->items[move_count++].aug_5 = from_inst->GetAugmentItemID(5);
|
||||
|
||||
if (from_inst->IsType(EQEmu::item::ItemClassBag)) {
|
||||
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) {
|
||||
for (uint8 bag_idx = EQEmu::inventory::containerBegin; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) {
|
||||
const EQEmu::ItemInstance* from_baginst = from_inst->GetItem(bag_idx);
|
||||
|
||||
if(from_baginst) {
|
||||
@@ -1992,7 +1992,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
|
||||
qsaudit->items[move_count++].aug_5 = to_inst->GetAugmentItemID(5);
|
||||
|
||||
if (to_inst->IsType(EQEmu::item::ItemClassBag)) {
|
||||
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) {
|
||||
for (uint8 bag_idx = EQEmu::inventory::containerBegin; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) {
|
||||
const EQEmu::ItemInstance* to_baginst = to_inst->GetItem(bag_idx);
|
||||
|
||||
if(to_baginst) {
|
||||
@@ -2021,7 +2021,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
|
||||
|
||||
void Client::DyeArmor(EQEmu::TintProfile* dye){
|
||||
int16 slot=0;
|
||||
for (int i = EQEmu::textures::TextureBegin; i <= EQEmu::textures::LastTintableTexture; i++) {
|
||||
for (int i = EQEmu::textures::textureBegin; i <= EQEmu::textures::LastTintableTexture; i++) {
|
||||
if ((m_pp.item_tint.Slot[i].Color & 0x00FFFFFF) != (dye->Slot[i].Color & 0x00FFFFFF)) {
|
||||
slot = m_inv.HasItem(32557, 1, invWherePersonal);
|
||||
if (slot != INVALID_INDEX){
|
||||
@@ -2115,7 +2115,7 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
|
||||
int num = 0;
|
||||
for(x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++)
|
||||
{
|
||||
if (x == EQEmu::legacy::SlotCursor + 1)
|
||||
if (x == EQEmu::inventory::slotCursor + 1)
|
||||
x = EQEmu::legacy::GENERAL_BAGS_BEGIN;
|
||||
TempItem = nullptr;
|
||||
ins = GetInv().GetItem(x);
|
||||
@@ -2132,7 +2132,7 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
|
||||
return false;
|
||||
for(x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END?
|
||||
{
|
||||
if (x == EQEmu::legacy::SlotCursor + 1)
|
||||
if (x == EQEmu::inventory::slotCursor + 1)
|
||||
x = EQEmu::legacy::GENERAL_BAGS_BEGIN;
|
||||
TempItem = nullptr;
|
||||
ins = GetInv().GetItem(x);
|
||||
@@ -2293,7 +2293,7 @@ void Client::DisenchantSummonedBags(bool client_update)
|
||||
}
|
||||
|
||||
while (!m_inv.CursorEmpty()) {
|
||||
auto inst = m_inv[EQEmu::legacy::SlotCursor];
|
||||
auto inst = m_inv[EQEmu::inventory::slotCursor];
|
||||
if (!inst) { break; }
|
||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { break; }
|
||||
if (!inst->GetItem()->IsClassBag()) { break; }
|
||||
@@ -2307,14 +2307,14 @@ void Client::DisenchantSummonedBags(bool client_update)
|
||||
if (!new_inst) { break; }
|
||||
|
||||
if (CopyBagContents(new_inst, inst)) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, EQEmu::legacy::SlotCursor);
|
||||
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, EQEmu::inventory::slotCursor);
|
||||
std::list<EQEmu::ItemInstance*> local;
|
||||
local.push_front(new_inst);
|
||||
m_inv.PopItem(EQEmu::legacy::SlotCursor);
|
||||
m_inv.PopItem(EQEmu::inventory::slotCursor);
|
||||
safe_delete(inst);
|
||||
|
||||
while (!m_inv.CursorEmpty()) {
|
||||
auto limbo_inst = m_inv.PopItem(EQEmu::legacy::SlotCursor);
|
||||
auto limbo_inst = m_inv.PopItem(EQEmu::inventory::slotCursor);
|
||||
if (limbo_inst == nullptr) { continue; }
|
||||
local.push_back(limbo_inst);
|
||||
}
|
||||
@@ -2356,11 +2356,11 @@ void Client::RemoveNoRent(bool client_update)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_inv[EQEmu::legacy::SlotPowerSource]) {
|
||||
auto inst = m_inv[EQEmu::legacy::SlotPowerSource];
|
||||
if (m_inv[EQEmu::inventory::slotPowerSource]) {
|
||||
auto inst = m_inv[EQEmu::inventory::slotPowerSource];
|
||||
if (inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::legacy::SlotPowerSource);
|
||||
DeleteItemInInventory(EQEmu::legacy::SlotPowerSource, 0, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false); // Ti slot non-existent
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotPowerSource, 0, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false); // Ti slot non-existent
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2408,7 +2408,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
std::list<EQEmu::ItemInstance*> local;
|
||||
|
||||
while (!m_inv.CursorEmpty()) {
|
||||
auto inst = m_inv.PopItem(EQEmu::legacy::SlotCursor);
|
||||
auto inst = m_inv.PopItem(EQEmu::inventory::slotCursor);
|
||||
if (inst == nullptr) { continue; }
|
||||
local.push_back(inst);
|
||||
}
|
||||
@@ -2460,15 +2460,15 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
if (m_inv[EQEmu::legacy::SlotPowerSource]) {
|
||||
auto inst = m_inv.PopItem(EQEmu::legacy::SlotPowerSource);
|
||||
if (m_inv[EQEmu::inventory::slotPowerSource]) {
|
||||
auto inst = m_inv.PopItem(EQEmu::inventory::slotPowerSource);
|
||||
if (inst) {
|
||||
if (CheckLoreConflict(inst->GetItem())) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::legacy::SlotPowerSource);
|
||||
database.SaveInventory(character_id, nullptr, EQEmu::legacy::SlotPowerSource);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource);
|
||||
database.SaveInventory(character_id, nullptr, EQEmu::inventory::slotPowerSource);
|
||||
}
|
||||
else {
|
||||
m_inv.PutItem(EQEmu::legacy::SlotPowerSource, *inst);
|
||||
m_inv.PutItem(EQEmu::inventory::slotPowerSource, *inst);
|
||||
}
|
||||
safe_delete(inst);
|
||||
}
|
||||
@@ -2520,7 +2520,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
std::list<EQEmu::ItemInstance*> local_2;
|
||||
|
||||
while (!m_inv.CursorEmpty()) {
|
||||
auto inst = m_inv.PopItem(EQEmu::legacy::SlotCursor);
|
||||
auto inst = m_inv.PopItem(EQEmu::inventory::slotCursor);
|
||||
if (inst == nullptr) { continue; }
|
||||
local_1.push_back(inst);
|
||||
}
|
||||
@@ -2573,13 +2573,13 @@ void Client::MoveSlotNotAllowed(bool client_update)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_inv[EQEmu::legacy::SlotPowerSource] && !m_inv[EQEmu::legacy::SlotPowerSource]->IsSlotAllowed(EQEmu::legacy::SlotPowerSource)) {
|
||||
auto inst = m_inv.PopItem(EQEmu::legacy::SlotPowerSource);
|
||||
if (m_inv[EQEmu::inventory::slotPowerSource] && !m_inv[EQEmu::inventory::slotPowerSource]->IsSlotAllowed(EQEmu::inventory::slotPowerSource)) {
|
||||
auto inst = m_inv.PopItem(EQEmu::inventory::slotPowerSource);
|
||||
bool is_arrow = (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
|
||||
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size, is_arrow);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, EQEmu::legacy::SlotPowerSource, free_slot_id);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource, free_slot_id);
|
||||
PutItemInInventory(free_slot_id, *inst, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false);
|
||||
database.SaveInventory(character_id, nullptr, EQEmu::legacy::SlotPowerSource);
|
||||
database.SaveInventory(character_id, nullptr, EQEmu::inventory::slotPowerSource);
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
@@ -2697,13 +2697,13 @@ static int16 BandolierSlotToWeaponSlot(int BandolierSlot)
|
||||
switch (BandolierSlot)
|
||||
{
|
||||
case bandolierPrimary:
|
||||
return EQEmu::legacy::SlotPrimary;
|
||||
return EQEmu::inventory::slotPrimary;
|
||||
case bandolierSecondary:
|
||||
return EQEmu::legacy::SlotSecondary;
|
||||
return EQEmu::inventory::slotSecondary;
|
||||
case bandolierRange:
|
||||
return EQEmu::legacy::SlotRange;
|
||||
return EQEmu::inventory::slotRange;
|
||||
default:
|
||||
return EQEmu::legacy::SlotAmmo;
|
||||
return EQEmu::inventory::slotAmmo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2778,12 +2778,12 @@ void Client::SetBandolier(const EQApplicationPacket *app)
|
||||
|
||||
// removed 'invWhereCursor' argument from above and implemented slots 30, 331-340 checks here
|
||||
if (slot == INVALID_INDEX) {
|
||||
if (m_inv.GetItem(EQEmu::legacy::SlotCursor)) {
|
||||
if (m_inv.GetItem(EQEmu::legacy::SlotCursor)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID &&
|
||||
m_inv.GetItem(EQEmu::legacy::SlotCursor)->GetCharges() >= 1) { // '> 0' the same, but this matches Inventory::_HasItem conditional check
|
||||
slot = EQEmu::legacy::SlotCursor;
|
||||
if (m_inv.GetItem(EQEmu::inventory::slotCursor)) {
|
||||
if (m_inv.GetItem(EQEmu::inventory::slotCursor)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID &&
|
||||
m_inv.GetItem(EQEmu::inventory::slotCursor)->GetCharges() >= 1) { // '> 0' the same, but this matches Inventory::_HasItem conditional check
|
||||
slot = EQEmu::inventory::slotCursor;
|
||||
}
|
||||
else if (m_inv.GetItem(EQEmu::legacy::SlotCursor)->GetItem()->ItemClass == 1) {
|
||||
else if (m_inv.GetItem(EQEmu::inventory::slotCursor)->GetItem()->ItemClass == 1) {
|
||||
for(int16 CursorBagSlot = EQEmu::legacy::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::legacy::CURSOR_BAG_END; CursorBagSlot++) {
|
||||
if (m_inv.GetItem(CursorBagSlot)) {
|
||||
if (m_inv.GetItem(CursorBagSlot)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID &&
|
||||
@@ -2930,7 +2930,7 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
|
||||
//
|
||||
if(ItemToReturn->IsStackable()) {
|
||||
|
||||
for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving.
|
||||
for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving.
|
||||
|
||||
EQEmu::ItemInstance* InvItem = m_inv.GetItem(i);
|
||||
|
||||
@@ -2956,12 +2956,12 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
|
||||
//
|
||||
if (InvItem && InvItem->IsClassBag()) {
|
||||
|
||||
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
|
||||
int16 BaseSlotID = Inventory::CalcSlotId(i, EQEmu::inventory::containerBegin);
|
||||
|
||||
uint8 BagSize=InvItem->GetItem()->BagSlots;
|
||||
|
||||
uint8 BagSlot;
|
||||
for (BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
|
||||
for (BagSlot = EQEmu::inventory::containerBegin; BagSlot < BagSize; BagSlot++) {
|
||||
InvItem = m_inv.GetItem(BaseSlotID + BagSlot);
|
||||
if (InvItem && (InvItem->GetItem()->ID == ItemID) &&
|
||||
(InvItem->GetCharges() < InvItem->GetItem()->StackSize)) {
|
||||
@@ -2989,7 +2989,7 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
|
||||
|
||||
// We have tried stacking items, now just try and find an empty slot.
|
||||
|
||||
for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor.
|
||||
for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::inventory::slotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor.
|
||||
|
||||
EQEmu::ItemInstance* InvItem = m_inv.GetItem(i);
|
||||
|
||||
@@ -3008,11 +3008,11 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
|
||||
}
|
||||
if (InvItem->IsClassBag() && Inventory::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
|
||||
|
||||
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
|
||||
int16 BaseSlotID = Inventory::CalcSlotId(i, EQEmu::inventory::containerBegin);
|
||||
|
||||
uint8 BagSize=InvItem->GetItem()->BagSlots;
|
||||
|
||||
for (uint8 BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
|
||||
for (uint8 BagSlot = EQEmu::inventory::containerBegin; BagSlot < BagSize; BagSlot++) {
|
||||
|
||||
InvItem = m_inv.GetItem(BaseSlotID + BagSlot);
|
||||
|
||||
@@ -3050,7 +3050,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
||||
std::map<int16, const EQEmu::ItemInstance*> instmap;
|
||||
|
||||
// build reference map
|
||||
for (int16 index = SLOT_BEGIN; index < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++index) {
|
||||
for (int16 index = EQEmu::inventory::slotBegin; index < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++index) {
|
||||
auto inst = m_inv[index];
|
||||
if (inst == nullptr) { continue; }
|
||||
instmap[index] = inst;
|
||||
@@ -3078,7 +3078,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
||||
|
||||
auto tsobject = GetTradeskillObject();
|
||||
if (tsobject != nullptr) {
|
||||
for (int16 index = SLOT_BEGIN; index < EQEmu::legacy::TYPE_WORLD_SIZE; ++index) {
|
||||
for (int16 index = EQEmu::inventory::slotBegin; index < EQEmu::legacy::TYPE_WORLD_SIZE; ++index) {
|
||||
auto inst = tsobject->GetItem(index);
|
||||
if (inst == nullptr) { continue; }
|
||||
instmap[EQEmu::legacy::WORLD_BEGIN + index] = inst;
|
||||
@@ -3094,8 +3094,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
||||
instmap[8000 + limbo] = *cursor_itr;
|
||||
}
|
||||
|
||||
if (m_inv[EQEmu::legacy::SlotPowerSource])
|
||||
instmap[EQEmu::legacy::SlotPowerSource] = m_inv[EQEmu::legacy::SlotPowerSource];
|
||||
if (m_inv[EQEmu::inventory::slotPowerSource])
|
||||
instmap[EQEmu::inventory::slotPowerSource] = m_inv[EQEmu::inventory::slotPowerSource];
|
||||
|
||||
// call InterrogateInventory_ for error check
|
||||
for (auto instmap_itr = instmap.begin(); (instmap_itr != instmap.end()) && (!error); ++instmap_itr) {
|
||||
@@ -3153,7 +3153,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
|
||||
}
|
||||
else {
|
||||
if (inst) {
|
||||
for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::legacy::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any EQEmu::ItemInstance as having the max internal slots available
|
||||
for (int16 sub = EQEmu::inventory::containerBegin; (sub < EQEmu::inventory::ContainerCount) && (!error); ++sub) { // treat any EQEmu::ItemInstance as having the max internal slots available
|
||||
if (inst->GetItem(sub))
|
||||
InterrogateInventory_(true, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1);
|
||||
}
|
||||
@@ -3183,7 +3183,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
|
||||
}
|
||||
|
||||
if (inst) {
|
||||
for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++sub) {
|
||||
for (int16 sub = EQEmu::inventory::containerBegin; (sub < EQEmu::inventory::ContainerCount); ++sub) {
|
||||
if (inst->GetItem(sub))
|
||||
InterrogateInventory_(false, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1);
|
||||
}
|
||||
@@ -3202,7 +3202,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
|
||||
(head >= EQEmu::legacy::TRIBUTE_BEGIN && head <= EQEmu::legacy::TRIBUTE_END) ||
|
||||
(head >= EQEmu::legacy::WORLD_BEGIN && head <= EQEmu::legacy::WORLD_END) ||
|
||||
(head >= 8000 && head <= 8101) ||
|
||||
(head == EQEmu::legacy::SlotPowerSource)) {
|
||||
(head == EQEmu::inventory::slotPowerSource)) {
|
||||
switch (depth)
|
||||
{
|
||||
case 0: // requirement: inst is extant
|
||||
@@ -3214,7 +3214,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
|
||||
return true;
|
||||
if (!parent->IsType(EQEmu::item::ItemClassCommon))
|
||||
return true;
|
||||
if (index >= EQEmu::legacy::ITEM_COMMON_SIZE)
|
||||
if (index >= EQEmu::inventory::SocketCount)
|
||||
return true;
|
||||
break;
|
||||
default: // requirement: none (something bad happened...)
|
||||
@@ -3223,7 +3223,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
|
||||
}
|
||||
else if (
|
||||
(head >= EQEmu::legacy::GENERAL_BEGIN && head <= EQEmu::legacy::GENERAL_END) ||
|
||||
(head == EQEmu::legacy::SlotCursor) ||
|
||||
(head == EQEmu::inventory::slotCursor) ||
|
||||
(head >= EQEmu::legacy::BANK_BEGIN && head <= EQEmu::legacy::BANK_END) ||
|
||||
(head >= EQEmu::legacy::SHARED_BANK_BEGIN && head <= EQEmu::legacy::SHARED_BANK_END) ||
|
||||
(head >= EQEmu::legacy::TRADE_BEGIN && head <= EQEmu::legacy::TRADE_END)) {
|
||||
@@ -3243,7 +3243,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
|
||||
if (parent->IsClassCommon()) {
|
||||
if (!(inst->GetItem()->AugType > 0))
|
||||
return true;
|
||||
if (index >= EQEmu::legacy::ITEM_COMMON_SIZE)
|
||||
if (index >= EQEmu::inventory::SocketCount)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -3257,7 +3257,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const EQEmu::It
|
||||
if (parent->IsClassCommon()) {
|
||||
if (!(inst->GetItem()->AugType > 0))
|
||||
return true;
|
||||
if (index >= EQEmu::legacy::ITEM_COMMON_SIZE)
|
||||
if (index >= EQEmu::inventory::SocketCount)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
+19
-19
@@ -313,7 +313,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::legacy::SlotPrimary | 1 << EQEmu::legacy::SlotSecondary)) {
|
||||
|| item2->Slots & (1 << EQEmu::inventory::slotPrimary | 1 << EQEmu::inventory::slotSecondary)) {
|
||||
memset(newid, 0, sizeof(newid));
|
||||
for(int i=0;i<7;i++){
|
||||
if (!isalpha(item2->IDFile[i])){
|
||||
@@ -327,47 +327,47 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
|
||||
emat = item2->Material;
|
||||
}
|
||||
|
||||
if (foundslot == EQEmu::legacy::SlotPrimary) {
|
||||
if (foundslot == EQEmu::inventory::slotPrimary) {
|
||||
if (item2->Proc.Effect != 0)
|
||||
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
|
||||
|
||||
eslot = EQEmu::textures::TexturePrimary;
|
||||
eslot = EQEmu::textures::weaponPrimary;
|
||||
if (item2->Damage > 0)
|
||||
SendAddPlayerState(PlayerState::PrimaryWeaponEquipped);
|
||||
if (item2->IsType2HWeapon())
|
||||
SetTwoHanderEquipped(true);
|
||||
}
|
||||
else if (foundslot == EQEmu::legacy::SlotSecondary
|
||||
else if (foundslot == EQEmu::inventory::slotSecondary
|
||||
&& (GetOwner() != nullptr || (CanThisClassDualWield() && zone->random.Roll(NPC_DW_CHANCE)) || (item2->Damage==0)) &&
|
||||
(item2->IsType1HWeapon() || item2->ItemType == EQEmu::item::ItemTypeShield))
|
||||
{
|
||||
if (item2->Proc.Effect!=0)
|
||||
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
|
||||
|
||||
eslot = EQEmu::textures::TextureSecondary;
|
||||
eslot = EQEmu::textures::weaponSecondary;
|
||||
if (item2->Damage > 0)
|
||||
SendAddPlayerState(PlayerState::SecondaryWeaponEquipped);
|
||||
}
|
||||
else if (foundslot == EQEmu::legacy::SlotHead) {
|
||||
eslot = EQEmu::textures::TextureHead;
|
||||
else if (foundslot == EQEmu::inventory::slotHead) {
|
||||
eslot = EQEmu::textures::armorHead;
|
||||
}
|
||||
else if (foundslot == EQEmu::legacy::SlotChest) {
|
||||
eslot = EQEmu::textures::TextureChest;
|
||||
else if (foundslot == EQEmu::inventory::slotChest) {
|
||||
eslot = EQEmu::textures::armorChest;
|
||||
}
|
||||
else if (foundslot == EQEmu::legacy::SlotArms) {
|
||||
eslot = EQEmu::textures::TextureArms;
|
||||
else if (foundslot == EQEmu::inventory::slotArms) {
|
||||
eslot = EQEmu::textures::armorArms;
|
||||
}
|
||||
else if (foundslot == EQEmu::legacy::SlotWrist1 || foundslot == EQEmu::legacy::SlotWrist2) {
|
||||
eslot = EQEmu::textures::TextureWrist;
|
||||
else if (foundslot == EQEmu::inventory::slotWrist1 || foundslot == EQEmu::inventory::slotWrist2) {
|
||||
eslot = EQEmu::textures::armorWrist;
|
||||
}
|
||||
else if (foundslot == EQEmu::legacy::SlotHands) {
|
||||
eslot = EQEmu::textures::TextureHands;
|
||||
else if (foundslot == EQEmu::inventory::slotHands) {
|
||||
eslot = EQEmu::textures::armorHands;
|
||||
}
|
||||
else if (foundslot == EQEmu::legacy::SlotLegs) {
|
||||
eslot = EQEmu::textures::TextureLegs;
|
||||
else if (foundslot == EQEmu::inventory::slotLegs) {
|
||||
eslot = EQEmu::textures::armorLegs;
|
||||
}
|
||||
else if (foundslot == EQEmu::legacy::SlotFeet) {
|
||||
eslot = EQEmu::textures::TextureFeet;
|
||||
else if (foundslot == EQEmu::inventory::slotFeet) {
|
||||
eslot = EQEmu::textures::armorFeet;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+50
-50
@@ -1762,43 +1762,43 @@ luabind::scope lua_register_slot() {
|
||||
return luabind::class_<Slots>("Slot")
|
||||
.enum_("constants")
|
||||
[
|
||||
luabind::value("Charm", static_cast<int>(EQEmu::legacy::SlotCharm)),
|
||||
luabind::value("Ear1", static_cast<int>(EQEmu::legacy::SlotEar1)),
|
||||
luabind::value("Head", static_cast<int>(EQEmu::legacy::SlotHead)),
|
||||
luabind::value("Face", static_cast<int>(EQEmu::legacy::SlotFace)),
|
||||
luabind::value("Ear2", static_cast<int>(EQEmu::legacy::SlotEar2)),
|
||||
luabind::value("Neck", static_cast<int>(EQEmu::legacy::SlotNeck)),
|
||||
luabind::value("Shoulder", static_cast<int>(EQEmu::legacy::SlotShoulders)), // deprecated
|
||||
luabind::value("Shoulders", static_cast<int>(EQEmu::legacy::SlotShoulders)),
|
||||
luabind::value("Arms", static_cast<int>(EQEmu::legacy::SlotArms)),
|
||||
luabind::value("Back", static_cast<int>(EQEmu::legacy::SlotBack)),
|
||||
luabind::value("Bracer1", static_cast<int>(EQEmu::legacy::SlotWrist1)), // deprecated
|
||||
luabind::value("Wrist1", static_cast<int>(EQEmu::legacy::SlotWrist1)),
|
||||
luabind::value("Bracer2", static_cast<int>(EQEmu::legacy::SlotWrist2)), // deprecated
|
||||
luabind::value("Wrist2", static_cast<int>(EQEmu::legacy::SlotWrist2)),
|
||||
luabind::value("Range", static_cast<int>(EQEmu::legacy::SlotRange)),
|
||||
luabind::value("Hands", static_cast<int>(EQEmu::legacy::SlotHands)),
|
||||
luabind::value("Primary", static_cast<int>(EQEmu::legacy::SlotPrimary)),
|
||||
luabind::value("Secondary", static_cast<int>(EQEmu::legacy::SlotSecondary)),
|
||||
luabind::value("Ring1", static_cast<int>(EQEmu::legacy::SlotFinger1)), // deprecated
|
||||
luabind::value("Finger1", static_cast<int>(EQEmu::legacy::SlotFinger1)),
|
||||
luabind::value("Ring2", static_cast<int>(EQEmu::legacy::SlotFinger2)), // deprecated
|
||||
luabind::value("Finger2", static_cast<int>(EQEmu::legacy::SlotFinger2)),
|
||||
luabind::value("Chest", static_cast<int>(EQEmu::legacy::SlotChest)),
|
||||
luabind::value("Legs", static_cast<int>(EQEmu::legacy::SlotLegs)),
|
||||
luabind::value("Feet", static_cast<int>(EQEmu::legacy::SlotFeet)),
|
||||
luabind::value("Waist", static_cast<int>(EQEmu::legacy::SlotWaist)),
|
||||
luabind::value("PowerSource", static_cast<int>(EQEmu::legacy::SlotPowerSource)),
|
||||
luabind::value("Ammo", static_cast<int>(EQEmu::legacy::SlotAmmo)),
|
||||
luabind::value("General1", static_cast<int>(EQEmu::legacy::SlotGeneral1)),
|
||||
luabind::value("General2", static_cast<int>(EQEmu::legacy::SlotGeneral2)),
|
||||
luabind::value("General3", static_cast<int>(EQEmu::legacy::SlotGeneral3)),
|
||||
luabind::value("General4", static_cast<int>(EQEmu::legacy::SlotGeneral4)),
|
||||
luabind::value("General5", static_cast<int>(EQEmu::legacy::SlotGeneral5)),
|
||||
luabind::value("General6", static_cast<int>(EQEmu::legacy::SlotGeneral6)),
|
||||
luabind::value("General7", static_cast<int>(EQEmu::legacy::SlotGeneral7)),
|
||||
luabind::value("General8", static_cast<int>(EQEmu::legacy::SlotGeneral8)),
|
||||
luabind::value("Cursor", static_cast<int>(EQEmu::legacy::SlotCursor)),
|
||||
luabind::value("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
|
||||
@@ -1814,19 +1814,19 @@ luabind::scope lua_register_material() {
|
||||
return luabind::class_<Materials>("Material")
|
||||
.enum_("constants")
|
||||
[
|
||||
luabind::value("Head", static_cast<int>(EQEmu::textures::TextureHead)),
|
||||
luabind::value("Chest", static_cast<int>(EQEmu::textures::TextureChest)),
|
||||
luabind::value("Arms", static_cast<int>(EQEmu::textures::TextureArms)),
|
||||
luabind::value("Bracer", static_cast<int>(EQEmu::textures::TextureWrist)), // deprecated
|
||||
luabind::value("Wrist", static_cast<int>(EQEmu::textures::TextureWrist)),
|
||||
luabind::value("Hands", static_cast<int>(EQEmu::textures::TextureHands)),
|
||||
luabind::value("Legs", static_cast<int>(EQEmu::textures::TextureLegs)),
|
||||
luabind::value("Feet", static_cast<int>(EQEmu::textures::TextureFeet)),
|
||||
luabind::value("Primary", static_cast<int>(EQEmu::textures::TexturePrimary)),
|
||||
luabind::value("Secondary", static_cast<int>(EQEmu::textures::TextureSecondary)),
|
||||
luabind::value("Max", static_cast<int>(EQEmu::textures::TextureCount)), // deprecated
|
||||
luabind::value("Count", static_cast<int>(EQEmu::textures::TextureCount)),
|
||||
luabind::value("Invalid", static_cast<int>(EQEmu::textures::TextureInvalid))
|
||||
luabind::value("Head", static_cast<int>(EQEmu::textures::armorHead)),
|
||||
luabind::value("Chest", static_cast<int>(EQEmu::textures::armorChest)),
|
||||
luabind::value("Arms", static_cast<int>(EQEmu::textures::armorArms)),
|
||||
luabind::value("Bracer", static_cast<int>(EQEmu::textures::armorWrist)), // deprecated
|
||||
luabind::value("Wrist", static_cast<int>(EQEmu::textures::armorWrist)),
|
||||
luabind::value("Hands", static_cast<int>(EQEmu::textures::armorHands)),
|
||||
luabind::value("Legs", static_cast<int>(EQEmu::textures::armorLegs)),
|
||||
luabind::value("Feet", static_cast<int>(EQEmu::textures::armorFeet)),
|
||||
luabind::value("Primary", static_cast<int>(EQEmu::textures::weaponPrimary)),
|
||||
luabind::value("Secondary", static_cast<int>(EQEmu::textures::weaponSecondary)),
|
||||
luabind::value("Max", static_cast<int>(EQEmu::textures::materialCount)), // deprecated
|
||||
luabind::value("Count", static_cast<int>(EQEmu::textures::materialCount)),
|
||||
luabind::value("Invalid", static_cast<int>(EQEmu::textures::materialInvalid))
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
+16
-16
@@ -214,7 +214,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
|
||||
|
||||
unsigned int i;
|
||||
//should not include 21 (SLOT_AMMO)
|
||||
for (i = 0; i < EQEmu::legacy::SlotAmmo; i++) {
|
||||
for (i = 0; i < EQEmu::inventory::slotAmmo; i++) {
|
||||
if(equipment[i] == 0)
|
||||
continue;
|
||||
const EQEmu::ItemData * itm = database.GetItem(equipment[i]);
|
||||
@@ -1559,24 +1559,24 @@ void Merc::AI_Process() {
|
||||
//try main hand first
|
||||
if(attack_timer.Check())
|
||||
{
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary);
|
||||
|
||||
bool tripleSuccess = false;
|
||||
|
||||
if(GetOwner() && GetTarget() && CanThisClassDoubleAttack())
|
||||
{
|
||||
if(GetOwner()) {
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
|
||||
}
|
||||
|
||||
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE)) {
|
||||
tripleSuccess = true;
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
|
||||
}
|
||||
|
||||
//quad attack, does this belong here??
|
||||
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_QUAD)) {
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1588,8 +1588,8 @@ void Merc::AI_Process() {
|
||||
if(zone->random.Roll(flurrychance))
|
||||
{
|
||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1598,7 +1598,7 @@ void Merc::AI_Process() {
|
||||
if (GetTarget() && ExtraAttackChanceBonus) {
|
||||
if(zone->random.Roll(ExtraAttackChanceBonus))
|
||||
{
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::inventory::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1634,11 +1634,11 @@ void Merc::AI_Process() {
|
||||
// Max 78% of DW
|
||||
if (zone->random.Roll(DualWieldProbability))
|
||||
{
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
|
||||
Attack(GetTarget(), EQEmu::inventory::slotSecondary); // Single attack with offhand
|
||||
|
||||
if(CanThisClassDoubleAttack()) {
|
||||
if(GetTarget() && GetTarget()->GetHP() > -10)
|
||||
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
|
||||
Attack(GetTarget(), EQEmu::inventory::slotSecondary); // Single attack with offhand
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5045,13 +5045,13 @@ void Merc::ScaleStats(int scalepercent, bool setmax) {
|
||||
|
||||
void Merc::UpdateMercAppearance() {
|
||||
// Copied from Bot Code:
|
||||
uint32 itemID = NO_ITEM;
|
||||
uint8 materialFromSlot = EQEmu::textures::TextureInvalid;
|
||||
uint32 itemID = 0;
|
||||
uint8 materialFromSlot = EQEmu::textures::materialInvalid;
|
||||
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
|
||||
itemID = equipment[i];
|
||||
if(itemID != NO_ITEM) {
|
||||
if(itemID != 0) {
|
||||
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
|
||||
if (materialFromSlot != EQEmu::textures::TextureInvalid)
|
||||
if (materialFromSlot != EQEmu::textures::materialInvalid)
|
||||
this->SendWearChange(materialFromSlot);
|
||||
}
|
||||
}
|
||||
@@ -5065,8 +5065,8 @@ void Merc::UpdateEquipmentLight()
|
||||
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
|
||||
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
|
||||
|
||||
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
|
||||
if (index == EQEmu::legacy::SlotAmmo) { continue; }
|
||||
for (int index = EQEmu::inventory::slotBegin; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
|
||||
if (index == EQEmu::inventory::slotAmmo) { continue; }
|
||||
|
||||
auto item = database.GetItem(equipment[index]);
|
||||
if (item == nullptr) { continue; }
|
||||
|
||||
+1
-1
@@ -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, int special = 0);
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0);
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
|
||||
+7
-7
@@ -278,7 +278,7 @@ Mob::Mob(const char* in_name,
|
||||
RangedProcs[j].level_override = -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < EQEmu::textures::TextureCount; i++)
|
||||
for (i = EQEmu::textures::textureBegin; i < EQEmu::textures::materialCount; i++)
|
||||
{
|
||||
armor_tint.Slot[i].Color = in_armor_tint.Slot[i].Color;
|
||||
}
|
||||
@@ -1158,8 +1158,8 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
||||
if (Mob::IsPlayerRace(race) || i > 6)
|
||||
{
|
||||
ns->spawn.equipment.Slot[i].Material = GetEquipmentMaterial(i);
|
||||
ns->spawn.equipment.Slot[i].EliteMaterial = IsEliteMaterialItem(i);
|
||||
ns->spawn.equipment.Slot[i].HeroForgeModel = GetHerosForgeModel(i);
|
||||
ns->spawn.equipment.Slot[i].EliteModel = IsEliteMaterialItem(i);
|
||||
ns->spawn.equipment.Slot[i].HeroicModel = GetHerosForgeModel(i);
|
||||
ns->spawn.equipment_tint.Slot[i].Color = GetEquipmentColor(i);
|
||||
}
|
||||
}
|
||||
@@ -2374,8 +2374,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::legacy::SlotPrimary);
|
||||
const EQEmu::ItemInstance* sinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
|
||||
const EQEmu::ItemInstance* pinst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
const EQEmu::ItemInstance* sinst = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
|
||||
// 2HS, 2HB, or 2HP
|
||||
if(pinst && pinst->IsWeapon()) {
|
||||
@@ -2858,7 +2858,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
|
||||
if (item != 0)
|
||||
{
|
||||
// For primary and secondary we need the model, not the material
|
||||
if (material_slot == EQEmu::textures::TexturePrimary || material_slot == EQEmu::textures::TextureSecondary)
|
||||
if (material_slot == EQEmu::textures::weaponPrimary || material_slot == EQEmu::textures::weaponSecondary)
|
||||
{
|
||||
if (this->IsClient())
|
||||
{
|
||||
@@ -2902,7 +2902,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
|
||||
int32 Mob::GetHerosForgeModel(uint8 material_slot) const
|
||||
{
|
||||
uint32 HeroModel = 0;
|
||||
if (material_slot >= 0 && material_slot < EQEmu::textures::TexturePrimary)
|
||||
if (material_slot >= 0 && material_slot < EQEmu::textures::weaponPrimary)
|
||||
{
|
||||
uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
|
||||
const EQEmu::ItemData *item;
|
||||
|
||||
+9
-9
@@ -154,7 +154,7 @@ public:
|
||||
virtual void ThrowingAttack(Mob* other) { }
|
||||
uint16 GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg);
|
||||
// 13 = Primary (default), 14 = secondary
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) = 0;
|
||||
int MonkSpecialAttack(Mob* other, uint8 skill_used);
|
||||
virtual void TryBackstab(Mob *other,int ReuseTime = 10);
|
||||
@@ -390,7 +390,7 @@ public:
|
||||
inline uint8 GetDrakkinHeritage() const { return drakkin_heritage; }
|
||||
inline uint8 GetDrakkinTattoo() const { return drakkin_tattoo; }
|
||||
inline uint8 GetDrakkinDetails() const { return drakkin_details; }
|
||||
inline uint32 GetArmorTint(uint8 i) const { return armor_tint.Slot[(i < EQEmu::textures::TextureCount) ? i : 0].Color; }
|
||||
inline uint32 GetArmorTint(uint8 i) const { return armor_tint.Slot[(i < EQEmu::textures::materialCount) ? i : 0].Color; }
|
||||
inline uint8 GetClass() const { return class_; }
|
||||
inline uint8 GetLevel() const { return level; }
|
||||
inline uint8 GetOrigLevel() const { return orig_level; }
|
||||
@@ -577,7 +577,7 @@ public:
|
||||
bool lookForAftArc = true);
|
||||
|
||||
//Procs
|
||||
void TriggerDefensiveProcs(Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary, bool FromSkillProc = false, int damage = 0);
|
||||
void TriggerDefensiveProcs(Mob *on, uint16 hand = EQEmu::inventory::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;
|
||||
@@ -1158,13 +1158,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::legacy::SlotPrimary);
|
||||
void TryWeaponProc(const EQEmu::ItemInstance* inst, const EQEmu::ItemData* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
|
||||
void TrySpellProc(const EQEmu::ItemInstance* inst, const EQEmu::ItemData* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
|
||||
void TryWeaponProc(const EQEmu::ItemInstance* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
|
||||
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 ExecWeaponProc(const EQEmu::ItemInstance* weapon, uint16 spell_id, Mob *on, int level_override = -1);
|
||||
virtual float GetProcChances(float ProcBonus, uint16 hand = EQEmu::legacy::SlotPrimary);
|
||||
virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = EQEmu::legacy::SlotPrimary, Mob *on = nullptr);
|
||||
virtual float 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 GetSpecialProcChances(uint16 hand);
|
||||
virtual float GetAssassinateProcChances(uint16 ReuseTime);
|
||||
virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm?
|
||||
|
||||
+4
-4
@@ -847,7 +847,7 @@ void Client::AI_Process()
|
||||
if (GetTarget() && !IsStunned() && !IsMezzed() && !GetFeigned()) {
|
||||
if (attack_timer.Check()) {
|
||||
// Should charmed clients not be procing?
|
||||
DoAttackRounds(GetTarget(), EQEmu::legacy::SlotPrimary);
|
||||
DoAttackRounds(GetTarget(), EQEmu::inventory::slotPrimary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -855,7 +855,7 @@ void Client::AI_Process()
|
||||
if (attack_dw_timer.Check()) {
|
||||
if (CheckDualWield()) {
|
||||
// Should charmed clients not be procing?
|
||||
DoAttackRounds(GetTarget(), EQEmu::legacy::SlotSecondary);
|
||||
DoAttackRounds(GetTarget(), EQEmu::inventory::slotSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1106,7 +1106,7 @@ void Mob::AI_Process() {
|
||||
//try main hand first
|
||||
if(attack_timer.Check()) {
|
||||
DoMainHandAttackRounds(target);
|
||||
TriggerDefensiveProcs(target, EQEmu::legacy::SlotPrimary, false);
|
||||
TriggerDefensiveProcs(target, EQEmu::inventory::slotPrimary, false);
|
||||
|
||||
bool specialed = false; // NPCs can only do one of these a round
|
||||
if (GetSpecialAbility(SPECATK_FLURRY)) {
|
||||
@@ -1952,7 +1952,7 @@ bool Mob::Flurry(ExtraAttackOptions *opts)
|
||||
int num_attacks = GetSpecialAbilityParam(SPECATK_FLURRY, 1);
|
||||
num_attacks = num_attacks > 0 ? num_attacks : RuleI(Combat, MaxFlurryHits);
|
||||
for (int i = 0; i < num_attacks; i++)
|
||||
Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts);
|
||||
Attack(target, EQEmu::inventory::slotPrimary, false, false, false, opts);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
+13
-13
@@ -490,7 +490,7 @@ void NPC::CheckMinMaxLevel(Mob *them)
|
||||
if(themlevel < (*cur)->min_level || themlevel > (*cur)->max_level)
|
||||
{
|
||||
material = Inventory::CalcMaterialFromSlot((*cur)->equip_slot);
|
||||
if (material != EQEmu::textures::TextureInvalid)
|
||||
if (material != EQEmu::textures::materialInvalid)
|
||||
SendWearChange(material);
|
||||
|
||||
cur = itemlist.erase(cur);
|
||||
@@ -750,8 +750,8 @@ void NPC::UpdateEquipmentLight()
|
||||
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
|
||||
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
|
||||
|
||||
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
|
||||
if (index == EQEmu::legacy::SlotAmmo) { continue; }
|
||||
for (int index = EQEmu::inventory::slotBegin; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
|
||||
if (index == EQEmu::inventory::slotAmmo) { continue; }
|
||||
|
||||
auto item = database.GetItem(equipment[index]);
|
||||
if (item == nullptr) { continue; }
|
||||
@@ -1378,7 +1378,7 @@ uint32 ZoneDatabase::NPCSpawnDB(uint8 command, const char* zone, uint32 zone_ver
|
||||
|
||||
int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
|
||||
{
|
||||
if (material_slot >= EQEmu::textures::TextureCount)
|
||||
if (material_slot >= EQEmu::textures::materialCount)
|
||||
return 0;
|
||||
|
||||
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
|
||||
@@ -1389,23 +1389,23 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
|
||||
{
|
||||
switch(material_slot)
|
||||
{
|
||||
case EQEmu::textures::TextureHead:
|
||||
case EQEmu::textures::armorHead:
|
||||
return helmtexture;
|
||||
case EQEmu::textures::TextureChest:
|
||||
case EQEmu::textures::armorChest:
|
||||
return texture;
|
||||
case EQEmu::textures::TextureArms:
|
||||
case EQEmu::textures::armorArms:
|
||||
return armtexture;
|
||||
case EQEmu::textures::TextureWrist:
|
||||
case EQEmu::textures::armorWrist:
|
||||
return bracertexture;
|
||||
case EQEmu::textures::TextureHands:
|
||||
case EQEmu::textures::armorHands:
|
||||
return handtexture;
|
||||
case EQEmu::textures::TextureLegs:
|
||||
case EQEmu::textures::armorLegs:
|
||||
return legtexture;
|
||||
case EQEmu::textures::TextureFeet:
|
||||
case EQEmu::textures::armorFeet:
|
||||
return feettexture;
|
||||
case EQEmu::textures::TexturePrimary:
|
||||
case EQEmu::textures::weaponPrimary:
|
||||
return d_melee_texture1;
|
||||
case EQEmu::textures::TextureSecondary:
|
||||
case EQEmu::textures::weaponSecondary:
|
||||
return d_melee_texture2;
|
||||
default:
|
||||
//they have nothing in the slot, and its not a special slot... they get nothing.
|
||||
|
||||
+1
-1
@@ -110,7 +110,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, int special = 0);
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
virtual bool Attack(Mob* other, int Hand = EQEmu::inventory::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0);
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return false; }
|
||||
|
||||
+5
-5
@@ -365,7 +365,7 @@ void Object::Close() {
|
||||
EQEmu::ItemInstance* container = this->m_inst;
|
||||
if(container != nullptr)
|
||||
{
|
||||
for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++)
|
||||
for (uint8 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++)
|
||||
{
|
||||
EQEmu::ItemInstance* inst = container->PopItem(i);
|
||||
if(inst != nullptr)
|
||||
@@ -521,11 +521,11 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
|
||||
|
||||
|
||||
// Transfer item to client
|
||||
sender->PutItemInInventory(EQEmu::legacy::SlotCursor, *m_inst, false);
|
||||
sender->SendItemPacket(EQEmu::legacy::SlotCursor, m_inst, ItemPacketTrade);
|
||||
sender->PutItemInInventory(EQEmu::inventory::slotCursor, *m_inst, false);
|
||||
sender->SendItemPacket(EQEmu::inventory::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::legacy::SlotCursor);
|
||||
sender->DeleteItemInInventory(EQEmu::inventory::slotCursor);
|
||||
|
||||
if(!m_ground_spawn)
|
||||
safe_delete(m_inst);
|
||||
@@ -602,7 +602,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 = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) {
|
||||
for (uint8 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
|
||||
const EQEmu::ItemInstance* inst = m_inst->GetItem(i);
|
||||
if (inst) {
|
||||
//sender->GetInv().PutItem(i+4000,inst);
|
||||
|
||||
+59
-59
@@ -68,15 +68,15 @@ void Mob::ApplySpecialAttackMod(EQEmu::skills::SkillType skill, int32 &dmg, int3
|
||||
case EQEmu::skills::SkillFlyingKick:
|
||||
case EQEmu::skills::SkillRoundKick:
|
||||
case EQEmu::skills::SkillKick:
|
||||
item_slot = EQEmu::legacy::SlotFeet;
|
||||
item_slot = EQEmu::inventory::slotFeet;
|
||||
break;
|
||||
case EQEmu::skills::SkillBash:
|
||||
item_slot = EQEmu::legacy::SlotSecondary;
|
||||
item_slot = EQEmu::inventory::slotSecondary;
|
||||
break;
|
||||
case EQEmu::skills::SkillDragonPunch:
|
||||
case EQEmu::skills::SkillEagleStrike:
|
||||
case EQEmu::skills::SkillTigerClaw:
|
||||
item_slot = EQEmu::legacy::SlotHands;
|
||||
item_slot = EQEmu::inventory::slotHands;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -111,7 +111,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::legacy::SlotSecondary);
|
||||
EQEmu::ItemInstance *item = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
if(item)
|
||||
{
|
||||
if (item->GetItem()->ItemType == EQEmu::item::ItemTypeShield)
|
||||
@@ -129,14 +129,14 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32
|
||||
|
||||
min_damage += min_damage * GetMeleeMinDamageMod_SE(skill) / 100;
|
||||
|
||||
int hand = EQEmu::legacy::SlotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should work for most
|
||||
int hand = EQEmu::inventory::slotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should work for most
|
||||
if (skill == EQEmu::skills::SkillThrowing || skill == EQEmu::skills::SkillArchery)
|
||||
hand = EQEmu::legacy::SlotRange;
|
||||
hand = EQEmu::inventory::slotRange;
|
||||
if (who->AvoidDamage(this, max_damage, hand)) {
|
||||
if (max_damage == -3)
|
||||
DoRiposte(who);
|
||||
} else {
|
||||
if (!CheckHitChance || (CheckHitChance && who->CheckHitChance(this, skill, EQEmu::legacy::SlotPrimary))) {
|
||||
if (!CheckHitChance || (CheckHitChance && who->CheckHitChance(this, skill, EQEmu::inventory::slotPrimary))) {
|
||||
who->MeleeMitigation(this, max_damage, min_damage);
|
||||
CommonOutgoingHitSuccess(who, max_damage, skill);
|
||||
} else {
|
||||
@@ -194,7 +194,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
|
||||
//These two are not subject to the combat ability timer, as they
|
||||
//allready do their checking in conjunction with the attack timer
|
||||
//throwing weapons
|
||||
if (ca_atk->m_atk == EQEmu::legacy::SlotRange) {
|
||||
if (ca_atk->m_atk == EQEmu::inventory::slotRange) {
|
||||
if (ca_atk->m_skill == EQEmu::skills::SkillThrowing) {
|
||||
SetAttackTimer();
|
||||
ThrowingAttack(GetTarget());
|
||||
@@ -244,8 +244,8 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
|
||||
DoAnim(animTailRake);
|
||||
|
||||
int32 ht = 0;
|
||||
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotSecondary)) <= 0 &&
|
||||
GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotShoulders)) <= 0){
|
||||
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::inventory::slotSecondary)) <= 0 &&
|
||||
GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::inventory::slotShoulders)) <= 0){
|
||||
dmg = -5;
|
||||
}
|
||||
else{
|
||||
@@ -321,7 +321,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
|
||||
DoAnim(animKick);
|
||||
|
||||
int32 ht = 0;
|
||||
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotFeet)) <= 0){
|
||||
if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::inventory::slotFeet)) <= 0){
|
||||
dmg = -5;
|
||||
}
|
||||
else{
|
||||
@@ -404,7 +404,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
|
||||
int32 min_dmg = 1;
|
||||
int reuse = 0;
|
||||
EQEmu::skills::SkillType skill_type; //to avoid casting... even though it "would work"
|
||||
uint8 itemslot = EQEmu::legacy::SlotFeet;
|
||||
uint8 itemslot = EQEmu::inventory::slotFeet;
|
||||
|
||||
switch(unchecked_type) {
|
||||
case EQEmu::skills::SkillFlyingKick:
|
||||
@@ -418,7 +418,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
|
||||
case EQEmu::skills::SkillDragonPunch:
|
||||
skill_type = EQEmu::skills::SkillDragonPunch;
|
||||
max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, DragonPunchBonus) / 100) + 26;
|
||||
itemslot = EQEmu::legacy::SlotHands;
|
||||
itemslot = EQEmu::inventory::slotHands;
|
||||
ApplySpecialAttackMod(skill_type, max_dmg, min_dmg);
|
||||
DoAnim(animTailRake);
|
||||
reuse = TailRakeReuseTime;
|
||||
@@ -426,7 +426,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
|
||||
case EQEmu::skills::SkillEagleStrike:
|
||||
skill_type = EQEmu::skills::SkillEagleStrike;
|
||||
max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, EagleStrikeBonus) / 100) + 19;
|
||||
itemslot = EQEmu::legacy::SlotHands;
|
||||
itemslot = EQEmu::inventory::slotHands;
|
||||
ApplySpecialAttackMod(skill_type, max_dmg, min_dmg);
|
||||
DoAnim(animEagleStrike);
|
||||
reuse = EagleStrikeReuseTime;
|
||||
@@ -434,7 +434,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
|
||||
case EQEmu::skills::SkillTigerClaw:
|
||||
skill_type = EQEmu::skills::SkillTigerClaw;
|
||||
max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, TigerClawBonus) / 100) + 12;
|
||||
itemslot = EQEmu::legacy::SlotHands;
|
||||
itemslot = EQEmu::inventory::slotHands;
|
||||
ApplySpecialAttackMod(skill_type, max_dmg, min_dmg);
|
||||
DoAnim(animTigerClaw);
|
||||
reuse = TigerClawReuseTime;
|
||||
@@ -498,7 +498,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::legacy::SlotPrimary);
|
||||
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
if (!wpn || (wpn->GetItem()->ItemType != EQEmu::item::ItemType1HPiercing)){
|
||||
Message_StringID(13, BACKSTAB_WEAPON);
|
||||
return;
|
||||
@@ -559,7 +559,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
|
||||
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillBackstab, other, 10);
|
||||
}
|
||||
else { //We do a single regular attack if we attack from the front without chaotic stab
|
||||
Attack(other, EQEmu::legacy::SlotPrimary);
|
||||
Attack(other, EQEmu::inventory::slotPrimary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,7 +577,7 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
|
||||
int32 backstab_dmg = 0;
|
||||
|
||||
if (IsClient()) {
|
||||
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
|
||||
const EQEmu::ItemInstance *wpn = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
if (wpn) {
|
||||
primaryweapondamage = GetWeaponDamage(other, wpn);
|
||||
if (primaryweapondamage) {
|
||||
@@ -650,7 +650,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::legacy::SlotPrimary) : (const EQEmu::ItemInstance*)nullptr) > 0){
|
||||
if (GetWeaponDamage(other, IsClient() ? CastToClient()->GetInv().GetItem(EQEmu::inventory::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);
|
||||
@@ -670,20 +670,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::legacy::SlotRange];
|
||||
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::inventory::slotRange];
|
||||
|
||||
//locate ammo
|
||||
int ammo_slot = EQEmu::legacy::SlotAmmo;
|
||||
const EQEmu::ItemInstance* Ammo = m_inv[EQEmu::legacy::SlotAmmo];
|
||||
int ammo_slot = EQEmu::inventory::slotAmmo;
|
||||
const EQEmu::ItemInstance* Ammo = m_inv[EQEmu::inventory::slotAmmo];
|
||||
|
||||
if (!RangeWeapon || !RangeWeapon->IsClassCommon()) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotRange), EQEmu::legacy::SlotRange);
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(EQEmu::legacy::SlotRange));
|
||||
Log.Out(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));
|
||||
return;
|
||||
}
|
||||
if (!Ammo || !Ammo->IsClassCommon()) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotAmmo), EQEmu::legacy::SlotAmmo);
|
||||
Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(EQEmu::legacy::SlotAmmo));
|
||||
Log.Out(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));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -838,7 +838,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
|
||||
|
||||
if (IsClient()){
|
||||
|
||||
_RangeWeapon = CastToClient()->m_inv[EQEmu::legacy::SlotRange];
|
||||
_RangeWeapon = CastToClient()->m_inv[EQEmu::inventory::slotRange];
|
||||
if (_RangeWeapon && _RangeWeapon->GetItem() && _RangeWeapon->GetItem()->ID == range_id)
|
||||
RangeWeapon = _RangeWeapon;
|
||||
|
||||
@@ -854,7 +854,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
|
||||
else if (AmmoItem)
|
||||
SendItemAnimation(other, AmmoItem, EQEmu::skills::SkillArchery);
|
||||
|
||||
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, EQEmu::skills::SkillArchery, EQEmu::legacy::SlotPrimary, chance_mod))) {
|
||||
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, EQEmu::skills::SkillArchery, EQEmu::inventory::slotPrimary, chance_mod))) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack missed %s.", other->GetName());
|
||||
|
||||
if (LaunchProjectile){
|
||||
@@ -952,7 +952,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
|
||||
}
|
||||
|
||||
if (!HeadShot)
|
||||
other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange);
|
||||
other->AvoidDamage(this, TotalDmg, EQEmu::inventory::slotRange);
|
||||
|
||||
other->MeleeMitigation(this, TotalDmg, minDmg);
|
||||
if(TotalDmg > 0){
|
||||
@@ -976,7 +976,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::legacy::SlotRange);
|
||||
TrySkillProc(other, EQEmu::skills::SkillArchery, 0, true, EQEmu::inventory::slotRange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -985,20 +985,20 @@ void Mob::DoArcheryAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
|
||||
|
||||
//Weapon Proc
|
||||
if(RangeWeapon && other && !other->HasDied())
|
||||
TryWeaponProc(RangeWeapon, other, EQEmu::legacy::SlotRange);
|
||||
TryWeaponProc(RangeWeapon, other, EQEmu::inventory::slotRange);
|
||||
|
||||
//Ammo Proc
|
||||
if (ammo_lost)
|
||||
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::legacy::SlotRange);
|
||||
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::inventory::slotRange);
|
||||
else if(Ammo && other && !other->HasDied())
|
||||
TryWeaponProc(Ammo, other, EQEmu::legacy::SlotRange);
|
||||
TryWeaponProc(Ammo, other, EQEmu::inventory::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::legacy::SlotRange);
|
||||
TrySkillProc(other, EQEmu::skills::SkillArchery, 0, false, EQEmu::inventory::slotRange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1264,7 +1264,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
|
||||
if (!chance_mod)
|
||||
chance_mod = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 2);
|
||||
|
||||
if (!other->CheckHitChance(this, skillInUse, EQEmu::legacy::SlotRange, chance_mod))
|
||||
if (!other->CheckHitChance(this, skillInUse, EQEmu::inventory::slotRange, chance_mod))
|
||||
{
|
||||
other->Damage(this, 0, SPELL_UNKNOWN, skillInUse);
|
||||
}
|
||||
@@ -1285,7 +1285,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
|
||||
|
||||
TotalDmg += TotalDmg * damage_mod / 100;
|
||||
|
||||
other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange);
|
||||
other->AvoidDamage(this, TotalDmg, EQEmu::inventory::slotRange);
|
||||
other->MeleeMitigation(this, TotalDmg, MinDmg);
|
||||
|
||||
if (TotalDmg > 0)
|
||||
@@ -1301,15 +1301,15 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
|
||||
other->Damage(this, TotalDmg, SPELL_UNKNOWN, skillInUse);
|
||||
|
||||
if (TotalDmg > 0 && HasSkillProcSuccess() && !other->HasDied())
|
||||
TrySkillProc(other, skillInUse, 0, true, EQEmu::legacy::SlotRange);
|
||||
TrySkillProc(other, skillInUse, 0, true, EQEmu::inventory::slotRange);
|
||||
}
|
||||
|
||||
//try proc on hits and misses
|
||||
if(other && !other->HasDied())
|
||||
TrySpellProc(nullptr, (const EQEmu::ItemData*)nullptr, other, EQEmu::legacy::SlotRange);
|
||||
TrySpellProc(nullptr, (const EQEmu::ItemData*)nullptr, other, EQEmu::inventory::slotRange);
|
||||
|
||||
if (HasSkillProcs() && other && !other->HasDied())
|
||||
TrySkillProc(other, skillInUse, 0, false, EQEmu::legacy::SlotRange);
|
||||
TrySkillProc(other, skillInUse, 0, false, EQEmu::inventory::slotRange);
|
||||
}
|
||||
|
||||
uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg) {
|
||||
@@ -1351,19 +1351,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
||||
return;
|
||||
}
|
||||
|
||||
int ammo_slot = EQEmu::legacy::SlotRange;
|
||||
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::legacy::SlotRange];
|
||||
int ammo_slot = EQEmu::inventory::slotRange;
|
||||
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::inventory::slotRange];
|
||||
|
||||
if (!RangeWeapon || !RangeWeapon->IsClassCommon()) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotRange), EQEmu::legacy::SlotRange);
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(EQEmu::legacy::SlotRange));
|
||||
Log.Out(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));
|
||||
return;
|
||||
}
|
||||
|
||||
const EQEmu::ItemData* item = RangeWeapon->GetItem();
|
||||
if (item->ItemType != EQEmu::item::ItemTypeLargeThrowing && item->ItemType != EQEmu::item::ItemTypeSmallThrowing) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType);
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(EQEmu::legacy::SlotRange));
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(EQEmu::inventory::slotRange));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1371,11 +1371,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::legacy::SlotAmmo];
|
||||
const EQEmu::ItemInstance* AmmoItem = m_inv[EQEmu::inventory::slotAmmo];
|
||||
if(AmmoItem != nullptr && AmmoItem->GetID() == RangeWeapon->GetID()) {
|
||||
//more in the ammo slot, use it
|
||||
RangeWeapon = AmmoItem;
|
||||
ammo_slot = EQEmu::legacy::SlotAmmo;
|
||||
ammo_slot = EQEmu::inventory::slotAmmo;
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges());
|
||||
} else {
|
||||
//look through our inventory for more
|
||||
@@ -1472,7 +1472,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
|
||||
else if (AmmoItem)
|
||||
SendItemAnimation(other, AmmoItem, EQEmu::skills::SkillThrowing);
|
||||
|
||||
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, EQEmu::skills::SkillThrowing, EQEmu::legacy::SlotPrimary, chance_mod))){
|
||||
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, EQEmu::skills::SkillThrowing, EQEmu::inventory::slotPrimary, chance_mod))){
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack missed %s.", other->GetName());
|
||||
if (LaunchProjectile){
|
||||
TryProjectileAttack(other, AmmoItem, EQEmu::skills::SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed);
|
||||
@@ -1519,7 +1519,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg);
|
||||
if (!Assassinate_Dmg)
|
||||
other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange);
|
||||
other->AvoidDamage(this, TotalDmg, EQEmu::inventory::slotRange);
|
||||
|
||||
other->MeleeMitigation(this, TotalDmg, minDmg);
|
||||
if(TotalDmg > 0)
|
||||
@@ -1538,7 +1538,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::legacy::SlotRange);
|
||||
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, true, EQEmu::inventory::slotRange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1547,15 +1547,15 @@ void Mob::DoThrowingAttackDmg(Mob* other, const EQEmu::ItemInstance* RangeWeapon
|
||||
|
||||
//Throwing item Proc
|
||||
if (ammo_lost)
|
||||
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::legacy::SlotRange);
|
||||
TryWeaponProc(nullptr, ammo_lost, other, EQEmu::inventory::slotRange);
|
||||
else if(RangeWeapon && other && !other->HasDied())
|
||||
TryWeaponProc(RangeWeapon, other, EQEmu::legacy::SlotRange);
|
||||
TryWeaponProc(RangeWeapon, other, EQEmu::inventory::slotRange);
|
||||
|
||||
if (HasSkillProcs() && other && !other->HasDied()){
|
||||
if (ReuseTime)
|
||||
TrySkillProc(other, EQEmu::skills::SkillThrowing, ReuseTime);
|
||||
else
|
||||
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, false, EQEmu::legacy::SlotRange);
|
||||
TrySkillProc(other, EQEmu::skills::SkillThrowing, 0, false, EQEmu::inventory::slotRange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1955,7 +1955,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
|
||||
if (ca_target!=this) {
|
||||
DoAnim(animTailRake);
|
||||
|
||||
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotShoulders)) <= 0){
|
||||
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::inventory::slotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::inventory::slotShoulders)) <= 0){
|
||||
dmg = -5;
|
||||
}
|
||||
else{
|
||||
@@ -2019,7 +2019,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
|
||||
if(ca_target!=this){
|
||||
DoAnim(animKick);
|
||||
|
||||
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotFeet)) <= 0){
|
||||
if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::inventory::slotFeet)) <= 0){
|
||||
dmg = -5;
|
||||
}
|
||||
else{
|
||||
@@ -2231,7 +2231,7 @@ uint32 Mob::TryHeadShot(Mob* defender, EQEmu::skills::SkillType skillInUse) {
|
||||
HeadShot_Level = itembonuses.HSLevel;
|
||||
|
||||
if(HeadShot_Dmg && HeadShot_Level && (defender->GetLevel() <= HeadShot_Level)){
|
||||
float ProcChance = GetSpecialProcChances(EQEmu::legacy::SlotRange);
|
||||
float ProcChance = GetSpecialProcChances(EQEmu::inventory::slotRange);
|
||||
if(zone->random.Roll(ProcChance))
|
||||
return HeadShot_Dmg;
|
||||
}
|
||||
@@ -2294,7 +2294,7 @@ uint32 Mob::TryAssassinate(Mob* defender, EQEmu::skills::SkillType skillInUse, u
|
||||
float ProcChance = 0.0f;
|
||||
|
||||
if (skillInUse == EQEmu::skills::SkillThrowing)
|
||||
ProcChance = GetSpecialProcChances(EQEmu::legacy::SlotRange);
|
||||
ProcChance = GetSpecialProcChances(EQEmu::inventory::slotRange);
|
||||
else
|
||||
ProcChance = GetAssassinateProcChances(ReuseTime);
|
||||
|
||||
@@ -2345,7 +2345,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
|
||||
|
||||
int damage = 0;
|
||||
uint32 hate = 0;
|
||||
int Hand = EQEmu::legacy::SlotPrimary;
|
||||
int Hand = EQEmu::inventory::slotPrimary;
|
||||
if (hate == 0 && weapon_damage > 1) hate = weapon_damage;
|
||||
|
||||
if(weapon_damage > 0){
|
||||
@@ -2369,7 +2369,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::legacy::SlotSecondary);
|
||||
EQEmu::ItemInstance *item = CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
if(item){
|
||||
if (item->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
|
||||
hate += item->GetItem()->AC;
|
||||
@@ -2391,7 +2391,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills:
|
||||
else
|
||||
damage = zone->random.Int(min_hit, max_hit);
|
||||
|
||||
if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::legacy::SlotRange : EQEmu::legacy::SlotPrimary)) { // SlotRange excludes ripo, primary doesn't have any extra behavior
|
||||
if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::inventory::slotRange : EQEmu::inventory::slotPrimary)) { // SlotRange excludes ripo, primary doesn't have any extra behavior
|
||||
if (damage == -3) {
|
||||
DoRiposte(other);
|
||||
if (HasDied())
|
||||
|
||||
+10
-10
@@ -622,7 +622,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::legacy::SlotCursor);
|
||||
EQEmu::ItemInstance* transI = CastToClient()->GetInv().GetItem(EQEmu::inventory::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...
|
||||
@@ -632,7 +632,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::legacy::SlotCursor, fcharges, true);
|
||||
CastToClient()->DeleteItemInInventory(EQEmu::inventory::slotCursor, fcharges, true);
|
||||
CastToClient()->SummonItem(13073, fcharges);
|
||||
}
|
||||
else{
|
||||
@@ -1173,7 +1173,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
|
||||
if (SummonedItem) {
|
||||
c->PushItemOnCursor(*SummonedItem);
|
||||
c->SendItemPacket(EQEmu::legacy::SlotCursor, SummonedItem, ItemPacketLimbo);
|
||||
c->SendItemPacket(EQEmu::inventory::slotCursor, SummonedItem, ItemPacketLimbo);
|
||||
safe_delete(SummonedItem);
|
||||
}
|
||||
SummonedItem = database.CreateItem(spell.base[i], charges);
|
||||
@@ -1445,7 +1445,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
}
|
||||
}
|
||||
|
||||
for (int x = EQEmu::textures::TextureBegin; x <= EQEmu::textures::LastTintableTexture; x++)
|
||||
for (int x = EQEmu::textures::textureBegin; x <= EQEmu::textures::LastTintableTexture; x++)
|
||||
SendWearChange(x);
|
||||
|
||||
if (caster == this && spell.id != 287 && spell.id != 601 &&
|
||||
@@ -1471,7 +1471,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
);
|
||||
caster->SendAppearancePacket(AT_Size, static_cast<uint32>(caster->GetTarget()->GetSize()));
|
||||
|
||||
for (int x = EQEmu::textures::TextureBegin; x <= EQEmu::textures::LastTintableTexture; x++)
|
||||
for (int x = EQEmu::textures::textureBegin; x <= EQEmu::textures::LastTintableTexture; x++)
|
||||
caster->SendWearChange(x);
|
||||
}
|
||||
}
|
||||
@@ -2239,7 +2239,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::legacy::SlotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal
|
||||
entity_list.AEAttack(caster, 30, EQEmu::inventory::slotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -3037,7 +3037,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::legacy::SlotCursor, SummonedItem, ItemPacketLimbo);
|
||||
c->SendItemPacket(EQEmu::inventory::slotCursor, SummonedItem, ItemPacketLimbo);
|
||||
safe_delete(SummonedItem);
|
||||
}
|
||||
|
||||
@@ -3855,7 +3855,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
|
||||
else{
|
||||
SendAppearancePacket(AT_Size, 6);
|
||||
}
|
||||
for (int x = EQEmu::textures::TextureBegin; x <= EQEmu::textures::LastTintableTexture; x++){
|
||||
for (int x = EQEmu::textures::textureBegin; x <= EQEmu::textures::LastTintableTexture; x++){
|
||||
SendWearChange(x);
|
||||
}
|
||||
break;
|
||||
@@ -5194,7 +5194,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::ITEM_COMMON_SIZE; ++y)
|
||||
for (int y = EQEmu::inventory::socketBegin; y < EQEmu::inventory::SocketCount; ++y)
|
||||
{
|
||||
if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS)
|
||||
continue;
|
||||
@@ -5343,7 +5343,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::ITEM_COMMON_SIZE; ++y)
|
||||
for (int y = EQEmu::inventory::socketBegin; y < EQEmu::inventory::SocketCount; ++y)
|
||||
{
|
||||
EQEmu::ItemInstance *aug = nullptr;
|
||||
aug = ins->GetAugment(y);
|
||||
|
||||
+2
-2
@@ -293,7 +293,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::legacy::SlotAmmo || item_slot == EQEmu::legacy::SlotPowerSource)){
|
||||
if (itm && (itm->GetItem()->Click.Type == EQEmu::item::ItemEffectEquipClick) && !(item_slot <= EQEmu::inventory::slotAmmo || item_slot == EQEmu::inventory::slotPowerSource)){
|
||||
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
|
||||
// They are attempting to cast a must equip clicky without having it equipped
|
||||
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID);
|
||||
@@ -1244,7 +1244,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
if (inst == nullptr)
|
||||
break;
|
||||
|
||||
for (int r = AUG_INDEX_BEGIN; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) {
|
||||
for (int r = EQEmu::inventory::socketBegin; r < EQEmu::inventory::SocketCount; 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 = SLOT_BEGIN; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++)
|
||||
for (uint8 i = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_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 = SLOT_BEGIN; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++)
|
||||
for (uint8 i = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++)
|
||||
{
|
||||
const EQEmu::ItemInstance* inst = container->GetItem(i);
|
||||
if (inst)
|
||||
@@ -297,7 +297,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
|
||||
const EQEmu::ItemData* new_weapon = inst->GetItem();
|
||||
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
|
||||
container->Clear();
|
||||
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::legacy::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::inventory::slotCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
|
||||
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
|
||||
if (RuleB(Inventory, DeleteTransformationMold))
|
||||
user->DeleteItemInInventory(in_combine->container_slot, 0, true);
|
||||
@@ -317,7 +317,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
|
||||
const EQEmu::ItemData* new_weapon = inst->GetItem();
|
||||
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
|
||||
container->Clear();
|
||||
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::legacy::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::inventory::slotCursor, 0, 0);
|
||||
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
|
||||
}
|
||||
else if (inst) {
|
||||
@@ -401,7 +401,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
|
||||
safe_delete(outapp);
|
||||
database.DeleteWorldContainer(worldo->m_id, zone->GetZoneID());
|
||||
} else{
|
||||
for (uint8 i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++) {
|
||||
for (uint8 i = EQEmu::inventory::slotBegin; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++) {
|
||||
const EQEmu::ItemInstance* inst = container->GetItem(i);
|
||||
if (inst) {
|
||||
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot,i),0,true);
|
||||
@@ -1237,7 +1237,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 = SLOT_BEGIN; x < EQEmu::legacy::TYPE_WORLD_SIZE; x++) {
|
||||
for (int x = EQEmu::inventory::slotBegin; x < EQEmu::legacy::TYPE_WORLD_SIZE; x++) {
|
||||
const EQEmu::ItemInstance* inst = container->GetItem(x);
|
||||
if(!inst)
|
||||
continue;
|
||||
|
||||
+16
-16
@@ -98,7 +98,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
|
||||
|
||||
// Item always goes into trade bucket from cursor
|
||||
Client* client = owner->CastToClient();
|
||||
EQEmu::ItemInstance* inst = client->GetInv().GetItem(EQEmu::legacy::SlotCursor);
|
||||
EQEmu::ItemInstance* inst = client->GetInv().GetItem(EQEmu::inventory::slotCursor);
|
||||
|
||||
if (!inst) {
|
||||
client->Message(13, "Error: Could not find item on your cursor!");
|
||||
@@ -131,7 +131,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
|
||||
if (_stack_size > 0)
|
||||
inst->SetCharges(_stack_size);
|
||||
else
|
||||
client->DeleteItemInInventory(EQEmu::legacy::SlotCursor);
|
||||
client->DeleteItemInInventory(EQEmu::inventory::slotCursor);
|
||||
|
||||
SendItemData(inst2, trade_slot_id);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id);
|
||||
|
||||
client->PutItemInInventory(trade_slot_id, *inst);
|
||||
client->DeleteItemInInventory(EQEmu::legacy::SlotCursor);
|
||||
client->DeleteItemInInventory(EQEmu::inventory::slotCursor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ void Trade::SendItemData(const EQEmu::ItemInstance* inst, int16 dest_slot_id)
|
||||
if (with && with->IsClient()) {
|
||||
with->SendItemPacket(dest_slot_id - EQEmu::legacy::TRADE_BEGIN, inst, ItemPacketTradeView);
|
||||
if (inst->GetItem()->ItemClass == 1) {
|
||||
for (uint16 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) {
|
||||
for (uint16 i = EQEmu::inventory::containerBegin; i < EQEmu::inventory::ContainerCount; i++) {
|
||||
uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i);
|
||||
const EQEmu::ItemInstance* bagitem = trader->GetInv().GetItem(bagslot_id);
|
||||
if (bagitem) {
|
||||
@@ -267,7 +267,7 @@ void Trade::LogTrade()
|
||||
strcat(logtext, item_num);
|
||||
|
||||
if (inst->IsClassBag()) {
|
||||
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) {
|
||||
for (uint8 j = EQEmu::inventory::containerBegin; j < EQEmu::inventory::ContainerCount; j++) {
|
||||
inst = trader->GetInv().GetItem(i, j);
|
||||
if (inst) {
|
||||
strcat(logtext, ",");
|
||||
@@ -312,7 +312,7 @@ void Trade::DumpTrade()
|
||||
i, ((inst->IsClassBag()) ? "True" : "False"));
|
||||
|
||||
if (inst->IsClassBag()) {
|
||||
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) {
|
||||
for (uint8 j = EQEmu::inventory::containerBegin; j < EQEmu::inventory::ContainerCount; j++) {
|
||||
inst = trader->GetInv().GetItem(i, j);
|
||||
if (inst) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "\tBagItem %i (Charges=%i, Slot=%i)",
|
||||
@@ -359,7 +359,7 @@ void Client::ResetTrade() {
|
||||
// there's no built-in safety check against an infinite loop..but, it should break on one of the conditional checks
|
||||
int16 free_slot = m_inv.FindFreeSlotForTradeItem(inst);
|
||||
|
||||
if ((free_slot == EQEmu::legacy::SlotCursor) || (free_slot == INVALID_INDEX))
|
||||
if ((free_slot == EQEmu::inventory::slotCursor) || (free_slot == INVALID_INDEX))
|
||||
break;
|
||||
|
||||
EQEmu::ItemInstance* partial_inst = GetInv().GetItem(free_slot);
|
||||
@@ -523,7 +523,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
qs_audit->char1_count += detail->charges;
|
||||
|
||||
//for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) {
|
||||
for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items
|
||||
for (uint8 sub_slot = EQEmu::inventory::containerBegin; (sub_slot < EQEmu::inventory::ContainerCount); ++sub_slot) { // this is to catch ALL items
|
||||
const EQEmu::ItemInstance* bag_inst = inst->GetItem(sub_slot);
|
||||
|
||||
if (bag_inst) {
|
||||
@@ -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::legacy::SlotCursor) || (partial_slot == INVALID_INDEX))
|
||||
if ((partial_slot == EQEmu::inventory::slotCursor) || (partial_slot == INVALID_INDEX))
|
||||
break;
|
||||
|
||||
EQEmu::ItemInstance* partial_inst = other->GetInv().GetItem(partial_slot);
|
||||
@@ -743,7 +743,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
|
||||
// 'step 3' should never really see containers..but, just in case...
|
||||
//for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) {
|
||||
for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items
|
||||
for (uint8 sub_slot = EQEmu::inventory::containerBegin; (sub_slot < EQEmu::inventory::ContainerCount); ++sub_slot) { // this is to catch ALL items
|
||||
const EQEmu::ItemInstance* bag_inst = inst->GetItem(sub_slot);
|
||||
|
||||
if (bag_inst) {
|
||||
@@ -841,7 +841,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
qs_audit->char_count += detail->charges;
|
||||
|
||||
if (trade_inst->IsClassBag()) {
|
||||
for (uint8 sub_slot = SUB_INDEX_BEGIN; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
|
||||
for (uint8 sub_slot = EQEmu::inventory::containerBegin; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
|
||||
const EQEmu::ItemInstance* trade_baginst = trade_inst->GetItem(sub_slot);
|
||||
|
||||
if(trade_baginst) {
|
||||
@@ -891,7 +891,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) {
|
||||
// pets need to look inside bags and try to equip items found there
|
||||
if (item->IsClassBag() && item->BagSlots > 0) {
|
||||
for (int16 bslot = SUB_INDEX_BEGIN; bslot < item->BagSlots; bslot++) {
|
||||
for (int16 bslot = EQEmu::inventory::containerBegin; bslot < item->BagSlots; bslot++) {
|
||||
const EQEmu::ItemInstance* baginst = inst->GetItem(bslot);
|
||||
if (baginst) {
|
||||
const EQEmu::ItemData* bagitem = baginst->GetItem();
|
||||
@@ -1235,7 +1235,7 @@ uint32 Client::FindTraderItemSerialNumber(int32 ItemID) {
|
||||
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++){
|
||||
item = this->GetInv().GetItem(i);
|
||||
if (item && item->GetItem()->ID == 17899){ //Traders Satchel
|
||||
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++) {
|
||||
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++) {
|
||||
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
|
||||
SlotID = Inventory::CalcSlotId(i, x);
|
||||
item = this->GetInv().GetItem(SlotID);
|
||||
@@ -1258,7 +1258,7 @@ EQEmu::ItemInstance* Client::FindTraderItemBySerialNumber(int32 SerialNumber){
|
||||
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++){
|
||||
item = this->GetInv().GetItem(i);
|
||||
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
|
||||
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++) {
|
||||
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++) {
|
||||
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
|
||||
SlotID = Inventory::CalcSlotId(i, x);
|
||||
item = this->GetInv().GetItem(SlotID);
|
||||
@@ -1289,7 +1289,7 @@ GetItems_Struct* Client::GetTraderItems(){
|
||||
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
|
||||
item = this->GetInv().GetItem(i);
|
||||
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
|
||||
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++) {
|
||||
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++) {
|
||||
SlotID = Inventory::CalcSlotId(i, x);
|
||||
|
||||
item = this->GetInv().GetItem(SlotID);
|
||||
@@ -1313,7 +1313,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){
|
||||
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
|
||||
item = this->GetInv().GetItem(i);
|
||||
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
|
||||
for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++){
|
||||
for (int x = EQEmu::inventory::containerBegin; x < EQEmu::inventory::ContainerCount; x++){
|
||||
SlotID = Inventory::CalcSlotId(i, x);
|
||||
|
||||
item = this->GetInv().GetItem(SlotID);
|
||||
|
||||
+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::legacy::SlotPrimary;
|
||||
int Hand = EQEmu::inventory::slotPrimary;
|
||||
|
||||
if (!other)
|
||||
return 0;
|
||||
|
||||
EQEmu::ItemInstance* weapon;
|
||||
weapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary);
|
||||
weapon = GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
|
||||
if(weapon != nullptr) {
|
||||
if (!weapon->IsWeapon()) {
|
||||
@@ -628,7 +628,7 @@ int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage)
|
||||
|
||||
int ucDamageBonus = 0;
|
||||
|
||||
if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass())
|
||||
if (Hand == EQEmu::inventory::slotPrimary && GetLevel() >= 28 && IsWarriorClass())
|
||||
{
|
||||
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::ItemData*) nullptr);
|
||||
|
||||
@@ -662,24 +662,24 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
|
||||
if (attacker->IsClient())
|
||||
{//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow.
|
||||
EQEmu::ItemInstance* weapon;
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
|
||||
if(weapon && weapon->IsWeapon()){
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotPrimary, weapon);
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotPrimary, weapon);
|
||||
}
|
||||
else {
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
if (weapon && weapon->IsWeapon())
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotSecondary, weapon);
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotSecondary, weapon);
|
||||
else {
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotRange);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotRange);
|
||||
if (weapon && weapon->IsWeapon())
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotRange, weapon);
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotRange, weapon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, 0, avoid_override);
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, 0, 0, avoid_override);
|
||||
|
||||
|
||||
Message(0, "#Tune - Begin Parse [Interval %i Max Loop Iterations %i]", interval, max_loop);
|
||||
@@ -691,7 +691,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
|
||||
|
||||
for (int j=0; j < max_loop; j++)
|
||||
{
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, false, 0, avoid_override, add_acc);
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, false, 0, avoid_override, add_acc);
|
||||
|
||||
if (Msg >= 3)
|
||||
Message(15, "#Tune - Processing... [%i] [ACCURACY %i] Hit Chance %.2f ",j,add_acc,tmp_hit_chance);
|
||||
@@ -706,7 +706,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
|
||||
|
||||
if (end){
|
||||
|
||||
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, Msg, 0, avoid_override);//Display Stat Report
|
||||
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, Msg, 0, avoid_override);//Display Stat Report
|
||||
|
||||
Message(0, " ");
|
||||
|
||||
@@ -742,24 +742,24 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
|
||||
if (attacker->IsClient())
|
||||
{//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow.
|
||||
EQEmu::ItemInstance* weapon;
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotPrimary);
|
||||
|
||||
if(weapon && weapon->IsWeapon()){
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotPrimary, weapon);
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotPrimary, weapon);
|
||||
}
|
||||
else {
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotSecondary);
|
||||
if (weapon && weapon->IsWeapon())
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotSecondary, weapon);
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotSecondary, weapon);
|
||||
else {
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotRange);
|
||||
weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::inventory::slotRange);
|
||||
if (weapon && weapon->IsWeapon())
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotRange, weapon);
|
||||
attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::inventory::slotRange, weapon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, acc_override, 0);
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, 0, acc_override, 0);
|
||||
|
||||
Message(0, "#Tune - Begin Parse [Interval %i Max Loop Iterations %i]", interval, max_loop);
|
||||
Message(0, "#Tune - Processing... Find Avoidance for hit chance on defender of (%.0f) pct from attacker. [Current Hit Chance %.2f]", hit_chance, tmp_hit_chance);
|
||||
@@ -769,7 +769,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
|
||||
|
||||
for (int j=0; j < max_loop; j++)
|
||||
{
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, acc_override, 0, 0, add_avoid);
|
||||
tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, 0, acc_override, 0, 0, add_avoid);
|
||||
|
||||
if (Msg >= 3)
|
||||
Message(0, "#Tune - Processing... [%i] [AVOIDANCE %i] Hit Chance %.2f ",j,add_avoid,tmp_hit_chance);
|
||||
@@ -784,7 +784,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
|
||||
|
||||
if (end){
|
||||
|
||||
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, Msg, acc_override, 0);//Display Stat Report
|
||||
Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::inventory::slotPrimary, 0, Msg, acc_override, 0);//Display Stat Report
|
||||
|
||||
Message(0, " ");
|
||||
|
||||
|
||||
+9
-9
@@ -487,7 +487,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::legacy::ITEM_COMMON_SIZE];
|
||||
uint32 aug[EQEmu::inventory::SocketCount];
|
||||
aug[0] = (uint32)atoi(row[3]);
|
||||
aug[1] = (uint32)atoi(row[4]);
|
||||
aug[2] = (uint32)atoi(row[5]);
|
||||
@@ -497,7 +497,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, EQEmu::ItemInstance* cont
|
||||
|
||||
EQEmu::ItemInstance* inst = database.CreateItem(item_id, charges);
|
||||
if (inst && inst->GetItem()->IsClassCommon()) {
|
||||
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++)
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++)
|
||||
if (aug[i])
|
||||
inst->PutAugment(&database, i, aug[i]);
|
||||
// Put item inside world container
|
||||
@@ -520,17 +520,17 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const EQ
|
||||
DeleteWorldContainer(parent_id,zone_id);
|
||||
|
||||
// Save all 10 items, if they exist
|
||||
for (uint8 index = SUB_INDEX_BEGIN; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; index++) {
|
||||
for (uint8 index = EQEmu::inventory::containerBegin; index < EQEmu::inventory::ContainerCount; index++) {
|
||||
|
||||
EQEmu::ItemInstance* inst = container->GetItem(index);
|
||||
if (!inst)
|
||||
continue;
|
||||
|
||||
uint32 item_id = inst->GetItem()->ID;
|
||||
uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
|
||||
uint32 augslot[EQEmu::inventory::SocketCount] = { 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
if (inst->IsType(EQEmu::item::ItemClassCommon)) {
|
||||
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
|
||||
for (int i = EQEmu::inventory::socketBegin; i < EQEmu::inventory::SocketCount; i++) {
|
||||
EQEmu::ItemInstance *auginst=inst->GetAugment(i);
|
||||
augslot[i]=(auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
|
||||
}
|
||||
@@ -2092,7 +2092,7 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
|
||||
else {
|
||||
auto armorTint_row = armortint_results.begin();
|
||||
|
||||
for (int index = EQEmu::textures::TextureBegin; index <= EQEmu::textures::LastTexture; index++) {
|
||||
for (int index = EQEmu::textures::textureBegin; index <= EQEmu::textures::LastTexture; index++) {
|
||||
temp_npctype_data->armor_tint.Slot[index].Color = atoi(armorTint_row[index * 3]) << 16;
|
||||
temp_npctype_data->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 1]) << 8;
|
||||
temp_npctype_data->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 2]);
|
||||
@@ -2102,7 +2102,7 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
|
||||
}
|
||||
// Try loading npc_types tint fields if armor tint is 0 or query failed to get results
|
||||
if (armor_tint_id == 0) {
|
||||
for (int index = EQEmu::textures::TextureChest; index < EQEmu::textures::TextureCount; index++) {
|
||||
for (int index = EQEmu::textures::armorChest; index < EQEmu::textures::materialCount; index++) {
|
||||
temp_npctype_data->armor_tint.Slot[index].Color = temp_npctype_data->armor_tint.Slot[0].Color; // odd way to 'zero-out' the array...
|
||||
}
|
||||
}
|
||||
@@ -2307,7 +2307,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
|
||||
tmpNPCType->armor_tint.Slot[0].Color |= (tmpNPCType->armor_tint.Slot[0].Color) ? (0xFF << 24) : 0;
|
||||
|
||||
if (armor_tint_id == 0)
|
||||
for (int index = EQEmu::textures::TextureChest; index <= EQEmu::textures::LastTexture; index++)
|
||||
for (int index = EQEmu::textures::armorChest; index <= EQEmu::textures::LastTexture; index++)
|
||||
tmpNPCType->armor_tint.Slot[index].Color = tmpNPCType->armor_tint.Slot[0].Color;
|
||||
else if (tmpNPCType->armor_tint.Slot[0].Color == 0) {
|
||||
std::string armorTint_query = StringFormat("SELECT red1h, grn1h, blu1h, "
|
||||
@@ -2327,7 +2327,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
|
||||
else {
|
||||
auto armorTint_row = results.begin();
|
||||
|
||||
for (int index = EQEmu::textures::TextureBegin; index <= EQEmu::textures::LastTexture; index++) {
|
||||
for (int index = EQEmu::textures::textureBegin; index <= EQEmu::textures::LastTexture; index++) {
|
||||
tmpNPCType->armor_tint.Slot[index].Color = atoi(armorTint_row[index * 3]) << 16;
|
||||
tmpNPCType->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 1]) << 8;
|
||||
tmpNPCType->armor_tint.Slot[index].Color |= atoi(armorTint_row[index * 3 + 2]);
|
||||
|
||||
Reference in New Issue
Block a user