Renamed and moved SkillUseTypes enumeration to EQEmu::skills::SkillType; eq_dictionary work

This commit is contained in:
Uleat
2016-05-25 18:50:26 -04:00
parent 615158e701
commit 71f128731f
86 changed files with 4987 additions and 3074 deletions
+89 -89
View File
@@ -50,7 +50,7 @@ extern WorldServer worldserver;
extern EntityList entity_list;
extern Zone* zone;
bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* weapon)
bool Mob::AttackAnimation(EQEmu::skills::SkillType &skillinuse, int Hand, const ItemInst* weapon)
{
// Determine animation
int type = 0;
@@ -61,63 +61,63 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
switch (item->ItemType) {
case EQEmu::item::ItemType1HSlash: // 1H Slashing
skillinuse = Skill1HSlashing;
skillinuse = EQEmu::skills::Skill1HSlashing;
type = anim1HWeapon;
break;
case EQEmu::item::ItemType2HSlash: // 2H Slashing
skillinuse = Skill2HSlashing;
skillinuse = EQEmu::skills::Skill2HSlashing;
type = anim2HSlashing;
break;
case EQEmu::item::ItemType1HPiercing: // Piercing
skillinuse = Skill1HPiercing;
skillinuse = EQEmu::skills::Skill1HPiercing;
type = anim1HPiercing;
break;
case EQEmu::item::ItemType1HBlunt: // 1H Blunt
skillinuse = Skill1HBlunt;
skillinuse = EQEmu::skills::Skill1HBlunt;
type = anim1HWeapon;
break;
case EQEmu::item::ItemType2HBlunt: // 2H Blunt
skillinuse = Skill2HBlunt;
skillinuse = EQEmu::skills::Skill2HBlunt;
type = anim2HSlashing; //anim2HWeapon
break;
case EQEmu::item::ItemType2HPiercing: // 2H Piercing
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
skillinuse = Skill1HPiercing;
skillinuse = EQEmu::skills::Skill1HPiercing;
else
skillinuse = Skill2HPiercing;
skillinuse = EQEmu::skills::Skill2HPiercing;
type = anim2HWeapon;
break;
case EQEmu::item::ItemTypeMartial:
skillinuse = SkillHandtoHand;
skillinuse = EQEmu::skills::SkillHandtoHand;
type = animHand2Hand;
break;
default:
skillinuse = SkillHandtoHand;
skillinuse = EQEmu::skills::SkillHandtoHand;
type = animHand2Hand;
break;
}// switch
}
else if(IsNPC()) {
switch (skillinuse) {
case Skill1HSlashing: // 1H Slashing
case EQEmu::skills::Skill1HSlashing: // 1H Slashing
type = anim1HWeapon;
break;
case Skill2HSlashing: // 2H Slashing
case EQEmu::skills::Skill2HSlashing: // 2H Slashing
type = anim2HSlashing;
break;
case Skill1HPiercing: // Piercing
case EQEmu::skills::Skill1HPiercing: // Piercing
type = anim1HPiercing;
break;
case Skill1HBlunt: // 1H Blunt
case EQEmu::skills::Skill1HBlunt: // 1H Blunt
type = anim1HWeapon;
break;
case Skill2HBlunt: // 2H Blunt
case EQEmu::skills::Skill2HBlunt: // 2H Blunt
type = anim2HSlashing; //anim2HWeapon
break;
case Skill2HPiercing: // 2H Piercing
case EQEmu::skills::Skill2HPiercing: // 2H Piercing
type = anim2HWeapon;
break;
case SkillHandtoHand:
case EQEmu::skills::SkillHandtoHand:
type = animHand2Hand;
break;
default:
@@ -126,7 +126,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
}// switch
}
else {
skillinuse = SkillHandtoHand;
skillinuse = EQEmu::skills::SkillHandtoHand;
type = animHand2Hand;
}
@@ -140,7 +140,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
// called when a mob is attacked, does the checks to see if it's a hit
// and does other mitigation checks. 'this' is the mob being attacked.
bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 chance_mod)
bool Mob::CheckHitChance(Mob* other, EQEmu::skills::SkillType skillinuse, int Hand, int16 chance_mod)
{
/*/
//Reworked a lot of this code to achieve better balance at higher levels.
@@ -218,7 +218,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
if(defender->IsClient())
{
chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense)));
chancetohit += (RuleR(Combat, WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(EQEmu::skills::SkillDefense) - defender->GetSkill(EQEmu::skills::SkillDefense)));
Log.Out(Logs::Detail, Logs::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit);
}
@@ -254,15 +254,15 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
hitBonus += attacker->itembonuses.HitChanceEffect[skillinuse] +
attacker->spellbonuses.HitChanceEffect[skillinuse]+
attacker->aabonuses.HitChanceEffect[skillinuse]+
attacker->itembonuses.HitChanceEffect[HIGHEST_SKILL+1] +
attacker->spellbonuses.HitChanceEffect[HIGHEST_SKILL+1] +
attacker->aabonuses.HitChanceEffect[HIGHEST_SKILL+1];
attacker->itembonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] +
attacker->spellbonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] +
attacker->aabonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1];
//Accuracy = Spell Effect , HitChance = 'Accuracy' from Item Effect
//Only AA derived accuracy can be skill limited. ie (Precision of the Pathfinder, Dead Aim)
hitBonus += (attacker->itembonuses.Accuracy[HIGHEST_SKILL+1] +
attacker->spellbonuses.Accuracy[HIGHEST_SKILL+1] +
attacker->aabonuses.Accuracy[HIGHEST_SKILL+1] +
hitBonus += (attacker->itembonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] +
attacker->spellbonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] +
attacker->aabonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] +
attacker->aabonuses.Accuracy[skillinuse] +
attacker->itembonuses.HitChance) / 15.0f; //Item Mod 'Accuracy'
@@ -271,7 +271,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
if(attacker->IsNPC())
hitBonus += (attacker->CastToNPC()->GetAccuracyRating() / 10.0f); //Modifier from database
if(skillinuse == SkillArchery)
if (skillinuse == EQEmu::skills::SkillArchery)
hitBonus -= hitBonus*RuleR(Combat, ArcheryHitPenalty);
//Calculate final chance to hit
@@ -382,13 +382,13 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
// Need to check if we have something in MainHand to actually attack with (or fists)
if (hand != EQEmu::legacy::SlotRange && CanThisClassRiposte() && InFront && !ImmuneRipo) {
if (IsClient())
CastToClient()->CheckIncreaseSkill(SkillRiposte, other, -10);
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillRiposte, other, -10);
// check auto discs ... I guess aa/items too :P
if (spellbonuses.RiposteChance == 10000 || aabonuses.RiposteChance == 10000 || itembonuses.RiposteChance == 10000) {
damage = -3;
return true;
}
int chance = GetSkill(SkillRiposte) + 100;
int chance = GetSkill(EQEmu::skills::SkillRiposte) + 100;
chance += (chance * (aabonuses.RiposteChance + spellbonuses.RiposteChance + itembonuses.RiposteChance)) / 100;
chance /= 50;
chance += itembonuses.HeroicDEX / 25; // live has "heroic strickthrough" here to counter
@@ -420,14 +420,14 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
if (CanThisClassBlock() && (InFront || bBlockFromRear)) {
if (IsClient())
CastToClient()->CheckIncreaseSkill(SkillBlock, other, -10);
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillBlock, other, -10);
// check auto discs ... I guess aa/items too :P
if (spellbonuses.IncreaseBlockChance == 10000 || aabonuses.IncreaseBlockChance == 10000 ||
itembonuses.IncreaseBlockChance == 10000) {
damage = -1;
return true;
}
int chance = GetSkill(SkillBlock) + 100;
int chance = GetSkill(EQEmu::skills::SkillBlock) + 100;
chance += (chance * (aabonuses.IncreaseBlockChance + spellbonuses.IncreaseBlockChance + itembonuses.IncreaseBlockChance)) / 100;
chance /= 25;
chance += itembonuses.HeroicDEX / 25; // live has "heroic strickthrough" here to counter
@@ -444,13 +444,13 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
// parry
if (CanThisClassParry() && InFront && hand != EQEmu::legacy::SlotRange) {
if (IsClient())
CastToClient()->CheckIncreaseSkill(SkillParry, other, -10);
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillParry, other, -10);
// check auto discs ... I guess aa/items too :P
if (spellbonuses.ParryChance == 10000 || aabonuses.ParryChance == 10000 || itembonuses.ParryChance == 10000) {
damage = -2;
return true;
}
int chance = GetSkill(SkillParry) + 100;
int chance = GetSkill(EQEmu::skills::SkillParry) + 100;
chance += (chance * (aabonuses.ParryChance + spellbonuses.ParryChance + itembonuses.ParryChance)) / 100;
chance /= 45;
chance += itembonuses.HeroicDEX / 25; // live has "heroic strickthrough" here to counter
@@ -467,13 +467,13 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
// dodge
if (CanThisClassDodge() && (InFront || GetClass() == MONK) ) {
if (IsClient())
CastToClient()->CheckIncreaseSkill(SkillDodge, other, -10);
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillDodge, other, -10);
// check auto discs ... I guess aa/items too :P
if (spellbonuses.DodgeChance == 10000 || aabonuses.DodgeChance == 10000 || itembonuses.DodgeChance == 10000) {
damage = -4;
return true;
}
int chance = GetSkill(SkillDodge) + 100;
int chance = GetSkill(EQEmu::skills::SkillDodge) + 100;
chance += (chance * (aabonuses.DodgeChance + spellbonuses.DodgeChance + itembonuses.DodgeChance)) / 100;
chance /= 45;
chance += itembonuses.HeroicAGI / 25; // live has "heroic strickthrough" here to counter
@@ -525,7 +525,7 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac
spellbonuses.CombatStability) / 100.0f;
if (RuleB(Combat, UseIntervalAC)) {
float softcap = (GetSkill(SkillDefense) + GetLevel()) *
float softcap = (GetSkill(EQEmu::skills::SkillDefense) + GetLevel()) *
RuleR(Combat, SoftcapFactor) * (1.0 + aa_mit);
float mitigation_rating = 0.0;
float attack_rating = 0.0;
@@ -625,17 +625,17 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac
if (GetClass() == WIZARD || GetClass() == MAGICIAN ||
GetClass() == NECROMANCER || GetClass() == ENCHANTER)
mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 4.0) + armor + 1;
mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 4.0) + armor + 1;
else
mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 3.0) + (armor * 1.333333) + 1;
mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 3.0) + (armor * 1.333333) + 1;
mitigation_rating *= 0.847;
mitigation_rating = mod_mitigation_rating(mitigation_rating, attacker);
if (attacker->IsClient())
attack_rating = (attacker->CastToClient()->CalcATK() + ((attacker->GetSTR()-66) * 0.9) + (attacker->GetSkill(SkillOffense)*1.345));
attack_rating = (attacker->CastToClient()->CalcATK() + ((attacker->GetSTR() - 66) * 0.9) + (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345));
else
attack_rating = (attacker->GetATK() + (attacker->GetSkill(SkillOffense)*1.345) + ((attacker->GetSTR()-66) * 0.9));
attack_rating = (attacker->GetATK() + (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345) + ((attacker->GetSTR() - 66) * 0.9));
attack_rating = attacker->mod_attack_rating(attack_rating, this);
@@ -1059,7 +1059,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
// calculate attack_skill and skillinuse depending on hand and weapon
// also send Packet to near clients
SkillUseTypes skillinuse;
EQEmu::skills::SkillType skillinuse;
AttackAnimation(skillinuse, Hand, weapon);
Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse);
@@ -1095,7 +1095,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
max_hit = (RuleI(Combat, HitCapPre20));
CheckIncreaseSkill(skillinuse, other, -15);
CheckIncreaseSkill(SkillOffense, other, -15);
CheckIncreaseSkill(EQEmu::skills::SkillOffense, other, -15);
// ***************************************************************
// *** Calculate the damage bonus, if applicable, for this hit ***
@@ -1236,7 +1236,7 @@ void Mob::Heal()
SendHPUpdate();
}
void Client::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special)
void Client::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special)
{
if(dead || IsCorpse())
return;
@@ -1249,7 +1249,7 @@ void Client::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes att
//Don't do PvP mitigation if the caster is damaging himself
if(other && other->IsClient() && (other != this) && damage > 0) {
int PvPMitigation = 100;
if(attack_skill == SkillArchery)
if (attack_skill == EQEmu::skills::SkillArchery)
PvPMitigation = 80;
else
PvPMitigation = 67;
@@ -1265,11 +1265,11 @@ void Client::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes att
if (damage > 0) {
if (spell_id == SPELL_UNKNOWN)
CheckIncreaseSkill(SkillDefense, other, -15);
CheckIncreaseSkill(EQEmu::skills::SkillDefense, other, -15);
}
}
bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill)
bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::SkillType attack_skill)
{
if(!ClientFinishedLoading())
return false;
@@ -1584,13 +1584,13 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
FaceTarget(GetTarget());
SkillUseTypes skillinuse = SkillHandtoHand;
EQEmu::skills::SkillType skillinuse = EQEmu::skills::SkillHandtoHand;
if (Hand == EQEmu::legacy::SlotPrimary) {
skillinuse = static_cast<SkillUseTypes>(GetPrimSkill());
skillinuse = static_cast<EQEmu::skills::SkillType>(GetPrimSkill());
OffHandAtk(false);
}
if (Hand == EQEmu::legacy::SlotSecondary) {
skillinuse = static_cast<SkillUseTypes>(GetSecSkill());
skillinuse = static_cast<EQEmu::skills::SkillType>(GetSecSkill());
OffHandAtk(true);
}
@@ -1613,32 +1613,32 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
switch(weapon->ItemType) {
case EQEmu::item::ItemType1HSlash:
skillinuse = Skill1HSlashing;
skillinuse = EQEmu::skills::Skill1HSlashing;
break;
case EQEmu::item::ItemType2HSlash:
skillinuse = Skill2HSlashing;
skillinuse = EQEmu::skills::Skill2HSlashing;
break;
case EQEmu::item::ItemType1HPiercing:
skillinuse = Skill1HPiercing;
skillinuse = EQEmu::skills::Skill1HPiercing;
break;
case EQEmu::item::ItemType2HPiercing:
skillinuse = Skill2HPiercing;
skillinuse = EQEmu::skills::Skill2HPiercing;
break;
case EQEmu::item::ItemType1HBlunt:
skillinuse = Skill1HBlunt;
skillinuse = EQEmu::skills::Skill1HBlunt;
break;
case EQEmu::item::ItemType2HBlunt:
skillinuse = Skill2HBlunt;
skillinuse = EQEmu::skills::Skill2HBlunt;
break;
case EQEmu::item::ItemTypeBow:
skillinuse = SkillArchery;
skillinuse = EQEmu::skills::SkillArchery;
break;
case EQEmu::item::ItemTypeLargeThrowing:
case EQEmu::item::ItemTypeSmallThrowing:
skillinuse = SkillThrowing;
skillinuse = EQEmu::skills::SkillThrowing;
break;
default:
skillinuse = SkillHandtoHand;
skillinuse = EQEmu::skills::SkillHandtoHand;
break;
}
}
@@ -1795,7 +1795,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
return false;
}
void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special) {
void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special) {
if(spell_id==0)
spell_id = SPELL_UNKNOWN;
@@ -1838,7 +1838,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack
}
}
bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, SkillUseTypes attack_skill)
bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::SkillType attack_skill)
{
Log.Out(Logs::Detail, Logs::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d",
((killer_mob) ? (killer_mob->GetName()) : ("[nullptr]")), damage, spell, attack_skill);
@@ -2485,7 +2485,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
}
DS -= DS * attacker->itembonuses.DSMitigation / 100;
}
attacker->Damage(this, -DS, spellid, SkillAbjuration/*hackish*/, false);
attacker->Damage(this, -DS, spellid, EQEmu::skills::SkillAbjuration/*hackish*/, false);
//we can assume there is a spell now
auto outapp = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
CombatDamage_Struct* cds = (CombatDamage_Struct*)outapp->pBuffer;
@@ -2512,7 +2512,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
if(rev_ds < 0) {
Log.Out(Logs::Detail, Logs::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName());
attacker->Damage(this, -rev_ds, rev_ds_spell_id, SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this
attacker->Damage(this, -rev_ds, rev_ds_spell_id, EQEmu::skills::SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this
//do we need to send a damage packet here also?
}
}
@@ -2584,7 +2584,7 @@ int Mob::GetHandToHandDamage(void)
{
if (RuleB(Combat, UseRevampHandToHand)) {
// everyone uses this in the revamp!
int skill = GetSkill(SkillHandtoHand);
int skill = GetSkill(EQEmu::skills::SkillHandtoHand);
int epic = 0;
if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 46)
epic = 280;
@@ -2625,7 +2625,7 @@ int Mob::GetHandToHandDelay(void)
{
if (RuleB(Combat, UseRevampHandToHand)) {
// everyone uses this in the revamp!
int skill = GetSkill(SkillHandtoHand);
int skill = GetSkill(EQEmu::skills::SkillHandtoHand);
int epic = 0;
int iksar = 0;
if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 46)
@@ -2968,7 +2968,7 @@ bool Mob::HasRangedProcs() const
bool Client::CheckDoubleAttack()
{
int chance = 0;
int skill = GetSkill(SkillDoubleAttack);
int skill = GetSkill(EQEmu::skills::SkillDoubleAttack);
//Check for bonuses that give you a double attack chance regardless of skill (ie Bestial Frenzy/Harmonious Attack AA)
int bonusGiveDA = aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack;
if (skill > 0)
@@ -2989,7 +2989,7 @@ bool Client::CheckDoubleAttack()
// with varying triple attack skill (1-3% error at least)
bool Client::CheckTripleAttack()
{
int chance = GetSkill(SkillTripleAttack);
int chance = GetSkill(EQEmu::skills::SkillTripleAttack);
if (chance < 1)
return false;
@@ -3013,7 +3013,7 @@ bool Mob::CheckDoubleAttack()
{
// Not 100% certain pets follow this or if it's just from pets not always
// having the same skills as most mobs
int chance = GetSkill(SkillDoubleAttack);
int chance = GetSkill(EQEmu::skills::SkillDoubleAttack);
if (GetLevel() > 35)
chance += GetLevel();
@@ -3024,9 +3024,9 @@ bool Mob::CheckDoubleAttack()
return zone->random.Int(1, 500) <= chance;
}
void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, const SkillUseTypes skill_used, bool &avoidable, const int8 buffslot, const bool iBuffTic, int special) {
void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, const EQEmu::skills::SkillType skill_used, bool &avoidable, const int8 buffslot, const bool iBuffTic, int special) {
// This method is called with skill_used=ABJURE for Damage Shield damage.
bool FromDamageShield = (skill_used == SkillAbjuration);
bool FromDamageShield = (skill_used == EQEmu::skills::SkillAbjuration);
Log.Out(Logs::Detail, Logs::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d",
damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot);
@@ -3041,7 +3041,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
// only apply DS if physical damage (no spell damage)
// damage shield calls this function with spell_id set, so its unavoidable
if (attacker && damage > 0 && spell_id == SPELL_UNKNOWN && skill_used != SkillArchery && skill_used != SkillThrowing) {
if (attacker && damage > 0 && spell_id == SPELL_UNKNOWN && skill_used != EQEmu::skills::SkillArchery && skill_used != EQEmu::skills::SkillThrowing) {
DamageShield(attacker);
}
@@ -3167,7 +3167,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
}
//check stun chances if bashing
if (damage > 0 && ((skill_used == SkillBash || skill_used == SkillKick) && attacker)) {
if (damage > 0 && ((skill_used == EQEmu::skills::SkillBash || skill_used == EQEmu::skills::SkillKick) && attacker)) {
// NPCs can stun with their bash/kick as soon as they receive it.
// Clients can stun mobs under level 56 with their kick when they get level 55 or greater.
// Clients have a chance to stun if the mob is 56+
@@ -3181,15 +3181,15 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
// Less than base immunity
// Client vs. Client always uses the chance
if (!IsClient() && GetLevel() <= RuleI(Spells, BaseImmunityLevel)) {
if (skill_used == SkillBash) // Bash always will
if (skill_used == EQEmu::skills::SkillBash) // Bash always will
stun_chance = 100;
else if (attacker->GetLevel() >= RuleI(Combat, ClientStunLevel))
stun_chance = 100; // only if you're over level 55 and using kick
} else { // higher than base immunity or Client vs. Client
// not sure on this number, use same as NPC for now
if (skill_used == SkillKick && attacker->GetLevel() < RuleI(Combat, ClientStunLevel))
if (skill_used == EQEmu::skills::SkillKick && attacker->GetLevel() < RuleI(Combat, ClientStunLevel))
stun_chance = RuleI(Combat, NPCBashKickStunChance);
else if (skill_used == SkillBash)
else if (skill_used == EQEmu::skills::SkillBash)
stun_chance = RuleI(Combat, NPCBashKickStunChance) +
attacker->spellbonuses.StunBashChance +
attacker->itembonuses.StunBashChance +
@@ -3268,7 +3268,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
a->meleepush_xy = attacker->GetHeading() * 2.0f;
if (RuleB(Combat, MeleePush) && damage > 0 && !IsRooted() &&
(IsClient() || zone->random.Roll(RuleI(Combat, MeleePushChance)))) {
a->force = EQEmu::GetSkillMeleePushForce(skill_used);
a->force = EQEmu::skills::GetSkillMeleePushForce(skill_used);
// update NPC stuff
auto new_pos = glm::vec3(m_Position.x + (a->force * std::sin(a->meleepush_xy) + m_Delta.x),
m_Position.y + (a->force * std::cos(a->meleepush_xy) + m_Delta.y), m_Position.z);
@@ -3868,10 +3868,10 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack
int deadlyChance = 0;
int deadlyMod = 0;
if(skill == SkillArchery && GetClass() == RANGER && GetSkill(SkillArchery) >= 65)
if (skill == EQEmu::skills::SkillArchery && GetClass() == RANGER && GetSkill(EQEmu::skills::SkillArchery) >= 65)
critChance += 6;
if (skill == SkillThrowing && GetClass() == ROGUE && GetSkill(SkillThrowing) >= 65) {
if (skill == EQEmu::skills::SkillThrowing && GetClass() == ROGUE && GetSkill(EQEmu::skills::SkillThrowing) >= 65) {
critChance += RuleI(Combat, RogueCritThrowingChance);
deadlyChance = RuleI(Combat, RogueDeadlyStrikeChance);
deadlyMod = RuleI(Combat, RogueDeadlyStrikeMod);
@@ -3952,7 +3952,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack
}
}
bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse)
bool Mob::TryFinishingBlow(Mob *defender, EQEmu::skills::SkillType skillinuse)
{
if (defender && !defender->IsClient() && defender->GetHPRatio() < 10){
@@ -4024,7 +4024,7 @@ void Mob::DoRiposte(Mob *defender)
if (defender->GetClass() == MONK)
defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]);
else if (defender->IsClient() && defender->CastToClient()->HasSkill((SkillUseTypes)defender->aabonuses.GiveDoubleRiposte[2]))
else if (defender->IsClient() && defender->CastToClient()->HasSkill((EQEmu::skills::SkillType)defender->aabonuses.GiveDoubleRiposte[2]))
defender->CastToClient()->DoClassAttacks(this, defender->aabonuses.GiveDoubleRiposte[2], true);
}
}
@@ -4063,7 +4063,7 @@ bool Mob::HasDied() {
return Result;
}
uint16 Mob::GetDamageTable(SkillUseTypes skillinuse)
uint16 Mob::GetDamageTable(EQEmu::skills::SkillType skillinuse)
{
if(GetLevel() <= 51)
{
@@ -4156,7 +4156,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
ProcMod = static_cast<float>(spells[base_spell_id].base2[i]);
}
else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= HIGHEST_SKILL) {
else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= EQEmu::skills::HIGHEST_SKILL) {
if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) {
float final_chance = chance * (ProcMod / 100.0f);
@@ -4200,7 +4200,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
ProcMod = static_cast<float>(spells[base_spell_id].base2[i]);
}
else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= HIGHEST_SKILL) {
else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= EQEmu::skills::HIGHEST_SKILL) {
if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) {
float final_chance = chance * (ProcMod / 100.0f);
@@ -4261,7 +4261,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
proc_spell_id = base1;
ProcMod = static_cast<float>(base2);
}
else if(effect_id == SE_LimitToSkill && base1 <= HIGHEST_SKILL) {
else if (effect_id == SE_LimitToSkill && base1 <= EQEmu::skills::HIGHEST_SKILL) {
if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) {
float final_chance = chance * (ProcMod / 100.0f);
@@ -4406,7 +4406,7 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type)
return damage;
}
void Mob::CommonOutgoingHitSuccess(Mob* defender, int32 &damage, SkillUseTypes skillInUse, ExtraAttackOptions *opts)
void Mob::CommonOutgoingHitSuccess(Mob* defender, int32 &damage, EQEmu::skills::SkillType skillInUse, ExtraAttackOptions *opts)
{
if (!defender)
return;
@@ -4623,15 +4623,15 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
// extra off hand non-sense, can only double with skill of 150 or above
// or you have any amount of GiveDoubleAttack
if (candouble && hand == EQEmu::legacy::SlotSecondary)
candouble = GetSkill(SkillDoubleAttack) > 149 || (aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack) > 0;
candouble = GetSkill(EQEmu::skills::SkillDoubleAttack) > 149 || (aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack) > 0;
if (candouble) {
CheckIncreaseSkill(SkillDoubleAttack, target, -10);
CheckIncreaseSkill(EQEmu::skills::SkillDoubleAttack, target, -10);
if (CheckDoubleAttack()) {
Attack(target, hand, false, false, IsFromSpell);
// you can only triple from the main hand
if (hand == EQEmu::legacy::SlotPrimary && CanThisClassTripleAttack()) {
CheckIncreaseSkill(SkillTripleAttack, target, -10);
CheckIncreaseSkill(EQEmu::skills::SkillTripleAttack, target, -10);
if (CheckTripleAttack())
Attack(target, hand, false, false, IsFromSpell);
}
@@ -4659,7 +4659,7 @@ bool Mob::CheckDualWield()
{
// Pets /might/ follow a slightly different progression
// although it could all be from pets having different skills than most mobs
int chance = GetSkill(SkillDualWield);
int chance = GetSkill(EQEmu::skills::SkillDualWield);
if (GetLevel() > 35)
chance += GetLevel();
@@ -4673,7 +4673,7 @@ bool Mob::CheckDualWield()
bool Client::CheckDualWield()
{
int chance = GetSkill(SkillDualWield) + GetLevel();
int chance = GetSkill(EQEmu::skills::SkillDualWield) + GetLevel();
chance += aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
int per_inc = spellbonuses.DualWieldChance + aabonuses.DualWieldChance + itembonuses.DualWieldChance;