mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Rename namespace EQEmu to namespace EQ (so we don't have two similar but different namespaces anymore)
This commit is contained in:
+94
-94
@@ -50,7 +50,7 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
|
||||
_baseFR = d->FR;
|
||||
_basePR = d->PR;
|
||||
_baseCorrup = d->Corrup;
|
||||
_OwnerClientVersion = static_cast<unsigned int>(EQEmu::versions::ClientVersion::Titanium);
|
||||
_OwnerClientVersion = static_cast<unsigned int>(EQ::versions::ClientVersion::Titanium);
|
||||
RestRegenHP = 0;
|
||||
RestRegenMana = 0;
|
||||
RestRegenEndurance = 0;
|
||||
@@ -66,15 +66,15 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
|
||||
memset(equipment, 0, sizeof(equipment));
|
||||
|
||||
SetMercID(0);
|
||||
SetStance(EQEmu::constants::stanceBalanced);
|
||||
SetStance(EQ::constants::stanceBalanced);
|
||||
rest_timer.Disable();
|
||||
|
||||
if (GetClass() == ROGUE)
|
||||
evade_timer.Start();
|
||||
|
||||
int r;
|
||||
for (r = 0; r <= EQEmu::skills::HIGHEST_SKILL; r++) {
|
||||
skills[r] = database.GetSkillCap(GetClass(), (EQEmu::skills::SkillType)r, GetLevel());
|
||||
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
||||
skills[r] = database.GetSkillCap(GetClass(), (EQ::skills::SkillType)r, GetLevel());
|
||||
}
|
||||
|
||||
size = d->size;
|
||||
@@ -217,12 +217,12 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
|
||||
|
||||
unsigned int i;
|
||||
//should not include 21 (SLOT_AMMO)
|
||||
for (i = EQEmu::invslot::BONUS_BEGIN; i <= EQEmu::invslot::BONUS_STAT_END; i++) {
|
||||
if (i == EQEmu::invslot::slotAmmo)
|
||||
for (i = EQ::invslot::BONUS_BEGIN; i <= EQ::invslot::BONUS_STAT_END; i++) {
|
||||
if (i == EQ::invslot::slotAmmo)
|
||||
continue;
|
||||
if (equipment[i] == 0)
|
||||
continue;
|
||||
const EQEmu::ItemData * itm = database.GetItem(equipment[i]);
|
||||
const EQ::ItemData * itm = database.GetItem(equipment[i]);
|
||||
if (itm)
|
||||
AddItemBonuses(itm, newbon);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
|
||||
SetAttackTimer();
|
||||
}
|
||||
|
||||
void Merc::AddItemBonuses(const EQEmu::ItemData *item, StatBonuses* newbon) {
|
||||
void Merc::AddItemBonuses(const EQ::ItemData *item, StatBonuses* newbon) {
|
||||
|
||||
if(GetLevel() < item->ReqLevel)
|
||||
{
|
||||
@@ -453,11 +453,11 @@ void Merc::AddItemBonuses(const EQEmu::ItemData *item, StatBonuses* newbon) {
|
||||
else
|
||||
newbon->DSMitigation += item->DSMitigation;
|
||||
}
|
||||
if (item->Worn.Effect>0 && (item->Worn.Type == EQEmu::item::ItemEffectWorn)) { // latent effects
|
||||
if (item->Worn.Effect>0 && (item->Worn.Type == EQ::item::ItemEffectWorn)) { // latent effects
|
||||
ApplySpellsBonuses(item->Worn.Effect, item->Worn.Level, newbon, 0, item->Worn.Type);
|
||||
}
|
||||
|
||||
if (item->Focus.Effect>0 && (item->Focus.Type == EQEmu::item::ItemEffectFocus)) { // focus effects
|
||||
if (item->Focus.Effect>0 && (item->Focus.Type == EQ::item::ItemEffectFocus)) { // focus effects
|
||||
ApplySpellsBonuses(item->Focus.Effect, item->Focus.Level, newbon, 0);
|
||||
}
|
||||
|
||||
@@ -509,7 +509,7 @@ void Merc::AddItemBonuses(const EQEmu::ItemData *item, StatBonuses* newbon) {
|
||||
}
|
||||
}
|
||||
|
||||
if (item->SkillModValue != 0 && item->SkillModType <= EQEmu::skills::HIGHEST_SKILL){
|
||||
if (item->SkillModValue != 0 && item->SkillModType <= EQ::skills::HIGHEST_SKILL){
|
||||
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
||||
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue))
|
||||
{
|
||||
@@ -563,7 +563,7 @@ void Merc::AddItemBonuses(const EQEmu::ItemData *item, StatBonuses* newbon) {
|
||||
}
|
||||
}
|
||||
|
||||
if (item->ExtraDmgSkill != 0 && item->ExtraDmgSkill <= EQEmu::skills::HIGHEST_SKILL) {
|
||||
if (item->ExtraDmgSkill != 0 && item->ExtraDmgSkill <= EQ::skills::HIGHEST_SKILL) {
|
||||
if((newbon->SkillDamageAmount[item->ExtraDmgSkill] + item->ExtraDmgAmt) > RuleI(Character, ItemExtraDmgCap))
|
||||
newbon->SkillDamageAmount[item->ExtraDmgSkill] = RuleI(Character, ItemExtraDmgCap);
|
||||
else
|
||||
@@ -928,8 +928,8 @@ int32 Merc::CalcBaseManaRegen()
|
||||
int32 regen = 0;
|
||||
if (IsSitting())
|
||||
{
|
||||
if (HasSkill(EQEmu::skills::SkillMeditate))
|
||||
regen = (((GetSkill(EQEmu::skills::SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
|
||||
if (HasSkill(EQ::skills::SkillMeditate))
|
||||
regen = (((GetSkill(EQ::skills::SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
|
||||
else
|
||||
regen = 2;
|
||||
}
|
||||
@@ -945,9 +945,9 @@ int32 Merc::CalcManaRegen()
|
||||
if (IsSitting())
|
||||
{
|
||||
BuffFadeBySitModifier();
|
||||
if (HasSkill(EQEmu::skills::SkillMeditate)) {
|
||||
if (HasSkill(EQ::skills::SkillMeditate)) {
|
||||
this->_medding = true;
|
||||
regen = ((GetSkill(EQEmu::skills::SkillMeditate) / 10) + mana_regen);
|
||||
regen = ((GetSkill(EQ::skills::SkillMeditate) / 10) + mana_regen);
|
||||
regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
|
||||
}
|
||||
else
|
||||
@@ -1015,7 +1015,7 @@ int32 Merc::CalcBaseEndurance()
|
||||
int32 sta_end = 0;
|
||||
int Stats = 0;
|
||||
|
||||
if (GetClientVersion() >= static_cast<unsigned int>(EQEmu::versions::ClientVersion::SoD) && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
|
||||
if (GetClientVersion() >= static_cast<unsigned int>(EQ::versions::ClientVersion::SoD) && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
|
||||
int HeroicStats = 0;
|
||||
|
||||
Stats = ((GetSTR() + GetSTA() + GetDEX() + GetAGI()) / 4);
|
||||
@@ -1175,16 +1175,16 @@ void Merc::CalcRestState() {
|
||||
RestRegenEndurance = 6 * (GetMaxEndurance() / zone->newzone_data.FastRegenEndurance);
|
||||
}
|
||||
|
||||
bool Merc::HasSkill(EQEmu::skills::SkillType skill_id) const {
|
||||
bool Merc::HasSkill(EQ::skills::SkillType skill_id) const {
|
||||
return((GetSkill(skill_id) > 0) && CanHaveSkill(skill_id));
|
||||
}
|
||||
|
||||
bool Merc::CanHaveSkill(EQEmu::skills::SkillType skill_id) const {
|
||||
bool Merc::CanHaveSkill(EQ::skills::SkillType skill_id) const {
|
||||
return(database.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)) > 0);
|
||||
//if you don't have it by max level, then odds are you never will?
|
||||
}
|
||||
|
||||
uint16 Merc::MaxSkill(EQEmu::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
||||
uint16 Merc::MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
||||
return(database.GetSkillCap(class_, skillid, level));
|
||||
}
|
||||
|
||||
@@ -1207,7 +1207,7 @@ void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
ns->spawn.show_name = true;
|
||||
|
||||
UpdateActiveLight();
|
||||
ns->spawn.light = m_Light.Type[EQEmu::lightsource::LightActive];
|
||||
ns->spawn.light = m_Light.Type[EQ::lightsource::LightActive];
|
||||
|
||||
/*
|
||||
// Wear Slots are not setup for Mercs yet
|
||||
@@ -1518,12 +1518,12 @@ void Merc::AI_Process() {
|
||||
// Hate redux actions
|
||||
if (evade_timer.Check(false)) {
|
||||
// Attempt to evade
|
||||
int timer_duration = (HideReuseTime - GetSkillReuseTime(EQEmu::skills::SkillHide)) * 1000;
|
||||
int timer_duration = (HideReuseTime - GetSkillReuseTime(EQ::skills::SkillHide)) * 1000;
|
||||
if (timer_duration < 0)
|
||||
timer_duration = 0;
|
||||
evade_timer.Start(timer_duration);
|
||||
|
||||
if (zone->random.Int(0, 260) < (int)GetSkill(EQEmu::skills::SkillHide))
|
||||
if (zone->random.Int(0, 260) < (int)GetSkill(EQ::skills::SkillHide))
|
||||
RogueEvade(GetTarget());
|
||||
|
||||
return;
|
||||
@@ -1590,24 +1590,24 @@ void Merc::AI_Process() {
|
||||
//try main hand first
|
||||
if(attack_timer.Check())
|
||||
{
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary);
|
||||
Attack(GetTarget(), EQ::invslot::slotPrimary);
|
||||
|
||||
bool tripleSuccess = false;
|
||||
|
||||
if(GetOwner() && GetTarget() && CanThisClassDoubleAttack())
|
||||
{
|
||||
if(GetOwner()) {
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, true);
|
||||
Attack(GetTarget(), EQ::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE)) {
|
||||
tripleSuccess = true;
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, true);
|
||||
Attack(GetTarget(), EQ::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
//quad attack, does this belong here??
|
||||
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_QUAD)) {
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, true);
|
||||
Attack(GetTarget(), EQ::invslot::slotPrimary, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1619,8 +1619,8 @@ void Merc::AI_Process() {
|
||||
if(zone->random.Roll(flurrychance))
|
||||
{
|
||||
MessageString(Chat::NPCFlurry, YOU_FLURRY);
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, false);
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, false);
|
||||
Attack(GetTarget(), EQ::invslot::slotPrimary, false);
|
||||
Attack(GetTarget(), EQ::invslot::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1629,7 +1629,7 @@ void Merc::AI_Process() {
|
||||
if (GetTarget() && ExtraAttackChanceBonus) {
|
||||
if(zone->random.Roll(ExtraAttackChanceBonus))
|
||||
{
|
||||
Attack(GetTarget(), EQEmu::invslot::slotPrimary, false);
|
||||
Attack(GetTarget(), EQ::invslot::slotPrimary, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1653,23 +1653,23 @@ void Merc::AI_Process() {
|
||||
bool bIsFist = true;
|
||||
|
||||
// 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)))
|
||||
if (bIsFist || ((weapontype != EQ::item::ItemType2HSlash) && (weapontype != EQ::item::ItemType2HPiercing) && (weapontype != EQ::item::ItemType2HBlunt)))
|
||||
{
|
||||
float DualWieldProbability = 0.0f;
|
||||
|
||||
int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
|
||||
DualWieldProbability = (GetSkill(EQEmu::skills::SkillDualWield) + GetLevel() + Ambidexterity) / 400.0f; // 78.0 max
|
||||
DualWieldProbability = (GetSkill(EQ::skills::SkillDualWield) + GetLevel() + Ambidexterity) / 400.0f; // 78.0 max
|
||||
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
||||
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
||||
|
||||
// Max 78% of DW
|
||||
if (zone->random.Roll(DualWieldProbability))
|
||||
{
|
||||
Attack(GetTarget(), EQEmu::invslot::slotSecondary); // Single attack with offhand
|
||||
Attack(GetTarget(), EQ::invslot::slotSecondary); // Single attack with offhand
|
||||
|
||||
if(CanThisClassDoubleAttack()) {
|
||||
if(GetTarget() && GetTarget()->GetHP() > -10)
|
||||
Attack(GetTarget(), EQEmu::invslot::slotSecondary); // Single attack with offhand
|
||||
Attack(GetTarget(), EQ::invslot::slotSecondary); // Single attack with offhand
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1993,7 +1993,7 @@ bool Merc::AIDoSpellCast(uint16 spellid, Mob* tar, int32 mana_cost, uint32* oDon
|
||||
SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0);
|
||||
SetMoving(false);
|
||||
|
||||
result = CastSpell(spellid, tar->GetID(), EQEmu::spells::CastingSlot::Gem2, -1, mana_cost, oDontDoAgainBefore, -1, -1, 0, 0);
|
||||
result = CastSpell(spellid, tar->GetID(), EQ::spells::CastingSlot::Gem2, -1, mana_cost, oDontDoAgainBefore, -1, -1, 0, 0);
|
||||
|
||||
if(IsCasting() && IsSitting())
|
||||
Stand();
|
||||
@@ -2348,7 +2348,7 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spells[selectedMercSpell.spellid].skill == EQEmu::skills::SkillBackstab && spells[selectedMercSpell.spellid].targettype == ST_Self) {
|
||||
if (spells[selectedMercSpell.spellid].skill == EQ::skills::SkillBackstab && spells[selectedMercSpell.spellid].targettype == ST_Self) {
|
||||
if(!hidden) {
|
||||
continue;
|
||||
}
|
||||
@@ -2577,15 +2577,15 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) {
|
||||
//Check if item focus effect exists for the client.
|
||||
if (itembonuses.FocusEffects[type]){
|
||||
|
||||
const EQEmu::ItemData* TempItem = nullptr;
|
||||
const EQEmu::ItemData* UsedItem = nullptr;
|
||||
const EQ::ItemData* TempItem = nullptr;
|
||||
const EQ::ItemData* UsedItem = nullptr;
|
||||
uint16 UsedFocusID = 0;
|
||||
int16 Total = 0;
|
||||
int16 focus_max = 0;
|
||||
int16 focus_max_real = 0;
|
||||
|
||||
//item focus
|
||||
for (int x = EQEmu::invslot::EQUIPMENT_BEGIN; x <= EQEmu::invslot::EQUIPMENT_END; ++x)
|
||||
for (int x = EQ::invslot::EQUIPMENT_BEGIN; x <= EQ::invslot::EQUIPMENT_END; ++x)
|
||||
{
|
||||
TempItem = nullptr;
|
||||
if (equipment[x] == 0)
|
||||
@@ -3669,13 +3669,13 @@ MercSpell Merc::GetBestMercSpellForAENuke(Merc* caster, Mob* tar) {
|
||||
|
||||
switch(caster->GetStance())
|
||||
{
|
||||
case EQEmu::constants::stanceBurnAE:
|
||||
case EQ::constants::stanceBurnAE:
|
||||
initialCastChance = 50;
|
||||
break;
|
||||
case EQEmu::constants::stanceBalanced:
|
||||
case EQ::constants::stanceBalanced:
|
||||
initialCastChance = 25;
|
||||
break;
|
||||
case EQEmu::constants::stanceBurn:
|
||||
case EQ::constants::stanceBurn:
|
||||
initialCastChance = 0;
|
||||
break;
|
||||
}
|
||||
@@ -3717,11 +3717,11 @@ MercSpell Merc::GetBestMercSpellForTargetedAENuke(Merc* caster, Mob* tar) {
|
||||
|
||||
switch(caster->GetStance())
|
||||
{
|
||||
case EQEmu::constants::stanceBurnAE:
|
||||
case EQ::constants::stanceBurnAE:
|
||||
numTargetsCheck = 1;
|
||||
break;
|
||||
case EQEmu::constants::stanceBalanced:
|
||||
case EQEmu::constants::stanceBurn:
|
||||
case EQ::constants::stanceBalanced:
|
||||
case EQ::constants::stanceBurn:
|
||||
numTargetsCheck = 2;
|
||||
break;
|
||||
}
|
||||
@@ -3769,11 +3769,11 @@ MercSpell Merc::GetBestMercSpellForPBAENuke(Merc* caster, Mob* tar) {
|
||||
|
||||
switch(caster->GetStance())
|
||||
{
|
||||
case EQEmu::constants::stanceBurnAE:
|
||||
case EQ::constants::stanceBurnAE:
|
||||
numTargetsCheck = 2;
|
||||
break;
|
||||
case EQEmu::constants::stanceBalanced:
|
||||
case EQEmu::constants::stanceBurn:
|
||||
case EQ::constants::stanceBalanced:
|
||||
case EQ::constants::stanceBurn:
|
||||
numTargetsCheck = 3;
|
||||
break;
|
||||
}
|
||||
@@ -3820,11 +3820,11 @@ MercSpell Merc::GetBestMercSpellForAERainNuke(Merc* caster, Mob* tar) {
|
||||
|
||||
switch(caster->GetStance())
|
||||
{
|
||||
case EQEmu::constants::stanceBurnAE:
|
||||
case EQ::constants::stanceBurnAE:
|
||||
numTargetsCheck = 1;
|
||||
break;
|
||||
case EQEmu::constants::stanceBalanced:
|
||||
case EQEmu::constants::stanceBurn:
|
||||
case EQ::constants::stanceBalanced:
|
||||
case EQ::constants::stanceBurn:
|
||||
numTargetsCheck = 2;
|
||||
break;
|
||||
}
|
||||
@@ -4045,7 +4045,7 @@ bool Merc::UseDiscipline(int32 spell_id, int32 target) {
|
||||
if(IsCasting())
|
||||
InterruptSpell();
|
||||
|
||||
CastSpell(spell_id, target, EQEmu::spells::CastingSlot::Discipline);
|
||||
CastSpell(spell_id, target, EQ::spells::CastingSlot::Discipline);
|
||||
|
||||
return(true);
|
||||
}
|
||||
@@ -4461,25 +4461,25 @@ void Merc::DoClassAttacks(Mob *target) {
|
||||
if(zone->random.Int(0, 100) > 25) //tested on live, warrior mobs both kick and bash, kick about 75% of the time, casting doesn't seem to make a difference.
|
||||
{
|
||||
DoAnim(animKick, 0, false);
|
||||
int32 dmg = GetBaseSkillDamage(EQEmu::skills::SkillKick);
|
||||
int32 dmg = GetBaseSkillDamage(EQ::skills::SkillKick);
|
||||
|
||||
if (GetWeaponDamage(target, (const EQEmu::ItemData*)nullptr) <= 0)
|
||||
if (GetWeaponDamage(target, (const EQ::ItemData*)nullptr) <= 0)
|
||||
dmg = DMG_INVULNERABLE;
|
||||
|
||||
reuse = KickReuseTime * 1000;
|
||||
DoSpecialAttackDamage(target, EQEmu::skills::SkillKick, dmg, 1, -1, reuse);
|
||||
DoSpecialAttackDamage(target, EQ::skills::SkillKick, dmg, 1, -1, reuse);
|
||||
did_attack = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DoAnim(animTailRake, 0, false);
|
||||
int32 dmg = GetBaseSkillDamage(EQEmu::skills::SkillBash);
|
||||
int32 dmg = GetBaseSkillDamage(EQ::skills::SkillBash);
|
||||
|
||||
if (GetWeaponDamage(target, (const EQEmu::ItemData*)nullptr) <= 0)
|
||||
if (GetWeaponDamage(target, (const EQ::ItemData*)nullptr) <= 0)
|
||||
dmg = DMG_INVULNERABLE;
|
||||
|
||||
reuse = BashReuseTime * 1000;
|
||||
DoSpecialAttackDamage(target, EQEmu::skills::SkillBash, dmg, 1, -1, reuse);
|
||||
DoSpecialAttackDamage(target, EQ::skills::SkillBash, dmg, 1, -1, reuse);
|
||||
did_attack = true;
|
||||
}
|
||||
}
|
||||
@@ -4501,7 +4501,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo
|
||||
return NPC::Attack(other, Hand, bRiposte, IsStrikethrough, IsFromSpell, opts);
|
||||
}
|
||||
|
||||
void Merc::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special)
|
||||
void Merc::Damage(Mob* other, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special)
|
||||
{
|
||||
if(IsDead() || IsCorpse())
|
||||
return;
|
||||
@@ -4542,7 +4542,7 @@ Mob* Merc::GetOwnerOrSelf() {
|
||||
return Result;
|
||||
}
|
||||
|
||||
bool Merc::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::SkillType attack_skill)
|
||||
bool Merc::Death(Mob* killerMob, int32 damage, uint16 spell, EQ::skills::SkillType attack_skill)
|
||||
{
|
||||
if(!NPC::Death(killerMob, damage, spell, attack_skill))
|
||||
{
|
||||
@@ -5062,12 +5062,12 @@ void Merc::ScaleStats(int scalepercent, bool setmax) {
|
||||
void Merc::UpdateMercAppearance() {
|
||||
// Copied from Bot Code:
|
||||
uint32 itemID = 0;
|
||||
uint8 materialFromSlot = EQEmu::textures::materialInvalid;
|
||||
for (int i = EQEmu::invslot::EQUIPMENT_BEGIN; i <= EQEmu::invslot::EQUIPMENT_END; ++i) {
|
||||
uint8 materialFromSlot = EQ::textures::materialInvalid;
|
||||
for (int i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invslot::EQUIPMENT_END; ++i) {
|
||||
itemID = equipment[i];
|
||||
if(itemID != 0) {
|
||||
materialFromSlot = EQEmu::InventoryProfile::CalcMaterialFromSlot(i);
|
||||
if (materialFromSlot != EQEmu::textures::materialInvalid)
|
||||
materialFromSlot = EQ::InventoryProfile::CalcMaterialFromSlot(i);
|
||||
if (materialFromSlot != EQ::textures::materialInvalid)
|
||||
this->SendWearChange(materialFromSlot);
|
||||
}
|
||||
}
|
||||
@@ -5078,18 +5078,18 @@ void Merc::UpdateMercAppearance() {
|
||||
|
||||
void Merc::UpdateEquipmentLight()
|
||||
{
|
||||
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
|
||||
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
|
||||
m_Light.Type[EQ::lightsource::LightEquipment] = 0;
|
||||
m_Light.Level[EQ::lightsource::LightEquipment] = 0;
|
||||
|
||||
for (int index = EQEmu::invslot::EQUIPMENT_BEGIN; index <= EQEmu::invslot::EQUIPMENT_END; ++index) {
|
||||
if (index == EQEmu::invslot::slotAmmo) { continue; }
|
||||
for (int index = EQ::invslot::EQUIPMENT_BEGIN; index <= EQ::invslot::EQUIPMENT_END; ++index) {
|
||||
if (index == EQ::invslot::slotAmmo) { continue; }
|
||||
|
||||
auto item = database.GetItem(equipment[index]);
|
||||
if (item == nullptr) { continue; }
|
||||
|
||||
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]);
|
||||
if (EQ::lightsource::IsLevelGreater(item->Light, m_Light.Type[EQ::lightsource::LightEquipment])) {
|
||||
m_Light.Type[EQ::lightsource::LightEquipment] = item->Light;
|
||||
m_Light.Level[EQ::lightsource::LightEquipment] = EQ::lightsource::TypeToLevel(m_Light.Type[EQ::lightsource::LightEquipment]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5101,14 +5101,14 @@ void Merc::UpdateEquipmentLight()
|
||||
if (!item->IsClassCommon()) { continue; }
|
||||
if (item->Light < 9 || item->Light > 13) { continue; }
|
||||
|
||||
if (EQEmu::lightsource::TypeToLevel(item->Light))
|
||||
if (EQ::lightsource::TypeToLevel(item->Light))
|
||||
general_light_type = item->Light;
|
||||
}
|
||||
|
||||
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type[EQEmu::lightsource::LightEquipment]))
|
||||
m_Light.Type[EQEmu::lightsource::LightEquipment] = general_light_type;
|
||||
if (EQ::lightsource::IsLevelGreater(general_light_type, m_Light.Type[EQ::lightsource::LightEquipment]))
|
||||
m_Light.Type[EQ::lightsource::LightEquipment] = general_light_type;
|
||||
|
||||
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
|
||||
m_Light.Level[EQ::lightsource::LightEquipment] = EQ::lightsource::TypeToLevel(m_Light.Type[EQ::lightsource::LightEquipment]);
|
||||
}
|
||||
|
||||
void Merc::AddItem(uint8 slot, uint32 item_id) {
|
||||
@@ -5164,109 +5164,109 @@ void Client::SendMercResponsePackets(uint32 ResponseType)
|
||||
SendMercMerchantResponsePacket(6);
|
||||
break;
|
||||
case 7: //You must dismiss your suspended mercenary before purchasing a new one!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(7);
|
||||
else
|
||||
//You have the maximum number of mercenaries. You must dismiss one before purchasing a new one!
|
||||
SendMercMerchantResponsePacket(6);
|
||||
break;
|
||||
case 8: //You can not purchase a mercenary because your group is full!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(8);
|
||||
else
|
||||
SendMercMerchantResponsePacket(7);
|
||||
break;
|
||||
case 9: //You can not purchase a mercenary because you are in combat!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
//Mercenary failed to spawn!
|
||||
SendMercMerchantResponsePacket(3);
|
||||
else
|
||||
SendMercMerchantResponsePacket(8);
|
||||
break;
|
||||
case 10: //You have recently dismissed a mercenary and must wait a few more seconds before you can purchase a new one!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
//Mercenary failed to spawn!
|
||||
SendMercMerchantResponsePacket(3);
|
||||
else
|
||||
SendMercMerchantResponsePacket(9);
|
||||
break;
|
||||
case 11: //An error occurred created your mercenary!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(9);
|
||||
else
|
||||
SendMercMerchantResponsePacket(10);
|
||||
break;
|
||||
case 12: //Upkeep Charge Message
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(10);
|
||||
else
|
||||
SendMercMerchantResponsePacket(11);
|
||||
break;
|
||||
case 13: // ???
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(11);
|
||||
else
|
||||
SendMercMerchantResponsePacket(12);
|
||||
break;
|
||||
case 14: //You ran out of funds to pay for your mercenary!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(12);
|
||||
else
|
||||
SendMercMerchantResponsePacket(13);
|
||||
break;
|
||||
case 15: // ???
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(13);
|
||||
else
|
||||
SendMercMerchantResponsePacket(14);
|
||||
break;
|
||||
case 16: //Your mercenary is about to be suspended due to insufficient funds!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(14);
|
||||
else
|
||||
SendMercMerchantResponsePacket(15);
|
||||
break;
|
||||
case 17: //There is no mercenary liaison nearby!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(15);
|
||||
else
|
||||
SendMercMerchantResponsePacket(16);
|
||||
break;
|
||||
case 18: //You are too far from the liaison!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(16);
|
||||
else
|
||||
SendMercMerchantResponsePacket(17);
|
||||
break;
|
||||
case 19: //You do not meet the requirements for that mercenary!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
SendMercMerchantResponsePacket(17);
|
||||
else
|
||||
SendMercMerchantResponsePacket(18);
|
||||
break;
|
||||
case 20: //You are unable to interact with the liaison!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
//You are too far from the liaison!
|
||||
SendMercMerchantResponsePacket(16);
|
||||
else
|
||||
SendMercMerchantResponsePacket(19);
|
||||
break;
|
||||
case 21: //You do not have a high enough membership level to purchase this mercenary!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
//You do not meet the requirements for that mercenary!
|
||||
SendMercMerchantResponsePacket(17);
|
||||
else
|
||||
SendMercMerchantResponsePacket(20);
|
||||
break;
|
||||
case 22: //Your purchase has failed because this mercenary requires a Gold membership!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
//You do not meet the requirements for that mercenary!
|
||||
SendMercMerchantResponsePacket(17);
|
||||
else
|
||||
SendMercMerchantResponsePacket(21);
|
||||
break;
|
||||
case 23: //Your purchase has failed because this mercenary requires at least a Silver membership!
|
||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF)
|
||||
//You do not meet the requirements for that mercenary!
|
||||
SendMercMerchantResponsePacket(17);
|
||||
else
|
||||
@@ -5649,7 +5649,7 @@ void Client::SpawnMerc(Merc* merc, bool setMaxStats) {
|
||||
merc->SetSuspended(false);
|
||||
SetMerc(merc);
|
||||
merc->Unsuspend(setMaxStats);
|
||||
merc->SetStance((EQEmu::constants::StanceType)GetMercInfo().Stance);
|
||||
merc->SetStance((EQ::constants::StanceType)GetMercInfo().Stance);
|
||||
|
||||
Log(Logs::General, Logs::Mercenaries, "SpawnMerc Success for %s.", GetName());
|
||||
|
||||
@@ -6106,7 +6106,7 @@ void Client::UpdateMercLevel() {
|
||||
|
||||
void Client::SendMercMerchantResponsePacket(int32 response_type) {
|
||||
// This response packet brings up the Mercenary Manager window
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
|
||||
if (ClientVersion() >= EQ::versions::ClientVersion::SoD)
|
||||
{
|
||||
auto outapp = new EQApplicationPacket(OP_MercenaryHire, sizeof(MercenaryMerchantResponse_Struct));
|
||||
MercenaryMerchantResponse_Struct* mmr = (MercenaryMerchantResponse_Struct*)outapp->pBuffer;
|
||||
|
||||
Reference in New Issue
Block a user