Merge branch 'master' into ConfigFileUpdate

This commit is contained in:
phredi
2016-05-24 20:47:52 -05:00
76 changed files with 1887 additions and 1720 deletions
+1 -1
View File
@@ -423,7 +423,7 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration)
uint32 sitem = 0;
sitem = CorpseToUse->GetWornItem(x);
if(sitem){
const Item_Struct * itm = database.GetItem(sitem);
const EQEmu::Item_Struct * itm = database.GetItem(sitem);
npca->AddLootDrop(itm, &npca->itemlist, 1, 1, 127, true, true);
}
}
+119 -154
View File
@@ -54,110 +54,75 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
{
// Determine animation
int type = 0;
if (weapon && weapon->IsType(ItemClassCommon)) {
const Item_Struct* item = weapon->GetItem();
if (weapon && weapon->IsClassCommon()) {
const EQEmu::Item_Struct* item = weapon->GetItem();
Log.Out(Logs::Detail, Logs::Attack, "Weapon skill : %i", item->ItemType);
switch (item->ItemType)
{
case ItemType1HSlash: // 1H Slashing
{
skillinuse = Skill1HSlashing;
type = anim1HWeapon;
break;
}
case ItemType2HSlash: // 2H Slashing
{
skillinuse = Skill2HSlashing;
type = anim2HSlashing;
break;
}
case ItemType1HPiercing: // Piercing
{
switch (item->ItemType) {
case EQEmu::item::ItemType1HSlash: // 1H Slashing
skillinuse = Skill1HSlashing;
type = anim1HWeapon;
break;
case EQEmu::item::ItemType2HSlash: // 2H Slashing
skillinuse = Skill2HSlashing;
type = anim2HSlashing;
break;
case EQEmu::item::ItemType1HPiercing: // Piercing
skillinuse = Skill1HPiercing;
type = anim1HPiercing;
break;
case EQEmu::item::ItemType1HBlunt: // 1H Blunt
skillinuse = Skill1HBlunt;
type = anim1HWeapon;
break;
case EQEmu::item::ItemType2HBlunt: // 2H Blunt
skillinuse = Skill2HBlunt;
type = anim2HSlashing; //anim2HWeapon
break;
case EQEmu::item::ItemType2HPiercing: // 2H Piercing
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
skillinuse = Skill1HPiercing;
type = anim1HPiercing;
break;
}
case ItemType1HBlunt: // 1H Blunt
{
skillinuse = Skill1HBlunt;
type = anim1HWeapon;
break;
}
case ItemType2HBlunt: // 2H Blunt
{
skillinuse = Skill2HBlunt;
type = anim2HSlashing; //anim2HWeapon
break;
}
case ItemType2HPiercing: // 2H Piercing
{
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
skillinuse = Skill1HPiercing;
else
skillinuse = Skill2HPiercing;
type = anim2HWeapon;
break;
}
case ItemTypeMartial:
{
skillinuse = SkillHandtoHand;
type = animHand2Hand;
break;
}
default:
{
skillinuse = SkillHandtoHand;
type = animHand2Hand;
break;
}
else
skillinuse = Skill2HPiercing;
type = anim2HWeapon;
break;
case EQEmu::item::ItemTypeMartial:
skillinuse = SkillHandtoHand;
type = animHand2Hand;
break;
default:
skillinuse = SkillHandtoHand;
type = animHand2Hand;
break;
}// switch
}
else if(IsNPC()) {
switch (skillinuse)
{
case Skill1HSlashing: // 1H Slashing
{
type = anim1HWeapon;
break;
}
case Skill2HSlashing: // 2H Slashing
{
type = anim2HSlashing;
break;
}
case Skill1HPiercing: // Piercing
{
type = anim1HPiercing;
break;
}
case Skill1HBlunt: // 1H Blunt
{
type = anim1HWeapon;
break;
}
case Skill2HBlunt: // 2H Blunt
{
type = anim2HSlashing; //anim2HWeapon
break;
}
case Skill2HPiercing: // 2H Piercing
{
type = anim2HWeapon;
break;
}
case SkillHandtoHand:
{
type = animHand2Hand;
break;
}
default:
{
type = animHand2Hand;
break;
}
switch (skillinuse) {
case Skill1HSlashing: // 1H Slashing
type = anim1HWeapon;
break;
case Skill2HSlashing: // 2H Slashing
type = anim2HSlashing;
break;
case Skill1HPiercing: // Piercing
type = anim1HPiercing;
break;
case Skill1HBlunt: // 1H Blunt
type = anim1HWeapon;
break;
case Skill2HBlunt: // 2H Blunt
type = anim2HSlashing; //anim2HWeapon
break;
case Skill2HPiercing: // 2H Piercing
type = anim2HWeapon;
break;
case SkillHandtoHand:
type = animHand2Hand;
break;
default:
type = animHand2Hand;
break;
}// switch
}
else {
@@ -825,7 +790,7 @@ int32 Client::GetMeleeMitDmg(Mob *attacker, int32 damage, int32 minhit,
//Else we know we can hit.
//GetWeaponDamage(mob*, const Item_Struct*) is intended to be used for mobs or any other situation where we do not have a client inventory item
//GetWeaponDamage(mob*, const ItemInst*) is intended to be used for situations where we have a client inventory item
int Mob::GetWeaponDamage(Mob *against, const Item_Struct *weapon_item) {
int Mob::GetWeaponDamage(Mob *against, const EQEmu::Item_Struct *weapon_item) {
int dmg = 0;
int banedmg = 0;
@@ -1151,7 +1116,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
// Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above
// who belong to a melee class. If we're here, then all of these conditions apply.
ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr );
ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const EQEmu::Item_Struct*) nullptr );
min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus;
@@ -1162,7 +1127,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
if (Hand == EQEmu::legacy::SlotSecondary) {
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const Item_Struct*) nullptr, true );
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::Item_Struct*) nullptr, true );
min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus;
@@ -1630,7 +1595,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
}
//figure out what weapon they are using, if any
const Item_Struct* weapon = nullptr;
const EQEmu::Item_Struct* 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])
@@ -1641,40 +1606,40 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
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 == ItemTypeShield){
if (Hand == EQEmu::legacy::SlotSecondary && weapon->ItemType == EQEmu::item::ItemTypeShield){
Log.Out(Logs::Detail, Logs::Combat, "Attack with shield canceled.");
return false;
}
switch(weapon->ItemType){
case ItemType1HSlash:
skillinuse = Skill1HSlashing;
break;
case ItemType2HSlash:
skillinuse = Skill2HSlashing;
break;
case ItemType1HPiercing:
skillinuse = Skill1HPiercing;
break;
case ItemType2HPiercing:
skillinuse = Skill2HPiercing;
break;
case ItemType1HBlunt:
skillinuse = Skill1HBlunt;
break;
case ItemType2HBlunt:
skillinuse = Skill2HBlunt;
break;
case ItemTypeBow:
skillinuse = SkillArchery;
break;
case ItemTypeLargeThrowing:
case ItemTypeSmallThrowing:
skillinuse = SkillThrowing;
break;
default:
skillinuse = SkillHandtoHand;
break;
switch(weapon->ItemType) {
case EQEmu::item::ItemType1HSlash:
skillinuse = Skill1HSlashing;
break;
case EQEmu::item::ItemType2HSlash:
skillinuse = Skill2HSlashing;
break;
case EQEmu::item::ItemType1HPiercing:
skillinuse = Skill1HPiercing;
break;
case EQEmu::item::ItemType2HPiercing:
skillinuse = Skill2HPiercing;
break;
case EQEmu::item::ItemType1HBlunt:
skillinuse = Skill1HBlunt;
break;
case EQEmu::item::ItemType2HBlunt:
skillinuse = Skill2HBlunt;
break;
case EQEmu::item::ItemTypeBow:
skillinuse = SkillArchery;
break;
case EQEmu::item::ItemTypeLargeThrowing:
case EQEmu::item::ItemTypeSmallThrowing:
skillinuse = SkillThrowing;
break;
default:
skillinuse = SkillHandtoHand;
break;
}
}
@@ -2542,7 +2507,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
}
}
uint8 Mob::GetWeaponDamageBonus(const Item_Struct *weapon, bool offhand)
uint8 Mob::GetWeaponDamageBonus(const EQEmu::Item_Struct *weapon, bool offhand)
{
// dev quote with old and new formulas
// https://forums.daybreakgames.com/eq/index.php?threads/test-update-09-17-15.226618/page-5#post-3326194
@@ -2554,8 +2519,7 @@ uint8 Mob::GetWeaponDamageBonus(const Item_Struct *weapon, bool offhand)
return 1 + ((level - 28) / 3); // how does weaponless scale?
auto delay = weapon->Delay;
if (weapon->ItemType == ItemType1HSlash || weapon->ItemType == ItemType1HBlunt ||
weapon->ItemType == ItemTypeMartial || weapon->ItemType == ItemType1HPiercing) {
if (weapon->IsType1HWeapon() || weapon->ItemType == EQEmu::item::ItemTypeMartial) {
// we assume sinister strikes is checked before calling here
if (!offhand) {
if (delay <= 39)
@@ -3574,12 +3538,12 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) {
}
if(!weapon_g) {
TrySpellProc(nullptr, (const Item_Struct*)nullptr, on);
TrySpellProc(nullptr, (const EQEmu::Item_Struct*)nullptr, on);
return;
}
if(!weapon_g->IsType(ItemClassCommon)) {
TrySpellProc(nullptr, (const Item_Struct*)nullptr, on);
if (!weapon_g->IsClassCommon()) {
TrySpellProc(nullptr, (const EQEmu::Item_Struct*)nullptr, on);
return;
}
@@ -3592,7 +3556,7 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) {
return;
}
void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, uint16 hand)
void Mob::TryWeaponProc(const ItemInst *inst, const EQEmu::Item_Struct *weapon, Mob *on, uint16 hand)
{
if (!weapon)
@@ -3611,7 +3575,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
// We can proc once here, either weapon or one aug
bool proced = false; // silly bool to prevent augs from going if weapon does
skillinuse = GetSkillByItemType(weapon->ItemType);
if (weapon->Proc.Type == ET_CombatProc && IsValidSpell(weapon->Proc.Effect)) {
if (weapon->Proc.Type == EQEmu::item::ItemEffectCombatProc && IsValidSpell(weapon->Proc.Effect)) {
float WPC = ProcChance * (100.0f + // Proc chance for this weapon
static_cast<float>(weapon->ProcRate)) / 100.0f;
if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really.
@@ -3645,11 +3609,11 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
const ItemInst *aug_i = inst->GetAugment(r);
if (!aug_i) // no aug, try next slot!
continue;
const Item_Struct *aug = aug_i->GetItem();
const EQEmu::Item_Struct *aug = aug_i->GetItem();
if (!aug)
continue;
if (aug->Proc.Type == ET_CombatProc && IsValidSpell(aug->Proc.Effect)) {
if (aug->Proc.Type == EQEmu::item::ItemEffectCombatProc && IsValidSpell(aug->Proc.Effect)) {
float APC = ProcChance * (100.0f + // Proc chance for this aug
static_cast<float>(aug->ProcRate)) / 100.0f;
if (zone->random.Roll(APC)) {
@@ -3675,7 +3639,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
return;
}
void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, uint16 hand)
void Mob::TrySpellProc(const ItemInst *inst, const EQEmu::Item_Struct *weapon, Mob *on, uint16 hand)
{
float ProcBonus = static_cast<float>(spellbonuses.SpellProcChance +
itembonuses.SpellProcChance + aabonuses.SpellProcChance);
@@ -3687,11 +3651,12 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
bool rangedattk = false;
if (weapon && hand == EQEmu::legacy::SlotRange) {
if (weapon->ItemType == ItemTypeArrow ||
weapon->ItemType == ItemTypeLargeThrowing ||
weapon->ItemType == ItemTypeSmallThrowing ||
weapon->ItemType == ItemTypeBow)
if (weapon->ItemType == EQEmu::item::ItemTypeArrow ||
weapon->ItemType == EQEmu::item::ItemTypeLargeThrowing ||
weapon->ItemType == EQEmu::item::ItemTypeSmallThrowing ||
weapon->ItemType == EQEmu::item::ItemTypeBow) {
rangedattk = true;
}
}
if (!weapon && hand == EQEmu::legacy::SlotRange && GetSpecialAbility(SPECATK_RANGED_ATK))
@@ -4531,7 +4496,7 @@ void Client::SetAttackTimer()
else //invalid slot (hands will always hit this)
continue;
const Item_Struct *ItemToUse = nullptr;
const EQEmu::Item_Struct *ItemToUse = nullptr;
//find our item
ItemInst *ci = GetInv().GetItem(i);
@@ -4550,16 +4515,16 @@ void Client::SetAttackTimer()
//see if we have a valid weapon
if (ItemToUse != nullptr) {
//check type and damage/delay
if (ItemToUse->ItemClass != ItemClassCommon
|| ItemToUse->Damage == 0
|| ItemToUse->Delay == 0) {
if (!ItemToUse->IsClassCommon()
|| ItemToUse->Damage == 0
|| ItemToUse->Delay == 0) {
//no weapon
ItemToUse = nullptr;
}
// Check to see if skill is valid
else if ((ItemToUse->ItemType > ItemTypeLargeThrowing) &&
(ItemToUse->ItemType != ItemTypeMartial) &&
(ItemToUse->ItemType != ItemType2HPiercing)) {
else if ((ItemToUse->ItemType > EQEmu::item::ItemTypeLargeThrowing) &&
(ItemToUse->ItemType != EQEmu::item::ItemTypeMartial) &&
(ItemToUse->ItemType != EQEmu::item::ItemType2HPiercing)) {
//no weapon
ItemToUse = nullptr;
}
@@ -4578,7 +4543,7 @@ void Client::SetAttackTimer()
speed = delay / haste_mod;
if (ItemToUse && ItemToUse->ItemType == ItemTypeBow) {
if (ItemToUse && ItemToUse->ItemType == EQEmu::item::ItemTypeBow) {
// Live actually had a bug here where they would return the non-modified attack speed
// rather than the cap ...
speed = std::max(speed - GetQuiverHaste(speed), RuleI(Combat, QuiverHasteCap));
+46 -45
View File
@@ -152,14 +152,14 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::legacy::SlotAmmo));
//These are given special flags due to how often they are checked for various spell effects.
const Item_Struct *item = inst->GetItem();
if (i == EQEmu::legacy::SlotSecondary && (item && item->ItemType == ItemTypeShield))
const EQEmu::Item_Struct *item = inst->GetItem();
if (i == EQEmu::legacy::SlotSecondary && (item && item->ItemType == EQEmu::item::ItemTypeShield))
SetShieldEquiped(true);
else if (i == EQEmu::legacy::SlotPrimary && (item && item->ItemType == ItemType2HBlunt)) {
else if (i == EQEmu::legacy::SlotPrimary && (item && item->ItemType == EQEmu::item::ItemType2HBlunt)) {
SetTwoHandBluntEquiped(true);
SetTwoHanderEquipped(true);
}
else if (i == EQEmu::legacy::SlotPrimary && (item && (item->ItemType == ItemType2HSlash || item->ItemType == ItemType2HPiercing)))
else if (i == EQEmu::legacy::SlotPrimary && (item && (item->ItemType == EQEmu::item::ItemType2HSlash || item->ItemType == EQEmu::item::ItemType2HPiercing)))
SetTwoHanderEquipped(true);
}
@@ -180,7 +180,7 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
}
//Optional ability to have worn effects calculate as an addititive bonus instead of highest value
if (RuleI(Spells, AdditiveBonusWornType) && RuleI(Spells, AdditiveBonusWornType) != ET_WornEffect){
if (RuleI(Spells, AdditiveBonusWornType) && RuleI(Spells, AdditiveBonusWornType) != EQEmu::item::ItemEffectWorn){
for (i = EQEmu::legacy::SlotCharm; i < EQEmu::legacy::SlotAmmo; i++) {
const ItemInst* inst = m_inv[i];
if(inst == 0)
@@ -210,7 +210,7 @@ void Client::ProcessItemCaps()
void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAug, bool isTribute, int rec_override, bool ammo_slot_item)
{
if (!inst || !inst->IsType(ItemClassCommon)) {
if (!inst || !inst->IsClassCommon()) {
return;
}
@@ -218,10 +218,10 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
return;
}
const Item_Struct *item = inst->GetItem();
const EQEmu::Item_Struct *item = inst->GetItem();
if (!isTribute && !inst->IsEquipable(GetBaseRace(), GetClass())) {
if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink)
if (item->ItemType != EQEmu::item::ItemTypeFood && item->ItemType != EQEmu::item::ItemTypeDrink)
return;
}
@@ -430,11 +430,11 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
else
newbon->DSMitigation += item->DSMitigation;
}
if (item->Worn.Effect > 0 && item->Worn.Type == ET_WornEffect) { // latent effects
if (item->Worn.Effect > 0 && item->Worn.Type == EQEmu::item::ItemEffectWorn) { // latent effects
ApplySpellsBonuses(item->Worn.Effect, item->Worn.Level, newbon, 0, item->Worn.Type);
}
if (item->Focus.Effect > 0 && (item->Focus.Type == ET_Focus)) { // focus effects
if (item->Focus.Effect > 0 && (item->Focus.Type == EQEmu::item::ItemEffectFocus)) { // focus effects
ApplySpellsBonuses(item->Focus.Effect, item->Focus.Level, newbon, 0);
}
@@ -544,13 +544,13 @@ void Client::AdditiveWornBonuses(const ItemInst *inst, StatBonuses* newbon, bool
which will also stack with regular (worntype 2) effects. [Ie set rule = 3 and item worntype = 3]
*/
if(!inst || !inst->IsType(ItemClassCommon))
if (!inst || !inst->IsClassCommon())
return;
if(inst->GetAugmentType()==0 && isAug == true)
return;
const Item_Struct *item = inst->GetItem();
const EQEmu::Item_Struct *item = inst->GetItem();
if(!inst->IsEquipable(GetBaseRace(),GetClass()))
return;
@@ -581,11 +581,11 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
if (food && drink)
break;
const ItemInst* inst = GetInv().GetItem(i);
if (inst && inst->GetItem() && inst->IsType(ItemClassCommon)) {
const Item_Struct *item=inst->GetItem();
if (item->ItemType == ItemTypeFood && !food)
if (inst && inst->GetItem() && inst->IsClassCommon()) {
const EQEmu::Item_Struct *item=inst->GetItem();
if (item->ItemType == EQEmu::item::ItemTypeFood && !food)
food = true;
else if (item->ItemType == ItemTypeDrink && !drink)
else if (item->ItemType == EQEmu::item::ItemTypeDrink && !drink)
drink = true;
else
continue;
@@ -597,11 +597,11 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
if (food && drink)
break;
const ItemInst* inst = GetInv().GetItem(i);
if (inst && inst->GetItem() && inst->IsType(ItemClassCommon)) {
const Item_Struct *item=inst->GetItem();
if (item->ItemType == ItemTypeFood && !food)
if (inst && inst->GetItem() && inst->IsClassCommon()) {
const EQEmu::Item_Struct *item=inst->GetItem();
if (item->ItemType == EQEmu::item::ItemTypeFood && !food)
food = true;
else if (item->ItemType == ItemTypeDrink && !drink)
else if (item->ItemType == EQEmu::item::ItemTypeDrink && !drink)
drink = true;
else
continue;
@@ -911,19 +911,19 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
break;
case SE_AddSingingMod:
switch (base2) {
case ItemTypeWindInstrument:
case EQEmu::item::ItemTypeWindInstrument:
newbon->windMod += base1;
break;
case ItemTypeStringedInstrument:
case EQEmu::item::ItemTypeStringedInstrument:
newbon->stringedMod += base1;
break;
case ItemTypeBrassInstrument:
case EQEmu::item::ItemTypeBrassInstrument:
newbon->brassMod += base1;
break;
case ItemTypePercussionInstrument:
case EQEmu::item::ItemTypePercussionInstrument:
newbon->percussionMod += base1;
break;
case ItemTypeSinging:
case EQEmu::item::ItemTypeSinging:
newbon->singingMod += base1;
break;
}
@@ -2753,23 +2753,24 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
break;
case SE_AddSingingMod:
switch (base2)
{
case ItemTypeWindInstrument:
new_bonus->windMod += effect_value;
break;
case ItemTypeStringedInstrument:
new_bonus->stringedMod += effect_value;
break;
case ItemTypeBrassInstrument:
new_bonus->brassMod += effect_value;
break;
case ItemTypePercussionInstrument:
new_bonus->percussionMod += effect_value;
break;
case ItemTypeSinging:
new_bonus->singingMod += effect_value;
break;
switch (base2) {
case EQEmu::item::ItemTypeWindInstrument:
new_bonus->windMod += effect_value;
break;
case EQEmu::item::ItemTypeStringedInstrument:
new_bonus->stringedMod += effect_value;
break;
case EQEmu::item::ItemTypeBrassInstrument:
new_bonus->brassMod += effect_value;
break;
case EQEmu::item::ItemTypePercussionInstrument:
new_bonus->percussionMod += effect_value;
break;
case EQEmu::item::ItemTypeSinging:
new_bonus->singingMod += effect_value;
break;
default:
break;
}
break;
@@ -3202,7 +3203,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon)
if(newbon){
for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]);
const EQEmu::Item_Struct *cur = database.GetItem(equipment[i]);
if(cur){
//basic stats
newbon->AC += cur->AC;
@@ -3257,12 +3258,12 @@ void NPC::CalcItemBonuses(StatBonuses *newbon)
if(cur->CombatEffects > 0) {
newbon->ProcChance += cur->CombatEffects;
}
if (cur->Worn.Effect>0 && (cur->Worn.Type == ET_WornEffect)) { // latent effects
if (cur->Worn.Effect>0 && (cur->Worn.Type == EQEmu::item::ItemEffectWorn)) { // latent effects
ApplySpellsBonuses(cur->Worn.Effect, cur->Worn.Level, newbon, 0, cur->Worn.Type);
}
if (RuleB(Spells, NPC_UseFocusFromItems)){
if (cur->Focus.Effect>0 && (cur->Focus.Type == ET_Focus)){ // focus effects
if (cur->Focus.Effect>0 && (cur->Focus.Type == EQEmu::item::ItemEffectFocus)){ // focus effects
ApplySpellsBonuses(cur->Focus.Effect, cur->Focus.Level, newbon);
}
}
+71 -80
View File
@@ -93,7 +93,6 @@ Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, nullptr, glm
timers[i] = 0;
strcpy(this->name, this->GetCleanName());
memset(&m_Light, 0, sizeof(EQEmu::lightsource::LightSourceProfile));
memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct));
}
@@ -234,9 +233,9 @@ uint32 Bot::GetBotArcheryRange() {
if (!range_inst || !ammo_inst)
return 0;
const Item_Struct *range_item = range_inst->GetItem();
const Item_Struct *ammo_item = ammo_inst->GetItem();
if (!range_item || !ammo_item || range_item->ItemType != ItemTypeBow || ammo_item->ItemType != ItemTypeArrow)
const EQEmu::Item_Struct *range_item = range_inst->GetItem();
const EQEmu::Item_Struct *ammo_item = ammo_inst->GetItem();
if (!range_item || !ammo_item || range_item->ItemType != EQEmu::item::ItemTypeBow || ammo_item->ItemType != EQEmu::item::ItemTypeArrow)
return 0;
// everything is good!
@@ -1181,38 +1180,30 @@ uint16 Bot::GetPrimarySkillValue() {
else {
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
switch(type) {
case ItemType1HSlash: {
skill = Skill1HSlashing;
break;
}
case ItemType2HSlash: {
skill = Skill2HSlashing;
break;
}
case ItemType1HPiercing: {
skill = Skill1HPiercing;
break;
}
case ItemType1HBlunt: {
skill = Skill1HBlunt;
break;
}
case ItemType2HBlunt: {
skill = Skill2HBlunt;
break;
}
case ItemType2HPiercing: {
skill = Skill2HPiercing;
break;
}
case ItemTypeMartial: {
skill = SkillHandtoHand;
break;
}
default: {
skill = SkillHandtoHand;
break;
}
case EQEmu::item::ItemType1HSlash:
skill = Skill1HSlashing;
break;
case EQEmu::item::ItemType2HSlash:
skill = Skill2HSlashing;
break;
case EQEmu::item::ItemType1HPiercing:
skill = Skill1HPiercing;
break;
case EQEmu::item::ItemType1HBlunt:
skill = Skill1HBlunt;
break;
case EQEmu::item::ItemType2HBlunt:
skill = Skill2HBlunt;
break;
case EQEmu::item::ItemType2HPiercing:
skill = Skill2HPiercing;
break;
case EQEmu::item::ItemTypeMartial:
skill = SkillHandtoHand;
break;
default:
skill = SkillHandtoHand;
break;
}
}
@@ -1907,12 +1898,12 @@ void Bot::BotRangedAttack(Mob* other) {
}
ItemInst* rangedItem = GetBotItem(EQEmu::legacy::SlotRange);
const Item_Struct* RangeWeapon = 0;
const EQEmu::Item_Struct* RangeWeapon = 0;
if(rangedItem)
RangeWeapon = rangedItem->GetItem();
ItemInst* ammoItem = GetBotItem(EQEmu::legacy::SlotAmmo);
const Item_Struct* Ammo = 0;
const EQEmu::Item_Struct* Ammo = 0;
if(ammoItem)
Ammo = ammoItem->GetItem();
@@ -2021,7 +2012,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
int32 min_hit = 1;
int32 max_hit = ((2 * weapon_damage * GetDamageTable(skillinuse)) / 100);
if(GetLevel() >= 28 && IsWarriorClass()) {
int ucDamageBonus = GetWeaponDamageBonus((const Item_Struct*) nullptr);
int ucDamageBonus = GetWeaponDamageBonus((const EQEmu::Item_Struct*) nullptr);
min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus;
hate += ucDamageBonus;
@@ -2063,12 +2054,12 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
if(skillinuse == SkillBash){
const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
const Item_Struct* botweapon = 0;
const EQEmu::Item_Struct* botweapon = 0;
if(inst)
botweapon = inst->GetItem();
if(botweapon) {
if(botweapon->ItemType == ItemTypeShield)
if (botweapon->ItemType == EQEmu::item::ItemTypeShield)
hate += botweapon->AC;
hate = (hate * (100 + GetFuriousBash(botweapon->Focus.Effect)) / 100);
@@ -2123,7 +2114,7 @@ void Bot::ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg)
if (item_slot >= EQEmu::legacy::EQUIPMENT_BEGIN){
const ItemInst* inst = GetBotItem(item_slot);
const Item_Struct* botweapon = 0;
const EQEmu::Item_Struct* botweapon = 0;
if(inst)
botweapon = inst->GetItem();
@@ -2488,7 +2479,7 @@ void Bot::AI_Process() {
if (GetTarget() && ExtraAttackChanceBonus) {
ItemInst *wpn = GetBotItem(EQEmu::legacy::SlotPrimary);
if(wpn) {
if(wpn->GetItem()->ItemType == ItemType2HSlash || wpn->GetItem()->ItemType == ItemType2HBlunt || wpn->GetItem()->ItemType == ItemType2HPiercing) {
if (wpn->GetItem()->IsType2HWeapon()) {
if(zone->random.Int(0, 100) < ExtraAttackChanceBonus)
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
}
@@ -2511,7 +2502,7 @@ void Bot::AI_Process() {
//now off hand
if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) {
const ItemInst* instweapon = GetBotItem(EQEmu::legacy::SlotSecondary);
const Item_Struct* weapon = 0;
const EQEmu::Item_Struct* weapon = 0;
//can only dual wield without a weapon if you're a monk
if(instweapon || (botClass == MONK)) {
if(instweapon)
@@ -2524,7 +2515,7 @@ void Bot::AI_Process() {
bIsFist = false;
}
if(bIsFist || ((weapontype != ItemType2HSlash) && (weapontype != ItemType2HPiercing) && (weapontype != ItemType2HBlunt))) {
if (bIsFist || !weapon->IsType2HWeapon()) {
float DualWieldProbability = 0.0f;
int32 Ambidexterity = (aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity);
DualWieldProbability = ((GetSkill(SkillDualWield) + GetLevel() + Ambidexterity) / 400.0f); // 78.0 max
@@ -2955,10 +2946,10 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
ns->spawn.size = 0;
ns->spawn.NPC = 0; // 0=player,1=npc,2=pc corpse,3=npc corpse
UpdateActiveLight();
ns->spawn.light = m_Light.Type.Active;
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
ns->spawn.helm = helmtexture; //(GetShowHelm() ? helmtexture : 0); //0xFF;
ns->spawn.equip_chest2 = texture; //0xFF;
const Item_Struct* item = 0;
const EQEmu::Item_Struct* item = 0;
const ItemInst* inst = 0;
uint32 spawnedbotid = 0;
spawnedbotid = this->GetBotID();
@@ -3401,7 +3392,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
//EQoffline: will give the items to the bots and change the bot stats
if(inst && (GetBotOwner() == client->CastToMob()) && !IsEngaged()) {
std::string TempErrorMessage;
const Item_Struct* mWeaponItem = inst->GetItem();
const EQEmu::Item_Struct* mWeaponItem = inst->GetItem();
bool failedLoreCheck = false;
for (int m = AUG_INDEX_BEGIN; m < EQEmu::legacy::ITEM_COMMON_SIZE; ++m) {
ItemInst *itm = inst->GetAugment(m);
@@ -3436,9 +3427,9 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
how_many_slots++;
if(!GetBotItem(j)) {
if (j == EQEmu::legacy::SlotPrimary) {
if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if (mWeaponItem->IsType2HWeapon()) {
if (GetBotItem(EQEmu::legacy::SlotSecondary)) {
if(mWeaponItem && (mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if (mWeaponItem && mWeaponItem->IsType2HWeapon()) {
if (client->CheckLoreConflict(GetBotItem(EQEmu::legacy::SlotSecondary)->GetItem())) {
failedLoreCheck = true;
}
@@ -3473,7 +3464,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
if(success) {
if (GetBotItem(EQEmu::legacy::SlotPrimary)) {
ItemInst* remove_item = GetBotItem(EQEmu::legacy::SlotPrimary);
if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) {
if (remove_item->GetItem()->IsType2HWeapon()) {
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
@@ -3510,7 +3501,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
}
if(!failedLoreCheck) {
if (j == EQEmu::legacy::SlotPrimary) {
if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if (mWeaponItem->IsType2HWeapon()) {
if (GetBotItem(EQEmu::legacy::SlotSecondary)) {
if (client->CheckLoreConflict(GetBotItem(EQEmu::legacy::SlotSecondary)->GetItem())) {
failedLoreCheck = true;
@@ -3544,7 +3535,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
}
if (success && GetBotItem(EQEmu::legacy::SlotPrimary)) {
ItemInst* remove_item = GetBotItem(EQEmu::legacy::SlotPrimary);
if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) {
if (remove_item->GetItem()->IsType2HWeapon()) {
BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
@@ -3580,7 +3571,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
}
}
const Item_Struct* item2 = 0;
const EQEmu::Item_Struct* item2 = 0;
for(int y = beginSlotID; y <= endSlotID; ++y) {
item2 = database.GetItem(items[y]);
if(item2) {
@@ -3819,7 +3810,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass()) {
// Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above
// who belong to a melee class. If we're here, then all of these conditions apply.
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const Item_Struct*) nullptr);
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::Item_Struct*) nullptr);
min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus;
hate += ucDamageBonus;
@@ -3828,7 +3819,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
//Live AA - Sinister Strikes *Adds weapon damage bonus to offhand weapon.
if (Hand == EQEmu::legacy::SlotSecondary) {
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const Item_Struct*) nullptr);
ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const EQEmu::Item_Struct*) nullptr);
min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus;
hate += ucDamageBonus;
@@ -4286,8 +4277,8 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
//Check if item focus effect exists for the client.
if (itembonuses.FocusEffects[bottype]) {
const Item_Struct* TempItem = 0;
const Item_Struct* UsedItem = 0;
const EQEmu::Item_Struct* TempItem = 0;
const EQEmu::Item_Struct* UsedItem = 0;
const ItemInst* TempInst = 0;
uint16 UsedFocusID = 0;
int32 Total = 0;
@@ -4323,7 +4314,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
ItemInst *aug = nullptr;
aug = ins->GetAugment(y);
if(aug) {
const Item_Struct* TempItemAug = aug->GetItem();
const EQEmu::Item_Struct* TempItemAug = aug->GetItem();
if (TempItemAug && TempItemAug->Focus.Effect > 0 && TempItemAug->Focus.Effect != SPELL_UNKNOWN) {
if(rand_effectiveness) {
focus_max = CalcBotFocusEffect(bottype, TempItemAug->Focus.Effect, spell_id, true);
@@ -4871,12 +4862,12 @@ void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
if(skill == SkillBash) {
const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
const Item_Struct* botweapon = 0;
const EQEmu::Item_Struct* botweapon = 0;
if(inst)
botweapon = inst->GetItem();
if(botweapon) {
if(botweapon->ItemType == ItemTypeShield)
if (botweapon->ItemType == EQEmu::item::ItemTypeShield)
hate += botweapon->AC;
hate = (hate * (100 + GetFuriousBash(botweapon->Focus.Effect)) / 100);
@@ -4936,11 +4927,11 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
bool bIsBehind = false;
bool bCanFrontalBS = false;
const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotPrimary);
const Item_Struct* botpiercer = nullptr;
const EQEmu::Item_Struct* botpiercer = nullptr;
if(inst)
botpiercer = inst->GetItem();
if(!botpiercer || (botpiercer->ItemType != ItemType1HPiercing)) {
if (!botpiercer || (botpiercer->ItemType != EQEmu::item::ItemType1HPiercing)) {
BotGroupSay(this, "I can't backstab with this weapon!");
return;
}
@@ -5109,7 +5100,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 == ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && (m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1))
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))
canBash = true;
if(!canBash || zone->random.Int(0, 100) > 25)
@@ -5128,7 +5119,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 == ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && (m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1))
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))
skill_to_use = SkillBash;
}
break;
@@ -5373,7 +5364,7 @@ bool Bot::IsBotAttackAllowed(Mob* attacker, Mob* target, bool& hasRuleDefined) {
void Bot::EquipBot(std::string* errorMessage) {
GetBotItems(m_inv, errorMessage);
const ItemInst* inst = 0;
const Item_Struct* item = 0;
const EQEmu::Item_Struct* item = 0;
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
inst = GetBotItem(i);
if(inst) {
@@ -5500,7 +5491,7 @@ void Bot::SetAttackTimer() {
float haste_mod = (GetHaste() * 0.01f);
attack_timer.SetAtTrigger(4000, true);
Timer* TimerToUse = nullptr;
const Item_Struct* PrimaryWeapon = nullptr;
const EQEmu::Item_Struct* PrimaryWeapon = nullptr;
for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) {
if (i == EQEmu::legacy::SlotPrimary)
TimerToUse = &attack_timer;
@@ -5511,14 +5502,14 @@ void Bot::SetAttackTimer() {
else
continue;
const Item_Struct* ItemToUse = nullptr;
const EQEmu::Item_Struct* ItemToUse = nullptr;
ItemInst* ci = GetBotItem(i);
if (ci)
ItemToUse = ci->GetItem();
if (i == EQEmu::legacy::SlotSecondary) {
if (PrimaryWeapon != nullptr) {
if (PrimaryWeapon->ItemClass == ItemClassCommon && (PrimaryWeapon->ItemType == ItemType2HSlash || PrimaryWeapon->ItemType == ItemType2HBlunt || PrimaryWeapon->ItemType == ItemType2HPiercing)) {
if (PrimaryWeapon->IsClassCommon() && PrimaryWeapon->IsType2HWeapon()) {
attack_dw_timer.Disable();
continue;
}
@@ -5531,7 +5522,7 @@ void Bot::SetAttackTimer() {
}
if (ItemToUse != nullptr) {
if (ItemToUse->ItemClass != ItemClassCommon || ItemToUse->Damage == 0 || ItemToUse->Delay == 0 || ((ItemToUse->ItemType > ItemTypeLargeThrowing) && (ItemToUse->ItemType != ItemTypeMartial) && (ItemToUse->ItemType != ItemType2HPiercing)))
if (!ItemToUse->IsClassCommon() || ItemToUse->Damage == 0 || ItemToUse->Delay == 0 || ((ItemToUse->ItemType > EQEmu::item::ItemTypeLargeThrowing) && (ItemToUse->ItemType != EQEmu::item::ItemTypeMartial) && (ItemToUse->ItemType != EQEmu::item::ItemType2HPiercing)))
ItemToUse = nullptr;
}
@@ -7186,7 +7177,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
insr->TargetID = inspectedBot->GetNPCTypeID();
insr->playerid = inspectedBot->GetID();
const Item_Struct* item = 0;
const EQEmu::Item_Struct* item = 0;
const ItemInst* inst = 0;
// Modded to display power source items (will only show up on SoF+ client inspect windows though.)
@@ -7238,7 +7229,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
void Bot::CalcItemBonuses(StatBonuses* newbon)
{
const Item_Struct* itemtmp = 0;
const EQEmu::Item_Struct* itemtmp = 0;
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
const ItemInst* item = GetBotItem((i == 22 ? 9999 : i));
@@ -7259,7 +7250,7 @@ void Bot::CalcItemBonuses(StatBonuses* newbon)
}
void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug, bool isTribute, int rec_override) {
if(!inst || !inst->IsType(ItemClassCommon))
if (!inst || !inst->IsClassCommon())
{
return;
}
@@ -7269,11 +7260,11 @@ void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug,
return;
}
const Item_Struct *item = inst->GetItem();
const EQEmu::Item_Struct *item = inst->GetItem();
if(!isTribute && !inst->IsEquipable(GetBaseRace(),GetClass()))
{
if(item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink)
if (item->ItemType != EQEmu::item::ItemTypeFood && item->ItemType != EQEmu::item::ItemTypeDrink)
return;
}
@@ -7480,11 +7471,11 @@ void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug,
else
newbon->DSMitigation += item->DSMitigation;
}
if (item->Worn.Effect > 0 && item->Worn.Type == ET_WornEffect) {// latent effects
if (item->Worn.Effect > 0 && item->Worn.Type == EQEmu::item::ItemEffectWorn) {// latent effects
ApplySpellsBonuses(item->Worn.Effect, item->Worn.Level, newbon, 0, item->Worn.Type);
}
if (item->Focus.Effect>0 && (item->Focus.Type == ET_Focus)) { // focus effects
if (item->Focus.Effect>0 && (item->Focus.Type == EQEmu::item::ItemEffectFocus)) { // focus effects
ApplySpellsBonuses(item->Focus.Effect, item->Focus.Level, newbon, 0);
}
@@ -7636,7 +7627,7 @@ void Bot::CalcBotStats(bool showtext) {
}
}
bool Bot::CheckLoreConflict(const Item_Struct* item) {
bool Bot::CheckLoreConflict(const EQEmu::Item_Struct* item) {
if (!item || !(item->LoreFlag))
return false;
@@ -8044,7 +8035,7 @@ int Bot::GetRawACNoShield(int &shield_ac) {
shield_ac = 0;
ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
if(inst) {
if(inst->GetItem()->ItemType == ItemTypeShield) {
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++) {
@@ -8059,7 +8050,7 @@ int Bot::GetRawACNoShield(int &shield_ac) {
}
uint32 Bot::CalcCurrentWeight() {
const Item_Struct* TempItem = 0;
const EQEmu::Item_Struct* TempItem = 0;
ItemInst* inst;
uint32 Total = 0;
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
+2 -2
View File
@@ -385,8 +385,8 @@ public:
void BotTradeSwapItem(Client* client, int16 lootSlot, const ItemInst* inst, const ItemInst* inst_swap, uint32 equipableSlots, std::string* errorMessage, bool swap = true);
void BotTradeAddItem(uint32 id, const ItemInst* inst, int16 charges, uint32 equipableSlots, uint16 lootSlot, std::string* errorMessage, bool addToDb = true);
void EquipBot(std::string* errorMessage);
bool CheckLoreConflict(const Item_Struct* item);
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment); }
bool CheckLoreConflict(const EQEmu::Item_Struct* item);
virtual void UpdateEquipmentLight() { m_Light.Type[EQEmu::lightsource::LightEquipment] = m_inv.FindBrightestLightType(); m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]); }
// Static Class Methods
//static void DestroyBotRaidObjects(Client* client); // Can be removed after bot raids are dumped
+4 -4
View File
@@ -7062,7 +7062,7 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
}
const ItemInst* inst = nullptr;
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
bool is2Hweapon = false;
std::string item_link;
@@ -7081,7 +7081,7 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
}
item = inst->GetItem();
if ((i == EQEmu::legacy::SlotPrimary) && ((item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HPiercing))) {
if ((i == EQEmu::legacy::SlotPrimary) && item->IsType2HWeapon()) {
is2Hweapon = true;
}
@@ -7131,7 +7131,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
return;
}
const Item_Struct* itm = nullptr;
const EQEmu::Item_Struct* itm = nullptr;
const ItemInst* itminst = my_bot->GetBotItem(slotId);
if (itminst)
itm = itminst->GetItem();
@@ -7234,7 +7234,7 @@ void bot_subcommand_inventory_window(Client *c, const Seperator *sep)
//linker.SetLinkType(linker.linkItemInst);
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) {
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
const ItemInst* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::legacy::SlotPowerSource : i);
if (inst)
item = inst->GetItem();
+41 -58
View File
@@ -1902,7 +1902,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
UpdateEquipmentLight();
UpdateActiveLight();
ns->spawn.light = m_Light.Type.Active;
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
}
bool Client::GMHideMe(Client* client) {
@@ -2539,7 +2539,7 @@ void Client::SetFeigned(bool in_feigned) {
feigned=in_feigned;
}
void Client::LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32 price, const Item_Struct* item, bool buying)
void Client::LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32 price, const EQEmu::Item_Struct* item, bool buying)
{
if(!player || !merchant || !item)
return;
@@ -2577,7 +2577,7 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
// Start bind
if (!bindwound_timer.Enabled()) {
// make sure we actually have a bandage... and consume it.
int16 bslot = m_inv.HasItemByUse(ItemTypeBandage, 1, invWhereWorn | invWherePersonal);
int16 bslot = m_inv.HasItemByUse(EQEmu::item::ItemTypeBandage, 1, invWhereWorn | invWherePersonal);
if (bslot == INVALID_INDEX) {
bind_out->type = 3;
QueuePacket(outapp);
@@ -2725,8 +2725,8 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
}
void Client::SetMaterial(int16 in_slot, uint32 item_id) {
const Item_Struct* item = database.GetItem(item_id);
if (item && (item->ItemClass==ItemClassCommon))
const EQEmu::Item_Struct* item = database.GetItem(item_id);
if (item && item->IsClassCommon())
{
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
if (matslot != EQEmu::legacy::MaterialInvalid)
@@ -3768,7 +3768,7 @@ void Client::SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID) {
return;
}
void Client::SendPickPocketResponse(Mob *from, uint32 amt, int type, const Item_Struct* item){
void Client::SendPickPocketResponse(Mob *from, uint32 amt, int type, const EQEmu::Item_Struct* item){
EQApplicationPacket* outapp = new EQApplicationPacket(OP_PickPocket, sizeof(sPickPocket_Struct));
sPickPocket_Struct* pick_out = (sPickPocket_Struct*) outapp->pBuffer;
pick_out->coin = amt;
@@ -3945,7 +3945,7 @@ bool Client::KeyRingCheck(uint32 item_id)
void Client::KeyRingList()
{
Message(4,"Keys on Keyring:");
const Item_Struct *item = 0;
const EQEmu::Item_Struct *item = 0;
for(std::list<uint32>::iterator iter = keyring.begin();
iter != keyring.end();
++iter)
@@ -4212,51 +4212,34 @@ uint16 Client::GetPrimarySkillValue()
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
switch (type)
{
case ItemType1HSlash: // 1H Slashing
{
skill = Skill1HSlashing;
break;
}
case ItemType2HSlash: // 2H Slashing
{
skill = Skill2HSlashing;
break;
}
case ItemType1HPiercing: // Piercing
{
switch (type) {
case EQEmu::item::ItemType1HSlash: // 1H Slashing
skill = Skill1HSlashing;
break;
case EQEmu::item::ItemType2HSlash: // 2H Slashing
skill = Skill2HSlashing;
break;
case EQEmu::item::ItemType1HPiercing: // Piercing
skill = Skill1HPiercing;
break;
case EQEmu::item::ItemType1HBlunt: // 1H Blunt
skill = Skill1HBlunt;
break;
case EQEmu::item::ItemType2HBlunt: // 2H Blunt
skill = Skill2HBlunt;
break;
case EQEmu::item::ItemType2HPiercing: // 2H Piercing
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
skill = Skill1HPiercing;
break;
}
case ItemType1HBlunt: // 1H Blunt
{
skill = Skill1HBlunt;
break;
}
case ItemType2HBlunt: // 2H Blunt
{
skill = Skill2HBlunt;
break;
}
case ItemType2HPiercing: // 2H Piercing
{
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
skill = Skill1HPiercing;
else
skill = Skill2HPiercing;
break;
}
case ItemTypeMartial: // Hand to Hand
{
skill = SkillHandtoHand;
break;
}
default: // All other types default to Hand to Hand
{
skill = SkillHandtoHand;
break;
}
else
skill = Skill2HPiercing;
break;
case EQEmu::item::ItemTypeMartial: // Hand to Hand
skill = SkillHandtoHand;
break;
default: // All other types default to Hand to Hand
skill = SkillHandtoHand;
break;
}
}
@@ -5708,7 +5691,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
insr->TargetID = requester->GetID();
insr->playerid = requestee->GetID();
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
const ItemInst* inst = nullptr;
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
for(int16 L = 0; L <= 20; L++) {
@@ -5720,7 +5703,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
strcpy(insr->itemnames[L], item->Name);
if (inst && inst->GetOrnamentationAug(ornamentationAugtype))
{
const Item_Struct *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
const EQEmu::Item_Struct *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
insr->itemicons[L] = aug_item->Icon;
}
else if (inst && inst->GetOrnamentationIcon())
@@ -6902,7 +6885,7 @@ void Client::SendAltCurrencies() {
uint32 i = 0;
std::list<AltCurrencyDefinition_Struct>::iterator iter = zone->AlternateCurrencies.begin();
while(iter != zone->AlternateCurrencies.end()) {
const Item_Struct* item = database.GetItem((*iter).item_id);
const EQEmu::Item_Struct* item = database.GetItem((*iter).item_id);
altc->entries[i].currency_number = (*iter).id;
altc->entries[i].unknown00 = 1;
altc->entries[i].currency_number2 = (*iter).id;
@@ -7555,7 +7538,7 @@ void Client::DuplicateLoreMessage(uint32 ItemID)
return;
}
const Item_Struct *item = database.GetItem(ItemID);
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
if(!item)
return;
@@ -8272,7 +8255,7 @@ void Client::SetConsumption(int32 in_hunger, int32 in_thirst)
safe_delete(outapp);
}
void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_consume)
void Client::Consume(const EQEmu::Item_Struct *item, uint8 type, int16 slot, bool auto_consume)
{
if(!item) { return; }
@@ -8285,7 +8268,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_
else
cons_mod = cons_mod * RuleI(Character, ConsumptionMultiplier) / 100;
if(type == ItemTypeFood)
if (type == EQEmu::item::ItemTypeFood)
{
int hchange = item->CastTime * cons_mod;
hchange = mod_food_value(item, hchange);
@@ -8390,7 +8373,7 @@ int Client::GetQuiverHaste(int delay)
const ItemInst *pi = nullptr;
for (int r = EQEmu::legacy::GENERAL_BEGIN; r <= EQEmu::legacy::GENERAL_END; r++) {
pi = GetInv().GetItem(r);
if (pi && pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver &&
if (pi && pi->IsClassBag() && pi->GetItem()->BagType == EQEmu::item::BagTypeQuiver &&
pi->GetItem()->BagWR > 0)
break;
if (r == EQEmu::legacy::GENERAL_END)
+13 -9
View File
@@ -27,7 +27,11 @@ class Object;
class Raid;
class Seperator;
class ServerPacket;
struct Item_Struct;
namespace EQEmu
{
struct Item_Struct;
}
#include "../common/timer.h"
#include "../common/ptimer.h"
@@ -290,7 +294,7 @@ public:
void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
virtual bool Process();
void LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32 price, const Item_Struct* item, bool buying);
void LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32 price, const EQEmu::Item_Struct* item, bool buying);
void SendPacketQueue(bool Block = true);
void QueuePacket(const EQApplicationPacket* app, bool ack_req = true, CLIENT_CONN_STATUS = CLIENT_CONNECTINGALL, eqFilterType filter=FilterNone);
void FastQueuePacket(EQApplicationPacket** app, bool ack_req = true, CLIENT_CONN_STATUS = CLIENT_CONNECTINGALL);
@@ -398,7 +402,7 @@ public:
inline uint8 GetLanguageSkill(uint16 n) const { return m_pp.languages[n]; }
void SendPickPocketResponse(Mob *from, uint32 amt, int type, const Item_Struct* item = nullptr);
void SendPickPocketResponse(Mob *from, uint32 amt, int type, const EQEmu::Item_Struct* item = nullptr);
inline const char* GetLastName() const { return lastname; }
@@ -594,7 +598,7 @@ public:
void AssignToInstance(uint16 instance_id);
void RemoveFromInstance(uint16 instance_id);
void WhoAll();
bool CheckLoreConflict(const Item_Struct* item);
bool CheckLoreConflict(const EQEmu::Item_Struct* item);
void ChangeLastName(const char* in_lastname);
void GetGroupAAs(GroupLeadershipAA_Struct *into) const;
void GetRaidAAs(RaidLeadershipAA_Struct *into) const;
@@ -737,7 +741,7 @@ public:
#endif
uint32 GetEquipment(uint8 material_slot) const; // returns item id
uint32 GetEquipmentColor(uint8 material_slot) const;
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = m_inv.FindBrightestLightType(); m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment); }
virtual void UpdateEquipmentLight() { m_Light.Type[EQEmu::lightsource::LightEquipment] = m_inv.FindBrightestLightType(); m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]); }
inline bool AutoSplitEnabled() { return m_pp.autosplit != 0; }
@@ -1173,7 +1177,7 @@ public:
void LoadAccountFlags();
void SetAccountFlag(std::string flag, std::string val);
std::string GetAccountFlag(std::string flag); float GetDamageMultiplier(SkillUseTypes);
void Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_consume);
void Consume(const EQEmu::Item_Struct *item, uint8 type, int16 slot, bool auto_consume);
void PlayMP3(const char* fname);
void ExpeditionSay(const char *str, int ExpID);
int mod_client_damage(int damage, SkillUseTypes skillinuse, int hand, const ItemInst* weapon, Mob* other);
@@ -1195,9 +1199,9 @@ public:
int32 mod_client_xp(int32 in_exp, NPC *npc);
uint32 mod_client_xp_for_level(uint32 xp, uint16 check_level);
int mod_client_haste_cap(int cap);
int mod_consume(Item_Struct *item, ItemUseTypes type, int change);
int mod_food_value(const Item_Struct *item, int change);
int mod_drink_value(const Item_Struct *item, int change);
int mod_consume(EQEmu::Item_Struct *item, EQEmu::item::ItemType type, int change);
int mod_food_value(const EQEmu::Item_Struct *item, int change);
int mod_drink_value(const EQEmu::Item_Struct *item, int change);
void SetEngagedRaidTarget(bool value) { EngagedRaidTarget = value; }
bool GetEngagedRaidTarget() const { return EngagedRaidTarget; }
+6 -6
View File
@@ -487,7 +487,7 @@ int32 Client::GetRawItemAC()
// this skips MainAmmo..add an '=' conditional if that slot is required (original behavior)
for (int16 slot_id = EQEmu::legacy::EQUIPMENT_BEGIN; slot_id < EQEmu::legacy::EQUIPMENT_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if (inst && inst->IsType(ItemClassCommon)) {
if (inst && inst->IsClassCommon()) {
Total += inst->GetItem()->AC;
}
}
@@ -1070,7 +1070,7 @@ int32 Client::CalcAC()
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary);
if (equiped) {
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType;
if (shield == ItemTypeShield) {
if (shield == EQEmu::item::ItemTypeShield) {
displayed += itembonuses.HeroicSTR / 2;
}
}
@@ -1099,7 +1099,7 @@ int32 Client::GetACMit()
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary);
if (equiped) {
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType;
if (shield == ItemTypeShield) {
if (shield == EQEmu::item::ItemTypeShield) {
mitigation += itembonuses.HeroicSTR / 2;
}
}
@@ -1302,7 +1302,7 @@ int32 Client::CalcManaRegenCap()
uint32 Client::CalcCurrentWeight()
{
const Item_Struct* TempItem = 0;
const EQEmu::Item_Struct* TempItem = 0;
ItemInst* ins;
uint32 Total = 0;
int x;
@@ -1337,7 +1337,7 @@ uint32 Client::CalcCurrentWeight()
}
}
ItemInst* baginst = GetInv().GetItem(bagslot);
if (baginst && baginst->GetItem() && baginst->IsType(ItemClassContainer)) {
if (baginst && baginst->GetItem() && baginst->IsClassBag()) {
reduction = baginst->GetItem()->BagWR;
}
if (reduction > 0) {
@@ -2207,7 +2207,7 @@ int Client::GetRawACNoShield(int &shield_ac) const
shield_ac = 0;
const ItemInst *inst = m_inv.GetItem(EQEmu::legacy::SlotSecondary);
if (inst) {
if (inst->GetItem()->ItemType == ItemTypeShield) {
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++) {
+52 -52
View File
@@ -1881,7 +1881,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
merchantid = tmp->CastToNPC()->MerchantType;
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
bool found = false;
std::list<MerchantList> merlist = zone->merchanttable[merchantid];
std::list<MerchantList>::const_iterator itr;
@@ -2057,7 +2057,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app)
merchantid = tmp->CastToNPC()->MerchantType;
tmp->CastToNPC()->FaceTarget(this->CastToMob());
const Item_Struct *item = 0;
const EQEmu::Item_Struct *item = 0;
std::list<MerchantList> merlist = zone->merchanttable[merchantid];
std::list<MerchantList>::const_iterator itr;
for (itr = merlist.begin(); itr != merlist.end() && count<255; ++itr){
@@ -2156,7 +2156,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app)
return;
}
const Item_Struct* item = database.GetItem(itemid);
const EQEmu::Item_Struct* item = database.GetItem(itemid);
ItemInst* inst = GetInv().GetItem(ams_in->slot);
if (!item || !inst){
Message(13, "You seemed to have misplaced that item...");
@@ -2431,7 +2431,7 @@ void Client::Handle_OP_AltCurrencyMerchantRequest(const EQApplicationPacket *app
ss << alt_cur_id << "|1|" << alt_cur_id;
uint32 count = 0;
uint32 merchant_id = tar->MerchantType;
const Item_Struct *item = nullptr;
const EQEmu::Item_Struct *item = nullptr;
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
std::list<MerchantList>::const_iterator itr;
@@ -2491,7 +2491,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
return;
}
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
uint32 cost = 0;
uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id);
uint32 merchant_id = tar->MerchantType;
@@ -2640,7 +2640,7 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app)
return;
}
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
uint32 cost = 0;
uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id);
uint32 merchant_id = tar->MerchantType;
@@ -2733,7 +2733,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app)
return;
}
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
uint32 cost = 0;
uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id);
uint32 merchant_id = tar->MerchantType;
@@ -2815,7 +2815,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
const ItemInst* SecondaryWeapon = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
const ItemInst* PoisonItemInstance = GetInv()[ApplyPoisonData->inventorySlot];
bool IsPoison = PoisonItemInstance && (PoisonItemInstance->GetItem()->ItemType == ItemTypePoison);
bool IsPoison = PoisonItemInstance && (PoisonItemInstance->GetItem()->ItemType == EQEmu::item::ItemTypePoison);
if (!IsPoison)
{
@@ -2826,8 +2826,8 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
}
else if (GetClass() == ROGUE)
{
if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == ItemType1HPiercing) ||
(SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == ItemType1HPiercing)) {
if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == EQEmu::item::ItemType1HPiercing) ||
(SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == EQEmu::item::ItemType1HPiercing)) {
float SuccessChance = (GetSkill(SkillApplyPoison) + GetLevel()) / 400.0f;
double ChanceRoll = zone->random.Real(0, 1);
@@ -2907,7 +2907,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app)
}
AugmentInfo_Struct* AugInfo = (AugmentInfo_Struct*)app->pBuffer;
const Item_Struct * item = database.GetItem(AugInfo->itemid);
const EQEmu::Item_Struct * item = database.GetItem(AugInfo->itemid);
if (item) {
strn0cpy(AugInfo->augment_info, item->Name, 64);
@@ -2965,7 +2965,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
Message(13, "Error: Missing an augmentation distiller for safely removing this augment.");
return;
}
else if (solvent->GetItem()->ItemType == ItemUseTypes::ItemTypeAugmentationDistiller)
else if (solvent->GetItem()->ItemType == EQEmu::item::ItemTypeAugmentationDistiller)
{
old_aug = tobe_auged->GetAugment(in_augment->augment_index);
@@ -2982,7 +2982,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
return;
}
}
else if (solvent->GetItem()->ItemType != ItemUseTypes::ItemTypePerfectedAugmentationDistiller)
else if (solvent->GetItem()->ItemType != EQEmu::item::ItemTypePerfectedAugmentationDistiller)
{
Log.Out(Logs::General, Logs::Error, "Player tried to safely remove an augment with a non-distiller item.");
Message(13, "Error: Invalid augmentation distiller for safely removing this augment.");
@@ -3489,7 +3489,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app)
{
BarterItemSearchLinkRequest_Struct* bislr = (BarterItemSearchLinkRequest_Struct*)app->pBuffer;
const Item_Struct* item = database.GetItem(bislr->ItemID);
const EQEmu::Item_Struct* item = database.GetItem(bislr->ItemID);
if (!item)
Message(13, "Error: This item does not exist!");
@@ -3522,7 +3522,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app)
{
BuyerItemSearchLinkRequest_Struct* bislr = (BuyerItemSearchLinkRequest_Struct*)app->pBuffer;
const Item_Struct* item = database.GetItem(bislr->ItemID);
const EQEmu::Item_Struct* item = database.GetItem(bislr->ItemID);
if (!item)
Message(13, "Error: This item does not exist!");
@@ -3561,7 +3561,7 @@ void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app)
BazaarInspect_Struct* bis = (BazaarInspect_Struct*)app->pBuffer;
const Item_Struct* item = database.GetItem(bis->ItemID);
const EQEmu::Item_Struct* item = database.GetItem(bis->ItemID);
if (!item) {
Message(13, "Error: This item does not exist!");
@@ -4011,9 +4011,9 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
// packet field types will be reviewed as packet transistions occur
const ItemInst* inst = m_inv[castspell->inventoryslot]; //slot values are int16, need to check packet on this field
//bool cancast = true;
if (inst && inst->IsType(ItemClassCommon))
if (inst && inst->IsClassCommon())
{
const Item_Struct* item = inst->GetItem();
const EQEmu::Item_Struct* item = inst->GetItem();
if (item->Click.Effect != (uint32)castspell->spell_id)
{
database.SetMQDetectionFlag(account_name, name, "OP_CastSpell with item, tried to cast a different spell.", zone->GetShortName());
@@ -4021,7 +4021,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
return;
}
if ((item->Click.Type == ET_ClickEffect) || (item->Click.Type == ET_Expendable) || (item->Click.Type == ET_EquipClick) || (item->Click.Type == ET_ClickEffect2))
if ((item->Click.Type == EQEmu::item::ItemEffectClick) || (item->Click.Type == EQEmu::item::ItemEffectExpendable) || (item->Click.Type == EQEmu::item::ItemEffectEquipClick) || (item->Click.Type == EQEmu::item::ItemEffectClick2))
{
if (item->Click.Level2 > 0)
{
@@ -4861,12 +4861,12 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app)
return;
}
const Item_Struct* eat_item = myitem->GetItem();
const EQEmu::Item_Struct* eat_item = myitem->GetItem();
if (pcs->type == 0x01) {
Consume(eat_item, ItemTypeFood, pcs->slot, (pcs->auto_consumed == 0xffffffff));
Consume(eat_item, EQEmu::item::ItemTypeFood, pcs->slot, (pcs->auto_consumed == 0xffffffff));
}
else if (pcs->type == 0x02) {
Consume(eat_item, ItemTypeDrink, pcs->slot, (pcs->auto_consumed == 0xffffffff));
Consume(eat_item, EQEmu::item::ItemTypeDrink, pcs->slot, (pcs->auto_consumed == 0xffffffff));
}
else {
Log.Out(Logs::General, Logs::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type);
@@ -5134,7 +5134,7 @@ void Client::Handle_OP_DeleteItem(const EQApplicationPacket *app)
DeleteItem_Struct* alc = (DeleteItem_Struct*)app->pBuffer;
const ItemInst *inst = GetInv().GetItem(alc->from_slot);
if (inst && inst->GetItem()->ItemType == ItemTypeAlcohol) {
if (inst && inst->GetItem()->ItemType == EQEmu::item::ItemTypeAlcohol) {
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), inst->GetItem()->Name);
CheckIncreaseSkill(SkillAlcoholTolerance, nullptr, 25);
@@ -6918,7 +6918,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
return;
}
const Item_Struct* CursorItem = CursorItemInst->GetItem();
const EQEmu::Item_Struct* CursorItem = CursorItemInst->GetItem();
if (!CursorItem->NoDrop || CursorItemInst->IsAttuned())
{
@@ -7991,7 +7991,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
EQApplicationPacket* outapp = app->Copy();
InspectResponse_Struct* insr = (InspectResponse_Struct*)outapp->pBuffer;
Mob* tmp = entity_list.GetMob(insr->TargetID);
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::legacy::SlotWaist; L++) {
@@ -8001,7 +8001,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
if (item) {
strcpy(insr->itemnames[L], item->Name);
if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) {
const Item_Struct *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
const EQEmu::Item_Struct *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
insr->itemicons[L] = aug_item->Icon;
}
else if (inst->GetOrnamentationIcon()) {
@@ -8101,7 +8101,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app)
// todo: verify ivrs->link_hash based on a rule, in case we don't care about people being able to sniff data
// from the item DB
const Item_Struct *item = database.GetItem(ivrs->item_id);
const EQEmu::Item_Struct *item = database.GetItem(ivrs->item_id);
if (!item) {
if (ivrs->item_id != SAYLINK_ITEM_ID) {
Message(13, "Error: The item for the link you have clicked on does not exist!");
@@ -8192,7 +8192,7 @@ void Client::Handle_OP_ItemName(const EQApplicationPacket *app)
return;
}
ItemNamePacket_Struct *p = (ItemNamePacket_Struct*)app->pBuffer;
const Item_Struct *item = 0;
const EQEmu::Item_Struct *item = 0;
if ((item = database.GetItem(p->item_id)) != nullptr) {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ItemName, sizeof(ItemNamePacket_Struct));
p = (ItemNamePacket_Struct*)outapp->pBuffer;
@@ -8208,7 +8208,7 @@ void Client::Handle_OP_ItemPreview(const EQApplicationPacket *app)
VERIFY_PACKET_LENGTH(OP_ItemPreview, app, ItemPreview_Struct);
ItemPreview_Struct *ips = (ItemPreview_Struct *)app->pBuffer;
const Item_Struct* item = database.GetItem(ips->itemid);
const EQEmu::Item_Struct* item = database.GetItem(ips->itemid);
if (item) {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ItemPreview, strlen(item->Name) + strlen(item->Lore) + strlen(item->IDFile) + 898);
@@ -8424,7 +8424,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
return;
}
const Item_Struct* item = inst->GetItem();
const EQEmu::Item_Struct* item = inst->GetItem();
if (!item) {
Message(0, "Error: item not found in inventory slot #%i", slot_id);
DeleteItemInInventory(slot_id, 0, true);
@@ -8458,7 +8458,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
Log.Out(Logs::General, Logs::None, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id);
if (m_inv.SupportsClickCasting(slot_id) || ((item->ItemType == ItemTypePotion || item->PotionBelt) && m_inv.SupportsPotionBeltCasting(slot_id))) // sanity check
if (m_inv.SupportsClickCasting(slot_id) || ((item->ItemType == EQEmu::item::ItemTypePotion || item->PotionBelt) && m_inv.SupportsPotionBeltCasting(slot_id))) // sanity check
{
ItemInst* p_inst = (ItemInst*)inst;
@@ -8472,42 +8472,42 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
int r;
bool tryaug = false;
ItemInst* clickaug = 0;
Item_Struct* augitem = 0;
EQEmu::Item_Struct* augitem = 0;
for (r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) {
const ItemInst* aug_i = inst->GetAugment(r);
if (!aug_i)
continue;
const Item_Struct* aug = aug_i->GetItem();
const EQEmu::Item_Struct* aug = aug_i->GetItem();
if (!aug)
continue;
if ((aug->Click.Type == ET_ClickEffect) || (aug->Click.Type == ET_Expendable) || (aug->Click.Type == ET_EquipClick) || (aug->Click.Type == ET_ClickEffect2))
if ((aug->Click.Type == EQEmu::item::ItemEffectClick) || (aug->Click.Type == EQEmu::item::ItemEffectExpendable) || (aug->Click.Type == EQEmu::item::ItemEffectEquipClick) || (aug->Click.Type == EQEmu::item::ItemEffectClick2))
{
tryaug = true;
clickaug = (ItemInst*)aug_i;
augitem = (Item_Struct*)aug;
augitem = (EQEmu::Item_Struct*)aug;
spell_id = aug->Click.Effect;
break;
}
}
if ((spell_id <= 0) && (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol && item->ItemType != ItemTypeSpell))
if ((spell_id <= 0) && (item->ItemType != EQEmu::item::ItemTypeFood && item->ItemType != EQEmu::item::ItemTypeDrink && item->ItemType != EQEmu::item::ItemTypeAlcohol && item->ItemType != EQEmu::item::ItemTypeSpell))
{
Log.Out(Logs::General, Logs::None, "Item with no effect right clicked by %s", GetName());
}
else if (inst->IsType(ItemClassCommon))
else if (inst->IsClassCommon())
{
if (item->ItemType == ItemTypeSpell && (strstr((const char*)item->Name, "Tome of ") || strstr((const char*)item->Name, "Skill: ")))
if (item->ItemType == EQEmu::item::ItemTypeSpell && (strstr((const char*)item->Name, "Tome of ") || strstr((const char*)item->Name, "Skill: ")))
{
DeleteItemInInventory(slot_id, 1, true);
TrainDiscipline(item->ID);
}
else if (item->ItemType == ItemTypeSpell)
else if (item->ItemType == EQEmu::item::ItemTypeSpell)
{
return;
}
else if ((item->Click.Type == ET_ClickEffect) || (item->Click.Type == ET_Expendable) || (item->Click.Type == ET_EquipClick) || (item->Click.Type == ET_ClickEffect2))
else if ((item->Click.Type == EQEmu::item::ItemEffectClick) || (item->Click.Type == EQEmu::item::ItemEffectExpendable) || (item->Click.Type == EQEmu::item::ItemEffectEquipClick) || (item->Click.Type == EQEmu::item::ItemEffectClick2))
{
if (inst->GetCharges() == 0)
{
@@ -8565,22 +8565,22 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
{
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD && !inst->IsEquipable(GetBaseRace(), GetClass()))
{
if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol)
if (item->ItemType != EQEmu::item::ItemTypeFood && item->ItemType != EQEmu::item::ItemTypeDrink && item->ItemType != EQEmu::item::ItemTypeAlcohol)
{
Log.Out(Logs::General, Logs::None, "Error: unknown item->Click.Type (%i)", item->Click.Type);
}
else
{
//This is food/drink - consume it
if (item->ItemType == ItemTypeFood && m_pp.hunger_level < 5000)
if (item->ItemType == EQEmu::item::ItemTypeFood && m_pp.hunger_level < 5000)
{
Consume(item, item->ItemType, slot_id, false);
}
else if (item->ItemType == ItemTypeDrink && m_pp.thirst_level < 5000)
else if (item->ItemType == EQEmu::item::ItemTypeDrink && m_pp.thirst_level < 5000)
{
Consume(item, item->ItemType, slot_id, false);
}
else if (item->ItemType == ItemTypeAlcohol)
else if (item->ItemType == EQEmu::item::ItemTypeAlcohol)
{
#if EQDEBUG >= 1
Log.Out(Logs::General, Logs::None, "Drinking Alcohol from slot:%i", slot_id);
@@ -9701,7 +9701,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
else {
int16 from_parent = m_inv.CalcSlotId(mi->from_slot);
if (!m_inv[from_parent]) { mi_hack = true; }
else if (!m_inv[from_parent]->IsType(ItemClassContainer)) { mi_hack = true; }
else if (!m_inv[from_parent]->IsClassBag()) { mi_hack = true; }
else if (m_inv.CalcBagIdx(mi->from_slot) >= m_inv[from_parent]->GetItem()->BagSlots) { mi_hack = true; }
}
}
@@ -9711,7 +9711,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
else {
int16 to_parent = m_inv.CalcSlotId(mi->to_slot);
if (!m_inv[to_parent]) { mi_hack = true; }
else if (!m_inv[to_parent]->IsType(ItemClassContainer)) { mi_hack = true; }
else if (!m_inv[to_parent]->IsClassBag()) { mi_hack = true; }
else if (m_inv.CalcBagIdx(mi->to_slot) >= m_inv[to_parent]->GetItem()->BagSlots) { mi_hack = true; }
}
}
@@ -10545,7 +10545,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app)
}
if (mptbs->Action == 0) {
const Item_Struct *BaseItem = database.GetItem(mptbs->ItemID);
const EQEmu::Item_Struct *BaseItem = database.GetItem(mptbs->ItemID);
if (BaseItem) {
m_pp.potionbelt.Items[mptbs->SlotNumber].ID = BaseItem->ID;
m_pp.potionbelt.Items[mptbs->SlotNumber].Icon = BaseItem->Icon;
@@ -12028,8 +12028,8 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
return;
if (inst)
{
const Item_Struct* shield = inst->GetItem();
if (shield && shield->ItemType == ItemTypeShield)
const EQEmu::Item_Struct* shield = inst->GetItem();
if (shield && shield->ItemType == EQEmu::item::ItemTypeShield)
{
for (int x = 0; x < 2; x++)
{
@@ -12136,7 +12136,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
break;
}
}
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
uint32 prevcharges = 0;
if (item_id == 0) { //check to see if its on the temporary table
std::list<TempMerchantList> tmp_merlist = zone->tmpmerchanttable[tmp->GetNPCTypeID()];
@@ -12382,7 +12382,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app)
uint32 itemid = GetItemIDAt(mp->itemslot);
if (itemid == 0)
return;
const Item_Struct* item = database.GetItem(itemid);
const EQEmu::Item_Struct* item = database.GetItem(itemid);
ItemInst* inst = GetInv().GetItem(mp->itemslot);
if (!item || !inst){
Message(13, "You seemed to have misplaced that item..");
@@ -13479,7 +13479,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
TradeItemsValid = false;
break;
}
const Item_Struct *Item = database.GetItem(gis->Items[i]);
const EQEmu::Item_Struct *Item = database.GetItem(gis->Items[i]);
if (!Item) {
Message(13, "Unexpected error. Unable to start trader mode");
+9 -9
View File
@@ -299,7 +299,7 @@ bool Client::Process() {
ItemInst *ranged = GetInv().GetItem(EQEmu::legacy::SlotRange);
if(ranged)
{
if(ranged->GetItem() && ranged->GetItem()->ItemType == ItemTypeBow){
if (ranged->GetItem() && ranged->GetItem()->ItemType == EQEmu::item::ItemTypeBow){
if(ranged_timer.Check(false)){
if(GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient())){
if(GetTarget()->InFrontMob(this, GetTarget()->GetX(), GetTarget()->GetY())){
@@ -319,7 +319,7 @@ bool Client::Process() {
ranged_timer.Start();
}
}
else if(ranged->GetItem() && (ranged->GetItem()->ItemType == ItemTypeLargeThrowing || ranged->GetItem()->ItemType == ItemTypeSmallThrowing)){
else if (ranged->GetItem() && (ranged->GetItem()->ItemType == EQEmu::item::ItemTypeLargeThrowing || ranged->GetItem()->ItemType == EQEmu::item::ItemTypeSmallThrowing)){
if(ranged_timer.Check(false)){
if(GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient())){
if(GetTarget()->InFrontMob(this, GetTarget()->GetX(), GetTarget()->GetY())){
@@ -740,8 +740,8 @@ void Client::BulkSendInventoryItems()
for (int16 slot_id = EQEmu::legacy::TRADE_BEGIN; slot_id <= EQEmu::legacy::TRADE_END; slot_id++) {
ItemInst* inst = m_inv.PopItem(slot_id);
if(inst) {
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
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, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
PutItemInInventory(free_slot_id, *inst, false);
database.SaveInventory(character_id, nullptr, slot_id);
@@ -825,12 +825,12 @@ void Client::BulkSendInventoryItems()
}
void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
const Item_Struct* handyitem = nullptr;
const EQEmu::Item_Struct* handyitem = nullptr;
uint32 numItemSlots = 80; //The max number of items passed in the transaction.
if (m_ClientVersionBit & EQEmu::versions::bit_RoFAndLater) { // RoF+ can send 200 items
numItemSlots = 200;
}
const Item_Struct *item;
const EQEmu::Item_Struct *item;
std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
std::list<MerchantList>::const_iterator itr;
Mob* merch = entity_list.GetMobByNpcTypeID(npcid);
@@ -869,7 +869,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
else
handychance--;
int charges = 1;
if (item->ItemClass == ItemClassCommon)
if (item->IsClassCommon())
charges = item->MaxCharges;
ItemInst* inst = database.CreateItem(item, charges);
if (inst) {
@@ -1086,9 +1086,9 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
case memSpellScribing: { // scribing spell to book
const ItemInst* inst = m_inv[EQEmu::legacy::SlotCursor];
if(inst && inst->IsType(ItemClassCommon))
if (inst && inst->IsClassCommon())
{
const Item_Struct* item = inst->GetItem();
const EQEmu::Item_Struct* item = inst->GetItem();
if (RuleB(Character, RestrictSpellScribing) && !item->IsEquipable(GetRace(), GetClass())) {
Message_StringID(13, CANNOT_USE_ITEM);
+15 -15
View File
@@ -2543,7 +2543,7 @@ void command_peekinv(Client *c, const Seperator *sep)
Client* targetClient = c->GetTarget()->CastToClient();
const ItemInst* inst_main = nullptr;
const ItemInst* inst_sub = nullptr;
const Item_Struct* item_data = nullptr;
const EQEmu::Item_Struct* item_data = nullptr;
std::string item_link;
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemInst);
@@ -2584,7 +2584,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "InvSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2618,7 +2618,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "CursorSlot: %i, Depth: %i, Item: %i (%s), Charges: %i",
EQEmu::legacy::SlotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_INDEX_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2655,7 +2655,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "BankSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2677,7 +2677,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "SharedBankSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2700,7 +2700,7 @@ void command_peekinv(Client *c, const Seperator *sep)
c->Message((item_data == nullptr), "TradeSlot: %i, Item: %i (%s), Charges: %i",
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsClassBag() && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -2732,7 +2732,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(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(EQEmu::item::ItemClassBag) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) {
inst_sub = inst_main->GetItem(indexSub);
item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem();
linker.SetItemInst(inst_sub);
@@ -3146,7 +3146,7 @@ void command_equipitem(Client *c, const Seperator *sep)
bool partialmove = false;
int16 movecount;
if (from_inst && from_inst->IsType(ItemClassCommon)) {
if (from_inst && from_inst->IsClassCommon()) {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveItem, sizeof(MoveItem_Struct));
MoveItem_Struct* mi = (MoveItem_Struct*)outapp->pBuffer;
mi->from_slot = EQEmu::legacy::SlotCursor;
@@ -4357,10 +4357,10 @@ void command_iteminfo(Client *c, const Seperator *sep)
c->Message(0, ">> NoDrop: %u, NoRent: %u, NoPet: %u, NoTransfer: %u, FVNoDrop: %u",
item->NoDrop, item->NoRent, (uint8)item->NoPet, (uint8)item->NoTransfer, item->FVNoDrop);
if (item->ItemClass == ItemClassBook) {
if (item->IsClassBook()) {
c->Message(0, "*** This item is a Book (filename:'%s') ***", item->Filename);
}
else if (item->ItemClass == ItemClassContainer) {
else if (item->IsClassBag()) {
c->Message(0, "*** This item is a Container (%u slots) ***", item->BagSlots);
}
else {
@@ -5510,7 +5510,7 @@ void command_summonitem(Client *c, const Seperator *sep)
}
int16 item_status = 0;
const Item_Struct* item = database.GetItem(itemid);
const EQEmu::Item_Struct* item = database.GetItem(itemid);
if (item) {
item_status = static_cast<int16>(item->MinStatus);
}
@@ -5549,7 +5549,7 @@ void command_giveitem(Client *c, const Seperator *sep)
Client *t = c->GetTarget()->CastToClient();
uint32 itemid = atoi(sep->arg[1]);
int16 item_status = 0;
const Item_Struct* item = database.GetItem(itemid);
const EQEmu::Item_Struct* item = database.GetItem(itemid);
if(item) {
item_status = static_cast<int16>(item->MinStatus);
}
@@ -5602,7 +5602,7 @@ void command_itemsearch(Client *c, const Seperator *sep)
{
const char *search_criteria=sep->argplus[1];
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
std::string item_link;
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemData);
@@ -10225,7 +10225,7 @@ void command_zopp(Client *c, const Seperator *sep)
uint32 itemid = atoi(sep->arg[3]);
int16 charges = sep->argnum == 4 ? atoi(sep->arg[4]) : 1; // defaults to 1 charge if not specified
const Item_Struct* FakeItem = database.GetItem(itemid);
const EQEmu::Item_Struct* FakeItem = database.GetItem(itemid);
if (!FakeItem) {
c->Message(13, "Error: Item [%u] is not a valid item id.", itemid);
@@ -10233,7 +10233,7 @@ void command_zopp(Client *c, const Seperator *sep)
}
int16 item_status = 0;
const Item_Struct* item = database.GetItem(itemid);
const EQEmu::Item_Struct* item = database.GetItem(itemid);
if(item) {
item_status = static_cast<int16>(item->MinStatus);
}
+18 -21
View File
@@ -139,10 +139,8 @@ Corpse* Corpse::LoadCharacterCorpseEntity(uint32 in_dbid, uint32 in_charid, std:
pc->IsRezzed(rezzed);
pc->become_npc = false;
pc->m_Light.Level.Innate = pc->m_Light.Type.Innate = 0;
pc->UpdateEquipmentLight(); // itemlist populated above..need to determine actual values
pc->m_Light.Level.Spell = pc->m_Light.Type.Spell = 0;
safe_delete_array(pcs);
return pc;
@@ -409,7 +407,7 @@ void Corpse::MoveItemToCorpse(Client *client, ItemInst *inst, int16 equipSlot, s
removedList.push_back(equipSlot);
while (true) {
if (!inst->IsType(ItemClassContainer)) { break; }
if (!inst->IsClassBag()) { break; }
if (equipSlot < EQEmu::legacy::GENERAL_BEGIN || equipSlot > EQEmu::legacy::SlotCursor) { break; }
for (auto sub_index = SUB_INDEX_BEGIN; sub_index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++sub_index) {
@@ -531,7 +529,6 @@ in_helmtexture,
SetPlayerKillItemID(0);
UpdateEquipmentLight();
m_Light.Level.Spell = m_Light.Type.Spell = 0;
UpdateActiveLight();
}
@@ -980,7 +977,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
safe_delete(outapp);
if(Loot_Request_Type == 5) {
int pkitem = GetPlayerKillItem();
const Item_Struct* item = database.GetItem(pkitem);
const EQEmu::Item_Struct* item = database.GetItem(pkitem);
ItemInst* inst = database.CreateItem(item, item->MaxCharges);
if(inst) {
if (item->RecastDelay)
@@ -995,7 +992,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
}
int i = 0;
const Item_Struct* item = 0;
const EQEmu::Item_Struct* item = 0;
ItemList::iterator cur,end;
cur = itemlist.begin();
end = itemlist.end();
@@ -1110,7 +1107,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
being_looted_by = 0xFFFFFFFF;
return;
}
const Item_Struct* item = 0;
const EQEmu::Item_Struct* item = 0;
ItemInst *inst = 0;
ServerLootItem_Struct* item_data = nullptr, *bag_item_data[10];
@@ -1209,7 +1206,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
}
/* Remove Bag Contents */
if (item->ItemClass == ItemClassContainer && (GetPlayerKillItem() != -1 || GetPlayerKillItem() != 1)) {
if (item->IsClassBag() && (GetPlayerKillItem() != -1 || GetPlayerKillItem() != 1)) {
for (int i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) {
if (bag_item_data[i]) {
/* Delete needs to be before RemoveItem because its deletes the pointer for item_data/bag_item_data */
@@ -1283,7 +1280,7 @@ void Corpse::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
ns->spawn.NPC = 2;
UpdateActiveLight();
ns->spawn.light = m_Light.Type.Active;
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
}
void Corpse::QueryLoot(Client* to) {
@@ -1305,7 +1302,7 @@ void Corpse::QueryLoot(Client* to) {
else
x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF;
const Item_Struct* item = database.GetItem(sitem->item_id);
const EQEmu::Item_Struct* item = database.GetItem(sitem->item_id);
if (item)
to->Message((sitem->lootslot == 0xFFFF), "LootSlot: %i (EquipSlot: %i) Item: %s (%d), Count: %i", static_cast<int16>(sitem->lootslot), sitem->equip_slot, item->Name, item->ID, sitem->charges);
@@ -1319,7 +1316,7 @@ void Corpse::QueryLoot(Client* to) {
}
else {
sitem->lootslot=y;
const Item_Struct* item = database.GetItem(sitem->item_id);
const EQEmu::Item_Struct* item = database.GetItem(sitem->item_id);
if (item)
to->Message(0, "LootSlot: %i Item: %s (%d), Count: %i", sitem->lootslot, item->Name, item->ID, sitem->charges);
@@ -1414,7 +1411,7 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const {
}
uint32 Corpse::GetEquipmentColor(uint8 material_slot) const {
const Item_Struct *item;
const EQEmu::Item_Struct *item;
if (material_slot > EQEmu::legacy::MATERIAL_END) {
return 0;
@@ -1432,8 +1429,8 @@ uint32 Corpse::GetEquipmentColor(uint8 material_slot) const {
void Corpse::UpdateEquipmentLight()
{
m_Light.Type.Equipment = 0;
m_Light.Level.Equipment = 0;
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
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; }
@@ -1442,8 +1439,8 @@ void Corpse::UpdateEquipmentLight()
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment))
m_Light.Type.Equipment = item->Light;
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type[EQEmu::lightsource::LightEquipment]))
m_Light.Type[EQEmu::lightsource::LightEquipment] = item->Light;
}
uint8 general_light_type = 0;
@@ -1453,17 +1450,17 @@ void Corpse::UpdateEquipmentLight()
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
if (item->ItemClass != ItemClassCommon) { continue; }
if (!item->IsClassCommon()) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (EQEmu::lightsource::TypeToLevel(item->Light))
general_light_type = item->Light;
}
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
m_Light.Type.Equipment = general_light_type;
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type[EQEmu::lightsource::LightEquipment]))
m_Light.Type[EQEmu::lightsource::LightEquipment] = general_light_type;
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
}
void Corpse::AddLooter(Mob* who) {
+1 -1
View File
@@ -285,7 +285,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
{
if(sender->GetSkill(SkillPickLock))
{
if(lockpicks->GetItem()->ItemType == ItemTypeLockPick)
if(lockpicks->GetItem()->ItemType == EQEmu::item::ItemTypeLockPick)
{
float modskill=sender->GetSkill(SkillPickLock);
sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1);
+2 -2
View File
@@ -481,14 +481,14 @@ int32 Client::GetActSpellCasttime(uint16 spell_id, int32 casttime)
bool Client::TrainDiscipline(uint32 itemid) {
//get the item info
const Item_Struct *item = database.GetItem(itemid);
const EQEmu::Item_Struct *item = database.GetItem(itemid);
if(item == nullptr) {
Message(13, "Unable to find the tome you turned in!");
Log.Out(Logs::General, Logs::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid);
return(false);
}
if(item->ItemClass != ItemClassCommon || item->ItemType != ItemTypeSpell) {
if (!item->IsClassCommon() || item->ItemType != EQEmu::item::ItemTypeSpell) {
Message(13, "Invalid item type, you cannot learn from this item.");
//summon them the item back...
SummonItem(itemid);
+1 -1
View File
@@ -882,7 +882,7 @@ void PerlembParser::GetQuestPackageName(bool &isPlayerQuest, bool &isGlobalPlaye
}
else if(isItemQuest) {
// need a valid ItemInst pointer check here..unsure how to cancel this process
const Item_Struct* item = iteminst->GetItem();
const EQEmu::Item_Struct* item = iteminst->GetItem();
package_name = "qst_item_";
package_name += itoa(item->ID);
}
+1 -1
View File
@@ -33,7 +33,7 @@
const char *getItemName(unsigned itemid)
{
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
item = database.GetItem(itemid);
if (item)
+2 -2
View File
@@ -1955,7 +1955,7 @@ void EntityList::QueueClientsGuildBankItemUpdate(const GuildBankItemUpdate_Struc
memcpy(outgbius, gbius, sizeof(GuildBankItemUpdate_Struct));
const Item_Struct *Item = database.GetItem(gbius->ItemID);
const EQEmu::Item_Struct *Item = database.GetItem(gbius->ItemID);
auto it = client_list.begin();
while (it != client_list.end()) {
@@ -3821,7 +3821,7 @@ void EntityList::GroupMessage(uint32 gid, const char *from, const char *message)
uint16 EntityList::CreateGroundObject(uint32 itemid, const glm::vec4& position, uint32 decay_time)
{
const Item_Struct *is = database.GetItem(itemid);
const EQEmu::Item_Struct *is = database.GetItem(itemid);
if (!is)
return 0;
+19 -21
View File
@@ -154,20 +154,20 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id,
bool Client::CanFish() {
//make sure we still have a fishing pole on:
const ItemInst* Pole = m_inv[EQEmu::legacy::SlotPrimary];
int32 bslot = m_inv.HasItemByUse(ItemTypeFishingBait, 1, invWhereWorn|invWherePersonal);
int32 bslot = m_inv.HasItemByUse(EQEmu::item::ItemTypeFishingBait, 1, invWhereWorn | invWherePersonal);
const ItemInst* Bait = nullptr;
if (bslot != INVALID_INDEX)
Bait = m_inv.GetItem(bslot);
if(!Pole || !Pole->IsType(ItemClassCommon) || Pole->GetItem()->ItemType != ItemTypeFishingPole) {
if (m_inv.HasItemByUse(ItemTypeFishingPole, 1, invWhereWorn|invWherePersonal|invWhereBank|invWhereSharedBank|invWhereTrading|invWhereCursor)) //We have a fishing pole somewhere, just not equipped
if (!Pole || !Pole->IsClassCommon() || Pole->GetItem()->ItemType != EQEmu::item::ItemTypeFishingPole) {
if (m_inv.HasItemByUse(EQEmu::item::ItemTypeFishingPole, 1, invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor)) //We have a fishing pole somewhere, just not equipped
Message_StringID(MT_Skills, FISHING_EQUIP_POLE); //You need to put your fishing pole in your primary hand.
else //We don't have a fishing pole anywhere
Message_StringID(MT_Skills, FISHING_NO_POLE); //You can't fish without a fishing pole, go buy one.
return false;
}
if (!Bait || !Bait->IsType(ItemClassCommon) || Bait->GetItem()->ItemType != ItemTypeFishingBait) {
if (!Bait || !Bait->IsClassCommon() || Bait->GetItem()->ItemType != EQEmu::item::ItemTypeFishingBait) {
Message_StringID(MT_Skills, FISHING_NO_BAIT); //You can't fish without fishing bait, go buy some.
return false;
}
@@ -252,7 +252,7 @@ void Client::GoFish()
int fishing_skill = GetSkill(SkillFishing); //will take into account skill bonuses on pole & bait
//make sure we still have a fishing pole on:
int32 bslot = m_inv.HasItemByUse(ItemTypeFishingBait, 1, invWhereWorn|invWherePersonal);
int32 bslot = m_inv.HasItemByUse(EQEmu::item::ItemTypeFishingBait, 1, invWhereWorn | invWherePersonal);
const ItemInst* Bait = nullptr;
if (bslot != INVALID_INDEX)
Bait = m_inv.GetItem(bslot);
@@ -304,7 +304,7 @@ void Client::GoFish()
food_id = common_fish_ids[index];
}
const Item_Struct* food_item = database.GetItem(food_id);
const EQEmu::Item_Struct* food_item = database.GetItem(food_id);
Message_StringID(MT_Skills, FISHING_SUCCESS);
ItemInst* inst = database.CreateItem(food_item, 1);
@@ -396,7 +396,7 @@ void Client::ForageItem(bool guarantee) {
foragedfood = common_food_ids[index];
}
const Item_Struct* food_item = database.GetItem(foragedfood);
const EQEmu::Item_Struct* food_item = database.GetItem(foragedfood);
if(!food_item) {
Log.Out(Logs::General, Logs::Error, "nullptr returned from database.GetItem in ClientForageItem");
@@ -407,20 +407,18 @@ void Client::ForageItem(bool guarantee) {
stringid = FORAGE_GRUBS;
else
switch(food_item->ItemType) {
case ItemTypeFood:
stringid = FORAGE_FOOD;
break;
case ItemTypeDrink:
if(strstr(food_item->Name, "ater"))
stringid = FORAGE_WATER;
else
stringid = FORAGE_DRINK;
break;
default:
break;
}
case EQEmu::item::ItemTypeFood:
stringid = FORAGE_FOOD;
break;
case EQEmu::item::ItemTypeDrink:
if(strstr(food_item->Name, "ater"))
stringid = FORAGE_WATER;
else
stringid = FORAGE_DRINK;
break;
default:
break;
}
Message_StringID(MT_Skills, stringid);
ItemInst* inst = database.CreateItem(food_item, 1);
+10 -10
View File
@@ -694,7 +694,7 @@ void GuildBankManager::SendGuildBank(Client *c)
if (c->ClientVersionBit() & EQEmu::versions::bit_RoFAndLater) {
auto outapp = new EQApplicationPacket(OP_GuildBankItemList, sizeof(GuildBankItemListEntry_Struct) * 240);
for (int i = 0; i < GUILD_BANK_DEPOSIT_AREA_SIZE; ++i) {
const Item_Struct *Item = database.GetItem(guild_bank->Items.DepositArea[i].ItemID);
const EQEmu::Item_Struct *Item = database.GetItem(guild_bank->Items.DepositArea[i].ItemID);
if (Item) {
outapp->WriteUInt8(1);
outapp->WriteUInt32(guild_bank->Items.DepositArea[i].Permissions);
@@ -718,7 +718,7 @@ void GuildBankManager::SendGuildBank(Client *c)
outapp->SetWritePosition(outapp->GetWritePosition() + 20); // newer clients have 40 deposit slots, keep them 0 for now
for (int i = 0; i < GUILD_BANK_MAIN_AREA_SIZE; ++i) {
const Item_Struct *Item = database.GetItem(guild_bank->Items.MainArea[i].ItemID);
const EQEmu::Item_Struct *Item = database.GetItem(guild_bank->Items.MainArea[i].ItemID);
if (Item) {
outapp->WriteUInt8(1);
outapp->WriteUInt32(guild_bank->Items.MainArea[i].Permissions);
@@ -749,7 +749,7 @@ void GuildBankManager::SendGuildBank(Client *c)
{
if(guild_bank->Items.DepositArea[i].ItemID > 0)
{
const Item_Struct *Item = database.GetItem(guild_bank->Items.DepositArea[i].ItemID);
const EQEmu::Item_Struct *Item = database.GetItem(guild_bank->Items.DepositArea[i].ItemID);
if(!Item)
continue;
@@ -785,7 +785,7 @@ void GuildBankManager::SendGuildBank(Client *c)
{
if(guild_bank->Items.MainArea[i].ItemID > 0)
{
const Item_Struct *Item = database.GetItem(guild_bank->Items.MainArea[i].ItemID);
const EQEmu::Item_Struct *Item = database.GetItem(guild_bank->Items.MainArea[i].ItemID);
if(!Item)
continue;
@@ -916,7 +916,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32
return false;
}
const Item_Struct *Item = database.GetItem(ItemID);
const EQEmu::Item_Struct *Item = database.GetItem(ItemID);
GuildBankItemUpdate_Struct gbius;
@@ -982,7 +982,7 @@ int GuildBankManager::Promote(uint32 guildID, int slotID)
(*iter)->Items.DepositArea[slotID].ItemID = 0;
const Item_Struct *Item = database.GetItem((*iter)->Items.MainArea[mainSlot].ItemID);
const EQEmu::Item_Struct *Item = database.GetItem((*iter)->Items.MainArea[mainSlot].ItemID);
GuildBankItemUpdate_Struct gbius;
@@ -1038,7 +1038,7 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm
else
(*iter)->Items.MainArea[slotID].WhoFor[0] = '\0';
const Item_Struct *Item = database.GetItem((*iter)->Items.MainArea[slotID].ItemID);
const EQEmu::Item_Struct *Item = database.GetItem((*iter)->Items.MainArea[slotID].ItemID);
GuildBankItemUpdate_Struct gbius;
@@ -1169,7 +1169,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui
bool deleted = true;
const Item_Struct *Item = database.GetItem(BankArea[slotID].ItemID);
const EQEmu::Item_Struct *Item = database.GetItem(BankArea[slotID].ItemID);
if(!Item->Stackable || (quantity >= BankArea[slotID].Quantity)) {
std::string query = StringFormat("DELETE FROM `guild_bank` WHERE `guildid` = %i "
@@ -1230,7 +1230,7 @@ bool GuildBankManager::MergeStacks(uint32 GuildID, uint16 SlotID)
if(BankArea[SlotID].ItemID == 0)
return false;
const Item_Struct *Item = database.GetItem(BankArea[SlotID].ItemID);
const EQEmu::Item_Struct *Item = database.GetItem(BankArea[SlotID].ItemID);
if(!Item->Stackable)
return false;
@@ -1328,7 +1328,7 @@ bool GuildBankManager::SplitStack(uint32 GuildID, uint16 SlotID, uint32 Quantity
if(BankArea[SlotID].Quantity <= Quantity || Quantity == 0)
return false;
const Item_Struct *Item = database.GetItem(BankArea[SlotID].ItemID);
const EQEmu::Item_Struct *Item = database.GetItem(BankArea[SlotID].ItemID);
if(!Item->Stackable)
return false;
+93 -94
View File
@@ -177,7 +177,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
}
bool Client::CheckLoreConflict(const Item_Struct* item)
bool Client::CheckLoreConflict(const EQEmu::Item_Struct* item)
{
if (!item) { return false; }
if (!item->LoreFlag) { return false; }
@@ -195,7 +195,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// TODO: update calling methods and script apis to handle a failure return
const Item_Struct* item = database.GetItem(item_id);
const EQEmu::Item_Struct* item = database.GetItem(item_id);
// make sure the item exists
if(item == nullptr) {
@@ -213,7 +213,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
return false;
}
// check to make sure we are augmenting an augmentable item
else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) {
else if (((!item->IsClassCommon()) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) {
Message(13, "You can not augment an augment or a non-common class item.");
Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
@@ -247,7 +247,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
bool enforceusable = RuleB(Inventory, EnforceAugmentUsability);
for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::legacy::ITEM_COMMON_SIZE; ++iter) {
const Item_Struct* augtest = database.GetItem(augments[iter]);
const EQEmu::Item_Struct* augtest = database.GetItem(augments[iter]);
if(augtest == nullptr) {
if(augments[iter]) {
@@ -290,7 +290,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// check for augment type allowance
if(enforcewear) {
if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) {
if ((item->AugSlotType[iter] == EQEmu::item::AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) {
Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID);
Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
@@ -313,153 +313,153 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
uint8 it = item->ItemType;
switch(augtest->AugRestrict) {
case AugRestrAny:
case EQEmu::item::AugRestrictionAny:
break;
case AugRestrArmor:
case EQEmu::item::AugRestrictionArmor:
switch(it) {
case ItemTypeArmor:
case EQEmu::item::ItemTypeArmor:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestrWeapons:
case EQEmu::item::AugRestrictionWeapons:
switch(it) {
case ItemType1HSlash:
case ItemType1HBlunt:
case ItemType1HPiercing:
case ItemTypeMartial:
case ItemType2HSlash:
case ItemType2HBlunt:
case ItemType2HPiercing:
case ItemTypeBow:
case EQEmu::item::ItemType1HSlash:
case EQEmu::item::ItemType1HBlunt:
case EQEmu::item::ItemType1HPiercing:
case EQEmu::item::ItemTypeMartial:
case EQEmu::item::ItemType2HSlash:
case EQEmu::item::ItemType2HBlunt:
case EQEmu::item::ItemType2HPiercing:
case EQEmu::item::ItemTypeBow:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestr1HWeapons:
case EQEmu::item::AugRestriction1HWeapons:
switch(it) {
case ItemType1HSlash:
case ItemType1HBlunt:
case ItemType1HPiercing:
case ItemTypeMartial:
case EQEmu::item::ItemType1HSlash:
case EQEmu::item::ItemType1HBlunt:
case EQEmu::item::ItemType1HPiercing:
case EQEmu::item::ItemTypeMartial:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestr2HWeapons:
case EQEmu::item::AugRestriction2HWeapons:
switch(it) {
case ItemType2HSlash:
case ItemType2HBlunt:
case ItemType2HPiercing:
case ItemTypeBow:
case EQEmu::item::ItemType2HSlash:
case EQEmu::item::ItemType2HBlunt:
case EQEmu::item::ItemType2HPiercing:
case EQEmu::item::ItemTypeBow:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestr1HSlash:
case EQEmu::item::AugRestriction1HSlash:
switch(it) {
case ItemType1HSlash:
case EQEmu::item::ItemType1HSlash:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestr1HBlunt:
case EQEmu::item::AugRestriction1HBlunt:
switch(it) {
case ItemType1HBlunt:
case EQEmu::item::ItemType1HBlunt:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestrPiercing:
case EQEmu::item::AugRestrictionPiercing:
switch(it) {
case ItemType1HPiercing:
case EQEmu::item::ItemType1HPiercing:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestrHandToHand:
case EQEmu::item::AugRestrictionHandToHand:
switch(it) {
case ItemTypeMartial:
case EQEmu::item::ItemTypeMartial:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestr2HSlash:
case EQEmu::item::AugRestriction2HSlash:
switch(it) {
case ItemType2HSlash:
case EQEmu::item::ItemType2HSlash:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestr2HBlunt:
case EQEmu::item::AugRestriction2HBlunt:
switch(it) {
case ItemType2HBlunt:
case EQEmu::item::ItemType2HBlunt:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestr2HPierce:
case EQEmu::item::AugRestriction2HPierce:
switch(it) {
case ItemType2HPiercing:
case EQEmu::item::ItemType2HPiercing:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestrBows:
case EQEmu::item::AugRestrictionBows:
switch(it) {
case ItemTypeBow:
case EQEmu::item::ItemTypeBow:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestrShields:
case EQEmu::item::AugRestrictionShields:
switch(it) {
case ItemTypeShield:
case EQEmu::item::ItemTypeShield:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestr1HSlash1HBluntOrHandToHand:
case EQEmu::item::AugRestriction1HSlash1HBluntOrHandToHand:
switch(it) {
case ItemType1HSlash:
case ItemType1HBlunt:
case ItemTypeMartial:
case EQEmu::item::ItemType1HSlash:
case EQEmu::item::ItemType1HBlunt:
case EQEmu::item::ItemTypeMartial:
break;
default:
restrictfail = true;
break;
}
break;
case AugRestr1HBluntOrHandToHand:
case EQEmu::item::AugRestriction1HBluntOrHandToHand:
switch(it) {
case ItemType1HBlunt:
case ItemTypeMartial:
case EQEmu::item::ItemType1HBlunt:
case EQEmu::item::ItemTypeMartial:
break;
default:
restrictfail = true;
@@ -467,9 +467,9 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
}
break;
// These 3 are in-work
case AugRestrUnknown1:
case AugRestrUnknown2:
case AugRestrUnknown3:
case EQEmu::item::AugRestrictionUnknown1:
case EQEmu::item::AugRestrictionUnknown2:
case EQEmu::item::AugRestrictionUnknown3:
default:
restrictfail = true;
break;
@@ -760,7 +760,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
qsaudit->items[parent_offset].aug_4 = m_inv[slot_id]->GetAugmentItemID(4);
qsaudit->items[parent_offset].aug_5 = m_inv[slot_id]->GetAugmentItemID(5);
if(m_inv[slot_id]->IsType(ItemClassContainer)) {
if (m_inv[slot_id]->IsClassBag()) {
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) {
ItemInst* bagitem = m_inv[slot_id]->GetItem(bag_idx);
@@ -986,7 +986,7 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur
bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_cursor, ServerLootItem_Struct** bag_item_data)
{
// #1: Try to auto equip
if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel<=level && (!inst.GetItem()->Attuneable || inst.IsAttuned()) && inst.GetItem()->ItemType != ItemTypeAugmentation) {
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)
if (i == EQEmu::legacy::GENERAL_BEGIN) {
@@ -999,15 +999,14 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
if (!m_inv[i]) {
if (i == EQEmu::legacy::SlotPrimary && inst.IsWeapon()) { // If item is primary slot weapon
if ((inst.GetItem()->ItemType == ItemType2HSlash) || (inst.GetItem()->ItemType == ItemType2HBlunt) || (inst.GetItem()->ItemType == ItemType2HPiercing)) { // and uses 2hs \ 2hb \ 2hp
if (inst.GetItem()->IsType2HWeapon()) { // and uses 2hs \ 2hb \ 2hp
if (m_inv[EQEmu::legacy::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
uint8 use = m_inv[EQEmu::legacy::SlotPrimary]->GetItem()->ItemType;
if (use == ItemType2HSlash || use == ItemType2HBlunt || use == ItemType2HPiercing)
if (m_inv[EQEmu::legacy::SlotPrimary]->GetItem()->IsType2HWeapon())
continue;
}
if (i == EQEmu::legacy::SlotSecondary && inst.IsWeapon() && !CanThisClassDualWield()) {
@@ -1036,8 +1035,8 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
}
// #3: put it in inventory
bool is_arrow = (inst.GetItem()->ItemType == ItemTypeArrow) ? true : false;
int16 slot_id = m_inv.FindFreeSlot(inst.IsType(ItemClassContainer), try_cursor, inst.GetItem()->Size, is_arrow);
bool is_arrow = (inst.GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
int16 slot_id = m_inv.FindFreeSlot(inst.IsClassBag(), try_cursor, inst.GetItem()->Size, is_arrow);
if (slot_id != INVALID_INDEX) {
PutLootInInventory(slot_id, inst, bag_item_data);
return true;
@@ -1188,7 +1187,7 @@ int Client::GetItemLinkHash(const ItemInst* inst) {
if (!inst) //have to have an item to make the hash
return 0;
const Item_Struct* item = inst->GetItem();
const EQEmu::Item_Struct* item = inst->GetItem();
char* hash_str = 0;
/*register */int hash = 0;
@@ -1282,7 +1281,7 @@ packet with the item number in it, but I cant seem to find it right now
if (!inst)
return;
const Item_Struct* item = inst->GetItem();
const EQEmu::Item_Struct* item = inst->GetItem();
const char* name2 = &item->Name[0];
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ItemLinkText,strlen(name2)+68);
char buffer2[135] = {0};
@@ -1514,7 +1513,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
DeleteItemInInventory(dst_slot_id,0,true);
return(false);
}
if (src_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::legacy::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){
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++) {
const ItemInst* baginst = src_inst->GetItem(idx);
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(src_slot_id, idx), baginst)){
@@ -1529,7 +1528,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
DeleteItemInInventory(src_slot_id,0,true);
return(false);
}
if (dst_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::legacy::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){
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++) {
const ItemInst* baginst = dst_inst->GetItem(idx);
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(dst_slot_id, idx), baginst)){
@@ -1596,8 +1595,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
m_inv.DeleteItem(src_slot_id);
}
else {
const Item_Struct* world_item = world_inst->GetItem();
const Item_Struct* src_item = src_inst->GetItem();
const EQEmu::Item_Struct* world_item = world_inst->GetItem();
const EQEmu::Item_Struct* src_item = src_inst->GetItem();
if (world_item && src_item) {
// Case 2: Same item on cursor, stacks, transfer of charges needed
if ((world_item->ID == src_item->ID) && src_inst->IsStackable()) {
@@ -1837,7 +1836,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
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
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
const EQEmu::Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
ItemInst* token_inst = database.CreateItem(token_struct, 1);
SendItemPacket(resync_slot, token_inst, ItemPacketTrade);
@@ -1862,7 +1861,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
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) {
if(m_inv[resync_slot]) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
const EQEmu::Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
ItemInst* token_inst = database.CreateItem(token_struct, 1);
SendItemPacket(resync_slot, token_inst, ItemPacketTrade);
@@ -1879,7 +1878,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
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) {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : Inventory::CalcSlotId(move_slots->to_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
const EQEmu::Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
ItemInst* token_inst = database.CreateItem(token_struct, 1);
SendItemPacket(resync_slot, token_inst, ItemPacketTrade);
@@ -1904,7 +1903,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
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) {
if(m_inv[resync_slot]) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
const EQEmu::Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
ItemInst* token_inst = database.CreateItem(token_struct, 1);
SendItemPacket(resync_slot, token_inst, ItemPacketTrade);
@@ -1956,7 +1955,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
qsaudit->items[move_count].aug_4 = from_inst->GetAugmentItemID(4);
qsaudit->items[move_count++].aug_5 = from_inst->GetAugmentItemID(5);
if(from_inst->IsType(ItemClassContainer)) {
if (from_inst->IsType(EQEmu::item::ItemClassBag)) {
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) {
const ItemInst* from_baginst = from_inst->GetItem(bag_idx);
@@ -1989,7 +1988,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
qsaudit->items[move_count].aug_4 = to_inst->GetAugmentItemID(4);
qsaudit->items[move_count++].aug_5 = to_inst->GetAugmentItemID(5);
if(to_inst->IsType(ItemClassContainer)) {
if (to_inst->IsType(EQEmu::item::ItemClassBag)) {
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) {
const ItemInst* to_baginst = to_inst->GetItem(bag_idx);
@@ -2107,7 +2106,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) {
#endif
bool Client::DecreaseByID(uint32 type, uint8 amt) {
const Item_Struct* TempItem = nullptr;
const EQEmu::Item_Struct* TempItem = nullptr;
ItemInst* ins = nullptr;
int x;
int num = 0;
@@ -2231,7 +2230,7 @@ void Client::DisenchantSummonedBags(bool client_update)
auto inst = m_inv[slot_id];
if (!inst) { continue; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
if (!inst->GetItem()->IsClassBag()) { continue; }
if (inst->GetTotalItemCount() == 1) { continue; }
auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
@@ -2252,7 +2251,7 @@ void Client::DisenchantSummonedBags(bool client_update)
auto inst = m_inv[slot_id];
if (!inst) { continue; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
if (!inst->GetItem()->IsClassBag()) { continue; }
if (inst->GetTotalItemCount() == 1) { continue; }
auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
@@ -2273,7 +2272,7 @@ void Client::DisenchantSummonedBags(bool client_update)
auto inst = m_inv[slot_id];
if (!inst) { continue; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
if (inst->GetItem()->ItemClass != ItemClassContainer) { continue; }
if (!inst->GetItem()->IsClassBag()) { continue; }
if (inst->GetTotalItemCount() == 1) { continue; }
auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
@@ -2294,7 +2293,7 @@ void Client::DisenchantSummonedBags(bool client_update)
auto inst = m_inv[EQEmu::legacy::SlotCursor];
if (!inst) { break; }
if (!IsSummonedBagID(inst->GetItem()->ID)) { break; }
if (inst->GetItem()->ItemClass != ItemClassContainer) { break; }
if (!inst->GetItem()->IsClassBag()) { break; }
if (inst->GetTotalItemCount() == 1) { break; }
auto new_id = GetDisenchantedBagID(inst->GetItem()->BagSlots);
@@ -2562,8 +2561,8 @@ void Client::MoveSlotNotAllowed(bool client_update)
for (auto slot_id = EQEmu::legacy::EQUIPMENT_BEGIN; slot_id <= EQEmu::legacy::EQUIPMENT_END; ++slot_id) {
if(m_inv[slot_id] && !m_inv[slot_id]->IsSlotAllowed(slot_id)) {
auto inst = m_inv.PopItem(slot_id);
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
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, slot_id, free_slot_id);
PutItemInInventory(free_slot_id, *inst, client_update);
database.SaveInventory(character_id, nullptr, slot_id);
@@ -2573,8 +2572,8 @@ 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);
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
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);
PutItemInInventory(free_slot_id, *inst, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false);
database.SaveInventory(character_id, nullptr, EQEmu::legacy::SlotPowerSource);
@@ -2632,7 +2631,7 @@ uint32 Client::GetEquipmentColor(uint8 material_slot) const
if (material_slot > EQEmu::legacy::MATERIAL_END)
return 0;
const Item_Struct *item = database.GetItem(GetEquipment(material_slot));
const EQEmu::Item_Struct *item = database.GetItem(GetEquipment(material_slot));
if(item != nullptr)
return ((m_pp.item_tint[material_slot].RGB.UseTint) ? m_pp.item_tint[material_slot].Color : item->Color);
@@ -2716,7 +2715,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app)
strcpy(m_pp.bandoliers[bs->Number].Name, bs->Name);
const ItemInst* InvItem = nullptr;
const Item_Struct *BaseItem = nullptr;
const EQEmu::Item_Struct *BaseItem = nullptr;
int16 WeaponSlot = 0;
for(int BandolierSlot = bandolierPrimary; BandolierSlot <= bandolierAmmo; BandolierSlot++) {
@@ -2950,7 +2949,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
}
// If there is a bag in this slot, look inside it.
//
if (InvItem && InvItem->IsType(ItemClassContainer)) {
if (InvItem && InvItem->IsClassBag()) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
@@ -3002,7 +3001,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
return true;
}
if(InvItem->IsType(ItemClassContainer) && Inventory::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
if (InvItem->IsClassBag() && Inventory::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
@@ -3208,7 +3207,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
case 1: // requirement: parent is common and inst is augment
if ((!parent) || (!inst))
return true;
if (!parent->IsType(ItemClassCommon))
if (!parent->IsType(EQEmu::item::ItemClassCommon))
return true;
if (index >= EQEmu::legacy::ITEM_COMMON_SIZE)
return true;
@@ -3232,11 +3231,11 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
case 1: // requirement: parent is common and inst is augment ..or.. parent is container and inst is extant
if ((!parent) || (!inst))
return true;
if (parent->IsType(ItemClassContainer))
if (parent->IsType(EQEmu::item::ItemClassBag))
break;
if (parent->IsType(ItemClassBook))
if (parent->IsClassBook())
return true;
if (parent->IsType(ItemClassCommon)) {
if (parent->IsClassCommon()) {
if (!(inst->GetItem()->AugType > 0))
return true;
if (index >= EQEmu::legacy::ITEM_COMMON_SIZE)
@@ -3246,11 +3245,11 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
case 2: // requirement: parent is common and inst is augment
if ((!parent) || (!inst))
return true;
if (parent->IsType(ItemClassContainer))
if (parent->IsType(EQEmu::item::ItemClassBag))
return true;
if (parent->IsType(ItemClassBook))
if (parent->IsClassBook())
return true;
if (parent->IsType(ItemClassCommon)) {
if (parent->IsClassCommon()) {
if (!(inst->GetItem()->AugType > 0))
return true;
if (index >= EQEmu::legacy::ITEM_COMMON_SIZE)
+10 -11
View File
@@ -119,7 +119,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
int charges = lds->Entries[i].multiplier;
for(int j = 0; j < charges; ++j) {
if(zone->random.Real(0.0, 100.0) <= lds->Entries[i].chance) {
const Item_Struct* dbitem = GetItem(lds->Entries[i].item_id);
const EQEmu::Item_Struct* dbitem = GetItem(lds->Entries[i].item_id);
npc->AddLootDrop(dbitem, itemlist, lds->Entries[i].item_charges, lds->Entries[i].minlevel,
lds->Entries[i].maxlevel, lds->Entries[i].equip_item > 0 ? true : false, false);
}
@@ -140,7 +140,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
float roll_t_min = 0.0f;
bool active_item_list = false;
for(uint32 i = 0; i < lds->NumEntries; ++i) {
const Item_Struct* db_item = GetItem(lds->Entries[i].item_id);
const EQEmu::Item_Struct* db_item = GetItem(lds->Entries[i].item_id);
if(db_item) {
roll_t += lds->Entries[i].chance;
active_item_list = true;
@@ -157,7 +157,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
for(int i = 0; i < mindrop; ++i) {
float roll = (float)zone->random.Real(0.0, roll_t_min);
for(uint32 j = 0; j < lds->NumEntries; ++j) {
const Item_Struct* db_item = GetItem(lds->Entries[j].item_id);
const EQEmu::Item_Struct* db_item = GetItem(lds->Entries[j].item_id);
if(db_item) {
if(roll < lds->Entries[j].chance) {
npc->AddLootDrop(db_item, itemlist, lds->Entries[j].item_charges, lds->Entries[j].minlevel,
@@ -187,7 +187,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
for(int i = mindrop; i < droplimit; ++i) {
float roll = (float)zone->random.Real(0.0, roll_t);
for(uint32 j = 0; j < lds->NumEntries; ++j) {
const Item_Struct* db_item = GetItem(lds->Entries[j].item_id);
const EQEmu::Item_Struct* db_item = GetItem(lds->Entries[j].item_id);
if(db_item) {
if(roll < lds->Entries[j].chance) {
npc->AddLootDrop(db_item, itemlist, lds->Entries[j].item_charges, lds->Entries[j].minlevel,
@@ -221,7 +221,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
}
//if itemlist is null, just send wear changes
void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange) {
void NPC::AddLootDrop(const EQEmu::Item_Struct *item2, ItemList* itemlist, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange) {
if(item2 == nullptr)
return;
@@ -258,7 +258,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
if (equipit) {
uint8 eslot = 0xFF;
char newid[20];
const Item_Struct* compitem = nullptr;
const EQEmu::Item_Struct* compitem = nullptr;
bool found = false; // track if we found an empty slot we fit into
int32 foundslot = -1; // for multi-slot items
@@ -334,13 +334,12 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
eslot = EQEmu::legacy::MaterialPrimary;
if (item2->Damage > 0)
SendAddPlayerState(PlayerState::PrimaryWeaponEquipped);
if (item2->ItemType == ItemType2HBlunt || item2->ItemType == ItemType2HSlash || item2->ItemType == ItemType2HPiercing)
if (item2->IsType2HWeapon())
SetTwoHanderEquipped(true);
}
else if (foundslot == EQEmu::legacy::SlotSecondary
&& (GetOwner() != nullptr || (CanThisClassDualWield() && zone->random.Roll(NPC_DW_CHANCE)) || (item2->Damage==0)) &&
(item2->ItemType == ItemType1HSlash || item2->ItemType == ItemType1HBlunt || item2->ItemType == ItemTypeShield ||
item2->ItemType == ItemType1HPiercing))
(item2->IsType1HWeapon() || item2->ItemType == EQEmu::item::ItemTypeShield))
{
if (item2->Proc.Effect!=0)
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
@@ -416,14 +415,14 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
SendAppearancePacket(AT_Light, GetActiveLightType());
}
void NPC::AddItem(const Item_Struct* item, uint16 charges, bool equipitem) {
void NPC::AddItem(const EQEmu::Item_Struct* item, uint16 charges, bool equipitem) {
//slot isnt needed, its determined from the item.
AddLootDrop(item, &itemlist, charges, 1, 127, equipitem, equipitem);
}
void NPC::AddItem(uint32 itemid, uint16 charges, bool equipitem) {
//slot isnt needed, its determined from the item.
const Item_Struct * i = database.GetItem(itemid);
const EQEmu::Item_Struct * i = database.GetItem(itemid);
if(i == nullptr)
return;
AddLootDrop(i, &itemlist, charges, 1, 127, equipitem, equipitem);
+1 -1
View File
@@ -7,7 +7,7 @@
#include "lua_item.h"
Lua_Item::Lua_Item(uint32 item_id) {
const Item_Struct *t = database.GetItem(item_id);
const EQEmu::Item_Struct *t = database.GetItem(item_id);
SetLuaPtrData(t);
}
+9 -6
View File
@@ -4,7 +4,10 @@
#include "lua_ptr.h"
struct Item_Struct;
namespace EQEmu
{
struct Item_Struct;
}
namespace luabind {
struct scope;
@@ -12,17 +15,17 @@ namespace luabind {
luabind::scope lua_register_item();
class Lua_Item : public Lua_Ptr<const Item_Struct>
class Lua_Item : public Lua_Ptr<const EQEmu::Item_Struct>
{
typedef const Item_Struct NativeType;
typedef const EQEmu::Item_Struct NativeType;
public:
Lua_Item(uint32 item_id);
Lua_Item() : Lua_Ptr(nullptr) { }
Lua_Item(const Item_Struct *d) : Lua_Ptr(d) { }
Lua_Item(const EQEmu::Item_Struct *d) : Lua_Ptr(d) { }
virtual ~Lua_Item() { }
operator const Item_Struct*() {
return reinterpret_cast<const Item_Struct*>(GetLuaPtrData());
operator const EQEmu::Item_Struct*() {
return reinterpret_cast<const EQEmu::Item_Struct*>(GetLuaPtrData());
}
int GetMinStatus();
+1 -1
View File
@@ -41,7 +41,7 @@ Lua_ItemInst::Lua_ItemInst(const Lua_ItemInst& o) {
bool Lua_ItemInst::IsType(int item_class) {
Lua_Safe_Call_Bool();
return self->IsType(static_cast<ItemClassTypes>(item_class));
return self->IsType(static_cast<EQEmu::item::ItemClass>(item_class));
}
bool Lua_ItemInst::IsStackable() {
+1 -1
View File
@@ -298,7 +298,7 @@ void handle_player_timer(QuestInterface *parse, lua_State* L, Client* client, st
void handle_player_discover_item(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers) {
const Item_Struct *item = database.GetItem(extra_data);
const EQEmu::Item_Struct *item = database.GetItem(extra_data);
if(item) {
Lua_Item l_item(item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
+20 -19
View File
@@ -217,7 +217,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
for (i = 0; i < EQEmu::legacy::SlotAmmo; i++) {
if(equipment[i] == 0)
continue;
const Item_Struct * itm = database.GetItem(equipment[i]);
const EQEmu::Item_Struct * itm = database.GetItem(equipment[i]);
if(itm)
AddItemBonuses(itm, newbon);
}
@@ -243,7 +243,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
SetAttackTimer();
}
void Merc::AddItemBonuses(const Item_Struct *item, StatBonuses* newbon) {
void Merc::AddItemBonuses(const EQEmu::Item_Struct *item, StatBonuses* newbon) {
if(GetLevel() < item->ReqLevel)
{
@@ -456,11 +456,11 @@ void Merc::AddItemBonuses(const Item_Struct *item, StatBonuses* newbon) {
else
newbon->DSMitigation += item->DSMitigation;
}
if (item->Worn.Effect>0 && (item->Worn.Type == ET_WornEffect)) { // latent effects
if (item->Worn.Effect>0 && (item->Worn.Type == EQEmu::item::ItemEffectWorn)) { // latent effects
ApplySpellsBonuses(item->Worn.Effect, item->Worn.Level, newbon, 0, item->Worn.Type);
}
if (item->Focus.Effect>0 && (item->Focus.Type == ET_Focus)) { // focus effects
if (item->Focus.Effect>0 && (item->Focus.Type == EQEmu::item::ItemEffectFocus)) { // focus effects
ApplySpellsBonuses(item->Focus.Effect, item->Focus.Level, newbon, 0);
}
@@ -1210,7 +1210,7 @@ void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
ns->spawn.IsMercenary = 1;
UpdateActiveLight();
ns->spawn.light = m_Light.Type.Active;
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
/*
// Wear Slots are not setup for Mercs yet
@@ -1621,7 +1621,8 @@ void Merc::AI_Process() {
int weapontype = 0; // No weapon type
bool bIsFist = true;
if(bIsFist || ((weapontype != ItemType2HSlash) && (weapontype != ItemType2HPiercing) && (weapontype != ItemType2HBlunt)))
// why are we checking 'weapontype' when we know it's set to '0' above?
if (bIsFist || ((weapontype != EQEmu::item::ItemType2HSlash) && (weapontype != EQEmu::item::ItemType2HPiercing) && (weapontype != EQEmu::item::ItemType2HBlunt)))
{
float DualWieldProbability = 0.0f;
@@ -2544,8 +2545,8 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) {
//Check if item focus effect exists for the client.
if (itembonuses.FocusEffects[type]){
const Item_Struct* TempItem = 0;
const Item_Struct* UsedItem = 0;
const EQEmu::Item_Struct* TempItem = 0;
const EQEmu::Item_Struct* UsedItem = 0;
uint16 UsedFocusID = 0;
int16 Total = 0;
int16 focus_max = 0;
@@ -4407,7 +4408,7 @@ void Merc::DoClassAttacks(Mob *target) {
DoAnim(animKick);
int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){
if(GetWeaponDamage(target, (const EQEmu::Item_Struct*)nullptr) <= 0){
dmg = -5;
}
else{
@@ -4429,7 +4430,7 @@ void Merc::DoClassAttacks(Mob *target) {
DoAnim(animTailRake);
int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){
if(GetWeaponDamage(target, (const EQEmu::Item_Struct*)nullptr) <= 0){
dmg = -5;
}
else{
@@ -5041,8 +5042,8 @@ void Merc::UpdateMercAppearance() {
void Merc::UpdateEquipmentLight()
{
m_Light.Type.Equipment = 0;
m_Light.Level.Equipment = 0;
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; }
@@ -5050,9 +5051,9 @@ void Merc::UpdateEquipmentLight()
auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; }
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
m_Light.Type.Equipment = item->Light;
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type[EQEmu::lightsource::LightEquipment])) {
m_Light.Type[EQEmu::lightsource::LightEquipment] = item->Light;
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
}
}
@@ -5061,17 +5062,17 @@ void Merc::UpdateEquipmentLight()
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
if (item->ItemClass != ItemClassCommon) { continue; }
if (!item->IsClassCommon()) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (EQEmu::lightsource::TypeToLevel(item->Light))
general_light_type = item->Light;
}
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
m_Light.Type.Equipment = general_light_type;
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type[EQEmu::lightsource::LightEquipment]))
m_Light.Type[EQEmu::lightsource::LightEquipment] = general_light_type;
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
}
void Merc::AddItem(uint8 slot, uint32 item_id) {
+6 -2
View File
@@ -8,11 +8,15 @@ class Corpse;
class Group;
class Mob;
class Raid;
struct Item_Struct;
struct MercTemplate;
struct NPCType;
struct NewSpawn_Struct;
namespace EQEmu
{
struct Item_Struct;
}
#define MAXMERCS 1
#define TANK 1
#define HEALER 2
@@ -279,7 +283,7 @@ public:
protected:
void CalcItemBonuses(StatBonuses* newbon);
void AddItemBonuses(const Item_Struct *item, StatBonuses* newbon);
void AddItemBonuses(const EQEmu::Item_Struct *item, StatBonuses* newbon);
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
int16 GetFocusEffect(focusType type, uint16 spell_id);
+67 -73
View File
@@ -178,12 +178,10 @@ Mob::Mob(const char* in_name,
if (runspeed < 0 || runspeed > 20)
runspeed = 1.25f;
m_Light.Type.Innate = in_light;
m_Light.Level.Innate = EQEmu::lightsource::TypeToLevel(m_Light.Type.Innate);
m_Light.Level.Equipment = m_Light.Type.Equipment = 0;
m_Light.Level.Spell = m_Light.Type.Spell = 0;
m_Light.Type.Active = m_Light.Type.Innate;
m_Light.Level.Active = m_Light.Level.Innate;
m_Light.Type[EQEmu::lightsource::LightInnate] = in_light;
m_Light.Level[EQEmu::lightsource::LightInnate] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightInnate]);
m_Light.Type[EQEmu::lightsource::LightActive] = m_Light.Type[EQEmu::lightsource::LightInnate];
m_Light.Level[EQEmu::lightsource::LightActive] = m_Light.Level[EQEmu::lightsource::LightInnate];
texture = in_texture;
helmtexture = in_helmtexture;
@@ -1100,7 +1098,7 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.findable = findable?1:0;
UpdateActiveLight();
ns->spawn.light = m_Light.Type.Active;
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
ns->spawn.showhelm = (helmtexture && helmtexture != 0xFF) ? 1 : 0;
@@ -2227,18 +2225,18 @@ void Mob::SetAppearance(EmuAppearance app, bool iIgnoreSelf) {
bool Mob::UpdateActiveLight()
{
uint8 old_light_level = m_Light.Level.Active;
uint8 old_light_level = m_Light.Level[EQEmu::lightsource::LightActive];
m_Light.Type.Active = 0;
m_Light.Level.Active = 0;
m_Light.Type[EQEmu::lightsource::LightActive] = 0;
m_Light.Level[EQEmu::lightsource::LightActive] = 0;
if (EQEmu::lightsource::IsLevelGreater((m_Light.Type.Innate & 0x0F), m_Light.Type.Active)) { m_Light.Type.Active = m_Light.Type.Innate; }
if (m_Light.Level.Equipment > m_Light.Level.Active) { m_Light.Type.Active = m_Light.Type.Equipment; } // limiter in property handler
if (m_Light.Level.Spell > m_Light.Level.Active) { m_Light.Type.Active = m_Light.Type.Spell; } // limiter in property handler
if (EQEmu::lightsource::IsLevelGreater((m_Light.Type[EQEmu::lightsource::LightInnate] & 0x0F), m_Light.Type[EQEmu::lightsource::LightActive])) { m_Light.Type[EQEmu::lightsource::LightActive] = m_Light.Type[EQEmu::lightsource::LightInnate]; }
if (m_Light.Level[EQEmu::lightsource::LightEquipment] > m_Light.Level[EQEmu::lightsource::LightActive]) { m_Light.Type[EQEmu::lightsource::LightActive] = m_Light.Type[EQEmu::lightsource::LightEquipment]; } // limiter in property handler
if (m_Light.Level[EQEmu::lightsource::LightSpell] > m_Light.Level[EQEmu::lightsource::LightActive]) { m_Light.Type[EQEmu::lightsource::LightActive] = m_Light.Type[EQEmu::lightsource::LightSpell]; } // limiter in property handler
m_Light.Level.Active = EQEmu::lightsource::TypeToLevel(m_Light.Type.Active);
m_Light.Level[EQEmu::lightsource::LightActive] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightActive]);
return (m_Light.Level.Active != old_light_level);
return (m_Light.Level[EQEmu::lightsource::LightActive] != old_light_level);
}
void Mob::ChangeSize(float in_size = 0, bool bNoRestriction) {
@@ -2384,9 +2382,9 @@ bool Mob::CanThisClassDualWield(void) const {
// 2HS, 2HB, or 2HP
if(pinst && pinst->IsWeapon()) {
const Item_Struct* item = pinst->GetItem();
const EQEmu::Item_Struct* item = pinst->GetItem();
if((item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HPiercing))
if (item->IsType2HWeapon())
return false;
}
@@ -2756,7 +2754,7 @@ void Mob::SendArmorAppearance(Client *one_client)
{
if (!IsClient())
{
const Item_Struct *item;
const EQEmu::Item_Struct *item;
for (int i = 0; i < 7; ++i)
{
item = database.GetItem(GetEquipment(i));
@@ -2859,7 +2857,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
{
uint32 equipmaterial = 0;
int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
const Item_Struct *item;
const EQEmu::Item_Struct *item;
item = database.GetItem(GetEquipment(material_slot));
if (item != 0)
@@ -2912,7 +2910,7 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const
if (material_slot >= 0 && material_slot < EQEmu::legacy::MaterialPrimary)
{
uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
const Item_Struct *item;
const EQEmu::Item_Struct *item;
item = database.GetItem(GetEquipment(material_slot));
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
@@ -2966,7 +2964,7 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const
uint32 Mob::GetEquipmentColor(uint8 material_slot) const
{
const Item_Struct *item;
const EQEmu::Item_Struct *item;
if (armor_tint[material_slot])
{
@@ -2982,7 +2980,7 @@ uint32 Mob::GetEquipmentColor(uint8 material_slot) const
uint32 Mob::IsEliteMaterialItem(uint8 material_slot) const
{
const Item_Struct *item;
const EQEmu::Item_Struct *item;
item = database.GetItem(GetEquipment(material_slot));
if(item != 0)
@@ -3898,7 +3896,7 @@ int32 Mob::GetItemStat(uint32 itemid, const char *identifier)
if (!inst)
return 0;
const Item_Struct* item = inst->GetItem();
const EQEmu::Item_Struct* item = inst->GetItem();
if (!item)
return 0;
@@ -5021,62 +5019,58 @@ void Mob::SlowMitigation(Mob* caster)
uint16 Mob::GetSkillByItemType(int ItemType)
{
switch (ItemType)
{
case ItemType1HSlash:
return Skill1HSlashing;
case ItemType2HSlash:
return Skill2HSlashing;
case ItemType1HPiercing:
switch (ItemType) {
case EQEmu::item::ItemType1HSlash:
return Skill1HSlashing;
case EQEmu::item::ItemType2HSlash:
return Skill2HSlashing;
case EQEmu::item::ItemType1HPiercing:
return Skill1HPiercing;
case EQEmu::item::ItemType1HBlunt:
return Skill1HBlunt;
case EQEmu::item::ItemType2HBlunt:
return Skill2HBlunt;
case EQEmu::item::ItemType2HPiercing:
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
return Skill1HPiercing;
case ItemType1HBlunt:
return Skill1HBlunt;
case ItemType2HBlunt:
return Skill2HBlunt;
case ItemType2HPiercing:
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
return Skill1HPiercing;
else
return Skill2HPiercing;
case ItemTypeBow:
return SkillArchery;
case ItemTypeLargeThrowing:
case ItemTypeSmallThrowing:
return SkillThrowing;
case ItemTypeMartial:
return SkillHandtoHand;
default:
return SkillHandtoHand;
else
return Skill2HPiercing;
case EQEmu::item::ItemTypeBow:
return SkillArchery;
case EQEmu::item::ItemTypeLargeThrowing:
case EQEmu::item::ItemTypeSmallThrowing:
return SkillThrowing;
case EQEmu::item::ItemTypeMartial:
return SkillHandtoHand;
default:
return SkillHandtoHand;
}
return SkillHandtoHand;
}
uint8 Mob::GetItemTypeBySkill(SkillUseTypes skill)
{
switch (skill)
{
case SkillThrowing:
return ItemTypeSmallThrowing;
case SkillArchery:
return ItemTypeArrow;
case Skill1HSlashing:
return ItemType1HSlash;
case Skill2HSlashing:
return ItemType2HSlash;
case Skill1HPiercing:
return ItemType1HPiercing;
case Skill2HPiercing: // watch for undesired client behavior
return ItemType2HPiercing;
case Skill1HBlunt:
return ItemType1HBlunt;
case Skill2HBlunt:
return ItemType2HBlunt;
case SkillHandtoHand:
return ItemTypeMartial;
default:
return ItemTypeMartial;
switch (skill) {
case SkillThrowing:
return EQEmu::item::ItemTypeSmallThrowing;
case SkillArchery:
return EQEmu::item::ItemTypeArrow;
case Skill1HSlashing:
return EQEmu::item::ItemType1HSlash;
case Skill2HSlashing:
return EQEmu::item::ItemType2HSlash;
case Skill1HPiercing:
return EQEmu::item::ItemType1HPiercing;
case Skill2HPiercing: // watch for undesired client behavior
return EQEmu::item::ItemType2HPiercing;
case Skill1HBlunt:
return EQEmu::item::ItemType1HBlunt;
case Skill2HBlunt:
return EQEmu::item::ItemType2HBlunt;
case SkillHandtoHand:
return EQEmu::item::ItemTypeMartial;
default:
return EQEmu::item::ItemTypeMartial;
}
return ItemTypeMartial;
}
@@ -5633,7 +5627,7 @@ int32 Mob::GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot)
bool Mob::CanClassEquipItem(uint32 item_id)
{
const Item_Struct* itm = nullptr;
const EQEmu::Item_Struct* itm = nullptr;
itm = database.GetItem(item_id);
if (!itm)
+21 -17
View File
@@ -44,10 +44,14 @@ class Group;
class ItemInst;
class NPC;
class Raid;
struct Item_Struct;
struct NewSpawn_Struct;
struct PlayerPositionUpdateServer_Struct;
namespace EQEmu
{
struct Item_Struct;
}
class Mob : public Entity {
public:
enum CLIENT_CONN_STATUS { CLIENT_CONNECTING, CLIENT_CONNECTED, CLIENT_LINKDEAD,
@@ -703,17 +707,17 @@ public:
bool IsDestructibleObject() { return destructibleobject; }
void SetDestructibleObject(bool in) { destructibleobject = in; }
inline uint8 GetInnateLightType() { return m_Light.Type.Innate; }
inline uint8 GetEquipmentLightType() { return m_Light.Type.Equipment; }
inline uint8 GetSpellLightType() { return m_Light.Type.Spell; }
inline uint8 GetInnateLightType() { return m_Light.Type[EQEmu::lightsource::LightInnate]; }
inline uint8 GetEquipmentLightType() { return m_Light.Type[EQEmu::lightsource::LightEquipment]; }
inline uint8 GetSpellLightType() { return m_Light.Type[EQEmu::lightsource::LightSpell]; }
virtual void UpdateEquipmentLight() { m_Light.Type.Equipment = 0; m_Light.Level.Equipment = 0; }
inline void SetSpellLightType(uint8 light_type) { m_Light.Type.Spell = (light_type & 0x0F); m_Light.Level.Spell = EQEmu::lightsource::TypeToLevel(m_Light.Type.Spell); }
virtual void UpdateEquipmentLight() { m_Light.Type[EQEmu::lightsource::LightEquipment] = 0; m_Light.Level[EQEmu::lightsource::LightEquipment] = 0; }
inline void SetSpellLightType(uint8 light_type) { m_Light.Type[EQEmu::lightsource::LightSpell] = (light_type & 0x0F); m_Light.Level[EQEmu::lightsource::LightSpell] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightSpell]); }
inline uint8 GetActiveLightType() { return m_Light.Type.Active; }
inline uint8 GetActiveLightType() { return m_Light.Type[EQEmu::lightsource::LightActive]; }
bool UpdateActiveLight(); // returns true if change, false if no change
EQEmu::lightsource::LightSourceProfile* GetLightProfile() { return &m_Light; }
EQEmu::LightSourceProfile* GetLightProfile() { return &m_Light; }
Mob* GetPet();
void SetPet(Mob* newpet);
@@ -763,7 +767,7 @@ public:
virtual int GetHaste();
int32 GetMeleeMitigation();
uint8 GetWeaponDamageBonus(const Item_Struct* weapon, bool offhand = false);
uint8 GetWeaponDamageBonus(const EQEmu::Item_Struct* weapon, bool offhand = false);
uint16 GetDamageTable(SkillUseTypes skillinuse);
virtual int GetHandToHandDamage(void);
@@ -788,10 +792,10 @@ public:
int32 ReduceAllDamage(int32 damage);
virtual void DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, int32 min_damage = 1, int32 hate_override = -1, int ReuseTime = 10, bool CheckHitChance=false, bool CanAvoid=true);
virtual void DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const Item_Struct* AmmoItem=nullptr, uint16 weapon_damage=0, int16 chance_mod=0,int16 focus=0, int ReuseTime=0, uint32 range_id=0, int AmmoSlot=0, float speed = 4.0f);
virtual void DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const EQEmu::Item_Struct* AmmoItem=nullptr, uint16 weapon_damage=0, int16 chance_mod=0,int16 focus=0, int ReuseTime=0, uint32 range_id=0, int AmmoSlot=0, float speed = 4.0f);
virtual void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes skillinuse, int16 chance_mod=0, int16 focus=0, bool CanRiposte=false, int ReuseTime=0);
virtual void DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const ItemInst* Ammo=nullptr, uint16 weapon_damage=0, int16 chance_mod=0, int16 focus=0, int ReuseTime=0, uint32 range_id=0, uint32 ammo_id=0, const Item_Struct *AmmoItem=nullptr, int AmmoSlot=0, float speed= 4.0f);
bool TryProjectileAttack(Mob* other, const Item_Struct *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot, float speed);
virtual void DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const ItemInst* Ammo=nullptr, uint16 weapon_damage=0, int16 chance_mod=0, int16 focus=0, int ReuseTime=0, uint32 range_id=0, uint32 ammo_id=0, const EQEmu::Item_Struct *AmmoItem=nullptr, int AmmoSlot=0, float speed= 4.0f);
bool TryProjectileAttack(Mob* other, const EQEmu::Item_Struct *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot, float speed);
void ProjectileAttack();
inline bool HasProjectileAttack() const { return ActiveProjectileATK; }
inline void SetProjectileAttack(bool value) { ActiveProjectileATK = value; }
@@ -909,7 +913,7 @@ public:
// HP Event
inline int GetNextHPEvent() const { return nexthpevent; }
void SetNextHPEvent( int hpevent );
void SendItemAnimation(Mob *to, const Item_Struct *item, SkillUseTypes skillInUse, float velocity= 4.0);
void SendItemAnimation(Mob *to, const EQEmu::Item_Struct *item, SkillUseTypes skillInUse, float velocity= 4.0);
inline int& GetNextIncHPEvent() { return nextinchpevent; }
void SetNextIncHPEvent( int inchpevent );
@@ -1147,8 +1151,8 @@ protected:
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 ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TrySpellProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TryWeaponProc(const ItemInst* inst, const EQEmu::Item_Struct* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TrySpellProc(const ItemInst* inst, const EQEmu::Item_Struct* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void TryWeaponProc(const ItemInst* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary);
void ExecWeaponProc(const ItemInst* weapon, uint16 spell_id, Mob *on, int level_override = -1);
virtual float GetProcChances(float ProcBonus, uint16 hand = EQEmu::legacy::SlotPrimary);
@@ -1157,7 +1161,7 @@ protected:
virtual float GetAssassinateProcChances(uint16 ReuseTime);
virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm?
uint16 GetWeaponSpeedbyHand(uint16 hand);
int GetWeaponDamage(Mob *against, const Item_Struct *weapon_item);
int GetWeaponDamage(Mob *against, const EQEmu::Item_Struct *weapon_item);
int GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate = nullptr);
int GetKickDamage();
int GetBashDamage();
@@ -1185,7 +1189,7 @@ protected:
glm::vec4 m_Delta;
EQEmu::lightsource::LightSourceProfile m_Light;
EQEmu::LightSourceProfile m_Light;
float fixedZ;
EmuAppearance _appearance;
+7 -4
View File
@@ -9,7 +9,10 @@ class ItemInst;
class Spawn2;
struct Consider_Struct;
struct DBTradeskillRecipe_Struct;
struct Item_Struct;
namespace {
struct Item_Struct;
}
extern EntityList entity_list;
extern Zone* zone;
@@ -26,7 +29,7 @@ void Zone::mod_repop() { return; }
void NPC::mod_prespawn(Spawn2 *sp) { return; }
//Base damage from NPC::Attack
int NPC::mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const Item_Struct* weapon, Mob* other) { return(damage); }
int NPC::mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const EQEmu::Item_Struct* weapon, Mob* other) { return(damage); }
//Mob c has been given credit for a kill. This is called after the regular EVENT_KILLED_MERIT event.
void NPC::mod_npc_killed_merit(Mob* c) { return; }
@@ -104,8 +107,8 @@ int32 Client::mod_client_xp(int32 in_xp, NPC *npc) { return(in_xp); }
uint32 Client::mod_client_xp_for_level(uint32 xp, uint16 check_level) { return(xp); }
//Food and drink values as computed by consume requests. Return < 0 to abort the request.
int Client::mod_food_value(const Item_Struct *item, int change) { return(change); }
int Client::mod_drink_value(const Item_Struct *item, int change) { return(change); }
int Client::mod_food_value(const EQEmu::Item_Struct *item, int change) { return(change); }
int Client::mod_drink_value(const EQEmu::Item_Struct *item, int change) { return(change); }
//effect_vallue - Spell effect value as calculated by default formulas. You will want to ignore effects that don't lend themselves to scaling - pet ID's, gate coords, etc.
int Mob::mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster, uint16 caster_id) { return(effect_value); }
+13 -13
View File
@@ -523,7 +523,7 @@ void NPC::QueryLoot(Client* to)
int x = 0;
for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) {
const Item_Struct* item = database.GetItem((*cur)->item_id);
const EQEmu::Item_Struct* item = database.GetItem((*cur)->item_id);
if (item == nullptr) {
Log.Out(Logs::General, Logs::Error, "Database error, invalid item");
continue;
@@ -745,8 +745,8 @@ uint32 NPC::CountLoot() {
void NPC::UpdateEquipmentLight()
{
m_Light.Type.Equipment = 0;
m_Light.Level.Equipment = 0;
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; }
@@ -754,9 +754,9 @@ void NPC::UpdateEquipmentLight()
auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; }
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type.Equipment)) {
m_Light.Type.Equipment = item->Light;
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type[EQEmu::lightsource::LightEquipment])) {
m_Light.Type[EQEmu::lightsource::LightEquipment] = item->Light;
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
}
}
@@ -765,17 +765,17 @@ void NPC::UpdateEquipmentLight()
auto item = database.GetItem((*iter)->item_id);
if (item == nullptr) { continue; }
if (item->ItemClass != ItemClassCommon) { continue; }
if (!item->IsClassCommon()) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (EQEmu::lightsource::TypeToLevel(item->Light))
general_light_type = item->Light;
}
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type.Equipment))
m_Light.Type.Equipment = general_light_type;
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type[EQEmu::lightsource::LightEquipment]))
m_Light.Type[EQEmu::lightsource::LightEquipment] = general_light_type;
m_Light.Level.Equipment = EQEmu::lightsource::TypeToLevel(m_Light.Type.Equipment);
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
}
void NPC::Depop(bool StartSpawnTimer) {
@@ -1456,13 +1456,13 @@ void NPC::PickPocket(Client* thief)
// still needs to have FindFreeSlot vs PutItemInInventory issue worked out
while (steal_item) {
std::vector<std::pair<const Item_Struct*, uint16>> loot_selection; // <const Item_Struct*, charges>
std::vector<std::pair<const EQEmu::Item_Struct*, uint16>> loot_selection; // <const Item_Struct*, charges>
for (auto item_iter : itemlist) {
if (!item_iter || !item_iter->item_id)
continue;
auto item_test = database.GetItem(item_iter->item_id);
if (item_test->Magic || !item_test->NoDrop || item_test->ItemType == ItemClassContainer || thief->CheckLoreConflict(item_test))
if (item_test->Magic || !item_test->NoDrop || item_test->IsClassBag() || thief->CheckLoreConflict(item_test))
continue;
loot_selection.push_back(std::make_pair(item_test, ((item_test->Stackable) ? (1) : (item_iter->charges))));
@@ -1473,7 +1473,7 @@ void NPC::PickPocket(Client* thief)
}
int random = zone->random.Int(0, (loot_selection.size() - 1));
uint16 slot_id = thief->GetInv().FindFreeSlot(false, true, (loot_selection[random].first->Size), (loot_selection[random].first->ItemType == ItemTypeArrow));
uint16 slot_id = thief->GetInv().FindFreeSlot(false, true, (loot_selection[random].first->Size), (loot_selection[random].first->ItemType == EQEmu::item::ItemTypeArrow));
if (slot_id == INVALID_INDEX) {
steal_item = false;
break;
+8 -4
View File
@@ -90,7 +90,11 @@ class Client;
class Group;
class Raid;
class Spawn2;
struct Item_Struct;
namespace EQEmu
{
struct Item_Struct;
}
class NPC : public Mob
{
@@ -174,7 +178,7 @@ public:
virtual void SpellProcess();
virtual void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
void AddItem(const Item_Struct* item, uint16 charges, bool equipitem = true);
void AddItem(const EQEmu::Item_Struct* item, uint16 charges, bool equipitem = true);
void AddItem(uint32 itemid, uint16 charges, bool equipitem = true);
void AddLootTable();
void AddLootTable(uint32 ldid);
@@ -266,7 +270,7 @@ public:
bool IsTaunting() const { return taunting; }
void PickPocket(Client* thief);
void StartSwarmTimer(uint32 duration) { swarm_timer.Start(duration); }
void AddLootDrop(const Item_Struct*dbitem, ItemList* itemlistconst, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange = false);
void AddLootDrop(const EQEmu::Item_Struct*dbitem, ItemList* itemlistconst, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange = false);
virtual void DoClassAttacks(Mob *target);
void CheckSignal();
inline bool IsNotTargetableWithHotkey() const { return no_target_hotkey; }
@@ -399,7 +403,7 @@ public:
void SetMerchantProbability(uint8 amt) { probability = amt; }
uint8 GetMerchantProbability() { return probability; }
void mod_prespawn(Spawn2 *sp);
int mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const Item_Struct* weapon, Mob* other);
int mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const EQEmu::Item_Struct* weapon, Mob* other);
void mod_npc_killed_merit(Mob* c);
void mod_npc_killed(Mob* oos);
void AISpellsList(Client *c);
+9 -9
View File
@@ -138,7 +138,7 @@ Object::Object(Client* client, const ItemInst* inst)
// Set object name
if (inst) {
const Item_Struct* item = inst->GetItem();
const EQEmu::Item_Struct* item = inst->GetItem();
if (item && item->IDFile) {
if (strlen(item->IDFile) == 0) {
strcpy(m_data.object_name, DEFAULT_OBJECT_NAME);
@@ -194,7 +194,7 @@ Object::Object(const ItemInst *inst, float x, float y, float z, float heading, u
// Set object name
if (inst) {
const Item_Struct* item = inst->GetItem();
const EQEmu::Item_Struct* item = inst->GetItem();
if (item && item->IDFile) {
if (strlen(item->IDFile) == 0) {
strcpy(m_data.object_name, DEFAULT_OBJECT_NAME);
@@ -339,7 +339,7 @@ void Object::PutItem(uint8 index, const ItemInst* inst)
return;
}
if (m_inst && m_inst->IsType(ItemClassContainer)) {
if (m_inst && m_inst->IsType(EQEmu::item::ItemClassBag)) {
if (inst) {
m_inst->PutItem(index, *inst);
}
@@ -380,7 +380,7 @@ void Object::Close() {
// Remove item from container
void Object::DeleteItem(uint8 index)
{
if (m_inst && m_inst->IsType(ItemClassContainer)) {
if (m_inst && m_inst->IsType(EQEmu::item::ItemClassBag)) {
m_inst->DeleteItem(index);
// This is _highly_ inefficient, but for now it will work: Save entire object to database
@@ -393,7 +393,7 @@ ItemInst* Object::PopItem(uint8 index)
{
ItemInst* inst = nullptr;
if (m_inst && m_inst->IsType(ItemClassContainer)) {
if (m_inst && m_inst->IsType(EQEmu::item::ItemClassBag)) {
inst = m_inst->PopItem(index);
// This is _highly_ inefficient, but for now it will work: Save entire object to database
@@ -574,7 +574,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
// Send items inside of container
if (m_inst && m_inst->IsType(ItemClassContainer)) {
if (m_inst && m_inst->IsType(EQEmu::item::ItemClassBag)) {
//Clear out no-drop and no-rent items first if different player opens it
if(user != last_user)
@@ -628,7 +628,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob
}
// Save container contents, if container
if (inst && inst->IsType(ItemClassContainer))
if (inst && inst->IsType(EQEmu::item::ItemClassBag))
SaveWorldContainer(object.zone_id, database_id, inst);
return database_id;
@@ -665,7 +665,7 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec
}
// Save container contents, if container
if (inst && inst->IsType(ItemClassContainer))
if (inst && inst->IsType(EQEmu::item::ItemClassBag))
SaveWorldContainer(object.zone_id, id, inst);
}
@@ -881,7 +881,7 @@ uint32 Object::GetItemID()
return 0;
}
const Item_Struct* item = this->m_inst->GetItem();
const EQEmu::Item_Struct* item = this->m_inst->GetItem();
if (item == 0)
{
+1 -1
View File
@@ -69,7 +69,7 @@ IT10714_ACTORDEF=Augmentation Sealer
IT10725_ACTORDEF=Shuriken
*/
#define OT_DROPPEDITEM BagTypeLargeBag
#define OT_DROPPEDITEM EQEmu::item::BagTypeLargeBag
// Icon values:
//0x0453 a pie
+1 -1
View File
@@ -8131,7 +8131,7 @@ XS(XS_Mob_DoThrowingAttackDmg)
Mob * THIS;
Mob* target;
ItemInst* RangeWeapon = nullptr;
Item_Struct* item = nullptr;
EQEmu::Item_Struct* item = nullptr;
uint16 weapon_damage = (uint16)SvIV(ST(4));
int16 chance_mod = (int16)SvIV(ST(5));
int16 focus = (int16)SvIV(ST(6));
+1 -1
View File
@@ -134,7 +134,7 @@ XS(XS_QuestItem_IsType)
if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->IsType((ItemClassTypes)type);
RETVAL = THIS->IsType((EQEmu::item::ItemClass)type);
ST(0) = boolSV(RETVAL);
sv_2mortal(ST(0));
}
+2 -2
View File
@@ -420,7 +420,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
// like the special back items some focused pets may receive.
uint32 petinv[EQEmu::legacy::EQUIPMENT_SIZE];
memset(petinv, 0, sizeof(petinv));
const Item_Struct *item = 0;
const EQEmu::Item_Struct *item = 0;
if (database.GetBasePetItems(record.equipmentset, petinv)) {
for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++)
@@ -665,7 +665,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) {
if(items[i] == 0)
continue;
const Item_Struct* item2 = database.GetItem(items[i]);
const EQEmu::Item_Struct* item2 = database.GetItem(items[i]);
if (item2 && item2->NoDrop != 0) {
//dont bother saving item charges for now, NPCs never use them
//and nobody should be able to get them off the corpse..?
+6 -6
View File
@@ -812,12 +812,12 @@ void QuestManager::traindisc(int discipline_tome_item_id) {
}
bool QuestManager::isdisctome(int item_id) {
const Item_Struct *item = database.GetItem(item_id);
const EQEmu::Item_Struct *item = database.GetItem(item_id);
if(item == nullptr) {
return(false);
}
if(item->ItemClass != ItemClassCommon || item->ItemType != ItemTypeSpell) {
if (!item->IsClassCommon() || item->ItemType != EQEmu::item::ItemTypeSpell) {
return(false);
}
@@ -1303,7 +1303,7 @@ void QuestManager::settime(uint8 new_hour, uint8 new_min, bool update_world /*=
void QuestManager::itemlink(int item_id) {
QuestManagerCurrentQuestVars();
if (initiator) {
const Item_Struct* item = database.GetItem(item_id);
const EQEmu::Item_Struct* item = database.GetItem(item_id);
if (item == nullptr)
return;
@@ -2495,7 +2495,7 @@ void QuestManager::MerchantSetItem(uint32 NPCid, uint32 itemid, uint32 quantity)
if (merchant == 0 || !merchant->IsNPC() || (merchant->GetClass() != MERCHANT))
return; // don't do anything if NPCid isn't a merchant
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
item = database.GetItem(itemid);
if (!item) return; // if the item id doesn't correspond to a real item, do nothing
@@ -2508,7 +2508,7 @@ uint32 QuestManager::MerchantCountItem(uint32 NPCid, uint32 itemid) {
if (merchant == 0 || !merchant->IsNPC() || (merchant->GetClass() != MERCHANT))
return 0; // if it isn't a merchant, it doesn't have any items
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
item = database.GetItem(itemid);
if (!item)
return 0; // if it isn't a valid item, the merchant doesn't have any
@@ -2531,7 +2531,7 @@ uint32 QuestManager::MerchantCountItem(uint32 NPCid, uint32 itemid) {
// Item Link for use in Variables - "my $example_link = quest::varlink(item_id);"
const char* QuestManager::varlink(char* perltext, int item_id) {
QuestManagerCurrentQuestVars();
const Item_Struct* item = database.GetItem(item_id);
const EQEmu::Item_Struct* item = database.GetItem(item_id);
if (!item)
return "INVALID ITEM ID IN VARLINK";
+32 -32
View File
@@ -118,11 +118,11 @@ void Mob::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
ItemInst *item = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
if(item)
{
if(item->GetItem()->ItemType == ItemTypeShield)
if (item->GetItem()->ItemType == EQEmu::item::ItemTypeShield)
{
hate += item->GetItem()->AC;
}
const Item_Struct *itm = item->GetItem();
const EQEmu::Item_Struct *itm = item->GetItem();
auto fbash = GetFuriousBash(itm->Focus.Effect);
hate = hate * (100 + fbash) / 100;
if (fbash)
@@ -477,7 +477,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
}
}
else{
if(GetWeaponDamage(other, (const Item_Struct*)nullptr) <= 0){
if(GetWeaponDamage(other, (const EQEmu::Item_Struct*)nullptr) <= 0){
ndamage = -5;
}
}
@@ -513,7 +513,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
//make sure we have a proper weapon if we are a client.
if(IsClient()) {
const ItemInst *wpn = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
if(!wpn || (wpn->GetItem()->ItemType != ItemType1HPiercing)){
if (!wpn || (wpn->GetItem()->ItemType != EQEmu::item::ItemType1HPiercing)){
Message_StringID(13, BACKSTAB_WEAPON);
return;
}
@@ -697,28 +697,28 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
int ammo_slot = EQEmu::legacy::SlotAmmo;
const ItemInst* Ammo = m_inv[EQEmu::legacy::SlotAmmo];
if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) {
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));
return;
}
if (!Ammo || !Ammo->IsType(ItemClassCommon)) {
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));
return;
}
const Item_Struct* RangeItem = RangeWeapon->GetItem();
const Item_Struct* AmmoItem = Ammo->GetItem();
const EQEmu::Item_Struct* RangeItem = RangeWeapon->GetItem();
const EQEmu::Item_Struct* AmmoItem = Ammo->GetItem();
if(RangeItem->ItemType != ItemTypeBow) {
if (RangeItem->ItemType != EQEmu::item::ItemTypeBow) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType);
Message(0, "Error: Rangeweapon: Item %d is not a bow.", RangeWeapon->GetID());
return;
}
if(AmmoItem->ItemType != ItemTypeArrow) {
if (AmmoItem->ItemType != EQEmu::item::ItemTypeArrow) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType);
Message(0, "Error: Ammo: type %d != %d, you have the wrong type of ammo!", AmmoItem->ItemType, ItemTypeArrow);
Message(0, "Error: Ammo: type %d != %d, you have the wrong type of ammo!", AmmoItem->ItemType, EQEmu::item::ItemTypeArrow);
return;
}
@@ -731,10 +731,10 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
bool found = false;
for (r = EQEmu::legacy::GENERAL_BEGIN; r <= EQEmu::legacy::GENERAL_END; r++) {
const ItemInst *pi = m_inv[r];
if(pi == nullptr || !pi->IsType(ItemClassContainer))
if (pi == nullptr || !pi->IsClassBag())
continue;
const Item_Struct* bagitem = pi->GetItem();
if(!bagitem || bagitem->BagType != BagTypeQuiver)
const EQEmu::Item_Struct* bagitem = pi->GetItem();
if (!bagitem || bagitem->BagType != EQEmu::item::BagTypeQuiver)
continue;
//we found a quiver, look for the ammo in it
@@ -812,7 +812,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
}
void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const ItemInst* Ammo, uint16 weapon_damage, int16 chance_mod, int16 focus, int ReuseTime,
uint32 range_id, uint32 ammo_id, const Item_Struct *AmmoItem, int AmmoSlot, float speed) {
uint32 range_id, uint32 ammo_id, const EQEmu::Item_Struct *AmmoItem, int AmmoSlot, float speed) {
if ((other == nullptr ||
((IsClient() && CastToClient()->dead) ||
@@ -827,7 +827,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
const ItemInst* _RangeWeapon = nullptr;
const ItemInst* _Ammo = nullptr;
const Item_Struct* ammo_lost = nullptr;
const EQEmu::Item_Struct* ammo_lost = nullptr;
/*
If LaunchProjectile is false this function will do archery damage on target,
@@ -1023,7 +1023,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
}
}
bool Mob::TryProjectileAttack(Mob* other, const Item_Struct *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot, float speed){
bool Mob::TryProjectileAttack(Mob* other, const EQEmu::Item_Struct *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot, float speed){
if (!other)
return false;
@@ -1327,7 +1327,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
//try proc on hits and misses
if(other && !other->HasDied())
TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, EQEmu::legacy::SlotRange);
TrySpellProc(nullptr, (const EQEmu::Item_Struct*)nullptr, other, EQEmu::legacy::SlotRange);
if (HasSkillProcs() && other && !other->HasDied())
TrySkillProc(other, skillInUse, 0, false, EQEmu::legacy::SlotRange);
@@ -1375,14 +1375,14 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
int ammo_slot = EQEmu::legacy::SlotRange;
const ItemInst* RangeWeapon = m_inv[EQEmu::legacy::SlotRange];
if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) {
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));
return;
}
const Item_Struct* item = RangeWeapon->GetItem();
if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) {
const EQEmu::Item_Struct* 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));
return;
@@ -1442,7 +1442,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
CommonBreakInvisibleFromCombat();
}
void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Item_Struct* AmmoItem, uint16 weapon_damage, int16 chance_mod,int16 focus, int ReuseTime, uint32 range_id, int AmmoSlot, float speed)
void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const EQEmu::Item_Struct* AmmoItem, uint16 weapon_damage, int16 chance_mod,int16 focus, int ReuseTime, uint32 range_id, int AmmoSlot, float speed)
{
if ((other == nullptr ||
((IsClient() && CastToClient()->dead) ||
@@ -1456,7 +1456,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
}
const ItemInst* _RangeWeapon = nullptr;
const Item_Struct* ammo_lost = nullptr;
const EQEmu::Item_Struct* ammo_lost = nullptr;
/*
If LaunchProjectile is false this function will do archery damage on target,
@@ -1580,7 +1580,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
}
}
void Mob::SendItemAnimation(Mob *to, const Item_Struct *item, SkillUseTypes skillInUse, float velocity) {
void Mob::SendItemAnimation(Mob *to, const EQEmu::Item_Struct *item, SkillUseTypes skillInUse, float velocity) {
EQApplicationPacket *outapp = new EQApplicationPacket(OP_SomeItemPacketMaybe, sizeof(Arrow_Struct));
Arrow_Struct *as = (Arrow_Struct *) outapp->pBuffer;
as->type = 1;
@@ -1630,7 +1630,7 @@ void Mob::ProjectileAnimation(Mob* to, int item_id, bool IsArrow, float speed, f
if (!to)
return;
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
uint8 item_type = 0;
if(!item_id) {
@@ -1771,7 +1771,7 @@ void NPC::DoClassAttacks(Mob *target) {
DoAnim(animKick);
int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){
if(GetWeaponDamage(target, (const EQEmu::Item_Struct*)nullptr) <= 0){
dmg = -5;
}
else{
@@ -1792,7 +1792,7 @@ void NPC::DoClassAttacks(Mob *target) {
DoAnim(animTailRake);
int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){
if(GetWeaponDamage(target, (const EQEmu::Item_Struct*)nullptr) <= 0){
dmg = -5;
}
else{
@@ -1845,7 +1845,7 @@ void NPC::DoClassAttacks(Mob *target) {
DoAnim(animKick);
int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){
if(GetWeaponDamage(target, (const EQEmu::Item_Struct*)nullptr) <= 0){
dmg = -5;
}
else{
@@ -1870,7 +1870,7 @@ void NPC::DoClassAttacks(Mob *target) {
DoAnim(animTailRake);
int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){
if(GetWeaponDamage(target, (const EQEmu::Item_Struct*)nullptr) <= 0){
dmg = -5;
}
else{
@@ -2382,7 +2382,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
int32 max_hit = (2 * weapon_damage*GetDamageTable(skillinuse)) / 100;
if(GetLevel() >= 28 && IsWarriorClass() ) {
int ucDamageBonus = GetWeaponDamageBonus((const Item_Struct*) nullptr );
int ucDamageBonus = GetWeaponDamageBonus((const EQEmu::Item_Struct*) nullptr );
min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus;
hate += ucDamageBonus;
@@ -2392,10 +2392,10 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
if(IsClient()){
ItemInst *item = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
if(item){
if(item->GetItem()->ItemType == ItemTypeShield) {
if (item->GetItem()->ItemType == EQEmu::item::ItemTypeShield) {
hate += item->GetItem()->AC;
}
const Item_Struct *itm = item->GetItem();
const EQEmu::Item_Struct *itm = item->GetItem();
hate = hate * (100 + GetFuriousBash(itm->Focus.Effect)) / 100;
}
}
+12 -12
View File
@@ -617,7 +617,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#endif
if(IsClient()){
ItemInst* transI = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotCursor);
if(transI && transI->IsType(ItemClassCommon) && transI->IsStackable()){
if (transI && transI->IsClassCommon() && transI->IsStackable()){
uint32 fcharges = transI->GetCharges();
//Does it sound like meat... maybe should check if it looks like meat too...
if(strstr(transI->GetItem()->Name, "meat") ||
@@ -1132,7 +1132,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_SummonItem:
{
const Item_Struct *item = database.GetItem(spell.base[i]);
const EQEmu::Item_Struct *item = database.GetItem(spell.base[i]);
#ifdef SPELL_EFFECT_SPAM
const char *itemname = item ? item->Name : "*Unknown Item*";
snprintf(effect_desc, _EDLEN, "Summon Item: %s (id %d)", itemname, spell.base[i]);
@@ -1168,14 +1168,14 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
}
case SE_SummonItemIntoBag:
{
const Item_Struct *item = database.GetItem(spell.base[i]);
const EQEmu::Item_Struct *item = database.GetItem(spell.base[i]);
#ifdef SPELL_EFFECT_SPAM
const char *itemname = item ? item->Name : "*Unknown Item*";
snprintf(effect_desc, _EDLEN, "Summon Item In Bag: %s (id %d)", itemname, spell.base[i]);
#endif
uint8 slot;
if (!SummonedItem || !SummonedItem->IsType(ItemClassContainer)) {
if (!SummonedItem || !SummonedItem->IsClassBag()) {
if (caster)
caster->Message(13, "SE_SummonItemIntoBag but no bag has been summoned!");
} else if ((slot = SummonedItem->FirstOpenSlot()) == 0xff) {
@@ -5124,7 +5124,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
//item focus
if (itembonuses.FocusEffects[type]){
const Item_Struct* TempItem = 0;
const EQEmu::Item_Struct* TempItem = 0;
for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++)
{
@@ -5155,7 +5155,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
aug = ins->GetAugment(y);
if(aug)
{
const Item_Struct* TempItemAug = aug->GetItem();
const EQEmu::Item_Struct* TempItemAug = aug->GetItem();
if (TempItemAug && TempItemAug->Focus.Effect > 0 && IsValidSpell(TempItemAug->Focus.Effect)) {
proc_spellid = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id);
if (IsValidSpell(proc_spellid)){
@@ -5253,8 +5253,8 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
//Check if item focus effect exists for the client.
if (itembonuses.FocusEffects[type]){
const Item_Struct* TempItem = 0;
const Item_Struct* UsedItem = 0;
const EQEmu::Item_Struct* TempItem = 0;
const EQEmu::Item_Struct* UsedItem = 0;
uint16 UsedFocusID = 0;
int16 Total = 0;
int16 focus_max = 0;
@@ -5301,7 +5301,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
aug = ins->GetAugment(y);
if(aug)
{
const Item_Struct* TempItemAug = aug->GetItem();
const EQEmu::Item_Struct* TempItemAug = aug->GetItem();
if (TempItemAug && TempItemAug->Focus.Effect > 0 && TempItemAug->Focus.Effect != SPELL_UNKNOWN) {
if(rand_effectiveness) {
focus_max = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id, true);
@@ -5525,8 +5525,8 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) {
if (RuleB(Spells, NPC_UseFocusFromItems) && itembonuses.FocusEffects[type]){
const Item_Struct* TempItem = 0;
const Item_Struct* UsedItem = 0;
const EQEmu::Item_Struct* TempItem = 0;
const EQEmu::Item_Struct* UsedItem = 0;
uint16 UsedFocusID = 0;
int16 Total = 0;
int16 focus_max = 0;
@@ -5534,7 +5534,7 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) {
//item focus
for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]);
const EQEmu::Item_Struct *cur = database.GetItem(equipment[i]);
if(!cur)
continue;
+7 -7
View File
@@ -258,7 +258,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
int bitmask = 1;
bitmask = bitmask << (CastToClient()->GetClass() - 1);
if( itm && itm->GetItem()->Classes != 65535 ) {
if ((itm->GetItem()->Click.Type == ET_EquipClick) && !(itm->GetItem()->Classes & bitmask)) {
if ((itm->GetItem()->Click.Type == EQEmu::item::ItemEffectEquipClick) && !(itm->GetItem()->Classes & bitmask)) {
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are casting a spell from an item that requires equipping but shouldn't let them equip it
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!",
@@ -270,7 +270,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
}
return(false);
}
if ((itm->GetItem()->Click.Type == ET_ClickEffect2) && !(itm->GetItem()->Classes & bitmask)) {
if ((itm->GetItem()->Click.Type == EQEmu::item::ItemEffectClick2) && !(itm->GetItem()->Classes & bitmask)) {
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are casting a spell from an item that they don't meet the race/class requirements to cast
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!",
@@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
return(false);
}
}
if (itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= EQEmu::legacy::SlotAmmo || item_slot == EQEmu::legacy::SlotPowerSource)){
if (itm && (itm->GetItem()->Click.Type == EQEmu::item::ItemEffectEquipClick) && !(item_slot <= EQEmu::legacy::SlotAmmo || item_slot == EQEmu::legacy::SlotPowerSource)){
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are attempting to cast a must equip clicky without having it equipped
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID);
@@ -1136,7 +1136,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
missingreags=true;
}
const Item_Struct *item = database.GetItem(component);
const EQEmu::Item_Struct *item = database.GetItem(component);
if(item) {
c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name);
Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component);
@@ -1198,7 +1198,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
{
bool fromaug = false;
const ItemInst* inst = CastToClient()->GetInv()[inventory_slot];
Item_Struct* augitem = 0;
EQEmu::Item_Struct* augitem = 0;
uint32 recastdelay = 0;
uint32 recasttype = 0;
@@ -1211,7 +1211,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
if (!aug_i)
continue;
const Item_Struct* aug = aug_i->GetItem();
const EQEmu::Item_Struct* aug = aug_i->GetItem();
if (!aug)
continue;
@@ -1245,7 +1245,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
}
}
if (inst && inst->IsType(ItemClassCommon) && (inst->GetItem()->Click.Effect == spell_id) && inst->GetCharges() || fromaug)
if (inst && inst->IsClassCommon() && (inst->GetItem()->Click.Effect == spell_id) && inst->GetCharges() || fromaug)
{
//const Item_Struct* item = inst->GetItem();
int16 charges = inst->GetItem()->MaxCharges;
+2 -2
View File
@@ -1884,7 +1884,7 @@ void ClientTaskState::RewardTask(Client *c, TaskInformation *Task) {
if(!Task || !c) return;
const Item_Struct* Item;
const EQEmu::Item_Struct* Item;
std::vector<int> RewardList;
switch(Task->RewardMethod) {
@@ -2777,7 +2777,7 @@ void TaskManager::SendActiveTaskDescription(Client *c, int TaskID, int SequenceN
}
if(ItemID) {
const Item_Struct* reward_item = database.GetItem(ItemID);
const EQEmu::Item_Struct* reward_item = database.GetItem(ItemID);
EQEmu::saylink::SayLinkEngine linker;
linker.SetLinkType(linker.SayLinkItemData);
+70 -60
View File
@@ -61,8 +61,8 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
inst = user_inv.GetItem(in_augment->container_slot);
if (inst)
{
const Item_Struct* item = inst->GetItem();
if (item && inst->IsType(ItemClassContainer) && item->BagType == 53)
const EQEmu::Item_Struct* item = inst->GetItem();
if (item && inst->IsType(EQEmu::item::ItemClassBag) && item->BagType == 53)
{
// We have found an appropriate inventory augmentation sealer
container = inst;
@@ -166,8 +166,8 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
else
{
ItemInst *old_aug = nullptr;
bool isSolvent = auged_with->GetItem()->ItemType == ItemUseTypes::ItemTypeAugmentationSolvent;
if (!isSolvent && auged_with->GetItem()->ItemType != ItemUseTypes::ItemTypeAugmentationDistiller)
bool isSolvent = auged_with->GetItem()->ItemType == EQEmu::item::ItemTypeAugmentationSolvent;
if (!isSolvent && auged_with->GetItem()->ItemType != EQEmu::item::ItemTypeAugmentationDistiller)
{
Log.Out(Logs::General, Logs::Error, "Player tried to remove an augment without a solvent or distiller.");
user->Message(13, "Error: Missing an augmentation solvent or distiller for removing this augment.");
@@ -276,25 +276,25 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
else {
inst = user_inv.GetItem(in_combine->container_slot);
if (inst) {
const Item_Struct* item = inst->GetItem();
if (item && inst->IsType(ItemClassContainer)) {
const EQEmu::Item_Struct* item = inst->GetItem();
if (item && inst->IsType(EQEmu::item::ItemClassBag)) {
c_type = item->BagType;
some_id = item->ID;
}
}
}
if (!inst || !inst->IsType(ItemClassContainer)) {
if (!inst || !inst->IsType(EQEmu::item::ItemClassBag)) {
user->Message(13, "Error: Server does not recognize specified tradeskill container");
return;
}
container = inst;
if (container->GetItem() && container->GetItem()->BagType == BagTypeTransformationmold) {
if (container->GetItem() && container->GetItem()->BagType == EQEmu::item::BagTypeTransformationmold) {
const ItemInst* inst = container->GetItem(0);
bool AllowAll = RuleB(Inventory, AllowAnyWeaponTransformation);
if (inst && ItemInst::CanTransform(inst->GetItem(), container->GetItem(), AllowAll)) {
const Item_Struct* new_weapon = inst->GetItem();
const EQEmu::Item_Struct* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::legacy::SlotCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
@@ -311,10 +311,10 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
return;
}
if (container->GetItem() && container->GetItem()->BagType == BagTypeDetransformationmold) {
if (container->GetItem() && container->GetItem()->BagType == EQEmu::item::BagTypeDetransformationmold) {
const ItemInst* inst = container->GetItem(0);
if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIcon()) {
const Item_Struct* new_weapon = inst->GetItem();
const EQEmu::Item_Struct* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), EQEmu::legacy::SlotCursor, 0, 0);
@@ -538,7 +538,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
for(std::list<int>::iterator it = MissingItems.begin(); it != MissingItems.end(); ++it)
{
const Item_Struct* item = database.GetItem(*it);
const EQEmu::Item_Struct* item = database.GetItem(*it);
if(item)
user->Message_StringID(MT_Skills, TRADESKILL_MISSING_ITEM, item->Name);
@@ -607,77 +607,87 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
SkillUseTypes Object::TypeToSkill(uint32 type)
{
switch(type) // grouped and ordered by SkillUseTypes name - new types need to be verified for proper SkillUseTypes and use
{
switch(type) { // grouped and ordered by SkillUseTypes name - new types need to be verified for proper SkillUseTypes and use
/*SkillAlchemy*/
case BagTypeMedicineBag: { return SkillAlchemy; }
case EQEmu::item::BagTypeMedicineBag:
return SkillAlchemy;
/*SkillBaking*/
// case BagTypeMixingBowl: // No idea...
case BagTypeOven: { return SkillBaking; }
//case EQEmu::item::BagTypeMixingBowl: // No idea...
case EQEmu::item::BagTypeOven:
return SkillBaking;
/*SkillBlacksmithing*/
case BagTypeForge:
// case BagTypeKoadaDalForge:
case BagTypeTeirDalForge:
case BagTypeOggokForge:
case BagTypeStormguardForge:
// case BagTypeAkanonForge:
// case BagTypeNorthmanForge:
// case BagTypeCabilisForge:
// case BagTypeFreeportForge:
// case BagTypeRoyalQeynosForge:
// case BagTypeTrollForge:
case BagTypeFierDalForge:
case BagTypeValeForge: { return SkillBlacksmithing; } // Delete return if BagTypeGuktaForge enabled
// case BagTypeErudForge:
// case BagTypeGuktaForge: { return SkillBlacksmithing; }
case EQEmu::item::BagTypeForge:
//case EQEmu::item::BagTypeKoadaDalForge:
case EQEmu::item::BagTypeTeirDalForge:
case EQEmu::item::BagTypeOggokForge:
case EQEmu::item::BagTypeStormguardForge:
//case EQEmu::item::BagTypeAkanonForge:
//case EQEmu::item::BagTypeNorthmanForge:
//case EQEmu::item::BagTypeCabilisForge:
//case EQEmu::item::BagTypeFreeportForge:
//case EQEmu::item::BagTypeRoyalQeynosForge:
//case EQEmu::item::BagTypeTrollForge:
case EQEmu::item::BagTypeFierDalForge:
case EQEmu::item::BagTypeValeForge:
//case EQEmu::item::BagTypeErudForge:
//case EQEmu::item::BagTypeGuktaForge:
return SkillBlacksmithing;
/*SkillBrewing*/
// case BagTypeIceCreamChurn: // No idea...
case BagTypeBrewBarrel: { return SkillBrewing; }
//case EQEmu::item::BagTypeIceCreamChurn: // No idea...
case EQEmu::item::BagTypeBrewBarrel:
return SkillBrewing;
/*SkillFishing*/
case BagTypeTackleBox: { return SkillFishing; }
case EQEmu::item::BagTypeTackleBox:
return SkillFishing;
/*SkillFletching*/
case BagTypeFletchingKit: { return SkillFletching; } // Delete return if BagTypeFierDalFletchingKit enabled
// case BagTypeFierDalFletchingKit: { return SkillFletching; }
case EQEmu::item::BagTypeFletchingKit:
//case EQEmu::item::BagTypeFierDalFletchingKit:
return SkillFletching;
/*SkillJewelryMaking*/
case BagTypeJewelersKit: { return SkillJewelryMaking; }
case EQEmu::item::BagTypeJewelersKit:
return SkillJewelryMaking;
/*SkillMakePoison*/
// This is a guess and needs to be verified... (Could be SkillAlchemy)
// case BagTypeMortar: { return SkillMakePoison; }
// This is a guess and needs to be verified... (Could be SkillAlchemy)
//case EQEmu::item::BagTypeMortar:
// return SkillMakePoison;
/*SkillPottery*/
case BagTypePotteryWheel:
case BagTypeKiln: { return SkillPottery; } // Delete return if BagTypeIksarPotteryWheel enabled
// case BagTypeIksarPotteryWheel: { return SkillPottery; }
case EQEmu::item::BagTypePotteryWheel:
case EQEmu::item::BagTypeKiln:
//case EQEmu::item::BagTypeIksarPotteryWheel:
return SkillPottery;
/*SkillResearch*/
// case BagTypeLexicon:
case BagTypeWizardsLexicon:
case BagTypeMagesLexicon:
case BagTypeNecromancersLexicon:
case BagTypeEnchantersLexicon: { return SkillResearch; } // Delete return if BagTypeConcordanceofResearch enabled
// case BagTypeConcordanceofResearch: { return SkillResearch; }
//case EQEmu::item::BagTypeLexicon:
case EQEmu::item::BagTypeWizardsLexicon:
case EQEmu::item::BagTypeMagesLexicon:
case EQEmu::item::BagTypeNecromancersLexicon:
case EQEmu::item::BagTypeEnchantersLexicon:
//case EQEmu::item::BagTypeConcordanceofResearch:
return SkillResearch;
/*SkillTailoring*/
case BagTypeSewingKit: { return SkillTailoring; } // Delete return if BagTypeFierDalTailoringKit enabled
// case BagTypeHalflingTailoringKit:
// case BagTypeErudTailoringKit:
// case BagTypeFierDalTailoringKit: { return SkillTailoring; }
case EQEmu::item::BagTypeSewingKit:
//case EQEmu::item::BagTypeHalflingTailoringKit:
//case EQEmu::item::BagTypeErudTailoringKit:
//case EQEmu::item::BagTypeFierDalTailoringKit:
return SkillTailoring;
/*SkillTinkering*/
case BagTypeToolBox: { return SkillTinkering; }
case EQEmu::item::BagTypeToolBox:
return SkillTinkering;
/*Undefined*/
default: { break; }
default:
return TradeskillUnknown;
}
return TradeskillUnknown;
}
void Client::TradeskillSearchResults(const std::string &query, unsigned long objtype, unsigned long someid) {
@@ -952,7 +962,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
aa_chance = spellbonuses.ReduceTradeskillFail[spec->tradeskill] + itembonuses.ReduceTradeskillFail[spec->tradeskill] + aabonuses.ReduceTradeskillFail[spec->tradeskill];
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
chance = mod_tradeskill_chance(chance, spec);
@@ -1103,7 +1113,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
if (!inst)
continue;
const Item_Struct* item = GetItem(inst->GetItem()->ID);
const EQEmu::Item_Struct* item = GetItem(inst->GetItem()->ID);
if (!item)
continue;
@@ -1232,7 +1242,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
if(!inst)
continue;
const Item_Struct* item = GetItem(inst->GetItem()->ID);
const EQEmu::Item_Struct* item = GetItem(inst->GetItem()->ID);
if (!item)
continue;
+20 -20
View File
@@ -266,7 +266,7 @@ void Trade::LogTrade()
sprintf(item_num, "%i", inst->GetItem()->ID);
strcat(logtext, item_num);
if (inst->IsType(ItemClassContainer)) {
if (inst->IsClassBag()) {
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) {
inst = trader->GetInv().GetItem(i, j);
if (inst) {
@@ -309,9 +309,9 @@ void Trade::DumpTrade()
if (inst) {
Log.Out(Logs::Detail, Logs::Trading, "Item %i (Charges=%i, Slot=%i, IsBag=%s)",
inst->GetItem()->ID, inst->GetCharges(),
i, ((inst->IsType(ItemClassContainer)) ? "True" : "False"));
i, ((inst->IsClassBag()) ? "True" : "False"));
if (inst->IsType(ItemClassContainer)) {
if (inst->IsClassBag()) {
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) {
inst = trader->GetInv().GetItem(i, j);
if (inst) {
@@ -335,7 +335,7 @@ void Client::ResetTrade() {
for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
const ItemInst* inst = m_inv[trade_slot];
if (inst && inst->IsType(ItemClassContainer)) {
if (inst && inst->IsClassBag()) {
int16 free_slot = m_inv.FindFreeSlotForTradeItem(inst);
if (free_slot != INVALID_INDEX) {
@@ -490,7 +490,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
const ItemInst* inst = m_inv[trade_slot];
if (inst && inst->IsType(ItemClassContainer)) {
if (inst && inst->IsClassBag()) {
Log.Out(Logs::Detail, Logs::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName());
// TODO: need to check bag items/augments for no drop..everything for attuned...
@@ -840,7 +840,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
event_details->push_back(detail);
qs_audit->char_count += detail->charges;
if(trade_inst->IsType(ItemClassContainer)) {
if (trade_inst->IsClassBag()) {
for (uint8 sub_slot = SUB_INDEX_BEGIN; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
const ItemInst* trade_baginst = trade_inst->GetItem(sub_slot);
@@ -885,16 +885,16 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
continue;
}
const Item_Struct* item = inst->GetItem();
const EQEmu::Item_Struct* item = inst->GetItem();
if(item && quest_npc == false) {
// if it was not a NO DROP or Attuned item (or if a GM is trading), let the NPC have it
if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) {
// pets need to look inside bags and try to equip items found there
if(item->ItemClass == ItemClassContainer && item->BagSlots > 0) {
if (item->IsClassBag() && item->BagSlots > 0) {
for (int16 bslot = SUB_INDEX_BEGIN; bslot < item->BagSlots; bslot++) {
const ItemInst* baginst = inst->GetItem(bslot);
if (baginst) {
const Item_Struct* bagitem = baginst->GetItem();
const EQEmu::Item_Struct* bagitem = baginst->GetItem();
if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsAttuned() == false))) {
tradingWith->CastToNPC()->AddLootDrop(bagitem, &tradingWith->CastToNPC()->itemlist,
baginst->GetCharges(), 1, 127, true, true);
@@ -1158,7 +1158,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) {
std::string Packet;
int16 FreeSlotID=0;
const Item_Struct* item = database.GetItem(ItemID);
const EQEmu::Item_Struct* item = database.GetItem(ItemID);
if(!item){
Log.Out(Logs::Detail, Logs::Trading, "Bogus item deleted in Client::SendTraderItem!\n");
@@ -1169,7 +1169,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) {
if (inst)
{
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
bool is_arrow = (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
FreeSlotID = m_inv.FindFreeSlot(false, true, inst->GetItem()->Size, is_arrow);
PutItemInInventory(FreeSlotID, *inst);
@@ -1192,7 +1192,7 @@ void Client::SendSingleTraderItem(uint32 CharID, int SerialNumber) {
}
void Client::BulkSendTraderInventory(uint32 char_id) {
const Item_Struct *item;
const EQEmu::Item_Struct *item;
TraderCharges_Struct* TraderItems = database.LoadTraderItemWithCharges(char_id);
@@ -2030,7 +2030,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru
if(!Customer) return;
const Item_Struct *item = database.GetItem(ItemID);
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
if(!item) return;
@@ -2074,7 +2074,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St
if(!Customer) return;
const Item_Struct *item = database.GetItem(ItemID);
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
if(!item) return;
@@ -2233,7 +2233,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) {
}
const Item_Struct *item = 0;
const EQEmu::Item_Struct *item = 0;
if(IDOfItemToAdd)
item = database.GetItem(IDOfItemToAdd);
@@ -2399,7 +2399,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) {
char *buf = (char *)outapp->pBuffer;
const Item_Struct* item = database.GetItem(itemID);
const EQEmu::Item_Struct* item = database.GetItem(itemID);
if(!item) {
safe_delete(outapp);
@@ -2495,7 +2495,7 @@ void Client::ShowBuyLines(const EQApplicationPacket *app) {
char *Buf = (char *)outapp->pBuffer;
const Item_Struct* item = database.GetItem(ItemID);
const EQEmu::Item_Struct* item = database.GetItem(ItemID);
if(!item) {
safe_delete(outapp);
@@ -2539,7 +2539,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
/*uint32 BuyerID2 =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused
/*uint32 Unknown3 =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused
const Item_Struct *item = database.GetItem(ItemID);
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
if(!item || !Quantity || !Price || !QtyBuyerWants) return;
@@ -2930,7 +2930,7 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) {
/*uint32 UnknownZ =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused
uint32 ItemCount = VARSTRUCT_DECODE_TYPE(uint32, Buf);
const Item_Struct *item = database.GetItem(ItemID);
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
if(!item) return;
@@ -2994,7 +2994,7 @@ void Client::BuyerItemSearch(const EQApplicationPacket *app) {
BuyerItemSearchResults_Struct* bisr = (BuyerItemSearchResults_Struct*)outapp->pBuffer;
const Item_Struct* item = 0;
const EQEmu::Item_Struct* item = 0;
int Count=0;
+1 -1
View File
@@ -630,7 +630,7 @@ int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage)
if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass())
{
ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr );
ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const EQEmu::Item_Struct*) nullptr );
min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus;
+1 -1
View File
@@ -266,7 +266,7 @@ bool Zone::LoadZoneObjects() {
}
// Load child objects if container
if (inst && inst->IsType(ItemClassContainer)) {
if (inst && inst->IsType(EQEmu::item::ItemClassBag)) {
database.LoadWorldContainer(id, inst);
}
+6 -6
View File
@@ -496,7 +496,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container)
aug[5] = (uint32)atoi(row[8]);
ItemInst* inst = database.CreateItem(item_id, charges);
if (inst && inst->GetItem()->ItemClass == ItemClassCommon) {
if (inst && inst->GetItem()->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++)
if (aug[i])
inst->PutAugment(&database, i, aug[i]);
@@ -529,7 +529,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It
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 };
if (inst->IsType(ItemClassCommon)) {
if (inst->IsType(EQEmu::item::ItemClassCommon)) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
ItemInst *auginst=inst->GetAugment(i);
augslot[i]=(auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
@@ -629,7 +629,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) {
int Charges = atoi(row[3]);
int Cost = atoi(row[4]);
const Item_Struct *item = database.GetItem(ItemID);
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
if(!item) {
Log.Out(Logs::Detail, Logs::Trading, "Unable to create item\n");
@@ -684,7 +684,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg
Log.Out(Logs::Detail, Logs::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice);
const Item_Struct *item = database.GetItem(ItemID);
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
if(!item)
return;
@@ -1197,7 +1197,7 @@ bool ZoneDatabase::LoadCharacterBandolier(uint32 character_id, PlayerProfile_Str
i = atoi(row[r]); /* Bandolier ID */ r++;
si = atoi(row[r]); /* Bandolier Slot */ r++;
const Item_Struct* item_data = database.GetItem(atoi(row[r]));
const EQEmu::Item_Struct* item_data = database.GetItem(atoi(row[r]));
if (item_data) {
pp->bandoliers[i].Items[si].ID = item_data->ID; r++;
pp->bandoliers[i].Items[si].Icon = atoi(row[r]); r++; // Must use db value in case an Ornamentation is assigned
@@ -1249,7 +1249,7 @@ bool ZoneDatabase::LoadCharacterPotions(uint32 character_id, PlayerProfile_Struc
for (auto row = results.begin(); row != results.end(); ++row) {
i = atoi(row[0]);
const Item_Struct *item_data = database.GetItem(atoi(row[1]));
const EQEmu::Item_Struct *item_data = database.GetItem(atoi(row[1]));
if (!item_data)
continue;
pp->potionbelt.Items[i].ID = item_data->ID;