mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Logs::Combat to LogCombat
This commit is contained in:
parent
3e4587cd57
commit
89bfbe6bd2
127
zone/attack.cpp
127
zone/attack.cpp
@ -393,7 +393,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
|
||||
if (hit.hand != EQEmu::invslot::slotRange && (CanThisClassRiposte() || IsEnraged()) && InFront && !ImmuneRipo) {
|
||||
if (IsEnraged()) {
|
||||
hit.damage_done = DMG_RIPOSTED;
|
||||
Log(Logs::Detail, Logs::Combat, "I am enraged, riposting frontal attack.");
|
||||
LogCombat("I am enraged, riposting frontal attack");
|
||||
return true;
|
||||
}
|
||||
if (IsClient())
|
||||
@ -850,10 +850,10 @@ int Mob::ACSum()
|
||||
auto over_cap = ac - softcap;
|
||||
ac = softcap + (over_cap * returns);
|
||||
}
|
||||
Log(Logs::Detail, Logs::Combat, "ACSum ac %d softcap %d returns %f", ac, softcap, returns);
|
||||
LogCombat("ACSum ac [{}] softcap [{}] returns [{}]", ac, softcap, returns);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::Combat, "ACSum ac %d", ac);
|
||||
LogCombat("ACSum ac [{}]", ac);
|
||||
}
|
||||
return ac;
|
||||
}
|
||||
@ -1313,7 +1313,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts)
|
||||
{
|
||||
if (!other)
|
||||
return;
|
||||
Log(Logs::Detail, Logs::Combat, "%s::DoAttack vs %s base %d min %d offense %d tohit %d skill %d", GetName(),
|
||||
LogCombat("[{}]::DoAttack vs [{}] base [{}] min [{}] offense [{}] tohit [{}] skill [{}]", GetName(),
|
||||
other->GetName(), hit.base_damage, hit.min_damage, hit.offense, hit.tohit, hit.skill);
|
||||
|
||||
// check to see if we hit..
|
||||
@ -1330,7 +1330,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts)
|
||||
//if (IsDead())
|
||||
return;
|
||||
}
|
||||
Log(Logs::Detail, Logs::Combat, "Avoided/strikethrough damage with code %d", hit.damage_done);
|
||||
LogCombat("Avoided/strikethrough damage with code [{}]", hit.damage_done);
|
||||
}
|
||||
|
||||
if (hit.damage_done >= 0) {
|
||||
@ -1354,10 +1354,10 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts)
|
||||
ApplyDamageTable(hit);
|
||||
CommonOutgoingHitSuccess(other, hit, opts);
|
||||
}
|
||||
Log(Logs::Detail, Logs::Combat, "Final damage after all reductions: %d", hit.damage_done);
|
||||
LogCombat("Final damage after all reductions: [{}]", hit.damage_done);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::Combat, "Attack missed. Damage set to 0.");
|
||||
LogCombat("Attack missed. Damage set to 0");
|
||||
hit.damage_done = 0;
|
||||
}
|
||||
}
|
||||
@ -1377,7 +1377,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
if (!GetTarget())
|
||||
SetTarget(other);
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking %s with hand %d %s", other ? other->GetName() : "(nullptr)", Hand, bRiposte ? "(this is a riposte)" : "");
|
||||
LogCombat("Attacking [{}] with hand [{}] [{}]", other ? other->GetName() : "(nullptr)", Hand, bRiposte ? "(this is a riposte)" : "");
|
||||
|
||||
//SetAttackTimer();
|
||||
if (
|
||||
@ -1387,12 +1387,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
|| (GetHP() < 0)
|
||||
|| (!IsAttackAllowed(other))
|
||||
) {
|
||||
Log(Logs::Detail, Logs::Combat, "Attack cancelled, invalid circumstances.");
|
||||
LogCombat("Attack cancelled, invalid circumstances");
|
||||
return false; // Only bards can attack while casting
|
||||
}
|
||||
|
||||
if (DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm
|
||||
Log(Logs::Detail, Logs::Combat, "Attack cancelled, Divine Aura is in effect.");
|
||||
LogCombat("Attack cancelled, Divine Aura is in effect");
|
||||
MessageString(Chat::DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable
|
||||
return false;
|
||||
}
|
||||
@ -1412,20 +1412,20 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
|
||||
if (weapon != nullptr) {
|
||||
if (!weapon->IsWeapon()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Attack cancelled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID());
|
||||
LogCombat("Attack cancelled, Item [{}] ([{}]) is not a weapon", weapon->GetItem()->Name, weapon->GetID());
|
||||
return(false);
|
||||
}
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID());
|
||||
LogCombat("Attacking with weapon: [{}] ([{}])", weapon->GetItem()->Name, weapon->GetID());
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking without a weapon.");
|
||||
LogCombat("Attacking without a weapon");
|
||||
}
|
||||
|
||||
DamageHitInfo my_hit;
|
||||
// calculate attack_skill and skillinuse depending on hand and weapon
|
||||
// also send Packet to near clients
|
||||
my_hit.skill = AttackAnimation(Hand, weapon);
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon ? weapon->GetItem()->Name : "Fist", Hand, my_hit.skill);
|
||||
LogCombat("Attacking with [{}] in slot [{}] using skill [{}]", weapon ? weapon->GetItem()->Name : "Fist", Hand, my_hit.skill);
|
||||
|
||||
// Now figure out damage
|
||||
my_hit.damage_done = 1;
|
||||
@ -1493,7 +1493,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
|
||||
// damage = mod_client_damage(damage, skillinuse, Hand, weapon, other);
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Damage calculated: base %d min damage %d skill %d", my_hit.base_damage, my_hit.min_damage, my_hit.skill);
|
||||
LogCombat("Damage calculated: base [{}] min damage [{}] skill [{}]", my_hit.base_damage, my_hit.min_damage, my_hit.skill);
|
||||
|
||||
int hit_chance_bonus = 0;
|
||||
my_hit.offense = offense(my_hit.skill); // we need this a few times
|
||||
@ -1629,7 +1629,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::Sk
|
||||
}
|
||||
|
||||
int exploss = 0;
|
||||
Log(Logs::Detail, Logs::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill);
|
||||
LogCombat("Fatal blow dealt by [{}] with [{}] damage, spell [{}], skill [{}]", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill);
|
||||
|
||||
/*
|
||||
#1: Send death packet to everyone
|
||||
@ -1920,7 +1920,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
if (other->IsClient())
|
||||
other->CastToClient()->RemoveXTarget(this, false);
|
||||
RemoveFromHateList(other);
|
||||
Log(Logs::Detail, Logs::Combat, "I am not allowed to attack %s", other->GetName());
|
||||
LogCombat("I am not allowed to attack [{}]", other->GetName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1950,10 +1950,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
//We dont factor much from the weapon into the attack.
|
||||
//Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons
|
||||
if (weapon) {
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID);
|
||||
LogCombat("Attacking with weapon: [{}] ([{}]) (too bad im not using it for much)", weapon->Name, weapon->ID);
|
||||
|
||||
if (Hand == EQEmu::invslot::slotSecondary && !weapon->IsType1HWeapon()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Attack with non-weapon cancelled.");
|
||||
LogCombat("Attack with non-weapon cancelled");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2055,7 +2055,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
|
||||
other->AddToHateList(this, hate);
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Final damage against %s: %d", other->GetName(), my_hit.damage_done);
|
||||
LogCombat("Final damage against [{}]: [{}]", other->GetName(), my_hit.damage_done);
|
||||
|
||||
if (other->IsClient() && IsPet() && GetOwner()->IsClient()) {
|
||||
//pets do half damage to clients in pvp
|
||||
@ -2112,7 +2112,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::Skill
|
||||
//handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds
|
||||
if (attacked_timer.Check())
|
||||
{
|
||||
Log(Logs::Detail, Logs::Combat, "Triggering EVENT_ATTACK due to attack by %s", other ? other->GetName() : "nullptr");
|
||||
LogCombat("Triggering EVENT_ATTACK due to attack by [{}]", other ? other->GetName() : "nullptr");
|
||||
parse->EventNPC(EVENT_ATTACK, this, other, "", 0);
|
||||
}
|
||||
attacked_timer.Start(CombatEventTimer_expire);
|
||||
@ -2150,7 +2150,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::Skill
|
||||
|
||||
bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::SkillType attack_skill)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d",
|
||||
LogCombat("Fatal blow dealt by [{}] with [{}] damage, spell [{}], skill [{}]",
|
||||
((killer_mob) ? (killer_mob->GetName()) : ("[nullptr]")), damage, spell, attack_skill);
|
||||
|
||||
Mob *oos = nullptr;
|
||||
@ -2798,7 +2798,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
|
||||
if (DS == 0 && rev_ds == 0)
|
||||
return;
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName());
|
||||
LogCombat("Applying Damage Shield of value [{}] to [{}]", DS, attacker->GetName());
|
||||
|
||||
//invert DS... spells yield negative values for a true damage shield
|
||||
if (DS < 0) {
|
||||
@ -2844,7 +2844,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
|
||||
rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID;
|
||||
|
||||
if (rev_ds < 0) {
|
||||
Log(Logs::Detail, Logs::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName());
|
||||
LogCombat("Applying Reverse Damage Shield of value [{}] to [{}]", rev_ds, attacker->GetName());
|
||||
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?
|
||||
}
|
||||
@ -3365,13 +3365,13 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
ignore_invul = spell_id == 982 || spells[spell_id].cast_not_standing; // cazic touch
|
||||
|
||||
if (!ignore_invul && (GetInvul() || DivineAura())) {
|
||||
Log(Logs::Detail, Logs::Combat, "Avoiding %d damage due to invulnerability.", damage);
|
||||
LogCombat("Avoiding [{}] damage due to invulnerability", damage);
|
||||
damage = DMG_INVULNERABLE;
|
||||
}
|
||||
|
||||
// this should actually happen MUCH sooner, need to investigate though -- good enough for now
|
||||
if ((skill_used == EQEmu::skills::SkillArchery || skill_used == EQEmu::skills::SkillThrowing) && GetSpecialAbility(IMMUNE_RANGED_ATTACKS)) {
|
||||
Log(Logs::Detail, Logs::Combat, "Avoiding %d damage due to IMMUNE_RANGED_ATTACKS.", damage);
|
||||
LogCombat("Avoiding [{}] damage due to IMMUNE_RANGED_ATTACKS", damage);
|
||||
damage = DMG_INVULNERABLE;
|
||||
}
|
||||
|
||||
@ -3415,7 +3415,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
int healed = damage;
|
||||
|
||||
healed = attacker->GetActSpellHealing(spell_id, healed);
|
||||
Log(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName());
|
||||
LogCombat("Applying lifetap heal of [{}] to [{}]", healed, attacker->GetName());
|
||||
attacker->HealDamage(healed);
|
||||
|
||||
//we used to do a message to the client, but its gone now.
|
||||
@ -3441,7 +3441,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
//see if any runes want to reduce this damage
|
||||
if (spell_id == SPELL_UNKNOWN) {
|
||||
damage = ReduceDamage(damage);
|
||||
Log(Logs::Detail, Logs::Combat, "Melee Damage reduced to %d", damage);
|
||||
LogCombat("Melee Damage reduced to [{}]", damage);
|
||||
damage = ReduceAllDamage(damage);
|
||||
TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker);
|
||||
|
||||
@ -3501,7 +3501,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
|
||||
//fade mez if we are mezzed
|
||||
if (IsMezzed() && attacker) {
|
||||
Log(Logs::Detail, Logs::Combat, "Breaking mez due to attack.");
|
||||
LogCombat("Breaking mez due to attack");
|
||||
entity_list.MessageCloseString(
|
||||
this, /* Sender */
|
||||
true, /* Skip Sender */
|
||||
@ -3588,7 +3588,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
//increment chances of interrupting
|
||||
if (IsCasting()) { //shouldnt interrupt on regular spell damage
|
||||
attacked_count++;
|
||||
Log(Logs::Detail, Logs::Combat, "Melee attack while casting. Attack count %d", attacked_count);
|
||||
LogCombat("Melee attack while casting. Attack count [{}]", attacked_count);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3857,7 +3857,7 @@ float Mob::GetProcChances(float ProcBonus, uint16 hand)
|
||||
ProcChance += ProcChance * ProcBonus / 100.0f;
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||
LogCombat("Proc chance [{}] ([{}] from bonuses)", ProcChance, ProcBonus);
|
||||
return ProcChance;
|
||||
}
|
||||
|
||||
@ -3876,7 +3876,7 @@ float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 h
|
||||
ProcBonus += static_cast<float>(myagi) * RuleR(Combat, DefProcPerMinAgiContrib) / 100.0f;
|
||||
ProcChance = ProcChance + (ProcChance * ProcBonus);
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||
LogCombat("Defensive Proc chance [{}] ([{}] from bonuses)", ProcChance, ProcBonus);
|
||||
return ProcChance;
|
||||
}
|
||||
|
||||
@ -3930,12 +3930,12 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance* weapon_g, Mob *on, uint16 han
|
||||
}
|
||||
|
||||
if (!IsAttackAllowed(on)) {
|
||||
Log(Logs::Detail, Logs::Combat, "Preventing procing off of unattackable things.");
|
||||
LogCombat("Preventing procing off of unattackable things");
|
||||
return;
|
||||
}
|
||||
|
||||
if (DivineAura()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Procs cancelled, Divine Aura is in effect.");
|
||||
LogCombat("Procs cancelled, Divine Aura is in effect");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3982,8 +3982,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
|
||||
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.
|
||||
if (weapon->Proc.Level2 > ourlevel) {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Tried to proc (%s), but our level (%d) is lower than required (%d)",
|
||||
LogCombat("Tried to proc ([{}]), but our level ([{}]) is lower than required ([{}])",
|
||||
weapon->Name, ourlevel, weapon->Proc.Level2);
|
||||
if (IsPet()) {
|
||||
Mob *own = GetOwner();
|
||||
@ -3995,9 +3994,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
|
||||
}
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Attacking weapon (%s) successfully procing spell %d (%.2f percent chance)",
|
||||
weapon->Name, weapon->Proc.Effect, WPC * 100);
|
||||
LogCombat("Attacking weapon ([{}]) successfully procing spell [{}] ([{}] percent chance)", weapon->Name, weapon->Proc.Effect, WPC * 100);
|
||||
ExecWeaponProc(inst, weapon->Proc.Effect, on);
|
||||
proced = true;
|
||||
}
|
||||
@ -4077,15 +4074,11 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
// Perma procs (AAs)
|
||||
if (PermaProcs[i].spellID != SPELL_UNKNOWN) {
|
||||
if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus?
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Permanent proc %d procing spell %d (%d percent chance)",
|
||||
i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
||||
LogCombat("Permanent proc [{}] procing spell [{}] ([{}] percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
||||
ExecWeaponProc(nullptr, PermaProcs[i].spellID, on);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Permanent proc %d failed to proc %d (%d percent chance)",
|
||||
i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
||||
LogCombat("Permanent proc [{}] failed to proc [{}] ([{}] percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4093,18 +4086,14 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
if (SpellProcs[i].spellID != SPELL_UNKNOWN) {
|
||||
float chance = ProcChance * (static_cast<float>(SpellProcs[i].chance) / 100.0f);
|
||||
if (zone->random.Roll(chance)) {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Spell proc %d procing spell %d (%.2f percent chance)",
|
||||
i, SpellProcs[i].spellID, chance);
|
||||
LogCombat("Spell proc [{}] procing spell [{}] ([{}] percent chance)", i, SpellProcs[i].spellID, chance);
|
||||
SendBeginCast(SpellProcs[i].spellID, 0);
|
||||
ExecWeaponProc(nullptr, SpellProcs[i].spellID, on, SpellProcs[i].level_override);
|
||||
CheckNumHitsRemaining(NumHit::OffensiveSpellProcs, 0,
|
||||
SpellProcs[i].base_spellID);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Spell proc %d failed to proc %d (%.2f percent chance)",
|
||||
i, SpellProcs[i].spellID, chance);
|
||||
LogCombat("Spell proc [{}] failed to proc [{}] ([{}] percent chance)", i, SpellProcs[i].spellID, chance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4113,17 +4102,13 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
if (RangedProcs[i].spellID != SPELL_UNKNOWN) {
|
||||
float chance = ProcChance * (static_cast<float>(RangedProcs[i].chance) / 100.0f);
|
||||
if (zone->random.Roll(chance)) {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Ranged proc %d procing spell %d (%.2f percent chance)",
|
||||
i, RangedProcs[i].spellID, chance);
|
||||
LogCombat("Ranged proc [{}] procing spell [{}] ([{}] percent chance)", i, RangedProcs[i].spellID, chance);
|
||||
ExecWeaponProc(nullptr, RangedProcs[i].spellID, on);
|
||||
CheckNumHitsRemaining(NumHit::OffensiveSpellProcs, 0,
|
||||
RangedProcs[i].base_spellID);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Ranged proc %d failed to proc %d (%.2f percent chance)",
|
||||
i, RangedProcs[i].spellID, chance);
|
||||
LogCombat("Ranged proc [{}] failed to proc [{}] ([{}] percent chance)", i, RangedProcs[i].spellID, chance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4318,9 +4303,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
|
||||
}
|
||||
|
||||
hit.damage_done = hit.damage_done * crit_mod / 100;
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Crit success roll %d dex chance %d og dmg %d crit_mod %d new dmg %d", roll, dex_bonus,
|
||||
og_damage, crit_mod, hit.damage_done);
|
||||
LogCombat("Crit success roll [{}] dex chance [{}] og dmg [{}] crit_mod [{}] new dmg [{}]", roll, dex_bonus, og_damage, crit_mod, hit.damage_done);
|
||||
|
||||
// step 3: check deadly strike
|
||||
if (GetClass() == ROGUE && hit.skill == EQEmu::skills::SkillThrowing) {
|
||||
@ -4361,7 +4344,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
|
||||
|
||||
if (IsBerserk() || berserk) {
|
||||
hit.damage_done += og_damage * 119 / 100;
|
||||
Log(Logs::Detail, Logs::Combat, "Crip damage %d", hit.damage_done);
|
||||
LogCombat("Crip damage [{}]", hit.damage_done);
|
||||
|
||||
entity_list.FilteredMessageCloseString(
|
||||
this, /* Sender */
|
||||
@ -4441,7 +4424,7 @@ bool Mob::TryFinishingBlow(Mob *defender, int &damage)
|
||||
|
||||
void Mob::DoRiposte(Mob *defender)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Combat, "Preforming a riposte");
|
||||
LogCombat("Preforming a riposte");
|
||||
|
||||
if (!defender)
|
||||
return;
|
||||
@ -4461,8 +4444,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
defender->itembonuses.DoubleRiposte;
|
||||
|
||||
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Preforming a double riposted from SE_DoubleRiposte (%d percent chance)", DoubleRipChance);
|
||||
LogCombat("Preforming a double riposted from SE_DoubleRiposte ([{}] percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
@ -4473,9 +4455,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
|
||||
// Live AA - Double Riposte
|
||||
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Preforming a double riposted from SE_GiveDoubleRiposte base1 == 0 (%d percent chance)",
|
||||
DoubleRipChance);
|
||||
LogCombat("Preforming a double riposted from SE_GiveDoubleRiposte base1 == 0 ([{}] percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
if (HasDied())
|
||||
return;
|
||||
@ -4487,8 +4467,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1];
|
||||
|
||||
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||
Log(Logs::Detail, Logs::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)",
|
||||
DoubleRipChance);
|
||||
LogCombat("Preforming a return SPECIAL ATTACK ([{}] percent chance)", DoubleRipChance);
|
||||
|
||||
if (defender->GetClass() == MONK)
|
||||
defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]);
|
||||
@ -4942,13 +4921,13 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) {
|
||||
|
||||
if (!TryFadeEffect(spellbonuses.Root[1])) {
|
||||
BuffFadeBySlot(spellbonuses.Root[1]);
|
||||
Log(Logs::Detail, Logs::Combat, "Spell broke root! BreakChance percent chance");
|
||||
LogCombat("Spell broke root! BreakChance percent chance");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Spell did not break root. BreakChance percent chance");
|
||||
LogCombat("Spell did not break root. BreakChance percent chance");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -5124,19 +5103,19 @@ void Mob::CommonBreakInvisibleFromCombat()
|
||||
{
|
||||
//break invis when you attack
|
||||
if (invisible) {
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility due to melee attack.");
|
||||
LogCombat("Removing invisibility due to melee attack");
|
||||
BuffFadeByEffect(SE_Invisibility);
|
||||
BuffFadeByEffect(SE_Invisibility2);
|
||||
invisible = false;
|
||||
}
|
||||
if (invisible_undead) {
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility vs. undead due to melee attack.");
|
||||
LogCombat("Removing invisibility vs. undead due to melee attack");
|
||||
BuffFadeByEffect(SE_InvisVsUndead);
|
||||
BuffFadeByEffect(SE_InvisVsUndead2);
|
||||
invisible_undead = false;
|
||||
}
|
||||
if (invisible_animals) {
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility vs. animals due to melee attack.");
|
||||
LogCombat("Removing invisibility vs. animals due to melee attack");
|
||||
BuffFadeByEffect(SE_InvisVsAnimals);
|
||||
invisible_animals = false;
|
||||
}
|
||||
|
||||
44
zone/bot.cpp
44
zone/bot.cpp
@ -2069,7 +2069,7 @@ void Bot::BotRangedAttack(Mob* other) {
|
||||
//make sure the attack and ranged timers are up
|
||||
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
|
||||
if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())) {
|
||||
Log(Logs::Detail, Logs::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
LogCombat("Bot Archery attack canceled. Timer not up. Attack [{}], ranged [{}]", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
return;
|
||||
}
|
||||
@ -2087,7 +2087,7 @@ void Bot::BotRangedAttack(Mob* other) {
|
||||
if(!RangeWeapon || !Ammo)
|
||||
return;
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID);
|
||||
LogCombat("Shooting [{}] with bow [{}] ([{}]) and arrow [{}] ([{}])", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID);
|
||||
if(!IsAttackAllowed(other) || IsCasting() || DivineAura() || IsStunned() || IsMezzed() || (GetAppearance() == eaDead))
|
||||
return;
|
||||
|
||||
@ -2097,21 +2097,21 @@ void Bot::BotRangedAttack(Mob* other) {
|
||||
|
||||
//break invis when you attack
|
||||
if(invisible) {
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility due to melee attack.");
|
||||
LogCombat("Removing invisibility due to melee attack");
|
||||
BuffFadeByEffect(SE_Invisibility);
|
||||
BuffFadeByEffect(SE_Invisibility2);
|
||||
invisible = false;
|
||||
}
|
||||
|
||||
if(invisible_undead) {
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility vs. undead due to melee attack.");
|
||||
LogCombat("Removing invisibility vs. undead due to melee attack");
|
||||
BuffFadeByEffect(SE_InvisVsUndead);
|
||||
BuffFadeByEffect(SE_InvisVsUndead2);
|
||||
invisible_undead = false;
|
||||
}
|
||||
|
||||
if(invisible_animals) {
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility vs. animals due to melee attack.");
|
||||
LogCombat("Removing invisibility vs. animals due to melee attack");
|
||||
BuffFadeByEffect(SE_InvisVsAnimals);
|
||||
invisible_animals = false;
|
||||
}
|
||||
@ -4271,7 +4271,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, EQEmu::skills::SkillT
|
||||
|
||||
//handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds
|
||||
if(attacked_timer.Check()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName());
|
||||
LogCombat("Triggering EVENT_ATTACK due to attack by [{}]", from->GetName());
|
||||
parse->EventNPC(EVENT_ATTACK, this, from, "", 0);
|
||||
}
|
||||
|
||||
@ -4279,7 +4279,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, EQEmu::skills::SkillT
|
||||
// if spell is lifetap add hp to the caster
|
||||
if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) {
|
||||
int healed = GetActSpellHealing(spell_id, damage);
|
||||
Log(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName());
|
||||
LogCombat("Applying lifetap heal of [{}] to [{}]", healed, GetCleanName());
|
||||
HealDamage(healed);
|
||||
entity_list.MessageClose(this, true, 300, Chat::Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() );
|
||||
}
|
||||
@ -4321,7 +4321,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
|
||||
if ((GetHP() <= 0) || (GetAppearance() == eaDead)) {
|
||||
SetTarget(nullptr);
|
||||
Log(Logs::Detail, Logs::Combat, "Attempted to attack %s while unconscious or, otherwise, appearing dead", other->GetCleanName());
|
||||
LogCombat("Attempted to attack [{}] while unconscious or, otherwise, appearing dead", other->GetCleanName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -4333,20 +4333,20 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
// takes more to compare a call result, load for a call, load a compare to address and compare, and finally
|
||||
// push a value to an address than to just load for a call and push a value to an address.
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking %s with hand %d %s", other->GetCleanName(), Hand, (FromRiposte ? "(this is a riposte)" : ""));
|
||||
LogCombat("Attacking [{}] with hand [{}] [{}]", other->GetCleanName(), Hand, (FromRiposte ? "(this is a riposte)" : ""));
|
||||
if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) || (!IsAttackAllowed(other))) {
|
||||
if(this->GetOwnerID())
|
||||
entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName());
|
||||
|
||||
if(other) {
|
||||
RemoveFromHateList(other);
|
||||
Log(Logs::Detail, Logs::Combat, "I am not allowed to attack %s", other->GetCleanName());
|
||||
LogCombat("I am not allowed to attack [{}]", other->GetCleanName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if(DivineAura()) {//cant attack while invulnerable
|
||||
Log(Logs::Detail, Logs::Combat, "Attack canceled, Divine Aura is in effect.");
|
||||
LogCombat("Attack canceled, Divine Aura is in effect");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -4364,19 +4364,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
|
||||
if(weapon != nullptr) {
|
||||
if (!weapon->IsWeapon()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID());
|
||||
LogCombat("Attack canceled, Item [{}] ([{}]) is not a weapon", weapon->GetItem()->Name, weapon->GetID());
|
||||
return false;
|
||||
}
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID());
|
||||
LogCombat("Attacking with weapon: [{}] ([{}])", weapon->GetItem()->Name, weapon->GetID());
|
||||
}
|
||||
else
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking without a weapon.");
|
||||
LogCombat("Attacking without a weapon");
|
||||
|
||||
// calculate attack_skill and skillinuse depending on hand and weapon
|
||||
// also send Packet to near clients
|
||||
DamageHitInfo my_hit;
|
||||
my_hit.skill = AttackAnimation(Hand, weapon);
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, my_hit.skill);
|
||||
LogCombat("Attacking with [{}] in slot [{}] using skill [{}]", weapon?weapon->GetItem()->Name:"Fist", Hand, my_hit.skill);
|
||||
|
||||
// Now figure out damage
|
||||
my_hit.damage_done = 1;
|
||||
@ -4424,7 +4424,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
}
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Damage calculated: base %d min damage %d skill %d", my_hit.base_damage, my_hit.min_damage, my_hit.skill);
|
||||
LogCombat("Damage calculated: base [{}] min damage [{}] skill [{}]", my_hit.base_damage, my_hit.min_damage, my_hit.skill);
|
||||
|
||||
int hit_chance_bonus = 0;
|
||||
my_hit.offense = offense(my_hit.skill);
|
||||
@ -4442,7 +4442,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
|
||||
DoAttack(other, my_hit, opts);
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Final damage after all reductions: %d", my_hit.damage_done);
|
||||
LogCombat("Final damage after all reductions: [{}]", my_hit.damage_done);
|
||||
} else {
|
||||
my_hit.damage_done = DMG_INVULNERABLE;
|
||||
}
|
||||
@ -5308,7 +5308,7 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) {
|
||||
ProcChance += (ProcChance * ProcBonus / 100.0f);
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||
LogCombat("Proc chance [{}] ([{}] from bonuses)", ProcChance, ProcBonus);
|
||||
return ProcChance;
|
||||
}
|
||||
|
||||
@ -5362,13 +5362,13 @@ bool Bot::TryFinishingBlow(Mob *defender, int &damage)
|
||||
int fb_damage = aabonuses.FinishingBlow[1];
|
||||
int levelreq = aabonuses.FinishingBlowLvl[0];
|
||||
if (defender->GetLevel() <= levelreq && (chance >= zone->random.Int(1, 1000))) {
|
||||
Log(Logs::Detail, Logs::Combat, "Landed a finishing blow: levelreq at %d, other level %d",
|
||||
LogCombat("Landed a finishing blow: levelreq at [{}], other level [{}]",
|
||||
levelreq, defender->GetLevel());
|
||||
entity_list.MessageCloseString(this, false, 200, Chat::MeleeCrit, FINISHING_BLOW, GetName());
|
||||
damage = fb_damage;
|
||||
return true;
|
||||
} else {
|
||||
Log(Logs::Detail, Logs::Combat, "FAILED a finishing blow: levelreq at %d, other level %d",
|
||||
LogCombat("failed a finishing blow: levelreq at [{}], other level [{}]",
|
||||
levelreq, defender->GetLevel());
|
||||
return false;
|
||||
}
|
||||
@ -5377,14 +5377,14 @@ bool Bot::TryFinishingBlow(Mob *defender, int &damage)
|
||||
}
|
||||
|
||||
void Bot::DoRiposte(Mob* defender) {
|
||||
Log(Logs::Detail, Logs::Combat, "Preforming a riposte");
|
||||
LogCombat("Preforming a riposte");
|
||||
if (!defender)
|
||||
return;
|
||||
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
int32 DoubleRipChance = (defender->GetAABonuses().GiveDoubleRiposte[0] + defender->GetSpellBonuses().GiveDoubleRiposte[0] + defender->GetItemBonuses().GiveDoubleRiposte[0]);
|
||||
if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) {
|
||||
Log(Logs::Detail, Logs::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
||||
LogCombat("Preforming a double riposte ([{}] percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::invslot::slotPrimary, true);
|
||||
}
|
||||
|
||||
|
||||
@ -4627,7 +4627,7 @@ void Mob::MeleeLifeTap(int32 damage) {
|
||||
if(lifetap_amt && damage > 0){
|
||||
|
||||
lifetap_amt = damage * lifetap_amt / 100;
|
||||
Log(Logs::Detail, Logs::Combat, "Melee lifetap healing for %d damage.", damage);
|
||||
LogCombat("Melee lifetap healing for [{}] damage", damage);
|
||||
|
||||
if (lifetap_amt > 0)
|
||||
HealDamage(lifetap_amt); //Heal self for modified damage amount.
|
||||
|
||||
@ -631,7 +631,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
||||
//make sure the attack and ranged timers are up
|
||||
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
|
||||
if(!CanDoubleAttack && ((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) {
|
||||
Log(Logs::Detail, Logs::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
LogCombat("Throwing attack canceled. Timer not up. Attack [{}], ranged [{}]", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
// The server and client timers are not exact matches currently, so this would spam too often if enabled
|
||||
//Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
return;
|
||||
@ -643,12 +643,12 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
||||
const EQEmu::ItemInstance* Ammo = m_inv[EQEmu::invslot::slotAmmo];
|
||||
|
||||
if (!RangeWeapon || !RangeWeapon->IsClassCommon()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::invslot::slotRange), EQEmu::invslot::slotRange);
|
||||
LogCombat("Ranged attack canceled. Missing or invalid ranged weapon ([{}]) in slot [{}]", GetItemIDAt(EQEmu::invslot::slotRange), EQEmu::invslot::slotRange);
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(EQEmu::invslot::slotRange));
|
||||
return;
|
||||
}
|
||||
if (!Ammo || !Ammo->IsClassCommon()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(EQEmu::invslot::slotAmmo), EQEmu::invslot::slotAmmo);
|
||||
LogCombat("Ranged attack canceled. Missing or invalid ammo item ([{}]) in slot [{}]", GetItemIDAt(EQEmu::invslot::slotAmmo), EQEmu::invslot::slotAmmo);
|
||||
Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(EQEmu::invslot::slotAmmo));
|
||||
return;
|
||||
}
|
||||
@ -657,17 +657,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
||||
const EQEmu::ItemData* AmmoItem = Ammo->GetItem();
|
||||
|
||||
if (RangeItem->ItemType != EQEmu::item::ItemTypeBow) {
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType);
|
||||
LogCombat("Ranged attack canceled. Ranged item is not a bow. type [{}]", RangeItem->ItemType);
|
||||
Message(0, "Error: Rangeweapon: Item %d is not a bow.", RangeWeapon->GetID());
|
||||
return;
|
||||
}
|
||||
if (AmmoItem->ItemType != EQEmu::item::ItemTypeArrow) {
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType);
|
||||
LogCombat("Ranged attack canceled. Ammo item is not an arrow. type [{}]", AmmoItem->ItemType);
|
||||
Message(0, "Error: Ammo: type %d != %d, you have the wrong type of ammo!", AmmoItem->ItemType, EQEmu::item::ItemTypeArrow);
|
||||
return;
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID);
|
||||
LogCombat("Shooting [{}] with bow [{}] ([{}]) and arrow [{}] ([{}])", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID);
|
||||
|
||||
//look for ammo in inventory if we only have 1 left...
|
||||
if(Ammo->GetCharges() == 1) {
|
||||
@ -694,7 +694,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
||||
Ammo = baginst;
|
||||
ammo_slot = m_inv.CalcSlotId(r, i);
|
||||
found = true;
|
||||
Log(Logs::Detail, Logs::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges());
|
||||
LogCombat("Using ammo from quiver stack at slot [{}]. [{}] in stack", ammo_slot, Ammo->GetCharges());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -709,17 +709,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
||||
if (aslot != INVALID_INDEX) {
|
||||
ammo_slot = aslot;
|
||||
Ammo = m_inv[aslot];
|
||||
Log(Logs::Detail, Logs::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges());
|
||||
LogCombat("Using ammo from inventory stack at slot [{}]. [{}] in stack", ammo_slot, Ammo->GetCharges());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float range = RangeItem->Range + AmmoItem->Range + GetRangeDistTargetSizeMod(GetTarget());
|
||||
Log(Logs::Detail, Logs::Combat, "Calculated bow range to be %.1f", range);
|
||||
LogCombat("Calculated bow range to be [{}]", range);
|
||||
range *= range;
|
||||
float dist = DistanceSquared(m_Position, other->GetPosition());
|
||||
if(dist > range) {
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range);
|
||||
LogCombat("Ranged attack out of range client should catch this. ([{}] > [{}]).\n", dist, range);
|
||||
MessageString(Chat::Red,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase.
|
||||
return;
|
||||
}
|
||||
@ -747,9 +747,9 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
||||
|
||||
if (RangeItem->ExpendableArrow || !ChanceAvoidConsume || (ChanceAvoidConsume < 100 && zone->random.Int(0,99) > ChanceAvoidConsume)){
|
||||
DeleteItemInInventory(ammo_slot, 1, true);
|
||||
Log(Logs::Detail, Logs::Combat, "Consumed one arrow from slot %d", ammo_slot);
|
||||
LogCombat("Consumed one arrow from slot [{}]", ammo_slot);
|
||||
} else {
|
||||
Log(Logs::Detail, Logs::Combat, "Endless Quiver prevented ammo consumption.");
|
||||
LogCombat("Endless Quiver prevented ammo consumption");
|
||||
}
|
||||
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillArchery, GetTarget(), -15);
|
||||
@ -808,7 +808,7 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon,
|
||||
SendItemAnimation(other, AmmoItem, EQEmu::skills::SkillArchery);
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack hit %s.", other->GetName());
|
||||
LogCombat("Ranged attack hit [{}]", other->GetName());
|
||||
|
||||
uint32 hate = 0;
|
||||
int TotalDmg = 0;
|
||||
@ -840,12 +840,10 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon,
|
||||
hate = ((WDmg + ADmg));
|
||||
|
||||
if (RuleB(Combat, ProjectileDmgOnImpact)) {
|
||||
Log(Logs::Detail, Logs::Combat, "Bow and Arrow DMG %d, Max Damage %d.", WDmg,
|
||||
MaxDmg);
|
||||
LogCombat("Bow and Arrow DMG [{}], Max Damage [{}]", WDmg, MaxDmg);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg,
|
||||
ADmg, MaxDmg);
|
||||
LogCombat("Bow DMG [{}], Arrow DMG [{}], Max Damage [{}]", WDmg, ADmg, MaxDmg);
|
||||
}
|
||||
|
||||
if (MaxDmg == 0)
|
||||
@ -1087,7 +1085,7 @@ void NPC::RangedAttack(Mob* other)
|
||||
//make sure the attack and ranged timers are up
|
||||
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
|
||||
if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())){
|
||||
Log(Logs::Detail, Logs::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
LogCombat("Archery canceled. Timer not up. Attack [{}], ranged [{}]", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1223,7 +1221,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
||||
//make sure the attack and ranged timers are up
|
||||
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
|
||||
if((!CanDoubleAttack && (attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) {
|
||||
Log(Logs::Detail, Logs::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
LogCombat("Throwing attack canceled. Timer not up. Attack [{}], ranged [{}]", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
// The server and client timers are not exact matches currently, so this would spam too often if enabled
|
||||
//Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
return;
|
||||
@ -1233,19 +1231,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
||||
const EQEmu::ItemInstance* RangeWeapon = m_inv[EQEmu::invslot::slotRange];
|
||||
|
||||
if (!RangeWeapon || !RangeWeapon->IsClassCommon()) {
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::invslot::slotRange), EQEmu::invslot::slotRange);
|
||||
LogCombat("Ranged attack canceled. Missing or invalid ranged weapon ([{}]) in slot [{}]", GetItemIDAt(EQEmu::invslot::slotRange), EQEmu::invslot::slotRange);
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(EQEmu::invslot::slotRange));
|
||||
return;
|
||||
}
|
||||
|
||||
const EQEmu::ItemData* item = RangeWeapon->GetItem();
|
||||
if (item->ItemType != EQEmu::item::ItemTypeLargeThrowing && item->ItemType != EQEmu::item::ItemTypeSmallThrowing) {
|
||||
Log(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType);
|
||||
LogCombat("Ranged attack canceled. Ranged item [{}] is not a throwing weapon. type [{}]", item->ItemType);
|
||||
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(EQEmu::invslot::slotRange));
|
||||
return;
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName());
|
||||
LogCombat("Throwing [{}] ([{}]) at [{}]", item->Name, item->ID, other->GetName());
|
||||
|
||||
if(RangeWeapon->GetCharges() == 1) {
|
||||
//first check ammo
|
||||
@ -1254,7 +1252,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
||||
//more in the ammo slot, use it
|
||||
RangeWeapon = AmmoItem;
|
||||
ammo_slot = EQEmu::invslot::slotAmmo;
|
||||
Log(Logs::Detail, Logs::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges());
|
||||
LogCombat("Using ammo from ammo slot, stack at slot [{}]. [{}] in stack", ammo_slot, RangeWeapon->GetCharges());
|
||||
} else {
|
||||
//look through our inventory for more
|
||||
int32 aslot = m_inv.HasItem(item->ID, 1, invWherePersonal);
|
||||
@ -1262,17 +1260,17 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
||||
//the item wont change, but the instance does, not that it matters
|
||||
ammo_slot = aslot;
|
||||
RangeWeapon = m_inv[aslot];
|
||||
Log(Logs::Detail, Logs::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges());
|
||||
LogCombat("Using ammo from inventory slot, stack at slot [{}]. [{}] in stack", ammo_slot, RangeWeapon->GetCharges());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float range = item->Range + GetRangeDistTargetSizeMod(other);
|
||||
Log(Logs::Detail, Logs::Combat, "Calculated bow range to be %.1f", range);
|
||||
LogCombat("Calculated bow range to be [{}]", range);
|
||||
range *= range;
|
||||
float dist = DistanceSquared(m_Position, other->GetPosition());
|
||||
if(dist > range) {
|
||||
Log(Logs::Detail, Logs::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range);
|
||||
LogCombat("Throwing attack out of range client should catch this. ([{}] > [{}]).\n", dist, range);
|
||||
MessageString(Chat::Red,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase.
|
||||
return;
|
||||
}
|
||||
@ -1339,7 +1337,7 @@ void Mob::DoThrowingAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon
|
||||
SendItemAnimation(other, AmmoItem, EQEmu::skills::SkillThrowing);
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Throwing attack hit %s.", other->GetName());
|
||||
LogCombat("Throwing attack hit [{}]", other->GetName());
|
||||
|
||||
int WDmg = 0;
|
||||
|
||||
@ -1377,7 +1375,7 @@ void Mob::DoThrowingAttackDmg(Mob *other, const EQEmu::ItemInstance *RangeWeapon
|
||||
DoAttack(other, my_hit);
|
||||
TotalDmg = my_hit.damage_done;
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Item DMG %d. Hit for damage %d", WDmg, TotalDmg);
|
||||
LogCombat("Item DMG [{}]. Hit for damage [{}]", WDmg, TotalDmg);
|
||||
} else {
|
||||
TotalDmg = DMG_INVULNERABLE;
|
||||
}
|
||||
|
||||
@ -710,7 +710,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
stun_resist += aabonuses.StunResist;
|
||||
|
||||
if (stun_resist <= 0 || zone->random.Int(0,99) >= stun_resist) {
|
||||
Log(Logs::Detail, Logs::Combat, "Stunned. We had %d percent resist chance.", stun_resist);
|
||||
LogCombat("Stunned. We had [{}] percent resist chance", stun_resist);
|
||||
|
||||
if (caster && caster->IsClient())
|
||||
effect_value += effect_value*caster->GetFocusEffect(focusFcStunTimeMod, spell_id)/100;
|
||||
@ -720,7 +720,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
if (IsClient())
|
||||
MessageString(Chat::Stun, SHAKE_OFF_STUN);
|
||||
|
||||
Log(Logs::Detail, Logs::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist);
|
||||
LogCombat("Stun Resisted. We had [{}] percent resist chance", stun_resist);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user