[int64] Support for HP / Mana / End / Damage / Hate (#2091)

* Initial int64 work

* Hate 64 bit

* Update special_attacks.cpp

* Aggro / Damage / Hate int64

* NPC edit adjustments

* Fix bot compile

* More int64 adjustments

* More int64 references

* npcedit references

* aggrozone

* More int64 changes

* More int64 changes for damage

* Many more damage int64 references

* More spell damage int64 conversions

* HealDamage

* Damage fully working

* Remove debug

* Add migration

* More int64 adjustments

* Much wow, many int64

* More int64

* PR adjustments
This commit is contained in:
Chris Miles 2022-05-07 22:32:02 -05:00 committed by GitHub
parent d9c41526e8
commit f201d4c999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 743 additions and 708 deletions

View File

@ -1097,7 +1097,7 @@ int EQ::ItemInstance::GetItemElementalFlag(bool augments) const
int EQ::ItemInstance::GetItemElementalDamage(bool augments) const
{
int damage = 0;
int64 damage = 0;
const auto item = GetItem();
if (item) {
damage = item->ElemDmgAmt;
@ -1162,7 +1162,7 @@ int EQ::ItemInstance::GetItemRequiredLevel(bool augments) const
int EQ::ItemInstance::GetItemWeaponDamage(bool augments) const
{
int damage = 0;
int64 damage = 0;
const auto item = GetItem();
if (item) {
damage = item->Damage;
@ -1178,7 +1178,7 @@ int EQ::ItemInstance::GetItemWeaponDamage(bool augments) const
int EQ::ItemInstance::GetItemBackstabDamage(bool augments) const
{
int damage = 0;
int64 damage = 0;
const auto item = GetItem();
if (item) {
damage = item->BackstabDmg;
@ -1236,7 +1236,7 @@ int EQ::ItemInstance::GetItemBaneDamageRace(bool augments) const
int EQ::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
{
int damage = 0;
int64 damage = 0;
const auto item = GetItem();
if (item) {
if (item->BaneDmgBody == against)
@ -1253,7 +1253,7 @@ int EQ::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) con
int EQ::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
{
int damage = 0;
int64 damage = 0;
const auto item = GetItem();
if (item) {
if (item->BaneDmgRace == against)

View File

@ -575,9 +575,9 @@ char *RemoveApostrophes(const char *s)
return NewString;
}
const char *ConvertArray(int input, char *returnchar)
const char *ConvertArray(int64 input, char *returnchar)
{
sprintf(returnchar, "%i", input);
sprintf(returnchar, "%lld", input);
return returnchar;
}

View File

@ -204,7 +204,7 @@ bool strn0cpyt(char* dest, const char* source, uint32 size);
char *CleanMobName(const char *in, char *out);
char *RemoveApostrophes(const char *s);
char* strn0cpy(char* dest, const char* source, uint32 size);
const char *ConvertArray(int input, char *returnchar);
const char *ConvertArray(int64 input, char *returnchar);
const char *ConvertArrayF(float input, char *returnchar);
const char *MakeLowerString(const char *source);
uint32 hextoi(const char* num);

View File

@ -34,7 +34,7 @@
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/
#define CURRENT_BINARY_DATABASE_VERSION 9181
#define CURRENT_BINARY_DATABASE_VERSION 9182
#ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9028

View File

@ -435,6 +435,7 @@
9179|2022_04_30_hp_regen_per_second.sql|SHOW COLUMNS FROM `npc_types` LIKE 'hp_regen_per_second'|empty|
9180|2022_05_01_character_peqzone_flags.sql|SHOW TABLES LIKE 'character_peqzone_flags'|empty|
9181|2022_05_03_task_activity_goal_match_list.sql|SHOW COLUMNS FROM `task_activities` LIKE 'goal_match_list'|empty|
9182|2022_05_02_npc_types_int64.sql|SHOW COLUMNS FROM `npc_types` LIKE 'hp'|missing|bigint
# Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not

View File

@ -0,0 +1,4 @@
ALTER TABLE npc_types MODIFY COLUMN hp BIGINT;
ALTER TABLE npc_types MODIFY COLUMN mana BIGINT;
ALTER TABLE npc_types MODIFY COLUMN hp_regen_rate BIGINT;
ALTER TABLE npc_types MODIFY COLUMN mana_regen_rate BIGINT;

View File

@ -108,7 +108,7 @@ void EntityList::DescribeAggro(Client *to_who, NPC *from_who, float d, bool verb
}
if (is_engaged) {
uint32 hate_amount = from_who->GetHateAmount(npc);
uint64 hate_amount = from_who->GetHateAmount(npc);
to_who->Message(
Chat::White,
fmt::format(
@ -1165,10 +1165,10 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
bool dispel = false;
bool on_hatelist = target ? target->CheckAggro(this) : false;
int proc_cap = RuleI(Aggro, MaxScalingProcAggro);
int hate_cap = isproc && proc_cap != -1 ? proc_cap : 1200;
int64 hate_cap = isproc && proc_cap != -1 ? proc_cap : 1200;
int32 target_hp = target ? target->GetMaxHP() : 18000; // default to max
int32 default_aggro = 25;
int64 target_hp = target ? target->GetMaxHP() : 18000; // default to max
int64 default_aggro = 25;
if (target_hp >= 18000) // max
default_aggro = hate_cap;
else if (target_hp >= 390) // min, 390 is the first number with int division that is 26
@ -1178,13 +1178,13 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
switch (spells[spell_id].effect_id[o]) {
case SE_CurrentHPOnce:
case SE_CurrentHP: {
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
if(val < 0)
AggroAmount -= val;
break;
}
case SE_MovementSpeed: {
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
if (val < 0)
AggroAmount += default_aggro;
break;
@ -1192,7 +1192,7 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
case SE_AttackSpeed:
case SE_AttackSpeed2:
case SE_AttackSpeed3: {
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
if (val < 100)
AggroAmount += default_aggro;
break;
@ -1210,7 +1210,7 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
break;
case SE_ACv2:
case SE_ArmorClass: {
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
if (val < 0)
AggroAmount += default_aggro;
break;
@ -1228,19 +1228,19 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
case SE_INT:
case SE_WIS:
case SE_CHA: {
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
if (val < 0)
AggroAmount += 10;
break;
}
case SE_ResistAll: {
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
if (val < 0)
AggroAmount += 50;
break;
}
case SE_AllStats: {
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
if (val < 0)
AggroAmount += 70;
break;
@ -1282,7 +1282,7 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
case SE_ManaRegen_v2:
case SE_ManaPool:
case SE_CurrentEndurance: {
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id);
if (val < 0)
AggroAmount -= val * 2;
break;
@ -1344,7 +1344,7 @@ int32 Mob::CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possib
break;
}
// hate based on base healing power of the spell
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o],
int64 val = CalcSpellEffectValue_formula(spells[spell_id].formula[o],
spells[spell_id].base_value[o], spells[spell_id].max_value[o], GetLevel(), spell_id);
if (val > 0) {
if (heal_possible < val)
@ -1356,7 +1356,7 @@ int32 Mob::CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possib
else if (target_level <= 50 && val > 800)
val = 800; // per live patch notes, capped to 800
}
AggroAmount += std::max(val, 1);
AggroAmount += std::max(val, (int64)1);
break;
}
case SE_Rune:

View File

@ -1045,9 +1045,9 @@ void Mob::MeleeMitigation(Mob *attacker, DamageHitInfo &hit, ExtraAttackOptions
//Else we know we can hit.
//GetWeaponDamage(mob*, const EQ::ItemData*) is intended to be used for mobs or any other situation where we do not have a client inventory item
//GetWeaponDamage(mob*, const EQ::ItemInstance*) is intended to be used for situations where we have a client inventory item
int Mob::GetWeaponDamage(Mob *against, const EQ::ItemData *weapon_item) {
int dmg = 0;
int banedmg = 0;
int64 Mob::GetWeaponDamage(Mob *against, const EQ::ItemData *weapon_item) {
int64 dmg = 0;
int64 banedmg = 0;
//can't hit invulnerable stuff with weapons.
if (against->GetInvul() || against->GetSpecialAbility(IMMUNE_MELEE)) {
@ -1148,10 +1148,10 @@ int Mob::GetWeaponDamage(Mob *against, const EQ::ItemData *weapon_item) {
return dmg;
}
int Mob::GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, uint32 *hate)
int64 Mob::GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, uint64 *hate)
{
int dmg = 0;
int banedmg = 0;
int64 dmg = 0;
int64 banedmg = 0;
int x = 0;
if (!against || against->GetInvul() || against->GetSpecialAbility(IMMUNE_MELEE))
@ -1265,10 +1265,10 @@ int Mob::GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, uint
*hate += banedmg;
}
return std::max(0, dmg);
return std::max((int64)0, dmg);
}
int Client::DoDamageCaps(int base_damage)
int64 Client::DoDamageCaps(int64 base_damage)
{
// this is based on a client function that caps melee base_damage
auto level = GetLevel();
@ -1379,7 +1379,7 @@ int Client::DoDamageCaps(int base_damage)
}
}
return std::min(cap, base_damage);
return std::min((int64)cap, base_damage);
}
// other is the defender, this is the attacker
@ -1509,7 +1509,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
my_hit.damage_done = 1;
my_hit.min_damage = 0;
uint8 mylevel = GetLevel() ? GetLevel() : 1;
uint32 hate = 0;
uint64 hate = 0;
if (weapon)
hate = (weapon->GetItem()->Damage + weapon->GetItem()->ElemDmgAmt);
@ -1649,7 +1649,7 @@ void Mob::Heal()
SendHPUpdate();
}
void Client::Damage(Mob* other, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special)
void Client::Damage(Mob* other, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special)
{
if (dead || IsCorpse())
return;
@ -1668,7 +1668,7 @@ void Client::Damage(Mob* other, int32 damage, uint16 spell_id, EQ::skills::Skill
PvPMitigation = 80;
else
PvPMitigation = 67;
damage = std::max((damage * PvPMitigation) / 100, 1);
damage = std::max<int64_t>((damage * PvPMitigation) / 100, 1);
}
if (!ClientFinishedLoading())
@ -1684,7 +1684,7 @@ void Client::Damage(Mob* other, int32 damage, uint16 spell_id, EQ::skills::Skill
}
}
bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQ::skills::SkillType attack_skill)
bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::SkillType attack_skill)
{
if (!ClientFinishedLoading())
return false;
@ -2118,7 +2118,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
}
}
int weapon_damage = GetWeaponDamage(other, weapon);
int64 weapon_damage = GetWeaponDamage(other, weapon);
//do attack animation regardless of whether or not we can hit below
int16 charges = 0;
@ -2234,7 +2234,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, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) {
void NPC::Damage(Mob* other, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) {
if (spell_id == 0)
spell_id = SPELL_UNKNOWN;
@ -2277,7 +2277,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQ::skills::SkillTyp
}
}
bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillType attack_skill)
bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillType attack_skill)
{
LogCombat("Fatal blow dealt by [{}] with [{}] damage, spell [{}], skill [{}]",
((killer_mob) ? (killer_mob->GetName()) : ("[nullptr]")), damage, spell, attack_skill);
@ -2749,7 +2749,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
return true;
}
void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, bool iYellForHelp /*= true*/, bool bFrenzy /*= false*/, bool iBuffTic /*= false*/, uint16 spell_id, bool pet_command)
void Mob::AddToHateList(Mob* other, uint64 hate /*= 0*/, int64 damage /*= 0*/, bool iYellForHelp /*= true*/, bool bFrenzy /*= false*/, bool iBuffTic /*= false*/, uint16 spell_id, bool pet_command)
{
if (!other)
return;
@ -2780,7 +2780,7 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
AddRampage(other);
if (on_hatelist) { // odd reason, if you're not on the hate list, subtlety etc don't apply!
// Spell Casting Subtlety etc
int hatemod = 100 + other->spellbonuses.hatemod + other->itembonuses.hatemod + other->aabonuses.hatemod;
int64 hatemod = 100 + other->spellbonuses.hatemod + other->itembonuses.hatemod + other->aabonuses.hatemod;
if (hatemod < 1)
hatemod = 1;
@ -3090,7 +3090,7 @@ uint8 Mob::GetWeaponDamageBonus(const EQ::ItemData *weapon, bool offhand)
}
else {
// 2h damage bonus
int damage_bonus = 1 + (level - 28) / 3;
int64 damage_bonus = 1 + (level - 28) / 3;
if (delay <= 27)
return damage_bonus + 1;
// Client isn't reflecting what the dev quoted, this matches better
@ -3231,7 +3231,7 @@ int Mob::GetHandToHandDelay(void)
return 35;
}
int32 Mob::ReduceDamage(int32 damage)
int64 Mob::ReduceDamage(int64 damage)
{
if (damage <= 0)
return damage;
@ -3262,7 +3262,7 @@ int32 Mob::ReduceDamage(int32 damage)
if (slot >= 0 && (damage > spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MIN_DMG_TO_TRIGGER]))
{
DisableMeleeRune = true;
int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] / 100;
int64 damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] / 100;
if (damage_to_reduce >= buffs[slot].melee_rune)
{
LogSpells("Mob::ReduceDamage SE_MeleeThresholdGuard [{}] damage negated, [{}] damage remaining, fading buff", damage_to_reduce, buffs[slot].melee_rune);
@ -3283,7 +3283,7 @@ int32 Mob::ReduceDamage(int32 damage)
slot = spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_BUFFSLOT];
if (slot >= 0)
{
int damage_to_reduce = damage * spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_PERCENT] / 100;
int64 damage_to_reduce = damage * spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_PERCENT] / 100;
if (spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] && (damage_to_reduce > spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT]))
damage_to_reduce = spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT];
@ -3319,7 +3319,7 @@ int32 Mob::ReduceDamage(int32 damage)
return(damage);
}
int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTic, Mob* attacker)
int64 Mob::AffectMagicalDamage(int64 damage, uint16 spell_id, const bool iBuffTic, Mob* attacker)
{
if (damage <= 0)
return damage;
@ -3353,7 +3353,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
slot = spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_BUFFSLOT];
if (slot >= 0)
{
int damage_to_reduce = damage * spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_PERCENT] / 100;
int64 damage_to_reduce = damage * spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_PERCENT] / 100;
if (spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] && (damage_to_reduce > spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT]))
damage_to_reduce = spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT];
@ -3389,7 +3389,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
if (slot >= 0 && (damage > spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MIN_DMG_TO_TRIGGER]))
{
DisableSpellRune = true;
int damage_to_reduce = damage * spellbonuses.SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] / 100;
int64 damage_to_reduce = damage * spellbonuses.SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] / 100;
if (damage_to_reduce >= buffs[slot].magic_rune)
{
damage -= buffs[slot].magic_rune;
@ -3409,7 +3409,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
slot = spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_BUFFSLOT];
if (slot >= 0)
{
int damage_to_reduce = damage * spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT] / 100;
int64 damage_to_reduce = damage * spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT] / 100;
if (spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] && (damage_to_reduce > spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT]))
damage_to_reduce = spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT];
@ -3449,13 +3449,13 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
return damage;
}
int32 Mob::ReduceAllDamage(int32 damage)
int64 Mob::ReduceAllDamage(int64 damage)
{
if (damage <= 0)
return damage;
if (spellbonuses.ManaAbsorbPercentDamage) {
int32 mana_reduced = damage * spellbonuses.ManaAbsorbPercentDamage / 100;
int64 mana_reduced = damage * spellbonuses.ManaAbsorbPercentDamage / 100;
if (GetMana() >= mana_reduced) {
damage -= mana_reduced;
SetMana(GetMana() - mana_reduced);
@ -3464,7 +3464,7 @@ int32 Mob::ReduceAllDamage(int32 damage)
}
if (spellbonuses.EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_MITIGIATION]) {
int32 damage_reduced = damage * spellbonuses.EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_MITIGIATION] / 10000; //If hit for 1000, at 10% then lower damage by 100;
int64 damage_reduced = damage * spellbonuses.EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_MITIGIATION] / 10000; //If hit for 1000, at 10% then lower damage by 100;
int32 endurance_drain = damage_reduced * spellbonuses.EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_DRAIN_PER_HP] / 10000; //Reduce endurance by 0.05% per HP loss
if (endurance_drain < 1)
endurance_drain = 1;
@ -3612,7 +3612,7 @@ bool Mob::CheckDoubleAttack()
return zone->random.Int(1, 500) <= chance;
}
void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const EQ::skills::SkillType skill_used, bool &avoidable, const int8 buffslot, const bool iBuffTic, eSpecialAttacks special) {
void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, const EQ::skills::SkillType skill_used, bool &avoidable, const int8 buffslot, const bool iBuffTic, eSpecialAttacks special) {
// This method is called with skill_used=ABJURE for Damage Shield damage.
bool FromDamageShield = (skill_used == EQ::skills::SkillAbjuration);
bool ignore_invul = false;
@ -3667,7 +3667,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
if (attacker) {
// if spell is lifetap add hp to the caster
if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) {
int healed = damage;
int64 healed = damage;
healed = RuleB(Spells, CompoundLifetapHeals) ? attacker->GetActSpellHealing(spell_id, healed) : healed;
LogCombat("Applying lifetap heal of [{}] to [{}]", healed, attacker->GetName());
@ -3748,7 +3748,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
}
else {
int32 origdmg = damage;
int64 origdmg = damage;
damage = AffectMagicalDamage(damage, spell_id, iBuffTic, attacker);
if (origdmg != damage && attacker && attacker->IsClient()) {
if (attacker->CastToClient()->GetFilter(FilterDamageShields) != FilterHide)
@ -3772,9 +3772,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
}
//final damage has been determined.
SetHP(GetHP() - damage);
SetHP(int64(GetHP() - damage));
if (HasDied()) {
bool IsSaved = false;
@ -4068,11 +4066,11 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
}
void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id)
void Mob::HealDamage(uint64 amount, Mob *caster, uint16 spell_id)
{
int32 maxhp = GetMaxHP();
int32 curhp = GetHP();
uint32 acthealed = 0;
int64 maxhp = GetMaxHP();
int64 curhp = GetHP();
uint64 acthealed = 0;
if (amount > (maxhp - curhp))
acthealed = (maxhp - curhp);
@ -4813,10 +4811,17 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
}
}
bool Mob::TryFinishingBlow(Mob *defender, int &damage)
bool Mob::TryFinishingBlow(Mob *defender, int64 &damage)
{
float hp_limit = 10.0f;
auto fb_hp_limit = std::max({ aabonuses.FinishingBlowLvl[SBIndex::FINISHING_BLOW_LEVEL_HP_RATIO], spellbonuses.FinishingBlowLvl[SBIndex::FINISHING_BLOW_LEVEL_HP_RATIO], itembonuses.FinishingBlowLvl[SBIndex::FINISHING_BLOW_LEVEL_HP_RATIO] });
auto fb_hp_limit = std::max(
{
aabonuses.FinishingBlowLvl[SBIndex::FINISHING_BLOW_LEVEL_HP_RATIO],
spellbonuses.FinishingBlowLvl[SBIndex::FINISHING_BLOW_LEVEL_HP_RATIO],
itembonuses.FinishingBlowLvl[SBIndex::FINISHING_BLOW_LEVEL_HP_RATIO]
}
);
if (fb_hp_limit) {
hp_limit = fb_hp_limit/10.0f;
@ -4913,9 +4918,9 @@ void Mob::DoRiposte(Mob *defender)
}
}
void Mob::ApplyMeleeDamageMods(uint16 skill, int &damage, Mob *defender, ExtraAttackOptions *opts)
void Mob::ApplyMeleeDamageMods(uint16 skill, int64 &damage, Mob *defender, ExtraAttackOptions *opts)
{
int dmgbonusmod = 0;
int64 dmgbonusmod = 0;
dmgbonusmod += GetMeleeDamageMod_SE(skill);
dmgbonusmod += GetMeleeDmgPositionMod(defender);
@ -4936,7 +4941,7 @@ void Mob::ApplyMeleeDamageMods(uint16 skill, int &damage, Mob *defender, ExtraAt
bool Mob::HasDied() {
bool Result = false;
int32 hp_below = 0;
int64 hp_below = 0;
hp_below = (GetDelayDeath() * -1);
@ -5431,7 +5436,7 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) {
return false;
}
int32 Mob::RuneAbsorb(int32 damage, uint16 type)
int32 Mob::RuneAbsorb(int64 damage, uint16 type)
{
uint32 buff_max = GetMaxTotalSlots();
if (type == SE_Rune) {
@ -5613,7 +5618,7 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
CheckNumHitsRemaining(NumHit::OutgoingHitSuccess);
}
void Mob::DoShieldDamageOnShielder(Mob *shield_target, int hit_damage_done, EQ::skills::SkillType skillInUse)
void Mob::DoShieldDamageOnShielder(Mob *shield_target, int64 hit_damage_done, EQ::skills::SkillType skillInUse)
{
if (!shield_target) {
return;
@ -6070,12 +6075,12 @@ void Mob::SetSpawnedInWater(bool spawned_in_water) {
Mob::spawned_in_water = spawned_in_water;
}
int32 Mob::GetHPRegen() const
int64 Mob::GetHPRegen() const
{
return hp_regen;
}
int32 Mob::GetManaRegen() const
int64 Mob::GetManaRegen() const
{
return mana_regen;
}

View File

@ -34,8 +34,8 @@ public:
~Beacon();
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) { return true; }
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; }
virtual bool Death(Mob* killerMob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) { return true; }
virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; }
virtual bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr) { return false; }
virtual bool HasRaid() { return false; }

View File

@ -4379,7 +4379,7 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
const ItemInstance* trade_item_instance;
int16 from_client_slot;
int16 to_bot_slot;
ClientTrade(const ItemInstance* item, int16 from) : trade_item_instance(item), from_client_slot(from), to_bot_slot(invslot::SLOT_INVALID) { }
};
@ -4387,7 +4387,7 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
const ItemInstance* return_item_instance;
int16 from_bot_slot;
int16 to_client_slot;
ClientReturn(const ItemInstance* item, int16 from) : return_item_instance(item), from_bot_slot(from), to_client_slot(invslot::SLOT_INVALID) { }
};
@ -4471,7 +4471,7 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
linker.SetItemInst(trade_instance);
auto item_link = linker.GenerateLink();
if (trade_index != invslot::slotCursor && !trade_instance->IsDroppable()) {
LogError("Bot::PerformTradeWithClient trade hack detected by {} with {}.", client->GetCleanName(), GetCleanName());
client->Message(Chat::Red, "Trade hack detected, the trade has been cancelled.");
@ -4801,7 +4801,7 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
for (auto& trade_iterator : client_trade) {
// TODO: code for stackables
if (!database.botdb.SaveItemBySlot(this, trade_iterator.to_bot_slot, trade_iterator.trade_item_instance)) {
if (!database.botdb.SaveItemBySlot(this, trade_iterator.to_bot_slot, trade_iterator.trade_item_instance)) {
client->Message(
Chat::Red,
fmt::format(
@ -4850,7 +4850,7 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
}
}
bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) {
bool Bot::Death(Mob *killerMob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) {
if(!NPC::Death(killerMob, damage, spell_id, attack_skill))
return false;
@ -4938,7 +4938,7 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, EQ::skills::Skill
return true;
}
void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) {
void Bot::Damage(Mob *from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) {
if(spell_id == 0)
spell_id = SPELL_UNKNOWN;
@ -4951,7 +4951,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, EQ::skills::SkillType
attacked_timer.Start(CombatEventTimer_expire);
// if spell is lifetap add hp to the caster
if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) {
int healed = GetActSpellHealing(spell_id, damage);
int64 healed = GetActSpellHealing(spell_id, damage);
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() );
@ -4980,8 +4980,8 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, EQ::skills::SkillType
}
}
//void Bot::AddToHateList(Mob* other, uint32 hate = 0, int32 damage = 0, bool iYellForHelp = true, bool bFrenzy = false, bool iBuffTic = false)
void Bot::AddToHateList(Mob* other, uint32 hate, int32 damage, bool iYellForHelp, bool bFrenzy, bool iBuffTic, bool pet_command) {
//void Bot::AddToHateList(Mob* other, uint64 hate = 0, int64 damage = 0, bool iYellForHelp = true, bool bFrenzy = false, bool iBuffTic = false)
void Bot::AddToHateList(Mob* other, uint64 hate, int64 damage, bool iYellForHelp, bool bFrenzy, bool iBuffTic, bool pet_command) {
Mob::AddToHateList(other, hate, damage, iYellForHelp, bFrenzy, iBuffTic, pet_command);
}
@ -5055,7 +5055,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
my_hit.damage_done = 1;
my_hit.min_damage = 0;
uint8 mylevel = GetLevel() ? GetLevel() : 1;
uint32 hate = 0;
uint64 hate = 0;
if (weapon)
hate = (weapon->GetItem()->Damage + weapon->GetItem()->ElemDmgAmt);
@ -6053,7 +6053,7 @@ int Bot::GetHandToHandDamage(void) {
return 2;
}
bool Bot::TryFinishingBlow(Mob *defender, int &damage)
bool Bot::TryFinishingBlow(Mob *defender, int64 &damage)
{
if (!defender)
return false;
@ -6310,7 +6310,7 @@ void Bot::RogueBackstab(Mob *other, bool min_damage, int ReuseTime)
return;
}
uint32 hate = 0;
uint64 hate = 0;
int base_damage = GetBaseSkillDamage(EQ::skills::SkillBackstab, other);
hate = base_damage;
@ -6512,7 +6512,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
if(skill_to_use == -1)
return;
int dmg = GetBaseSkillDamage(static_cast<EQ::skills::SkillType>(skill_to_use), GetTarget());
int64 dmg = GetBaseSkillDamage(static_cast<EQ::skills::SkillType>(skill_to_use), GetTarget());
if (skill_to_use == EQ::skills::SkillBash) {
if (target != this) {
@ -6814,7 +6814,7 @@ bool Bot::ProcessGuildRemoval(Client* guildOfficer, std::string botName) {
return Result;
}
int32 Bot::CalcMaxMana() {
int64 Bot::CalcMaxMana() {
switch(GetCasterClass()) {
case 'I':
case 'W': {
@ -6896,7 +6896,7 @@ void Bot::SetAttackTimer() {
}
}
int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
int64 Bot::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) {
if (spells[spell_id].target_type == ST_Self)
return value;
@ -7001,7 +7001,7 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
return value;
}
int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
int64 Bot::GetActSpellHealing(uint16 spell_id, int64 value, Mob* target) {
if (target == nullptr)
target = this;
@ -7762,16 +7762,16 @@ void Bot::CalcBonuses() {
end_regen = CalcEnduranceRegen();
}
int32 Bot::CalcHPRegenCap(){
int64 Bot::CalcHPRegenCap(){
int level = GetLevel();
int32 hpregen_cap = 0;
int64 hpregen_cap = 0;
hpregen_cap = (RuleI(Character, ItemHealthRegenCap) + itembonuses.HeroicSTA / 25);
hpregen_cap += (aabonuses.ItemHPRegenCap + spellbonuses.ItemHPRegenCap + itembonuses.ItemHPRegenCap);
return (hpregen_cap * RuleI(Character, HPRegenMultiplier) / 100);
}
int32 Bot::CalcManaRegenCap(){
int32 cap = RuleI(Character, ItemManaRegenCap) + aabonuses.ItemManaRegenCap;
int64 Bot::CalcManaRegenCap(){
int64 cap = RuleI(Character, ItemManaRegenCap) + aabonuses.ItemManaRegenCap;
switch(GetCasterClass()) {
case 'I':
cap += (itembonuses.HeroicINT / 25);
@ -8122,7 +8122,7 @@ int32 Bot::LevelRegen() {
int level = GetLevel();
bool bonus = GetPlayerRaceBit(_baseRace) & RuleI(Character, BaseHPRegenBonusRaces);
uint8 multiplier1 = bonus ? 2 : 1;
int32 hp = 0;
int64 hp = 0;
if (level < 51) {
if (IsSitting()) {
if (level < 20)
@ -8167,14 +8167,14 @@ int32 Bot::LevelRegen() {
return hp;
}
int32 Bot::CalcHPRegen() {
int64 Bot::CalcHPRegen() {
int32 regen = (LevelRegen() + itembonuses.HPRegen + spellbonuses.HPRegen);
regen += (aabonuses.HPRegen + GroupLeadershipAAHealthRegeneration());
regen = ((regen * RuleI(Character, HPRegenMultiplier)) / 100);
return regen;
}
int32 Bot::CalcManaRegen() {
int64 Bot::CalcManaRegen() {
uint8 level = GetLevel();
uint8 botclass = GetClass();
int32 regen = 0;
@ -8205,7 +8205,7 @@ int32 Bot::CalcManaRegen() {
return regen;
}
uint32 Bot::GetClassHPFactor() {
uint64 Bot::GetClassHPFactor() {
uint32 factor;
switch(GetClass()) {
case BEASTLORD:
@ -8236,7 +8236,7 @@ uint32 Bot::GetClassHPFactor() {
return factor;
}
int32 Bot::CalcMaxHP() {
int64 Bot::CalcMaxHP() {
int32 bot_hp = 0;
uint32 nd = 10000;
bot_hp += (GenerateBaseHitPoints() + itembonuses.HP);
@ -8258,7 +8258,7 @@ int32 Bot::CalcMaxHP() {
return max_hp;
}
int32 Bot::CalcMaxEndurance() {
int64 Bot::CalcMaxEndurance() {
max_end = (CalcBaseEndurance() + spellbonuses.Endurance + itembonuses.Endurance);
if (max_end < 0)
max_end = 0;
@ -8276,7 +8276,7 @@ int32 Bot::CalcMaxEndurance() {
return max_end;
}
int32 Bot::CalcBaseEndurance() {
int64 Bot::CalcBaseEndurance() {
int32 base_end = 0;
int32 base_endurance = 0;
int32 ConvertedStats = 0;
@ -8331,13 +8331,13 @@ int32 Bot::CalcBaseEndurance() {
return base_end;
}
int32 Bot::CalcEnduranceRegen() {
int64 Bot::CalcEnduranceRegen() {
int32 regen = (int32(GetLevel() * 4 / 10) + 2);
regen += (spellbonuses.EnduranceRegen + itembonuses.EnduranceRegen);
return (regen * RuleI(Character, EnduranceRegenMultiplier) / 100);
}
int32 Bot::CalcEnduranceRegenCap() {
int64 Bot::CalcEnduranceRegenCap() {
int cap = (RuleI(Character, ItemEnduranceRegenCap) + itembonuses.HeroicSTR / 25 + itembonuses.HeroicDEX / 25 + itembonuses.HeroicAGI / 25 + itembonuses.HeroicSTA / 25);
return (cap * RuleI(Character, EnduranceRegenMultiplier) / 100);
}

View File

@ -145,8 +145,8 @@ public:
Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double totalPlayTime, uint32 lastZoneId, NPCType *npcTypeData);
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
virtual bool Death(Mob* killerMob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
virtual bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr);
virtual bool HasRaid() { return (GetRaid() ? true : false); }
@ -179,7 +179,7 @@ public:
uint16 BotGetSpellPriority(int spellslot) { return AIspells[spellslot].priority; }
virtual float GetProcChances(float ProcBonus, uint16 hand);
virtual int GetHandToHandDamage(void);
virtual bool TryFinishingBlow(Mob *defender, int &damage);
virtual bool TryFinishingBlow(Mob *defender, int64 &damage);
virtual void DoRiposte(Mob* defender);
inline virtual int32 GetATK() const { return ATK + itembonuses.ATK + spellbonuses.ATK + ((GetSTR() + GetSkill(EQ::skills::SkillOffense)) * 9 / 10); }
inline virtual int32 GetATKBonus() const { return itembonuses.ATK + spellbonuses.ATK; }
@ -208,16 +208,16 @@ public:
virtual Mob* GetOwnerOrSelf();
inline virtual bool HasOwner() { return (GetBotOwner() ? true : false); }
virtual int32 CheckHealAggroAmount(uint16 spellid, Mob *target, uint32 heal_possible = 0);
virtual int32 CalcMaxMana();
virtual int64 CalcMaxMana();
virtual void SetAttackTimer();
uint32 GetClassHPFactor();
virtual int32 CalcMaxHP();
uint64 GetClassHPFactor();
virtual int64 CalcMaxHP();
bool DoFinishedSpellAETarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool &stopLogic);
bool DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool &stopLogic);
bool DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool &stopLogic);
void SendBotArcheryWearChange(uint8 material_slot, uint32 material, uint32 color);
void Camp(bool databaseSave = true);
virtual void AddToHateList(Mob* other, uint32 hate = 0, int32 damage = 0, bool iYellForHelp = true, bool bFrenzy = false, bool iBuffTic = false, bool pet_command = false);
virtual void AddToHateList(Mob* other, uint64 hate = 0, int64 damage = 0, bool iYellForHelp = true, bool bFrenzy = false, bool iBuffTic = false, bool pet_command = false);
virtual void SetTarget(Mob* mob);
virtual void Zone();
std::vector<AISpells_Struct> GetBotSpells() { return AIspells; }
@ -286,23 +286,23 @@ public:
int32 CalcPR();
int32 CalcCR();
int32 CalcCorrup();
int32 CalcHPRegenCap();
int32 CalcManaRegenCap();
int64 CalcHPRegenCap();
int64 CalcManaRegenCap();
int32 LevelRegen();
int32 CalcHPRegen();
int32 CalcManaRegen();
int64 CalcHPRegen();
int64 CalcManaRegen();
uint32 CalcCurrentWeight();
int GroupLeadershipAAHealthEnhancement();
int GroupLeadershipAAManaEnhancement();
int GroupLeadershipAAHealthRegeneration();
int GroupLeadershipAAOffenseEnhancement();
void CalcRestState();
int32 CalcMaxEndurance(); //This calculates the maximum endurance we can have
int32 CalcBaseEndurance(); //Calculates Base End
int32 CalcEnduranceRegen(); //Calculates endurance regen used in DoEnduranceRegen()
int32 GetEndurance() const {return cur_end;} //This gets our current endurance
int32 GetMaxEndurance() const {return max_end;} //This gets our endurance from the last CalcMaxEndurance() call
int32 CalcEnduranceRegenCap();
int64 CalcMaxEndurance(); //This calculates the maximum endurance we can have
int64 CalcBaseEndurance(); //Calculates Base End
int64 CalcEnduranceRegen(); //Calculates endurance regen used in DoEnduranceRegen()
int64 GetEndurance() const {return cur_end;} //This gets our current endurance
int64 GetMaxEndurance() const {return max_end;} //This gets our endurance from the last CalcMaxEndurance() call
int64 CalcEnduranceRegenCap();
inline uint8 GetEndurancePercent() { return (uint8)((float)cur_end / (float)max_end * 100.0f); }
void SetEndurance(int32 newEnd); //This sets the current endurance to the new value
void DoEnduranceRegen(); //This Regenerates endurance
@ -327,8 +327,8 @@ public:
// Mob Spell Virtual Override Methods
virtual void SpellProcess();
virtual int32 GetActSpellDamage(uint16 spell_id, int32 value, Mob* target = nullptr);
virtual int32 GetActSpellHealing(uint16 spell_id, int32 value, Mob* target = nullptr);
virtual int64 GetActSpellDamage(uint16 spell_id, int64 value, Mob* target = nullptr);
virtual int64 GetActSpellHealing(uint16 spell_id, int64 value, Mob* target = nullptr);
virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime);
virtual int32 GetActSpellCost(uint16 spell_id, int32 cost);
virtual float GetActSpellRange(uint16 spell_id, float range);

View File

@ -1840,7 +1840,7 @@ void Client::IncStats(uint8 type,int16 increase_val){
safe_delete(outapp);
}
const int32& Client::SetMana(int32 amount) {
const int64& Client::SetMana(int64 amount) {
bool update = false;
if (amount < 0)
amount = 0;
@ -2904,7 +2904,7 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
max_percent = mod_bindwound_percent(max_percent, bindmob);
int max_hp = bindmob->GetMaxHP() * max_percent / 100;
int64 max_hp = bindmob->GetMaxHP() * max_percent / 100;
// send bindmob new hp's
if (bindmob->GetHP() < bindmob->GetMaxHP() && bindmob->GetHP() <= (max_hp)-1) {

View File

@ -247,8 +247,8 @@ public:
bool GotoPlayer(std::string player_name);
//abstract virtual function implementations required by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
virtual bool Death(Mob* killerMob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
virtual bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr);
virtual bool HasRaid() { return (GetRaid() ? true : false); }
@ -259,7 +259,7 @@ public:
virtual void SetAttackTimer();
int GetQuiverHaste(int delay);
void DoAttackRounds(Mob *target, int hand, bool IsFromSpell = false);
int DoDamageCaps(int base_damage);
int64 DoDamageCaps(int64 base_damage);
void AI_Init();
void AI_Start(uint32 iMoveDelay = 0);
@ -429,10 +429,10 @@ public:
inline const float GetBindHeading(uint32 index = 0) const { return m_pp.binds[index].heading; }
inline uint32 GetBindZoneID(uint32 index = 0) const { return m_pp.binds[index].zone_id; }
inline uint32 GetBindInstanceID(uint32 index = 0) const { return m_pp.binds[index].instance_id; }
int32 CalcMaxMana();
int32 CalcBaseMana();
const int32& SetMana(int32 amount);
int32 CalcManaRegenCap();
int64 CalcMaxMana();
int64 CalcBaseMana();
const int64& SetMana(int64 amount);
int64 CalcManaRegenCap();
// guild pool regen shit. Sends a SpawnAppearance with a value that regens to value * 0.001
void EnableAreaHPRegen(int value);
@ -578,12 +578,12 @@ public:
/*Endurance and such*/
void CalcMaxEndurance(); //This calculates the maximum endurance we can have
int32 CalcBaseEndurance(); //Calculates Base End
int32 CalcEnduranceRegen(bool bCombat = false); //Calculates endurance regen used in DoEnduranceRegen()
int32 GetEndurance() const {return current_endurance;} //This gets our current endurance
int32 GetMaxEndurance() const {return max_end;} //This gets our endurance from the last CalcMaxEndurance() call
int32 CalcEnduranceRegenCap();
int32 CalcHPRegenCap();
int64 CalcBaseEndurance(); //Calculates Base End
int64 CalcEnduranceRegen(bool bCombat = false); //Calculates endurance regen used in DoEnduranceRegen()
int64 GetEndurance() const {return current_endurance;} //This gets our current endurance
int64 GetMaxEndurance() const {return max_end;} //This gets our endurance from the last CalcMaxEndurance() call
int64 CalcEnduranceRegenCap();
int64 CalcHPRegenCap();
inline uint8 GetEndurancePercent() { return (uint8)((float)current_endurance / (float)max_end * 100.0f); }
void SetEndurance(int32 newEnd); //This sets the current endurance to the new value
void DoEnduranceRegen(); //This Regenerates endurance
@ -911,7 +911,7 @@ public:
void SendClearPlayerAA();
inline uint32 GetAAXP() const { return m_pp.expAA; }
inline uint32 GetAAPercent() const { return m_epp.perAA; }
int32 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id);
int64 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id);
void SetAATitle(const char *Title);
void SetTitleSuffix(const char *txt);
void MemorizeSpell(uint32 slot, uint32 spellid, uint32 scribing, uint32 reduction = 0);
@ -1577,7 +1577,7 @@ public:
void Consume(const EQ::ItemData *item, uint8 type, int16 slot, bool auto_consume);
void PlayMP3(const char* fname);
void ExpeditionSay(const char *str, int ExpID);
int mod_client_damage(int damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemInstance* weapon, Mob* other);
int mod_client_damage(int64 damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemInstance* weapon, Mob* other);
bool mod_client_message(char* message, uint8 chan_num);
bool mod_can_increase_skill(EQ::skills::SkillType skillid, Mob* against_who);
double mod_increase_skill_chance(double chance, Mob* against_who);
@ -1663,7 +1663,7 @@ protected:
void MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message = true);
bool client_data_loaded;
int32 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false);
int64 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false);
uint16 GetSympatheticFocusEffect(focusType type, uint16 spell_id);
void FinishAlternateAdvancementPurchase(AA::Rank *rank, bool ignore_cost);
@ -1730,12 +1730,12 @@ private:
int32 CalcPR();
int32 CalcCR();
int32 CalcCorrup();
int32 CalcMaxHP();
int32 CalcBaseHP();
int32 CalcHPRegen(bool bCombat = false);
int32 CalcManaRegen(bool bCombat = false);
int32 CalcBaseManaRegen();
uint32 GetClassHPFactor();
int64 CalcMaxHP();
int64 CalcBaseHP();
int64 CalcHPRegen(bool bCombat = false);
int64 CalcManaRegen(bool bCombat = false);
int64 CalcBaseManaRegen();
uint64 GetClassHPFactor();
void DoHPRegen();
void DoManaRegen();
void DoStaminaHungerUpdate();

View File

@ -164,7 +164,7 @@ int32 Client::LevelRegen()
int level = GetLevel();
bool bonus = GetPlayerRaceBit(GetBaseRace()) & RuleI(Character, BaseHPRegenBonusRaces);
uint8 multiplier1 = bonus ? 2 : 1;
int32 hp = 0;
int64 hp = 0;
//these calculations should match up with the info from Monkly Business, which was last updated ~05/2008: http://www.monkly-business.net/index.php?pageid=abilities
if (level < 51) {
if (sitting) {
@ -233,14 +233,14 @@ int32 Client::LevelRegen()
return hp;
}
int32 Client::CalcHPRegen(bool bCombat)
int64 Client::CalcHPRegen(bool bCombat)
{
int item_regen = itembonuses.HPRegen; // worn spells and +regen, already capped
int64 item_regen = itembonuses.HPRegen; // worn spells and +regen, already capped
item_regen += GetHeroicSTA() / 20;
item_regen += aabonuses.HPRegen;
int base = 0;
int64 base = 0;
auto base_data = database.GetBaseData(GetLevel(), GetClass());
if (base_data)
base = static_cast<int>(base_data->hp_regen);
@ -297,11 +297,11 @@ int32 Client::CalcHPRegen(bool bCombat)
base = fast_regen;
}
int regen = base + item_regen + spellbonuses.HPRegen; // TODO: client does this in buff tick
int64 regen = base + item_regen + spellbonuses.HPRegen; // TODO: client does this in buff tick
return (regen * RuleI(Character, HPRegenMultiplier) / 100);
}
int32 Client::CalcHPRegenCap()
int64 Client::CalcHPRegenCap()
{
int cap = RuleI(Character, ItemHealthRegenCap);
if (GetLevel() > 60)
@ -312,7 +312,7 @@ int32 Client::CalcHPRegenCap()
return (cap * RuleI(Character, HPRegenMultiplier) / 100);
}
int32 Client::CalcMaxHP()
int64 Client::CalcMaxHP()
{
float nd = 10000;
max_hp = (CalcBaseHP() + itembonuses.HP);
@ -328,11 +328,10 @@ int32 Client::CalcMaxHP()
if (current_hp > max_hp) {
current_hp = max_hp;
}
int hp_perc_cap = spellbonuses.HPPercCap[SBIndex::RESOURCE_PERCENT_CAP];
int64 hp_perc_cap = spellbonuses.HPPercCap[SBIndex::RESOURCE_PERCENT_CAP];
if (hp_perc_cap) {
int curHP_cap = (max_hp * hp_perc_cap) / 100;
int64 curHP_cap = (max_hp * hp_perc_cap) / 100;
if (current_hp > curHP_cap || (spellbonuses.HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && current_hp > spellbonuses.HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP])) {
current_hp = curHP_cap;
}
}
@ -477,7 +476,7 @@ uint32 Mob::GetClassLevelFactor()
return multiplier;
}
int32 Client::CalcBaseHP()
int64 Client::CalcBaseHP()
{
if (ClientVersion() >= EQ::versions::ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
int stats = GetSTA();
@ -507,7 +506,7 @@ int32 Client::CalcBaseHP()
}
// This is for calculating Base HPs + STA bonus for SoD or later clients.
uint32 Client::GetClassHPFactor()
uint64 Client::GetClassHPFactor()
{
int factor;
// Note: Base HP factor under level 41 is equal to factor / 12, and from level 41 to 80 is factor / 6.
@ -564,7 +563,7 @@ int32 Client::GetRawItemAC()
return Total;
}
int32 Client::CalcMaxMana()
int64 Client::CalcMaxMana()
{
switch (GetCasterClass()) {
case 'I':
@ -599,14 +598,14 @@ int32 Client::CalcMaxMana()
return max_mana;
}
int32 Client::CalcBaseMana()
int64 Client::CalcBaseMana()
{
int ConvertedWisInt = 0;
int MindLesserFactor, MindFactor;
int WisInt = 0;
int base_mana = 0;
int64 base_mana = 0;
int wisint_mana = 0;
int32 max_m = 0;
int64 max_m = 0;
switch (GetCasterClass()) {
case 'I':
WisInt = GetINT();
@ -688,7 +687,7 @@ int32 Client::CalcBaseMana()
return max_m;
}
int32 Client::CalcBaseManaRegen()
int64 Client::CalcBaseManaRegen()
{
uint8 clevel = GetLevel();
int32 regen = 0;
@ -706,7 +705,7 @@ int32 Client::CalcBaseManaRegen()
return regen;
}
int32 Client::CalcManaRegen(bool bCombat)
int64 Client::CalcManaRegen(bool bCombat)
{
int regen = 0;
auto level = GetLevel();
@ -776,9 +775,9 @@ int32 Client::CalcManaRegen(bool bCombat)
return (regen * RuleI(Character, ManaRegenMultiplier) / 100);
}
int32 Client::CalcManaRegenCap()
int64 Client::CalcManaRegenCap()
{
int32 cap = RuleI(Character, ItemManaRegenCap) + aabonuses.ItemManaRegenCap + itembonuses.ItemManaRegenCap + spellbonuses.ItemManaRegenCap;
int64 cap = RuleI(Character, ItemManaRegenCap) + aabonuses.ItemManaRegenCap + itembonuses.ItemManaRegenCap + spellbonuses.ItemManaRegenCap;
return (cap * RuleI(Character, ManaRegenMultiplier) / 100);
}
@ -1522,7 +1521,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id)
if (casting_spell_aa_id) {
return 10;
}
uint32 effectmod = 10;
int effectmodcap = 0;
if (RuleB(Character, UseSpellFileSongCap)) {
@ -1682,9 +1681,9 @@ void Client::CalcMaxEndurance()
}
}
int32 Client::CalcBaseEndurance()
int64 Client::CalcBaseEndurance()
{
int32 base_end = 0;
int64 base_end = 0;
if (ClientVersion() >= EQ::versions::ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
double heroic_stats = (GetHeroicSTR() + GetHeroicSTA() + GetHeroicDEX() + GetHeroicAGI()) / 4.0f;
double stats = (GetSTR() + GetSTA() + GetDEX() + GetAGI()) / 4.0f;
@ -1719,7 +1718,7 @@ int32 Client::CalcBaseEndurance()
HalfBonus800plus = int( (Stats - 800) / 16 );
}
}
int bonus_sum = BonusUpto800 + Bonus400to800 + HalfBonus400to800 + Bonus800plus + HalfBonus800plus;
int64 bonus_sum = BonusUpto800 + Bonus400to800 + HalfBonus400to800 + Bonus800plus + HalfBonus800plus;
base_end = LevelBase;
//take all of the sums from above, then multiply by level*0.075
base_end += ( bonus_sum * 3 * GetLevel() ) / 40;
@ -1727,9 +1726,9 @@ int32 Client::CalcBaseEndurance()
return base_end;
}
int32 Client::CalcEnduranceRegen(bool bCombat)
int64 Client::CalcEnduranceRegen(bool bCombat)
{
int base = 0;
int64 base = 0;
if (!IsStarved()) {
auto base_data = database.GetBaseData(GetLevel(), GetClass());
if (base_data) {
@ -1794,7 +1793,7 @@ int32 Client::CalcEnduranceRegen(bool bCombat)
auto aa_regen = aabonuses.EnduranceRegen;
int regen = base;
int64 regen = base;
if (!bCombat && CanFastRegen() && (IsSitting() || CanMedOnHorse())) {
auto max_end = GetMaxEndurance();
int fast_regen = 6 * (max_end / zone->newzone_data.FastRegenEndurance);
@ -1808,9 +1807,9 @@ int32 Client::CalcEnduranceRegen(bool bCombat)
return (regen * RuleI(Character, EnduranceRegenMultiplier) / 100);
}
int32 Client::CalcEnduranceRegenCap()
int64 Client::CalcEnduranceRegenCap()
{
int cap = RuleI(Character, ItemEnduranceRegenCap) + aabonuses.ItemEnduranceRegenCap + itembonuses.ItemEnduranceRegenCap + spellbonuses.ItemEnduranceRegenCap;
int64 cap = RuleI(Character, ItemEnduranceRegenCap) + aabonuses.ItemEnduranceRegenCap + itembonuses.ItemEnduranceRegenCap + spellbonuses.ItemEnduranceRegenCap;
return (cap * RuleI(Character, EnduranceRegenMultiplier) / 100);
}

View File

@ -1848,7 +1848,7 @@ void Client::DoStaminaHungerUpdate()
void Client::DoEnduranceRegen()
{
// endurance has some negative mods that could result in a negative regen when starved
int regen = CalcEnduranceRegen();
int64 regen = CalcEnduranceRegen();
if (regen < 0 || (regen > 0 && GetEndurance() < GetMaxEndurance()))
SetEndurance(GetEndurance() + regen);

View File

@ -32,16 +32,16 @@ bool CombatRecord::InCombat()
return start_time > 0;
}
void CombatRecord::ProcessHPEvent(int hp, int current_hp)
void CombatRecord::ProcessHPEvent(int64 hp, int64 current_hp)
{
// damage
if (hp < current_hp) {
damage_received = damage_received + abs(current_hp - hp);
damage_received = damage_received + std::llabs(current_hp - hp);
}
// heal
if (hp > current_hp && current_hp > 0) {
heal_received = heal_received + abs(current_hp - hp);
heal_received = heal_received + std::llabs(current_hp - hp);
}
LogCombatRecordDetail(
@ -50,7 +50,7 @@ void CombatRecord::ProcessHPEvent(int hp, int current_hp)
heal_received,
current_hp,
hp,
abs(current_hp - hp)
std::llabs(current_hp - hp)
);
}

View File

@ -10,7 +10,7 @@ public:
void Start(std::string in_mob_name);
void Stop();
bool InCombat();
void ProcessHPEvent(int hp, int current_hp);
void ProcessHPEvent(int64 hp, int64 current_hp);
double TimeInCombat() const;
private:
std::string mob_name;

View File

@ -112,8 +112,8 @@
typedef enum { //focus types
focusSpellHaste = 1, //@Fc, SPA: 127, SE_IncreaseSpellHaste, On Caster, cast time mod pct, base: pct
focusSpellDuration, //@Fc, SPA: 128, SE_IncreaseSpellDuration, On Caster, spell duration mod pct, base: pct
focusRange, //@Fc, SPA: 129, SE_IncreaseRange, On Caster, spell range mod pct, base: pct
focusReagentCost, //@Fc, SPA: 131, SE_ReduceReagentCost, On Caster, do not consume reagent pct chance, base: min pct, limit: max pct
focusRange, //@Fc, SPA: 129, SE_IncreaseRange, On Caster, spell range mod pct, base: pct
focusReagentCost, //@Fc, SPA: 131, SE_ReduceReagentCost, On Caster, do not consume reagent pct chance, base: min pct, limit: max pct
focusManaCost, //@Fc, SPA: 132, SE_ReduceManaCost, On Caster, reduce mana cost by pct, base: min pct, limt: max pct
focusImprovedHeal, //@Fc, SPA: 125, SE_ImprovedHeal, On Caster, spell healing mod pct, base: min pct, limit: max pct
focusImprovedDamage, //@Fc, SPA: 124, SE_ImprovedDamage, On Caster, spell damage mod pct, base: min pct, limit: max pct
@ -122,7 +122,7 @@ typedef enum { //focus types
focusPetPower, //@Fc, SPA: 167, SE_PetPowerIncrease, On Caster, pet power mod, base: value
focusResistRate, //@Fc, SPA: 126, SE_SpellResistReduction, On Caster, casted spell resist mod pct, base: min pct, limit: max pct
focusSpellHateMod, //@Fc, SPA: 130, SE_SpellHateMod, On Caster, spell hate mod pct, base: min pct, limit: max pct
focusTriggerOnCast, //@Fc, SPA: 339, SE_TriggerOnCast, On Caster, cast on spell use, base: chance pct limit: spellid
focusTriggerOnCast, //@Fc, SPA: 339, SE_TriggerOnCast, On Caster, cast on spell use, base: chance pct limit: spellid
focusSpellVulnerability, //@Fc, SPA: 296, SE_FcSpellVulnerability, On Target, spell damage taken mod pct, base: min pct, limit: max pct
focusFcSpellDamagePctIncomingPC, //@Fc, SPA: 483, SE_Fc_Spell_Damage_Pct_IncomingPC, On Target, spell damage taken mod pct, base: min pct, limit: max pct
focusTwincast, //@Fc, SPA: 399, SE_FcTwincast, On Caster, chance cast spell twice, base: chance pct
@ -136,7 +136,7 @@ typedef enum { //focus types
focusBlockNextSpell, //@Fc, SPA: 335, SE_BlockNextSpellFocus, On Caster, chance to block next spell, base: chance
focusFcHealPctIncoming, //@Fc, SPA: 393, SE_FcHealPctIncoming, On Target, heal received mod pct, base: pct
focusFcDamageAmtIncoming, //@Fc, SPA: 297, SE_FcDamageAmtIncoming, On Target, damage taken flat amt, base: amt
focusFcSpellDamageAmtIncomingPC, //@Fc, SPA: 484, SE_Fc_Spell_Damage_Amt_IncomingPC, On Target, damage taken flat amt, base: amt
focusFcSpellDamageAmtIncomingPC, //@Fc, SPA: 484, SE_Fc_Spell_Damage_Amt_IncomingPC, On Target, damage taken flat amt, base: amt
focusFcCastSpellOnLand, //@Fc, SPA: 481, SE_Fc_Cast_Spell_On_Land, On Target, cast spell if hit by spell, base: chance pct, limit: spellid
focusFcHealAmtIncoming, //@Fc, SPA: 394, SE_FcHealAmtIncoming, On Target, heal received mod flat amt, base: amt
focusFcBaseEffects, //@Fc, SPA: 413, SE_FcBaseEffects, On Caster, base spell effectiveness mod pct, base: pct
@ -338,13 +338,13 @@ struct Buffs_Struct {
struct StatBonuses {
int32 AC;
int32 HP;
int32 HPRegen;
int32 MaxHP;
int32 ManaRegen;
int32 EnduranceRegen;
int32 Mana;
int32 Endurance;
int64 HP;
int64 HPRegen;
int64 MaxHP;
int64 ManaRegen;
int64 EnduranceRegen;
int64 Mana;
int64 Endurance;
int32 ATK;
//would it be worth it to create a Stat_Struct?
int32 STR;
@ -414,7 +414,7 @@ struct StatBonuses {
uint32 stringedMod;
uint32 songModCap;
int8 hatemod;
int32 EnduranceReduction;
int64 EnduranceReduction;
int32 StrikeThrough; // PoP: Strike Through %
int32 MeleeMitigation; //i = Shielding
@ -695,10 +695,10 @@ namespace SBIndex {
constexpr uint16 REFLECT_CHANCE = 0; // SPA 158
constexpr uint16 REFLECT_RESISTANCE_MOD = 1; // SPA 158
constexpr uint16 REFLECT_DMG_EFFECTIVENESS = 2; // SPA 158
constexpr uint16 COMBAT_PROC_ORIGIN_ID = 0; // SPA
constexpr uint16 COMBAT_PROC_SPELL_ID = 1; // SPA
constexpr uint16 COMBAT_PROC_RATE_MOD = 2; // SPA
constexpr uint16 COMBAT_PROC_REUSE_TIMER = 3; // SPA
constexpr uint16 COMBAT_PROC_ORIGIN_ID = 0; // SPA
constexpr uint16 COMBAT_PROC_SPELL_ID = 1; // SPA
constexpr uint16 COMBAT_PROC_RATE_MOD = 2; // SPA
constexpr uint16 COMBAT_PROC_REUSE_TIMER = 3; // SPA
};
@ -879,7 +879,7 @@ struct ExtraAttackOptions {
{ }
float damage_percent;
int damage_flat;
int64 damage_flat;
float armor_pen_percent;
int armor_pen_flat;
float crit_percent;
@ -901,9 +901,9 @@ struct DamageTable {
struct DamageHitInfo {
//uint16 attacker; // id
//uint16 defender; // id
int base_damage;
int min_damage;
int damage_done;
int64 base_damage;
int64 min_damage;
int64 damage_done;
int offense;
int tohit;
int hand;

View File

@ -51,8 +51,8 @@ class Corpse : public Mob {
static Corpse* LoadCharacterCorpseEntity(uint32 in_dbid, uint32 in_charid, std::string in_charname, const glm::vec4& position, std::string time_of_death, bool rezzed, bool was_at_graveyard, uint32 guild_consent_id);
/* Corpse: General */
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) { return true; }
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; }
virtual bool Death(Mob* killerMob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) { return true; }
virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; }
virtual bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) { return false; }
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return false; }
@ -97,7 +97,7 @@ class Corpse : public Mob {
void RemoveItem(ServerLootItem_Struct* item_data);
void RemoveItemByID(uint32 item_id, int quantity = 1);
void AddItem(uint32 itemnum, uint16 charges, int16 slot = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
/* Corpse: Coin */
void SetCash(uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_platinum);
void RemoveCash();

View File

@ -40,7 +40,7 @@ float Mob::GetActSpellRange(uint16 spell_id, float range, bool IsBard)
return (range * extrange) / 100;
}
int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) {
if (spells[spell_id].target_type == ST_Self)
return value;
@ -49,7 +49,7 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
value += value*CastToNPC()->GetSpellFocusDMG()/100;
bool Critical = false;
int32 base_value = value;
int64 base_value = value;
int chance = 0;
// Need to scale HT damage differently after level 40! It no longer scales by the constant value in the spell file. It scales differently, instead of 10 more damage per level, it does 30 more damage per level. So we multiply the level minus 40 times 20 if they are over level 40.
@ -121,7 +121,7 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value)*ratio/100;
else if (IsNPC() && CastToNPC()->GetSpellScale())
value = int(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f);
value = int64(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f);
entity_list.MessageCloseString(
this, true, 100, Chat::SpellCrit,
@ -160,12 +160,12 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value);
if (IsNPC() && CastToNPC()->GetSpellScale())
value = int(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f);
value = int64(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f);
return value;
}
int32 Mob::GetActReflectedSpellDamage(int32 spell_id, int32 value, int effectiveness) {
int64 Mob::GetActReflectedSpellDamage(int32 spell_id, int64 value, int effectiveness) {
/*
Reflected spells use the spells base damage before any modifiers or formulas applied.
That value can then be modifier by the reflect spells 'max' value, defined here as effectiveness
@ -177,11 +177,11 @@ int32 Mob::GetActReflectedSpellDamage(int32 spell_id, int32 value, int effective
value += value * CastToNPC()->GetSpellFocusDMG() / 100;
if (CastToNPC()->GetSpellScale()) {
value = int(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f);
value = int64(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f);
}
}
int32 base_spell_dmg = value;
int64 base_spell_dmg = value;
value = value * effectiveness / 100;
@ -192,7 +192,7 @@ int32 Mob::GetActReflectedSpellDamage(int32 spell_id, int32 value, int effective
return value;
}
int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target, bool from_buff_tic) {
int64 Mob::GetActDoTDamage(uint16 spell_id, int64 value, Mob* target, bool from_buff_tic) {
if (target == nullptr)
return value;
@ -201,8 +201,8 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target, bool from_
value += value * CastToNPC()->GetSpellFocusDMG() / 100;
}
int32 base_value = value;
int32 extra_dmg = 0;
int64 base_value = value;
int64 extra_dmg = 0;
int16 chance = 0;
chance += itembonuses.CriticalDoTChance + spellbonuses.CriticalDoTChance + aabonuses.CriticalDoTChance;
@ -213,16 +213,16 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target, bool from_
chance = spells[spell_id].override_crit_chance;
if (!spells[spell_id].good_effect && chance > 0 && (zone->random.Roll(chance))) {
int32 ratio = 200;
int64 ratio = 200;
ratio += itembonuses.DotCritDmgIncrease + spellbonuses.DotCritDmgIncrease + aabonuses.DotCritDmgIncrease;
value = base_value*ratio/100;
value += int(base_value*GetFocusEffect(focusImprovedDamage, spell_id, nullptr, from_buff_tic)/100)*ratio/100;
value += int(base_value*GetFocusEffect(focusImprovedDamage2, spell_id, nullptr, from_buff_tic)/100)*ratio/100;
value += int(base_value*GetFocusEffect(focusFcDamagePctCrit, spell_id, nullptr, from_buff_tic)/100)*ratio/100;
value += int(base_value*GetFocusEffect(focusFcAmplifyMod, spell_id, nullptr, from_buff_tic) / 100)*ratio/100;
value += int(base_value*target->GetVulnerability(this, spell_id, 0, from_buff_tic)/100)*ratio/100;
value += int64(base_value*GetFocusEffect(focusImprovedDamage, spell_id, nullptr, from_buff_tic)/100)*ratio/100;
value += int64(base_value*GetFocusEffect(focusImprovedDamage2, spell_id, nullptr, from_buff_tic)/100)*ratio/100;
value += int64(base_value*GetFocusEffect(focusFcDamagePctCrit, spell_id, nullptr, from_buff_tic)/100)*ratio/100;
value += int64(base_value*GetFocusEffect(focusFcAmplifyMod, spell_id, nullptr, from_buff_tic) / 100)*ratio/100;
value += int64(base_value*target->GetVulnerability(this, spell_id, 0, from_buff_tic)/100)*ratio/100;
extra_dmg = target->GetFcDamageAmtIncoming(this, spell_id, from_buff_tic) +
int(GetFocusEffect(focusFcDamageAmtCrit, spell_id, nullptr, from_buff_tic)*ratio/100) +
int64(GetFocusEffect(focusFcDamageAmtCrit, spell_id, nullptr, from_buff_tic)*ratio/100) +
GetFocusEffect(focusFcDamageAmt, spell_id, nullptr, from_buff_tic) +
GetFocusEffect(focusFcDamageAmt2, spell_id, nullptr, from_buff_tic) +
GetFocusEffect(focusFcAmplifyAmt, spell_id, nullptr, from_buff_tic);
@ -277,12 +277,12 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target, bool from_
}
if (IsNPC() && CastToNPC()->GetSpellScale())
value = int(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f);
value = int64(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f);
return value;
}
int32 Mob::GetExtraSpellAmt(uint16 spell_id, int32 extra_spell_amt, int32 base_spell_dmg)
int64 Mob::GetExtraSpellAmt(uint16 spell_id, int64 extra_spell_amt, int64 base_spell_dmg)
{
if (RuleB(Spells, FlatItemExtraSpellAmt)) {
if (RuleB(Spells, ItemExtraSpellAmtCalcAsPercent))
@ -316,14 +316,14 @@ int32 Mob::GetExtraSpellAmt(uint16 spell_id, int32 extra_spell_amt, int32 base_s
return extra_spell_amt;
}
int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target, bool from_buff_tic) {
int64 Mob::GetActSpellHealing(uint16 spell_id, int64 value, Mob* target, bool from_buff_tic) {
if (IsNPC()) {
value += value * CastToNPC()->GetSpellFocusHeal() / 100;
}
int32 base_value = value;
int64 base_value = value;
int16 critical_chance = 0;
int8 critical_modifier = 1;
@ -354,17 +354,17 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target, bool fr
}
if (GetClass() == CLERIC) {
value += int(base_value*RuleI(Spells, ClericInnateHealFocus) / 100); //confirmed on live parsing clerics get an innate 5 pct heal focus
value += int64(base_value*RuleI(Spells, ClericInnateHealFocus) / 100); //confirmed on live parsing clerics get an innate 5 pct heal focus
}
value += int(base_value*GetFocusEffect(focusImprovedHeal, spell_id, nullptr, from_buff_tic) / 100);
value += int(base_value*GetFocusEffect(focusFcAmplifyMod, spell_id, nullptr, from_buff_tic) / 100);
value += int64(base_value*GetFocusEffect(focusImprovedHeal, spell_id, nullptr, from_buff_tic) / 100);
value += int64(base_value*GetFocusEffect(focusFcAmplifyMod, spell_id, nullptr, from_buff_tic) / 100);
// Instant Heals
if (spells[spell_id].buff_duration < 1) {
if (target) {
value += int(base_value * target->GetFocusEffect(focusFcHealPctIncoming, spell_id, this)/100); //SPA 393 Add before critical
value += int(base_value * target->GetFocusEffect(focusFcHealPctCritIncoming, spell_id, this)/100); //SPA 395 Add before critical (?)
value += int64(base_value * target->GetFocusEffect(focusFcHealPctIncoming, spell_id, this)/100); //SPA 393 Add before critical
value += int64(base_value * target->GetFocusEffect(focusFcHealPctCritIncoming, spell_id, this)/100); //SPA 395 Add before critical (?)
}
value += GetFocusEffect(focusFcHealAmtCrit, spell_id); //SPA 396 Add before critical
@ -413,7 +413,7 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target, bool fr
//Heal over time spells. [Heal Rate and Additional Healing effects do not increase this value]
else {
//Using IgnoreSpellDmgLvlRestriction to also allow healing to scale
int32 extra_heal = 0;
int64 extra_heal = 0;
if (RuleB(Spells, HOTsScaleWithHealAmt)) {
if (RuleB(Spells, IgnoreSpellDmgLvlRestriction) && !spells[spell_id].no_heal_damage_item_mod && itembonuses.HealAmt) {
extra_heal += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, base_value);

View File

@ -34,8 +34,8 @@ public:
~Encounter();
//abstract virtual function implementations required by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) { return true; }
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; }
virtual bool Death(Mob* killerMob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) { return true; }
virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; }
virtual bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
ExtraAttackOptions *opts = nullptr) {
return false;
@ -44,13 +44,13 @@ public:
virtual bool HasGroup() { return false; }
virtual Raid* GetRaid() { return 0; }
virtual Group* GetGroup() { return 0; }
bool IsEncounter() const { return true; }
const char* GetEncounterName() const { return encounter_name; }
bool Process();
virtual void Depop(bool not_used = true) { remove_me = true; }
protected:
bool remove_me;

View File

@ -3618,7 +3618,7 @@ void EntityList::ClearZoneFeignAggro(Mob *targ)
}
}
void EntityList::AggroZone(Mob *who, uint32 hate)
void EntityList::AggroZone(Mob *who, uint64 hate)
{
auto it = npc_list.begin();
while (it != npc_list.end()) {
@ -3645,7 +3645,7 @@ bool EntityList::MakeTrackPacket(Client *client)
uint32 distance = 0;
float MobDistance;
distance = (client->GetSkill(EQ::skills::SkillTracking) * client->GetClassTrackingDistanceMultiplier(client->GetClass()));
distance = (client->GetSkill(EQ::skills::SkillTracking) * client->GetClassTrackingDistanceMultiplier(client->GetClass()));
if (distance <= 0)
return false;
@ -5509,8 +5509,8 @@ std::vector<Mob*> EntityList::GetTargetsForVirusEffect(Mob *spreader, Mob *origi
for (auto &it : entity_list.GetCloseMobList(spreader, range)) {
Mob *mob = it.second;
if (!mob) {
continue;
if (!mob) {
continue;
}
if (mob == spreader) {

View File

@ -460,7 +460,7 @@ public:
void ClearWaterAggro(Mob* targ);
void ClearFeignAggro(Mob* targ);
void ClearZoneFeignAggro(Mob* targ);
void AggroZone(Mob* who, uint32 hate = 0);
void AggroZone(Mob* who, uint64 hate = 0);
bool Fighting(Mob* targ);
void RemoveFromHateLists(Mob* mob, bool settoone = false);

View File

@ -7,9 +7,9 @@ void command_aggrozone(Client *c, const Seperator *sep)
target = c->GetTarget();
}
uint32 hate = 0;
uint64 hate = 0;
if (sep->IsNumber(1)) {
hate = std::stoul(sep->arg[1]);
hate = std::strtoll(sep->arg[1], nullptr, 10);
}
entity_list.AggroZone(target, hate);

View File

@ -11,8 +11,8 @@ void command_damage(Client *c, const Seperator *sep)
Mob* target = c;
if (c->GetTarget()) {
target = c->GetTarget();
}
}
int damage = static_cast<int>(std::min(std::stoll(sep->arg[1]), (long long) 2000000000));
int64 damage = std::stoll(sep->arg[1], nullptr, 10);
target->Damage(c, damage, SPELL_UNKNOWN, EQ::skills::SkillHandtoHand, false);
}

View File

@ -233,15 +233,22 @@ void command_npcedit(Client *c, const Seperator *sep)
}
if (strcasecmp(sep->arg[1], "hp") == 0) {
c->Message(Chat::Yellow, fmt::format("NPC ID {} now has {} Health.", npc_id, atoi(sep->arg[2])).c_str());
std::string query = fmt::format("UPDATE npc_types SET hp = {} WHERE id = {}", atoi(sep->arg[2]), npc_id);
c->Message(
Chat::Yellow,
fmt::format(
"NPC ID {} now has {} Health.",
npc_id,
std::strtoll(sep->arg[2], nullptr, 10)
).c_str()
);
std::string query = fmt::format("UPDATE npc_types SET hp = {} WHERE id = {}", strtoull(sep->arg[2], nullptr, 10), npc_id);
content_db.QueryDatabase(query);
return;
}
if (strcasecmp(sep->arg[1], "mana") == 0) {
c->Message(Chat::Yellow, fmt::format("NPC ID {} now has {} Mana.", npc_id, atoi(sep->arg[2])).c_str());
std::string query = fmt::format("UPDATE npc_types SET mana = {} WHERE id = {}", atoi(sep->arg[2]), npc_id);
c->Message(Chat::Yellow, fmt::format("NPC ID {} now has {} Mana.", npc_id, std::strtoll(sep->arg[2], nullptr, 10)).c_str());
std::string query = fmt::format("UPDATE npc_types SET mana = {} WHERE id = {}", std::strtoll(sep->arg[2], nullptr, 10), npc_id);
content_db.QueryDatabase(query);
return;
}
@ -299,10 +306,10 @@ void command_npcedit(Client *c, const Seperator *sep)
if (strcasecmp(sep->arg[1], "hpregen") == 0) {
c->Message(
Chat::Yellow,
fmt::format("NPC ID {} now regenerates {} Health per Tick.", npc_id, atoi(sep->arg[2])).c_str());
fmt::format("NPC ID {} now regenerates {} Health per Tick.", npc_id, std::strtoll(sep->arg[2], nullptr, 10)).c_str());
std::string query = fmt::format(
"UPDATE npc_types SET hp_regen_rate = {} WHERE id = {}",
atoi(sep->arg[2]),
std::strtoll(sep->arg[2], nullptr, 10),
npc_id
);
content_db.QueryDatabase(query);
@ -315,11 +322,11 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"NPC ID {} now regenerates {} HP per second.",
npc_id,
atoi(sep->arg[2])).c_str()
std::strtoll(sep->arg[2], nullptr, 10)).c_str()
);
std::string query = fmt::format(
"UPDATE npc_types SET hp_regen_per_second = {} WHERE id = {}",
atoi(sep->arg[2]),
std::strtoll(sep->arg[2], nullptr, 10),
npc_id
);
content_db.QueryDatabase(query);
@ -329,10 +336,10 @@ void command_npcedit(Client *c, const Seperator *sep)
if (strcasecmp(sep->arg[1], "manaregen") == 0) {
c->Message(
Chat::Yellow,
fmt::format("NPC ID {} now regenerates {} Mana per Tick.", npc_id, atoi(sep->arg[2])).c_str());
fmt::format("NPC ID {} now regenerates {} Mana per Tick.", npc_id, std::strtoll(sep->arg[2], nullptr, 10)).c_str());
std::string query = fmt::format(
"UPDATE npc_types SET mana_regen_rate = {} WHERE id = {}",
atoi(sep->arg[2]),
std::strtoll(sep->arg[2], nullptr, 10),
npc_id
);
content_db.QueryDatabase(query);

View File

@ -1309,7 +1309,7 @@ void Group::BalanceHP(int32 penalty, float range, Mob* caster, int32 limit)
if (!range)
range = 200;
int dmgtaken = 0, numMem = 0, dmgtaken_tmp = 0;
int64 dmgtaken = 0, numMem = 0, dmgtaken_tmp = 0;
float distance;
float range2 = range*range;

View File

@ -98,7 +98,7 @@ struct_HateList *HateList::Find(Mob *in_entity)
return nullptr;
}
void HateList::SetHateAmountOnEnt(Mob* other, uint32 in_hate, uint32 in_damage)
void HateList::SetHateAmountOnEnt(Mob* other, uint64 in_hate, uint64 in_damage)
{
struct_HateList *entity = Find(other);
if (entity)
@ -116,7 +116,7 @@ Mob* HateList::GetDamageTopOnHateList(Mob* hater)
Mob* current = nullptr;
Group* grp = nullptr;
Raid* r = nullptr;
uint32 dmg_amt = 0;
uint64 dmg_amt = 0;
auto iterator = list.begin();
while (iterator != list.end())
@ -145,7 +145,7 @@ Mob* HateList::GetDamageTopOnHateList(Mob* hater)
dmg_amt = grp->GetTotalGroupDamage(hater);
}
}
else if ((*iterator)->entity_on_hatelist != nullptr && (uint32)(*iterator)->hatelist_damage >= dmg_amt)
else if ((*iterator)->entity_on_hatelist != nullptr && (uint64)(*iterator)->hatelist_damage >= dmg_amt)
{
current = (*iterator)->entity_on_hatelist;
dmg_amt = (*iterator)->hatelist_damage;
@ -181,7 +181,7 @@ Mob* HateList::GetClosestEntOnHateList(Mob *hater, bool skip_mezzed) {
return close_entity;
}
void HateList::AddEntToHateList(Mob *in_entity, int32 in_hate, int32 in_damage, bool in_is_entity_frenzied, bool iAddIfNotExist)
void HateList::AddEntToHateList(Mob *in_entity, int64 in_hate, int64 in_damage, bool in_is_entity_frenzied, bool iAddIfNotExist)
{
if (!in_entity)
return;
@ -247,7 +247,7 @@ bool HateList::RemoveEntFromHateList(Mob *in_entity)
return is_found;
}
void HateList::DoFactionHits(int32 npc_faction_level_id) {
void HateList::DoFactionHits(int64 npc_faction_level_id) {
if (npc_faction_level_id <= 0)
return;
auto iterator = list.begin();
@ -380,7 +380,7 @@ Mob *HateList::GetEntWithMostHateOnList(Mob *center, Mob *skip, bool skip_mezzed
aggro_mod += RuleI(Aggro, SittingAggroMod);
}
#endif
if (center){
if (center->GetTarget() == cur->entity_on_hatelist)
aggro_mod += RuleI(Aggro, CurrentTargetAggroMod);
@ -587,7 +587,7 @@ Mob *HateList::GetEscapingEntOnHateList() {
Mob *HateList::GetEscapingEntOnHateList(Mob *center, float range, bool first) {
// function is still in design stage
if (!center)
return nullptr;
@ -607,15 +607,15 @@ Mob *HateList::GetEscapingEntOnHateList(Mob *center, float range, bool first) {
continue;
if (iter->entity_on_hatelist->IsStunned())
continue;
float distance_test = DistanceSquared(center->GetPosition(), iter->entity_on_hatelist->GetPosition());
if (range > 0.0f && distance_test > range)
continue;
if (first)
return iter->entity_on_hatelist;
if (distance_test > mob_distance) {
escaping_mob = iter->entity_on_hatelist;
mob_distance = distance_test;
@ -625,7 +625,7 @@ Mob *HateList::GetEscapingEntOnHateList(Mob *center, float range, bool first) {
return escaping_mob;
}
int32 HateList::GetEntHateAmount(Mob *in_entity, bool damage)
int64 HateList::GetEntHateAmount(Mob *in_entity, bool damage)
{
struct_HateList *entity;

View File

@ -25,18 +25,16 @@ class Mob;
class Raid;
struct ExtraAttackOptions;
struct struct_HateList
{
Mob *entity_on_hatelist;
int32 hatelist_damage;
uint32 stored_hate_amount;
bool is_entity_frenzy;
int8 oor_count; // count on how long we've been out of range
uint32 last_modified; // we need to remove this if it gets higher than 10 mins
struct struct_HateList {
Mob *entity_on_hatelist;
int64 hatelist_damage;
uint64 stored_hate_amount;
bool is_entity_frenzy;
int8 oor_count; // count on how long we've been out of range
uint64 last_modified; // we need to remove this if it gets higher than 10 mins
};
class HateList
{
class HateList {
public:
HateList();
~HateList();
@ -52,8 +50,8 @@ public:
#ifdef BOTS
Bot* GetRandomBotOnHateList(bool skip_mezzed = false);
#endif
Client* GetRandomClientOnHateList(bool skip_mezzed = false);
NPC* GetRandomNPCOnHateList(bool skip_mezzed = false);
Client *GetRandomClientOnHateList(bool skip_mezzed = false);
NPC *GetRandomNPCOnHateList(bool skip_mezzed = false);
bool IsEntOnHateList(Mob *mob);
bool IsHateListEmpty();
@ -63,16 +61,22 @@ public:
int GetSummonedPetCountOnHateList();
int GetHateRatio(Mob *top, Mob *other);
int32 GetEntHateAmount(Mob *ent, bool in_damage = false);
int64 GetEntHateAmount(Mob *ent, bool in_damage = false);
std::list<struct_HateList*>& GetHateList() { return list; }
std::list<struct_HateList*> GetHateListByDistance(int distance = 0);
std::list<struct_HateList *> &GetHateList() { return list; }
std::list<struct_HateList *> GetHateListByDistance(int distance = 0);
void AddEntToHateList(Mob *ent, int32 in_hate = 0, int32 in_damage = 0, bool in_is_frenzied = false, bool add_to_hate_list_if_not_exist = true);
void DoFactionHits(int32 npc_faction_level_id);
void AddEntToHateList(
Mob *ent,
int64 in_hate = 0,
int64 in_damage = 0,
bool in_is_frenzied = false,
bool add_to_hate_list_if_not_exist = true
);
void DoFactionHits(int64 npc_faction_level_id);
void IsEntityInFrenzyMode();
void PrintHateListToClient(Client *c);
void SetHateAmountOnEnt(Mob *other, uint32 in_hate, uint32 in_damage);
void SetHateAmountOnEnt(Mob *other, uint64 in_hate, uint64 in_damage);
void SetHateOwner(Mob *new_hate_owner) { hate_owner = new_hate_owner; }
void SpellCast(Mob *caster, uint32 spell_id, float range, Mob *ae_center = nullptr);
void WipeHateList();
@ -80,10 +84,10 @@ public:
protected:
struct_HateList* Find(Mob *ent);
struct_HateList *Find(Mob *ent);
private:
std::list<struct_HateList*> list;
Mob *hate_owner;
std::list<struct_HateList *> list;
Mob *hate_owner;
};
#endif

View File

@ -20,22 +20,22 @@ void Lua_HateEntry::SetEnt(Lua_Mob e) {
self->entity_on_hatelist = e;
}
int Lua_HateEntry::GetDamage() {
int64 Lua_HateEntry::GetDamage() {
Lua_Safe_Call_Int();
return self->hatelist_damage;
}
void Lua_HateEntry::SetDamage(int value) {
void Lua_HateEntry::SetDamage(int64 value) {
Lua_Safe_Call_Void();
self->hatelist_damage = value;
}
int Lua_HateEntry::GetHate() {
uint64 Lua_HateEntry::GetHate() {
Lua_Safe_Call_Int();
return self->stored_hate_amount;
}
void Lua_HateEntry::SetHate(int value) {
void Lua_HateEntry::SetHate(uint64 value) {
Lua_Safe_Call_Void();
self->stored_hate_amount = value;
}

View File

@ -17,13 +17,13 @@ public:
Lua_HateEntry() : Lua_Ptr(nullptr) { }
Lua_HateEntry(struct_HateList *d) : Lua_Ptr(d) { }
virtual ~Lua_HateEntry() { }
Lua_Mob GetEnt();
void SetEnt(Lua_Mob e);
int GetDamage();
void SetDamage(int value);
int GetHate();
void SetHate(int value);
int64 GetDamage();
void SetDamage(int64 value);
uint64 GetHate();
void SetHate(uint64 value);
int GetFrenzy();
void SetFrenzy(bool value);
};

View File

@ -182,22 +182,22 @@ bool Lua_Mob::Attack(Lua_Mob other, int hand, bool from_riposte, bool is_striket
return self->Attack(other, hand, from_riposte, is_strikethrough, is_from_spell, &options);
}
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill) {
void Lua_Mob::Damage(Lua_Mob from, int64 damage, int spell_id, int attack_skill) {
Lua_Safe_Call_Void();
return self->Damage(from, damage, spell_id, static_cast<EQ::skills::SkillType>(attack_skill));
}
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable) {
void Lua_Mob::Damage(Lua_Mob from, int64 damage, int spell_id, int attack_skill, bool avoidable) {
Lua_Safe_Call_Void();
return self->Damage(from, damage, spell_id, static_cast<EQ::skills::SkillType>(attack_skill), avoidable);
}
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot) {
void Lua_Mob::Damage(Lua_Mob from, int64 damage, int spell_id, int attack_skill, bool avoidable, int buffslot) {
Lua_Safe_Call_Void();
return self->Damage(from, damage, spell_id, static_cast<EQ::skills::SkillType>(attack_skill), avoidable, buffslot);
}
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot, bool buff_tic) {
void Lua_Mob::Damage(Lua_Mob from, int64 damage, int spell_id, int attack_skill, bool avoidable, int buffslot, bool buff_tic) {
Lua_Safe_Call_Void();
return self->Damage(from, damage, spell_id, static_cast<EQ::skills::SkillType>(attack_skill), avoidable, buffslot, buff_tic);
}
@ -217,12 +217,12 @@ void Lua_Mob::Heal() {
self->Heal();
}
void Lua_Mob::HealDamage(uint32 amount) {
void Lua_Mob::HealDamage(uint64 amount) {
Lua_Safe_Call_Void();
self->HealDamage(amount);
}
void Lua_Mob::HealDamage(uint32 amount, Lua_Mob other) {
void Lua_Mob::HealDamage(uint64 amount, Lua_Mob other) {
Lua_Safe_Call_Void();
self->HealDamage(amount, other);
}
@ -237,7 +237,7 @@ uint32 Lua_Mob::GetLevelCon(int my, int other) {
return self->GetLevelCon(my, other);
}
void Lua_Mob::SetHP(int hp) {
void Lua_Mob::SetHP(int64 hp) {
Lua_Safe_Call_Void();
self->SetHP(hp);
}
@ -1016,27 +1016,27 @@ void Lua_Mob::AddToHateList(Lua_Mob other) {
self->AddToHateList(other);
}
void Lua_Mob::AddToHateList(Lua_Mob other, int hate) {
void Lua_Mob::AddToHateList(Lua_Mob other, int64 hate) {
Lua_Safe_Call_Void();
self->AddToHateList(other, hate);
}
void Lua_Mob::AddToHateList(Lua_Mob other, int hate, int damage) {
void Lua_Mob::AddToHateList(Lua_Mob other, int64 hate, int64 damage) {
Lua_Safe_Call_Void();
self->AddToHateList(other, hate, damage);
}
void Lua_Mob::AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help) {
void Lua_Mob::AddToHateList(Lua_Mob other, int64 hate, int64 damage, bool yell_for_help) {
Lua_Safe_Call_Void();
self->AddToHateList(other, hate, damage, yell_for_help);
}
void Lua_Mob::AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help, bool frenzy) {
void Lua_Mob::AddToHateList(Lua_Mob other, int64 hate, int64 damage, bool yell_for_help, bool frenzy) {
Lua_Safe_Call_Void();
self->AddToHateList(other, hate, damage, yell_for_help, frenzy);
}
void Lua_Mob::AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help, bool frenzy, bool buff_tic) {
void Lua_Mob::AddToHateList(Lua_Mob other, int64 hate, int64 damage, bool yell_for_help, bool frenzy, bool buff_tic) {
Lua_Safe_Call_Void();
self->AddToHateList(other, hate, damage, yell_for_help, frenzy, buff_tic);
}
@ -1046,12 +1046,12 @@ void Lua_Mob::SetHate(Lua_Mob other) {
self->SetHateAmountOnEnt(other);
}
void Lua_Mob::SetHate(Lua_Mob other, int hate) {
void Lua_Mob::SetHate(Lua_Mob other, int64 hate) {
Lua_Safe_Call_Void();
self->SetHateAmountOnEnt(other, hate);
}
void Lua_Mob::SetHate(Lua_Mob other, int hate, int damage) {
void Lua_Mob::SetHate(Lua_Mob other, int64 hate, int64 damage) {
Lua_Safe_Call_Void();
self->SetHateAmountOnEnt(other, hate, damage);
}
@ -1066,17 +1066,17 @@ void Lua_Mob::DoubleAggro(Lua_Mob other) {
self->DoubleAggro(other);
}
uint32 Lua_Mob::GetHateAmount(Lua_Mob target) {
uint64 Lua_Mob::GetHateAmount(Lua_Mob target) {
Lua_Safe_Call_Int();
return self->GetHateAmount(target);
}
uint32 Lua_Mob::GetHateAmount(Lua_Mob target, bool is_damage) {
uint64 Lua_Mob::GetHateAmount(Lua_Mob target, bool is_damage) {
Lua_Safe_Call_Int();
return self->GetHateAmount(target, is_damage);
}
uint32 Lua_Mob::GetDamageAmount(Lua_Mob target) {
uint64 Lua_Mob::GetDamageAmount(Lua_Mob target) {
Lua_Safe_Call_Int();
return self->GetDamageAmount(target);
}
@ -2283,7 +2283,7 @@ bool Lua_Mob::IsBerserk() {
return self->IsBerserk();
}
bool Lua_Mob::TryFinishingBlow(Lua_Mob defender, int &damage) {
bool Lua_Mob::TryFinishingBlow(Lua_Mob defender, int64 &damage) {
Lua_Safe_Call_Bool();
return self->TryFinishingBlow(defender, damage);
}
@ -2478,11 +2478,11 @@ luabind::scope lua_register_mob() {
.def(luabind::constructor<>())
.def("AddNimbusEffect", (void(Lua_Mob::*)(int))&Lua_Mob::AddNimbusEffect)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::AddToHateList)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::AddToHateList)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::AddToHateList)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool))&Lua_Mob::AddToHateList)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool,bool))&Lua_Mob::AddToHateList)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int,int,bool,bool,bool))&Lua_Mob::AddToHateList)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int64))&Lua_Mob::AddToHateList)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int64,int64))&Lua_Mob::AddToHateList)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int64,int64,bool))&Lua_Mob::AddToHateList)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int64,int64,bool,bool))&Lua_Mob::AddToHateList)
.def("AddToHateList", (void(Lua_Mob::*)(Lua_Mob,int64,int64,bool,bool,bool))&Lua_Mob::AddToHateList)
.def("ApplySpellBuff", (void(Lua_Mob::*)(int))&Lua_Mob::ApplySpellBuff)
.def("ApplySpellBuff", (void(Lua_Mob::*)(int, int))&Lua_Mob::ApplySpellBuff)
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::Attack)
@ -2553,10 +2553,10 @@ luabind::scope lua_register_mob() {
.def("CheckNumHitsRemaining", &Lua_Mob::CheckNumHitsRemaining)
.def("ClearSpecialAbilities", (void(Lua_Mob::*)(void))&Lua_Mob::ClearSpecialAbilities)
.def("CombatRange", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::CombatRange)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int))&Lua_Mob::Damage)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool))&Lua_Mob::Damage)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool,int))&Lua_Mob::Damage)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool,int,bool))&Lua_Mob::Damage)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int64,int,int))&Lua_Mob::Damage)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int64,int,int,bool))&Lua_Mob::Damage)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int64,int,int,bool,int))&Lua_Mob::Damage)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int64,int,int,bool,int,bool))&Lua_Mob::Damage)
.def("DelGlobal", (void(Lua_Mob::*)(const char*))&Lua_Mob::DelGlobal)
.def("DeleteBucket", (void(Lua_Mob::*)(std::string))&Lua_Mob::DeleteBucket)
.def("Depop", (void(Lua_Mob::*)(bool))&Lua_Mob::Depop)
@ -2653,8 +2653,8 @@ luabind::scope lua_register_mob() {
.def("GetHandToHandDamage", (int(Lua_Mob::*)(void))&Lua_Mob::GetHandToHandDamage)
.def("GetHandToHandDelay", (int(Lua_Mob::*)(void))&Lua_Mob::GetHandToHandDelay)
.def("GetHaste", (int(Lua_Mob::*)(void))&Lua_Mob::GetHaste)
.def("GetHateAmount", (uint32(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateAmount)
.def("GetHateAmount", (uint32(Lua_Mob::*)(Lua_Mob,bool))&Lua_Mob::GetHateAmount)
.def("GetHateAmount", (uint64(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateAmount)
.def("GetHateAmount", (uint64(Lua_Mob::*)(Lua_Mob,bool))&Lua_Mob::GetHateAmount)
.def("GetHateClosest", &Lua_Mob::GetHateClosest)
.def("GetHateDamageTop", (Lua_Mob(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetHateDamageTop)
.def("GetHateList", &Lua_Mob::GetHateList)
@ -2752,8 +2752,8 @@ luabind::scope lua_register_mob() {
.def("HasTwoHandBluntEquiped", (bool(Lua_Mob::*)(void))&Lua_Mob::HasTwoHandBluntEquiped)
.def("HasTwoHanderEquipped", (bool(Lua_Mob::*)(void))&Lua_Mob::HasTwoHanderEquipped)
.def("Heal", &Lua_Mob::Heal)
.def("HealDamage", (void(Lua_Mob::*)(uint32))&Lua_Mob::HealDamage)
.def("HealDamage", (void(Lua_Mob::*)(uint32,Lua_Mob))&Lua_Mob::HealDamage)
.def("HealDamage", (void(Lua_Mob::*)(uint64))&Lua_Mob::HealDamage)
.def("HealDamage", (void(Lua_Mob::*)(uint64,Lua_Mob))&Lua_Mob::HealDamage)
.def("InterruptSpell", (void(Lua_Mob::*)(int))&Lua_Mob::InterruptSpell)
.def("InterruptSpell", (void(Lua_Mob::*)(void))&Lua_Mob::InterruptSpell)
.def("IsAIControlled", (bool(Lua_Mob::*)(void))&Lua_Mob::IsAIControlled)
@ -2852,8 +2852,8 @@ luabind::scope lua_register_mob() {
.def("SetGlobal", (void(Lua_Mob::*)(const char*,const char*,int,const char*,Lua_Mob))&Lua_Mob::SetGlobal)
.def("SetHP", &Lua_Mob::SetHP)
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::SetHate)
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::SetHate)
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob,int,int))&Lua_Mob::SetHate)
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob,int64))&Lua_Mob::SetHate)
.def("SetHate", (void(Lua_Mob::*)(Lua_Mob,int64,int64))&Lua_Mob::SetHate)
.def("SetHeading", (void(Lua_Mob::*)(double))&Lua_Mob::SetHeading)
.def("SetInvisible", &Lua_Mob::SetInvisible)
.def("SetInvul", (void(Lua_Mob::*)(bool))&Lua_Mob::SetInvul)

View File

@ -58,18 +58,18 @@ public:
bool Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough);
bool Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell);
bool Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell, luabind::adl::object opts);
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill);
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable);
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot);
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot, bool buff_tic);
void Damage(Lua_Mob from, int64 damage, int spell_id, int attack_skill);
void Damage(Lua_Mob from, int64 damage, int spell_id, int attack_skill, bool avoidable);
void Damage(Lua_Mob from, int64 damage, int spell_id, int attack_skill, bool avoidable, int buffslot);
void Damage(Lua_Mob from, int64 damage, int spell_id, int attack_skill, bool avoidable, int buffslot, bool buff_tic);
void RangedAttack(Lua_Mob other);
void ThrowingAttack(Lua_Mob other);
void Heal();
void HealDamage(uint32 amount);
void HealDamage(uint32 amount, Lua_Mob other);
void HealDamage(uint64 amount);
void HealDamage(uint64 amount, Lua_Mob other);
uint32 GetLevelCon(int other);
uint32 GetLevelCon(int my, int other);
void SetHP(int hp);
void SetHP(int64 hp);
void DoAnim(int anim_num);
void DoAnim(int anim_num, int type);
void DoAnim(int anim_num, int type, bool ackreq);
@ -220,19 +220,19 @@ public:
Lua_NPC GetHateRandomNPC();
Lua_Mob GetHateClosest();
void AddToHateList(Lua_Mob other);
void AddToHateList(Lua_Mob other, int hate);
void AddToHateList(Lua_Mob other, int hate, int damage);
void AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help);
void AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help, bool frenzy);
void AddToHateList(Lua_Mob other, int hate, int damage, bool yell_for_help, bool frenzy, bool buff_tic);
void AddToHateList(Lua_Mob other, int64 hate);
void AddToHateList(Lua_Mob other, int64 hate, int64 damage);
void AddToHateList(Lua_Mob other, int64 hate, int64 damage, bool yell_for_help);
void AddToHateList(Lua_Mob other, int64 hate, int64 damage, bool yell_for_help, bool frenzy);
void AddToHateList(Lua_Mob other, int64 hate, int64 damage, bool yell_for_help, bool frenzy, bool buff_tic);
void SetHate(Lua_Mob other);
void SetHate(Lua_Mob other, int hate);
void SetHate(Lua_Mob other, int hate, int damage);
void SetHate(Lua_Mob other, int64 hate);
void SetHate(Lua_Mob other, int64 hate, int64 damage);
void HalveAggro(Lua_Mob other);
void DoubleAggro(Lua_Mob other);
uint32 GetHateAmount(Lua_Mob target);
uint32 GetHateAmount(Lua_Mob target, bool is_damage);
uint32 GetDamageAmount(Lua_Mob target);
uint64 GetHateAmount(Lua_Mob target);
uint64 GetHateAmount(Lua_Mob target, bool is_damage);
uint64 GetDamageAmount(Lua_Mob target);
void WipeHateList();
bool CheckAggro(Lua_Mob other);
void Stun(int duration);
@ -442,7 +442,7 @@ public:
int AttackAnimation(int Hand, Lua_ItemInst weapon);
int GetWeaponDamage(Lua_Mob against, Lua_ItemInst weapon);
bool IsBerserk();
bool TryFinishingBlow(Lua_Mob defender, int &damage);
bool TryFinishingBlow(Lua_Mob defender, int64 &damage);
int GetBodyType();
int GetOrigBodyType();
void CheckNumHitsRemaining(int type, int32 buff_slot, uint16 spell_id);

View File

@ -10,37 +10,37 @@ int32 Lua_StatBonuses::GetAC() const {
return self->AC;
}
int32 Lua_StatBonuses::GetHP() const {
int64 Lua_StatBonuses::GetHP() const {
Lua_Safe_Call_Int();
return self->HP;
}
int32 Lua_StatBonuses::GetHPRegen() const {
int64 Lua_StatBonuses::GetHPRegen() const {
Lua_Safe_Call_Int();
return self->HPRegen;
}
int32 Lua_StatBonuses::GetMaxHP() const {
int64 Lua_StatBonuses::GetMaxHP() const {
Lua_Safe_Call_Int();
return self->MaxHP;
}
int32 Lua_StatBonuses::GetManaRegen() const {
int64 Lua_StatBonuses::GetManaRegen() const {
Lua_Safe_Call_Int();
return self->ManaRegen;
}
int32 Lua_StatBonuses::GetEnduranceRegen() const {
int64 Lua_StatBonuses::GetEnduranceRegen() const {
Lua_Safe_Call_Int();
return self->EnduranceRegen;
}
int32 Lua_StatBonuses::GetMana() const {
int64 Lua_StatBonuses::GetMana() const {
Lua_Safe_Call_Int();
return self->Mana;
}
int32 Lua_StatBonuses::GetEndurance() const {
int64 Lua_StatBonuses::GetEndurance() const {
Lua_Safe_Call_Int();
return self->Endurance;
}
@ -385,7 +385,7 @@ int8 Lua_StatBonuses::Gethatemod() const {
return self->hatemod;
}
int32 Lua_StatBonuses::GetEnduranceReduction() const {
int64 Lua_StatBonuses::GetEnduranceReduction() const {
Lua_Safe_Call_Int();
return self->EnduranceReduction;
}

View File

@ -26,13 +26,13 @@ public:
}
int32 GetAC() const;
int32 GetHP() const;
int32 GetHPRegen() const;
int32 GetMaxHP() const;
int32 GetManaRegen() const;
int32 GetEnduranceRegen() const;
int32 GetMana() const;
int32 GetEndurance() const;
int64 GetHP() const;
int64 GetHPRegen() const;
int64 GetMaxHP() const;
int64 GetManaRegen() const;
int64 GetEnduranceRegen() const;
int64 GetMana() const;
int64 GetEndurance() const;
int32 GetATK() const;
int32 GetSTR() const;
int32 GetSTRCapMod() const;
@ -101,7 +101,7 @@ public:
uint32 GetstringedMod() const;
uint32 GetsongModCap() const;
int8 Gethatemod() const;
int32 GetEnduranceReduction() const;
int64 GetEnduranceReduction() const;
int32 GetStrikeThrough() const;
int32 GetMeleeMitigation() const;
int32 GetMeleeMitigationEffect() const;

View File

@ -825,15 +825,15 @@ int32 Merc::CalcAC() {
return(AC);
}
int32 Merc::CalcHPRegen() {
int32 regen = hp_regen + itembonuses.HPRegen + spellbonuses.HPRegen;
int64 Merc::CalcHPRegen() {
int64 regen = hp_regen + itembonuses.HPRegen + spellbonuses.HPRegen;
regen += aabonuses.HPRegen + GroupLeadershipAAHealthRegeneration();
return (regen * RuleI(Character, HPRegenMultiplier) / 100);
}
int32 Merc::CalcHPRegenCap()
int64 Merc::CalcHPRegenCap()
{
int cap = RuleI(Character, ItemHealthRegenCap) + itembonuses.HeroicSTA/25;
@ -842,7 +842,7 @@ int32 Merc::CalcHPRegenCap()
return (cap * RuleI(Character, HPRegenMultiplier) / 100);
}
int32 Merc::CalcMaxHP() {
int64 Merc::CalcMaxHP() {
float nd = 10000;
max_hp = (CalcBaseHP() + itembonuses.HP);
@ -862,9 +862,9 @@ int32 Merc::CalcMaxHP() {
if (current_hp > max_hp)
current_hp = max_hp;
int hp_perc_cap = spellbonuses.HPPercCap[SBIndex::RESOURCE_PERCENT_CAP];
int64 hp_perc_cap = spellbonuses.HPPercCap[SBIndex::RESOURCE_PERCENT_CAP];
if(hp_perc_cap) {
int curHP_cap = (max_hp * hp_perc_cap) / 100;
int64 curHP_cap = (max_hp * hp_perc_cap) / 100;
if (current_hp > curHP_cap || (spellbonuses.HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && current_hp > spellbonuses.HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP]))
current_hp = curHP_cap;
}
@ -872,12 +872,12 @@ int32 Merc::CalcMaxHP() {
return max_hp;
}
int32 Merc::CalcBaseHP()
int64 Merc::CalcBaseHP()
{
return base_hp;
}
int32 Merc::CalcMaxMana()
int64 Merc::CalcMaxMana()
{
switch(GetCasterClass())
{
@ -917,12 +917,12 @@ int32 Merc::CalcMaxMana()
return max_mana;
}
int32 Merc::CalcBaseMana()
int64 Merc::CalcBaseMana()
{
return base_mana;
}
int32 Merc::CalcBaseManaRegen()
int64 Merc::CalcBaseManaRegen()
{
uint8 clevel = GetLevel();
int32 regen = 0;
@ -939,9 +939,9 @@ int32 Merc::CalcBaseManaRegen()
return regen;
}
int32 Merc::CalcManaRegen()
int64 Merc::CalcManaRegen()
{
int32 regen = 0;
int64 regen = 0;
if (IsSitting())
{
BuffFadeBySitModifier();
@ -971,9 +971,9 @@ int32 Merc::CalcManaRegen()
return (regen * RuleI(Character, ManaRegenMultiplier) / 100);
}
int32 Merc::CalcManaRegenCap()
int64 Merc::CalcManaRegenCap()
{
int32 cap = RuleI(Character, ItemManaRegenCap) + aabonuses.ItemManaRegenCap;
int64 cap = RuleI(Character, ItemManaRegenCap) + aabonuses.ItemManaRegenCap;
switch(GetCasterClass())
{
case 'I':
@ -1007,10 +1007,10 @@ void Merc::CalcMaxEndurance()
}
}
int32 Merc::CalcBaseEndurance()
int64 Merc::CalcBaseEndurance()
{
int32 base_end = 0;
int32 base_endurance = 0;
int64 base_end = 0;
int64 base_endurance = 0;
int32 ConvertedStats = 0;
int32 sta_end = 0;
int Stats = 0;
@ -1079,15 +1079,15 @@ int32 Merc::CalcBaseEndurance()
return base_end;
}
int32 Merc::CalcEnduranceRegen() {
int32 regen = int32(GetLevel() * 4 / 10) + 2;
int64 Merc::CalcEnduranceRegen() {
int64 regen = int32(GetLevel() * 4 / 10) + 2;
regen += aabonuses.EnduranceRegen + spellbonuses.EnduranceRegen + itembonuses.EnduranceRegen;
return (regen * RuleI(Character, EnduranceRegenMultiplier) / 100);
}
int32 Merc::CalcEnduranceRegenCap() {
int cap = (RuleI(Character, ItemEnduranceRegenCap) + itembonuses.HeroicSTR/25 + itembonuses.HeroicDEX/25 + itembonuses.HeroicAGI/25 + itembonuses.HeroicSTA/25);
int64 Merc::CalcEnduranceRegenCap() {
int64 cap = (RuleI(Character, ItemEnduranceRegenCap) + itembonuses.HeroicSTR/25 + itembonuses.HeroicDEX/25 + itembonuses.HeroicAGI/25 + itembonuses.HeroicSTA/25);
return (cap * RuleI(Character, EnduranceRegenMultiplier) / 100);
}
@ -2552,7 +2552,7 @@ bool Merc::CheckAENuke(Merc* caster, Mob* tar, uint16 spell_id, uint8 &numTarget
return false;
}
int32 Merc::GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic) {
int64 Merc::GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic) {
int32 realTotal = 0;
int32 realTotal2 = 0;
@ -4440,7 +4440,7 @@ 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(EQ::skills::SkillKick);
int64 dmg = GetBaseSkillDamage(EQ::skills::SkillKick);
if (GetWeaponDamage(target, (const EQ::ItemData*)nullptr) <= 0)
dmg = DMG_INVULNERABLE;
@ -4452,7 +4452,7 @@ void Merc::DoClassAttacks(Mob *target) {
else
{
DoAnim(animTailRake, 0, false);
int32 dmg = GetBaseSkillDamage(EQ::skills::SkillBash);
int64 dmg = GetBaseSkillDamage(EQ::skills::SkillBash);
if (GetWeaponDamage(target, (const EQ::ItemData*)nullptr) <= 0)
dmg = DMG_INVULNERABLE;
@ -4480,7 +4480,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, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special)
void Merc::Damage(Mob* other, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special)
{
if(IsDead() || IsCorpse())
return;
@ -4521,7 +4521,7 @@ Mob* Merc::GetOwnerOrSelf() {
return Result;
}
bool Merc::Death(Mob* killerMob, int32 damage, uint16 spell, EQ::skills::SkillType attack_skill)
bool Merc::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::SkillType attack_skill)
{
if(!NPC::Death(killerMob, damage, spell, attack_skill))
{
@ -4929,9 +4929,9 @@ void Merc::ScaleStats(int scalepercent, bool setmax) {
float scalerate = (float)scalepercent / 100.0f;
if ((int)((float)base_hp * scalerate) > 1)
if ((int64)((float)base_hp * scalerate) > 1)
{
max_hp = (int)((float)base_hp * scalerate);
max_hp = (int64)((float)base_hp * scalerate);
base_hp = max_hp;
if (setmax)
current_hp = max_hp;
@ -4939,7 +4939,7 @@ void Merc::ScaleStats(int scalepercent, bool setmax) {
if (base_mana)
{
max_mana = (int)((float)base_mana * scalerate);
max_mana = (int64)((float)base_mana * scalerate);
base_mana = max_mana;
if (setmax)
current_mana = max_mana;
@ -4947,7 +4947,7 @@ void Merc::ScaleStats(int scalepercent, bool setmax) {
if (base_end)
{
max_end = (int)((float)base_end * scalerate);
max_end = (int64)((float)base_end * scalerate);
base_end = max_end;
if (setmax)
cur_end = max_end;

View File

@ -52,8 +52,8 @@ public:
virtual ~Merc();
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
virtual bool Death(Mob* killerMob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
virtual bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr);
virtual bool HasRaid() { return false; }
@ -182,7 +182,7 @@ public:
// stat functions
virtual void ScaleStats(int scalepercent, bool setmax = false);
virtual void CalcBonuses();
int32 GetEndurance() const {return cur_end;} //This gets our current endurance
int64 GetEndurance() const {return cur_end;} //This gets our current endurance
inline uint8 GetEndurancePercent() { return (uint8)((float)cur_end / (float)max_end * 100.0f); }
inline virtual int32 GetATK() const { return ATK; }
inline virtual int32 GetATKBonus() const { return itembonuses.ATK + spellbonuses.ATK; }
@ -272,7 +272,7 @@ protected:
void AddItemBonuses(const EQ::ItemData *item, StatBonuses* newbon);
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
int32 GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic = false);
int64 GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic = false);
std::vector<MercSpell> merc_spells;
std::map<uint32,MercTimer> timers;
@ -309,21 +309,21 @@ private:
int32 CalcPR();
int32 CalcCR();
int32 CalcCorrup();
int32 CalcMaxHP();
int32 CalcBaseHP();
int32 GetClassHPFactor();
int32 CalcHPRegen();
int32 CalcHPRegenCap();
int32 CalcMaxMana();
int32 CalcBaseMana();
int32 CalcManaRegen();
int32 CalcBaseManaRegen();
int32 CalcManaRegenCap();
int64 CalcMaxHP();
int64 CalcBaseHP();
int64 GetClassHPFactor();
int64 CalcHPRegen();
int64 CalcHPRegenCap();
int64 CalcMaxMana();
int64 CalcBaseMana();
int64 CalcManaRegen();
int64 CalcBaseManaRegen();
int64 CalcManaRegenCap();
void CalcMaxEndurance(); //This calculates the maximum endurance we can have
int32 CalcBaseEndurance(); //Calculates Base End
int32 GetMaxEndurance() const {return max_end;} //This gets our endurance from the last CalcMaxEndurance() call
int32 CalcEnduranceRegen(); //Calculates endurance regen used in DoEnduranceRegen()
int32 CalcEnduranceRegenCap();
int64 CalcBaseEndurance(); //Calculates Base End
int64 GetMaxEndurance() const {return max_end;} //This gets our endurance from the last CalcMaxEndurance() call
int64 CalcEnduranceRegen(); //Calculates endurance regen used in DoEnduranceRegen()
int64 CalcEnduranceRegenCap();
void SetEndurance(int32 newEnd); //This sets the current endurance to the new value
void DoEnduranceUpkeep(); //does the endurance upkeep
void CalcRestState();
@ -375,8 +375,8 @@ private:
EQ::constants::StanceType _currentStance;
EQ::InventoryProfile m_inv;
int32 max_end;
int32 cur_end;
int64 max_end;
int64 cur_end;
bool _medding;
bool _suspended;
bool p_depop;

View File

@ -45,8 +45,8 @@ extern WorldServer worldserver;
Mob::Mob(
const char *in_name,
const char *in_lastname,
int32 in_cur_hp,
int32 in_max_hp,
int64 in_cur_hp,
int64 in_max_hp,
uint8 in_gender,
uint16 in_race,
uint8 in_class,
@ -85,8 +85,8 @@ Mob::Mob(
uint16 in_see_invis_undead,
uint8 in_see_hide,
uint8 in_see_improved_hide,
int32 in_hp_regen,
int32 in_mana_regen,
int64 in_hp_regen,
int64 in_mana_regen,
uint8 in_qglobal,
uint8 in_maxlevel,
uint32 in_scalerate,
@ -947,7 +947,7 @@ int Mob::_GetFearSpeed() const {
return speed_mod;
}
int32 Mob::CalcMaxMana() {
int64 Mob::CalcMaxMana() {
switch (GetCasterClass()) {
case 'I':
max_mana = (((GetINT()/2)+1) * GetLevel()) + spellbonuses.Mana + itembonuses.Mana;
@ -967,15 +967,15 @@ int32 Mob::CalcMaxMana() {
return max_mana;
}
int32 Mob::CalcMaxHP() {
int64 Mob::CalcMaxHP() {
max_hp = (base_hp + itembonuses.HP + spellbonuses.HP);
max_hp += max_hp * ((aabonuses.MaxHPChange + spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f);
return max_hp;
}
int32 Mob::GetItemHPBonuses() {
int32 item_hp = 0;
int64 Mob::GetItemHPBonuses() {
int64 item_hp = 0;
item_hp = itembonuses.HP;
item_hp += item_hp * itembonuses.MaxHPChange / 10000;
return item_hp;
@ -3243,10 +3243,10 @@ void Mob::SetTargetable(bool on) {
}
}
const int32& Mob::SetMana(int32 amount)
const int64& Mob::SetMana(int64 amount)
{
CalcMaxMana();
int32 mmana = GetMaxMana();
int64 mmana = GetMaxMana();
current_mana = amount < 0 ? 0 : (amount > mmana ? mmana : amount);
/*
if(IsClient())
@ -4387,7 +4387,7 @@ int Mob::GetSnaredAmount()
{
if (spells[buffs[i].spellid].effect_id[j] == SE_MovementSpeed)
{
int val = CalcSpellEffectValue_formula(spells[buffs[i].spellid].formula[j], spells[buffs[i].spellid].base_value[j], spells[buffs[i].spellid].max_value[j], buffs[i].casterlevel, buffs[i].spellid);
int64 val = CalcSpellEffectValue_formula(spells[buffs[i].spellid].formula[j], spells[buffs[i].spellid].base_value[j], spells[buffs[i].spellid].max_value[j], buffs[i].casterlevel, buffs[i].spellid);
//int effect = CalcSpellEffectValue(buffs[i].spellid, spells[buffs[i].spellid].effectid[j], buffs[i].casterlevel);
if (val < 0 && std::abs(val) > worst_snare)
worst_snare = std::abs(val);
@ -4398,7 +4398,7 @@ int Mob::GetSnaredAmount()
return worst_snare;
}
void Mob::TriggerDefensiveProcs(Mob *on, uint16 hand, bool FromSkillProc, int damage)
void Mob::TriggerDefensiveProcs(Mob *on, uint16 hand, bool FromSkillProc, int64 damage)
{
if (!on) {
return;
@ -4611,7 +4611,7 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id)
if(IsClient())
{
int32 focus = CastToClient()->GetFocusEffect(focusTwincast, spell_id);
int focus = CastToClient()->GetFocusEffect(focusTwincast, spell_id);
if (focus > 0)
{
@ -4659,7 +4659,7 @@ void Mob::ApplyHealthTransferDamage(Mob *caster, Mob *target, uint16 spell_id)
for (int i = 0; i < EFFECT_COUNT; i++) {
if (spells[spell_id].effect_id[i] == SE_Health_Transfer) {
int new_hp = GetMaxHP();
int64 new_hp = GetMaxHP();
new_hp -= GetMaxHP() * spells[spell_id].base_value[i] / 1000;
if (new_hp > 0) {
@ -5374,7 +5374,7 @@ int Mob::GetCriticalChanceBonus(uint16 skill)
int16 Mob::GetMeleeDamageMod_SE(uint16 skill)
{
int dmg_mod = 0;
int64 dmg_mod = 0;
// All skill dmg mod + Skill specific
dmg_mod += itembonuses.DamageModifier[EQ::skills::HIGHEST_SKILL + 1] + spellbonuses.DamageModifier[EQ::skills::HIGHEST_SKILL + 1] + aabonuses.DamageModifier[EQ::skills::HIGHEST_SKILL + 1] +
@ -5398,7 +5398,7 @@ int16 Mob::GetMeleeDamageMod_SE(uint16 skill)
int16 Mob::GetMeleeMinDamageMod_SE(uint16 skill)
{
int dmg_mod = 0;
int64 dmg_mod = 0;
dmg_mod = itembonuses.MinDamageModifier[skill] + spellbonuses.MinDamageModifier[skill] +
itembonuses.MinDamageModifier[EQ::skills::HIGHEST_SKILL + 1] + spellbonuses.MinDamageModifier[EQ::skills::HIGHEST_SKILL + 1];
@ -5495,7 +5495,7 @@ int16 Mob::GetPositionalDmgAmt(Mob* defender)
return total_amt;
}
void Mob::MeleeLifeTap(int32 damage) {
void Mob::MeleeLifeTap(int64 damage) {
int32 lifetap_amt = 0;
int32 melee_lifetap_mod = spellbonuses.MeleeLifetap + itembonuses.MeleeLifetap + aabonuses.MeleeLifetap
@ -6576,7 +6576,7 @@ int Mob::CheckBaneDamage(const EQ::ItemInstance *item)
if (!item)
return 0;
int damage = item->GetItemBaneDamageBody(GetBodyType(), true);
int64 damage = item->GetItemBaneDamageBody(GetBodyType(), true);
damage += item->GetItemBaneDamageRace(GetRace(), true);
return damage;

View File

@ -112,8 +112,8 @@ public:
Mob(
const char *in_name,
const char *in_lastname,
int32 in_cur_hp,
int32 in_max_hp,
int64 in_cur_hp,
int64 in_max_hp,
uint8 in_gender,
uint16 in_race,
uint8 in_class,
@ -152,8 +152,8 @@ public:
uint16 in_see_invis_undead, // see through invis vs. undead
uint8 in_see_hide,
uint8 in_see_improved_hide,
int32 in_hp_regen,
int32 in_mana_regen,
int64 in_hp_regen,
int64 in_mana_regen,
uint8 in_qglobal,
uint8 in_maxlevel,
uint32 in_scalerate,
@ -208,11 +208,11 @@ public:
bool CheckHitChance(Mob* attacker, DamageHitInfo &hit);
void TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *opts = nullptr);
void TryPetCriticalHit(Mob *defender, DamageHitInfo &hit);
virtual bool TryFinishingBlow(Mob *defender, int &damage);
virtual bool TryFinishingBlow(Mob *defender, int64 &damage);
int TryHeadShot(Mob* defender, EQ::skills::SkillType skillInUse);
int TryAssassinate(Mob* defender, EQ::skills::SkillType skillInUse);
virtual void DoRiposte(Mob* defender);
void ApplyMeleeDamageMods(uint16 skill, int &damage, Mob * defender = nullptr, ExtraAttackOptions *opts = nullptr);
void ApplyMeleeDamageMods(uint16 skill, int64 &damage, Mob * defender = nullptr, ExtraAttackOptions *opts = nullptr);
int ACSum(bool skip_caps = false);
inline int GetDisplayAC() { return 1000 * (ACSum(true) + compute_defense()) / 847; }
int offense(EQ::skills::SkillType skill);
@ -318,13 +318,13 @@ public:
void NegateSpellEffectBonuses(uint16 spell_id);
bool NegateSpellEffect(uint16 spell_id, int effect_id);
virtual float GetActSpellRange(uint16 spell_id, float range, bool IsBard = false);
virtual int32 GetActSpellDamage(uint16 spell_id, int32 value, Mob* target = nullptr);
virtual int32 GetActDoTDamage(uint16 spell_id, int32 value, Mob* target, bool from_buff_tic = true);
virtual int32 GetActSpellHealing(uint16 spell_id, int32 value, Mob* target = nullptr, bool from_buff_tic = false);
virtual int64 GetActSpellDamage(uint16 spell_id, int64 value, Mob* target = nullptr);
virtual int64 GetActDoTDamage(uint16 spell_id, int64 value, Mob* target, bool from_buff_tic = true);
virtual int64 GetActSpellHealing(uint16 spell_id, int64 value, Mob* target = nullptr, bool from_buff_tic = false);
virtual int32 GetActSpellCost(uint16 spell_id, int32 cost){ return cost;}
virtual int32 GetActSpellDuration(uint16 spell_id, int32 duration);
virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime);
virtual int32 GetActReflectedSpellDamage(int32 spell_id, int32 value, int effectiveness);
virtual int64 GetActReflectedSpellDamage(int32 spell_id, int64 value, int effectiveness);
float ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use_resist_override = false,
int resist_override = 0, bool CharismaCheck = false, bool CharmTick = false, bool IsRoot = false,
int level_override = -1);
@ -370,8 +370,8 @@ public:
uint16 CastingSpellID() const { return casting_spell_id; }
bool TryDispel(uint8 caster_level, uint8 buff_level, int level_modifier);
bool TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed = 1.5f);
void ResourceTap(int32 damage, uint16 spell_id);
void TryTriggerThreshHold(int32 damage, int effect_id, Mob* attacker);
void ResourceTap(int64 damage, uint16 spell_id);
void TryTriggerThreshHold(int64 damage, int effect_id, Mob* attacker);
void CalcDestFromHeading(float heading, float distance, float MaxZDiff, float StartX, float StartY, float &dX, float &dY, float &dZ);
void BeamDirectional(uint16 spell_id, int16 resist_adjust);
void ConeDirectional(uint16 spell_id, int16 resist_adjust);
@ -429,7 +429,7 @@ public:
inline Buffs_Struct* GetBuffs() { return buffs; }
void DoGravityEffect();
void DamageShield(Mob* other, bool spell_ds = false);
int32 RuneAbsorb(int32 damage, uint16 type);
int32 RuneAbsorb(int64 damage, uint16 type);
bool FindBuff(uint16 spell_id);
uint16 FindBuffBySlot(int slot);
uint32 BuffCount();
@ -492,14 +492,14 @@ public:
bool CanClassEquipItem(uint32 item_id);
bool CanRaceEquipItem(uint32 item_id);
bool AffectedBySpellExcludingSlot(int slot, int effect);
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) = 0;
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill,
virtual bool Death(Mob* killerMob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill) = 0;
virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill,
bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) = 0;
virtual void SetHP(int32 hp);
virtual void SetHP(int64 hp);
bool ChangeHP(Mob* other, int32 amount, uint16 spell_id = 0, int8 buffslot = -1, bool iBuffTic = false);
inline void SetOOCRegen(int32 newoocregen) {ooc_regen = newoocregen;}
virtual void Heal();
virtual void HealDamage(uint32 ammount, Mob* caster = nullptr, uint16 spell_id = SPELL_UNKNOWN);
virtual void HealDamage(uint64 ammount, Mob* caster = nullptr, uint16 spell_id = SPELL_UNKNOWN);
virtual void SetMaxHP() { current_hp = max_hp; }
virtual inline uint16 GetBaseRace() const { return base_race; }
virtual inline uint8 GetBaseGender() const { return base_gender; }
@ -599,20 +599,20 @@ public:
inline virtual int32 GetMaxCR() const { return 255; }
inline virtual int32 GetMaxFR() const { return 255; }
inline virtual int32 GetDelayDeath() const { return 0; }
inline int32 GetHP() const { return current_hp; }
inline int32 GetMaxHP() const { return max_hp; }
virtual int32 CalcMaxHP();
inline int32 GetMaxMana() const { return max_mana; }
inline int32 GetMana() const { return current_mana; }
virtual int32 GetEndurance() const { return 0; }
virtual int32 GetMaxEndurance() const { return 0; }
inline int64 GetHP() const { return current_hp; }
inline int64 GetMaxHP() const { return max_hp; }
virtual int64 CalcMaxHP();
inline int64 GetMaxMana() const { return max_mana; }
inline int64 GetMana() const { return current_mana; }
virtual int64 GetEndurance() const { return 0; }
virtual int64 GetMaxEndurance() const { return 0; }
virtual void SetEndurance(int32 newEnd) { return; }
int32 GetItemHPBonuses();
int64 GetItemHPBonuses();
int32 GetSpellHPBonuses();
virtual const int32& SetMana(int32 amount);
virtual const int64& SetMana(int64 amount);
inline float GetManaRatio() const { return max_mana == 0 ? 100 :
((static_cast<float>(current_mana) / max_mana) * 100); }
virtual int32 CalcMaxMana();
virtual int64 CalcMaxMana();
uint32 GetNPCTypeID() const { return npctype_id; }
void SetNPCTypeID(uint32 npctypeid) { npctype_id = npctypeid; }
inline const glm::vec4& GetPosition() const { return m_Position; }
@ -682,14 +682,14 @@ public:
//AI
static uint32 GetLevelCon(uint8 mylevel, uint8 iOtherLevel);
inline uint32 GetLevelCon(uint8 iOtherLevel) const { return GetLevelCon(GetLevel(), iOtherLevel); }
virtual void AddToHateList(Mob* other, uint32 hate = 0, int32 damage = 0, bool iYellForHelp = true,
virtual void AddToHateList(Mob* other, uint64 hate = 0, int64 damage = 0, bool iYellForHelp = true,
bool bFrenzy = false, bool iBuffTic = false, uint16 spell_id = SPELL_UNKNOWN, bool pet_comand = false);
bool RemoveFromHateList(Mob* mob);
void SetHateAmountOnEnt(Mob* other, int32 hate = 0, int32 damage = 0) { hate_list.SetHateAmountOnEnt(other,hate,damage);}
void HalveAggro(Mob *other) { uint32 in_hate = GetHateAmount(other); SetHateAmountOnEnt(other, (in_hate > 1 ? in_hate / 2 : 1)); }
void DoubleAggro(Mob *other) { uint32 in_hate = GetHateAmount(other); SetHateAmountOnEnt(other, (in_hate ? in_hate * 2 : 1)); }
uint32 GetHateAmount(Mob* tmob, bool is_dam = false) { return hate_list.GetEntHateAmount(tmob,is_dam);}
uint32 GetDamageAmount(Mob* tmob) { return hate_list.GetEntHateAmount(tmob, true);}
void SetHateAmountOnEnt(Mob* other, int64 hate = 0, int64 damage = 0) { hate_list.SetHateAmountOnEnt(other,hate,damage);}
void HalveAggro(Mob *other) { uint64 in_hate = GetHateAmount(other); SetHateAmountOnEnt(other, (in_hate > 1 ? in_hate / 2 : 1)); }
void DoubleAggro(Mob *other) { uint64 in_hate = GetHateAmount(other); SetHateAmountOnEnt(other, (in_hate ? in_hate * 2 : 1)); }
uint64 GetHateAmount(Mob* tmob, bool is_dam = false) { return hate_list.GetEntHateAmount(tmob,is_dam);}
uint64 GetDamageAmount(Mob* tmob) { return hate_list.GetEntHateAmount(tmob, true);}
int GetHateRatio(Mob *first, Mob *with) { return hate_list.GetHateRatio(first, with); }
Mob* GetHateTop() { return hate_list.GetEntWithMostHateOnList(this);}
Mob* GetSecondaryHate(Mob *skip) { return hate_list.GetEntWithMostHateOnList(this, skip); }
@ -772,7 +772,7 @@ public:
inline AuraMgr &GetAuraMgr() { return aura_mgr; } // mainly used for zone db loading/saving
//Procs
void TriggerDefensiveProcs(Mob *on, uint16 hand = EQ::invslot::slotPrimary, bool FromSkillProc = false, int damage = 0);
void TriggerDefensiveProcs(Mob *on, uint16 hand = EQ::invslot::slotPrimary, bool FromSkillProc = false, int64 damage = 0);
bool AddRangedProc(uint16 spell_id, uint16 iChance = 3, uint16 base_spell_id = SPELL_UNKNOWN, uint32 proc_reuse_time = 0);
bool RemoveRangedProc(uint16 spell_id, bool bAll = false);
bool HasRangedProcs() const;
@ -826,7 +826,7 @@ public:
void QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::Options &opts);
int32 GetItemStat(uint32 itemid, const char *identifier);
int32 CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus=false, uint16 casterid = 0, Mob *caster = nullptr);
int64 CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus=false, uint16 casterid = 0, Mob *caster = nullptr);
uint8 IsFocusEffect(uint16 spellid, int effect_index, bool AA=false,uint32 aa_effect=0);
void SendIllusionPacket(uint16 in_race, uint8 in_gender = 0xFF, uint8 in_texture = 0xFF, uint8 in_helmtexture = 0xFF,
uint8 in_haircolor = 0xFF, uint8 in_beardcolor = 0xFF, uint8 in_eyecolor1 = 0xFF, uint8 in_eyecolor2 = 0xFF,
@ -856,8 +856,8 @@ public:
bool TryFadeEffect(int slot);
uint16 GetSpellEffectResistChance(uint16 spell_id);
int32 GetVulnerability(Mob *caster, uint32 spell_id, uint32 ticsremaining, bool from_buff_tic = false);
int32 GetFcDamageAmtIncoming(Mob *caster, int32 spell_id, bool from_buff_tic = false);
int32 GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spell_id); //**** This can be removed when bot healing focus code is updated ****
int64 GetFcDamageAmtIncoming(Mob *caster, int32 spell_id, bool from_buff_tic = false);
int64 GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spell_id); //**** This can be removed when bot healing focus code is updated ****
int32 GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackOptions *opts = nullptr);
int32 GetPositionalDmgTaken(Mob *attacker);
int32 GetPositionalDmgTakenAmt(Mob *attacker);
@ -882,8 +882,8 @@ public:
inline bool CanBlockSpell() const { return(spellbonuses.FocusEffects[focusBlockNextSpell]); }
bool DoHPToManaCovert(uint16 mana_cost = 0);
int8 GetDecayEffectValue(uint16 spell_id, uint16 spelleffect);
int32 GetExtraSpellAmt(uint16 spell_id, int32 extra_spell_amt, int32 base_spell_dmg);
void MeleeLifeTap(int32 damage);
int64 GetExtraSpellAmt(uint16 spell_id, int64 extra_spell_amt, int64 base_spell_dmg);
void MeleeLifeTap(int64 damage);
bool PassCastRestriction(int value);
void SendCastRestrictionMessage(int requirement_id, bool is_target_requirement = true, bool is_discipline = false);
bool ImprovedTaunt();
@ -1033,15 +1033,15 @@ public:
inline bool IsSilenced() const { return silenced; }
inline bool IsAmnesiad() const { return amnesiad; }
int32 ReduceDamage(int32 damage);
int32 AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTic, Mob* attacker);
int32 ReduceAllDamage(int32 damage);
int64 ReduceDamage(int64 damage);
int64 AffectMagicalDamage(int64 damage, uint16 spell_id, const bool iBuffTic, Mob* attacker);
int64 ReduceAllDamage(int64 damage);
void DoSpecialAttackDamage(Mob *who, EQ::skills::SkillType skill, int base_damage, int min_damage = 0, int32 hate_override = -1, int ReuseTime = 10);
virtual void DoThrowingAttackDmg(Mob* other, const EQ::ItemInstance* RangeWeapon = nullptr, const EQ::ItemData* AmmoItem = nullptr, uint16 weapon_damage = 0, int16 chance_mod = 0, int16 focus = 0, int ReuseTime = 0, uint32 range_id = 0, int AmmoSlot = 0, float speed = 4.0f, bool DisableProcs = false);
void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQ::skills::SkillType skillinuse, int16 chance_mod = 0, int16 focus = 0, bool CanRiposte = false, int ReuseTime = 0);
virtual void DoArcheryAttackDmg(Mob* other, const EQ::ItemInstance* RangeWeapon = nullptr, const EQ::ItemInstance* Ammo = nullptr, uint16 weapon_damage = 0, int16 chance_mod = 0, int16 focus = 0, int ReuseTime = 0, uint32 range_id = 0, uint32 ammo_id = 0, const EQ::ItemData *AmmoItem = nullptr, int AmmoSlot = 0, float speed = 4.0f, bool DisableProcs = false);
bool TryProjectileAttack(Mob* other, const EQ::ItemData *item, EQ::skills::SkillType skillInUse, uint16 weapon_dmg, const EQ::ItemInstance* RangeWeapon, const EQ::ItemInstance* Ammo, int AmmoSlot, float speed, bool DisableProcs = false);
bool TryProjectileAttack(Mob* other, const EQ::ItemData *item, EQ::skills::SkillType skillInUse, uint64 weapon_dmg, const EQ::ItemInstance* RangeWeapon, const EQ::ItemInstance* Ammo, int AmmoSlot, float speed, bool DisableProcs = false);
void ProjectileAttack();
inline bool HasProjectileAttack() const { return ActiveProjectileATK; }
inline void SetProjectileAttack(bool value) { ActiveProjectileATK = value; }
@ -1170,8 +1170,8 @@ public:
//uint32 GetInstrumentMod(uint16 spell_id) const;
uint32 GetInstrumentMod(uint16 spell_id);
int CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level = 1, uint32 instrument_mod = 10, Mob *caster = nullptr, int ticsremaining = 0,uint16 casterid=0);
int CalcSpellEffectValue_formula(int formula, int base_value, int max_value, int caster_level, uint16 spell_id, int ticsremaining = 0);
int64 CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level = 1, uint32 instrument_mod = 10, Mob *caster = nullptr, int ticsremaining = 0,uint16 casterid=0);
int64 CalcSpellEffectValue_formula(int64 formula, int64 base_value, int64 max_value, int caster_level, uint16 spell_id, int ticsremaining = 0);
virtual int CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int caster_level2, Mob* caster1 = nullptr, Mob* caster2 = nullptr, int buffslot = -1);
uint32 GetCastedSpellInvSlot() const { return casting_spell_inventory_slot; }
@ -1202,7 +1202,7 @@ public:
Trade* trade;
bool ShieldAbility(uint32 target_id, int shielder_max_distance = 15, int shield_duration = 12000, int shield_target_mitigation = 50, int shielder_mitigation = 75, bool use_aa = false, bool can_shield_npc = true);
void DoShieldDamageOnShielder(Mob *shield_target, int hit_damage_done, EQ::skills::SkillType skillInUse);
void DoShieldDamageOnShielder(Mob *shield_target, int64 hit_damage_done, EQ::skills::SkillType skillInUse);
void ShieldAbilityFinish();
void ShieldAbilityClearVariables();
inline uint32 GetShielderID() const { return m_shielder_id; }
@ -1248,31 +1248,46 @@ public:
inline void SetEmoteID(uint16 emote) { emoteid = emote; }
inline uint16 GetEmoteID() { return emoteid; }
bool HasSpellEffect(int effect_id);
int mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster, uint16 caster_id);
float mod_hit_chance(float chancetohit, EQ::skills::SkillType skillinuse, Mob* attacker);
float mod_riposte_chance(float ripostchance, Mob* attacker);
float mod_block_chance(float blockchance, Mob* attacker);
float mod_parry_chance(float parrychance, Mob* attacker);
float mod_dodge_chance(float dodgechance, Mob* attacker);
float mod_monk_weight(float monkweight, Mob* attacker);
float mod_mitigation_rating(float mitigation_rating, Mob* attacker);
float mod_attack_rating(float attack_rating, Mob* defender);
int32 mod_kick_damage(int32 dmg);
int32 mod_bash_damage(int32 dmg);
int32 mod_frenzy_damage(int32 dmg);
int32 mod_monk_special_damage(int32 ndamage, EQ::skills::SkillType skill_type);
int32 mod_backstab_damage(int32 ndamage);
int mod_archery_bonus_chance(int bonuschance, const EQ::ItemInstance* RangeWeapon);
uint32 mod_archery_bonus_damage(uint32 MaxDmg, const EQ::ItemInstance* RangeWeapon);
int32 mod_archery_damage(int32 TotalDmg, bool hasbonus, const EQ::ItemInstance* RangeWeapon);
uint16 mod_throwing_damage(uint16 MaxDmg);
int32 mod_cast_time(int32 cast_time);
int mod_buff_duration(int res, Mob* caster, Mob* target, uint16 spell_id);
int mod_spell_stack(uint16 spellid1, int caster_level1, Mob* caster1, uint16 spellid2, int caster_level2, Mob* caster2);
int mod_spell_resist(int resist_chance, int level_mod, int resist_modifier, int target_resist, uint8 resist_type, uint16 spell_id, Mob* caster);
void mod_spell_cast(uint16 spell_id, Mob* spelltar, bool reflect, bool use_resist_adjust, int16 resist_adjust, bool isproc);
bool mod_will_aggro(Mob *attacker, Mob *on);
bool HasSpellEffect(int effect_id);
int mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob *caster, uint16 caster_id);
float mod_hit_chance(float chancetohit, EQ::skills::SkillType skillinuse, Mob *attacker);
float mod_riposte_chance(float ripostchance, Mob *attacker);
float mod_block_chance(float blockchance, Mob *attacker);
float mod_parry_chance(float parrychance, Mob *attacker);
float mod_dodge_chance(float dodgechance, Mob *attacker);
float mod_monk_weight(float monkweight, Mob *attacker);
float mod_mitigation_rating(float mitigation_rating, Mob *attacker);
float mod_attack_rating(float attack_rating, Mob *defender);
int64 mod_kick_damage(int64 dmg);
int64 mod_bash_damage(int64 dmg);
int64 mod_frenzy_damage(int64 dmg);
int64 mod_monk_special_damage(int64 ndamage, EQ::skills::SkillType skill_type);
int64 mod_backstab_damage(int64 ndamage);
int64 mod_archery_bonus_chance(int bonuschance, const EQ::ItemInstance *RangeWeapon);
uint64 mod_archery_bonus_damage(uint64 MaxDmg, const EQ::ItemInstance *RangeWeapon);
int64 mod_archery_damage(int64 TotalDmg, bool hasbonus, const EQ::ItemInstance *RangeWeapon);
uint64 mod_throwing_damage(uint64 MaxDmg);
int32 mod_cast_time(int32 cast_time);
int mod_buff_duration(int res, Mob *caster, Mob *target, uint16 spell_id);
int mod_spell_stack(uint16 spellid1, int caster_level1, Mob *caster1, uint16 spellid2, int caster_level2, Mob *caster2);
int mod_spell_resist(
int resist_chance,
int level_mod,
int resist_modifier,
int target_resist,
uint8 resist_type,
uint16 spell_id,
Mob *caster
);
void mod_spell_cast(
uint16 spell_id,
Mob *spelltar,
bool reflect,
bool use_resist_adjust,
int16 resist_adjust,
bool isproc
);
bool mod_will_aggro(Mob *attacker, Mob *on);
//Command #Tune functions
void TuneGetStats(Mob* defender, Mob *attacker);
@ -1281,30 +1296,30 @@ public:
void TuneGetAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_chance, int interval, int max_loop, int accuracy_override, int Msg);
void TuneGetAccuracyByHitChance(Mob* defender, Mob *attacker, float hit_chance, int interval, int max_loop, int avoidance_override, int Msg);
/*support functions*/
int TuneClientGetMeanDamage(Mob* other, int ac_override = 0, int atk_override = 0, int add_ac = 0, int add_atk = 0);
int TuneClientGetMaxDamage(Mob* other);
int TuneClientGetMinDamage(Mob* other, int max_hit);
int64 TuneClientGetMeanDamage(Mob* other, int ac_override = 0, int atk_override = 0, int add_ac = 0, int add_atk = 0);
int64 TuneClientGetMaxDamage(Mob* other);
int64 TuneClientGetMinDamage(Mob* other, int max_hit);
float TuneGetACMitigationPct(Mob* defender, Mob *attacker);
int TuneGetOffense(Mob* defender, Mob *attacker, int atk_override = 0);
int TuneGetAccuracy(Mob* defender, Mob *attacker, int accuracy_override = 0, int add_accuracy = 0);
int TuneGetAvoidance(Mob* defender, Mob *attacker, int avoidance_override = 0, int add_avoidance = 0);
int64 TuneGetOffense(Mob* defender, Mob *attacker, int atk_override = 0);
int64 TuneGetAccuracy(Mob* defender, Mob *attacker, int accuracy_override = 0, int add_accuracy = 0);
int64 TuneGetAvoidance(Mob* defender, Mob *attacker, int avoidance_override = 0, int add_avoidance = 0);
float TuneGetHitChance(Mob* defender, Mob *attacker, int avoidance_override = 0, int accuracy_override = 0, int add_avoidance = 0, int add_accuracy = 0);
float TuneGetAvoidMeleeChance(Mob* defender, Mob *attacker, int type);
int TuneCalcEvasionBonus(int final_avoidance, int base_avoidance);
int64 TuneCalcEvasionBonus(int final_avoidance, int base_avoidance);
/*modified combat code - These SYNC to attack.cpp, relevant changes to these functions in attack.cpp should be changed to the below as well*/
int TuneNPCAttack(Mob* other, bool no_avoid = true, bool no_hit_chance = true, int hit_chance_bonus = 10000, int ac_override = 0, int atk_override = 0, int add_ac = 0, int add_atk = 0,
int64 TuneNPCAttack(Mob* other, bool no_avoid = true, bool no_hit_chance = true, int hit_chance_bonus = 10000, int ac_override = 0, int atk_override = 0, int add_ac = 0, int add_atk = 0,
bool get_offense = false, bool get_accuracy = false, int avoidance_override = 0, int accuracy_override = 0, int add_avoidance = 0, int add_accuracy = 0);
int TuneClientAttack(Mob* other, bool no_avoid = true, bool no_hit_chance = true, int hit_chance_bonus = 10000, int ac_override = 0, int atk_override = 0, int add_ac = 0, int add_atk = 0,
int64 TuneClientAttack(Mob* other, bool no_avoid = true, bool no_hit_chance = true, int hit_chance_bonus = 10000, int ac_override = 0, int atk_override = 0, int add_ac = 0, int add_atk = 0,
bool get_offense = false, bool get_accuracy = false, int avoidance_override = 0, int accuracy_override = 0, int add_avoidance = 0, int add_accuracy = 0);
void TuneDoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts = nullptr, bool no_avoid = true, bool no_hit_chance = true, int ac_override = 0, int add_ac = 0,
int avoidance_override = 0, int accuracy_override = 0, int add_avoidance = 0, int add_accuracy = 0);
void TuneMeleeMitigation(Mob *attacker, DamageHitInfo &hit, int ac_override, int add_ac);
int Tuneoffense(EQ::skills::SkillType skill, int atk_override = 0, int add_atk = 0);
int TuneACSum(bool skip_caps=false, int ac_override = 0, int add_ac = 0);
int TuneGetTotalToHit(EQ::skills::SkillType skill, int chance_mod, int accuracy_override = 0, int add_accurracy = 0); // compute_tohit + spell bonuses
int Tunecompute_tohit(EQ::skills::SkillType skillinuse, int accuracy_override = 0, int add_accuracy = 0);
int TuneGetTotalDefense(int avoidance_override = 0, int add_avoidance = 0);
int Tunecompute_defense(int avoidance_override = 0, int add_avoidance = 0);
int64 Tuneoffense(EQ::skills::SkillType skill, int atk_override = 0, int add_atk = 0);
int64 TuneACSum(bool skip_caps=false, int ac_override = 0, int add_ac = 0);
int64 TuneGetTotalToHit(EQ::skills::SkillType skill, int chance_mod, int accuracy_override = 0, int add_accurracy = 0); // compute_tohit + spell bonuses
int64 Tunecompute_tohit(EQ::skills::SkillType skillinuse, int accuracy_override = 0, int add_accuracy = 0);
int64 TuneGetTotalDefense(int avoidance_override = 0, int add_avoidance = 0);
int64 Tunecompute_defense(int avoidance_override = 0, int add_avoidance = 0);
bool TuneCheckHitChance(Mob* other, DamageHitInfo &hit, int avoidance_override = 0, int add_avoidance = 0);
EQ::skills::SkillType TuneAttackAnimation(int Hand, const EQ::ItemInstance* weapon, EQ::skills::SkillType skillinuse = EQ::skills::Skill1HBlunt);
void TuneCommonOutgoingHitSuccess(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *opts = nullptr);
@ -1326,11 +1341,11 @@ public:
void AddAssistCap() { ++npc_assist_cap; }
void DelAssistCap() { --npc_assist_cap; }
void ResetAssistCap() { npc_assist_cap = 0; }
int GetWeaponDamage(Mob *against, const EQ::ItemData *weapon_item);
int GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, uint32 *hate = nullptr);
int64 GetWeaponDamage(Mob *against, const EQ::ItemData *weapon_item);
int64 GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, uint64 *hate = nullptr);
int32 GetHPRegen() const;
int32 GetManaRegen() const;
int64 GetHPRegen() const;
int64 GetManaRegen() const;
bool CanOpenDoors() const;
void SetCanOpenDoors(bool can_open);
@ -1366,7 +1381,7 @@ public:
#endif
protected:
void CommonDamage(Mob* other, int &damage, const uint16 spell_id, const EQ::skills::SkillType attack_skill, bool &avoidable, const int8 buffslot, const bool iBuffTic, eSpecialAttacks specal = eSpecialAttacks::None);
void CommonDamage(Mob* other, int64 &damage, const uint16 spell_id, const EQ::skills::SkillType attack_skill, bool &avoidable, const int8 buffslot, const bool iBuffTic, eSpecialAttacks specal = eSpecialAttacks::None);
static uint16 GetProcID(uint16 spell_id, uint8 effect_index);
float _GetMovementSpeed(int mod) const;
int _GetWalkSpeed() const;
@ -1422,14 +1437,14 @@ protected:
int targeted;
bool findable;
bool trackable;
int32 current_hp;
int32 max_hp;
int32 base_hp;
int32 current_mana;
int32 max_mana;
int32 hp_regen;
int64 current_hp;
int64 max_hp;
int64 base_hp;
int64 current_mana;
int64 max_mana;
int64 hp_regen;
int64 hp_regen_per_second;
int32 mana_regen;
int64 mana_regen;
int32 ooc_regen;
uint8 maxlevel;
uint32 scalerate;
@ -1508,7 +1523,7 @@ protected:
virtual
#endif
int GetBaseSkillDamage(EQ::skills::SkillType skill, Mob *target = nullptr);
virtual int32 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false) { return 0; }
virtual int64 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false) { return 0; }
void CalculateNewFearpoint();
float FindGroundZ(float new_x, float new_y, float z_offset=0.0);
float FindDestGroundZ(glm::vec3 dest, float z_offset=0.0);

View File

@ -461,12 +461,12 @@ inline std::string GetMobAttributeByString(Mob *mob, const std::string &attribut
commify(std::to_string((int) RuleI(Character, ItemDSMitigationCap)));
}
if (attribute == "hp_regen") {
return commify(std::to_string((int) client->GetHPRegen())) + " / " +
return commify(std::to_string((int64) client->GetHPRegen())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemHealthRegenCap)));
}
if (attribute == "mana_regen") {
return commify(std::to_string((int) client->GetManaRegen())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemManaRegenCap)));
return commify(std::to_string((int64) client->GetManaRegen())) + " / " +
commify(std::to_string((int64) RuleI(Character, ItemManaRegenCap)));
}
if (attribute == "end_regen") {
return commify(std::to_string((int) client->CalcEnduranceRegen())) + " / " +

View File

@ -29,7 +29,7 @@ void Zone::mod_repop() { return; }
void NPC::mod_prespawn(Spawn2 *sp) { return; }
//Base damage from NPC::Attack
int NPC::mod_npc_damage(int damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemData* weapon, Mob* other) { return(damage); }
int NPC::mod_npc_damage(int64 damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemData* weapon, Mob* other) { return(damage); }
//Mob c has been given credit for a kill. This is called after the regular EVENT_KILLED_MERIT event.
void NPC::mod_npc_killed_merit(Mob* c) { return; }
@ -38,7 +38,7 @@ void NPC::mod_npc_killed_merit(Mob* c) { return; }
void NPC::mod_npc_killed(Mob* oos) { return; }
//Base damage from Client::Attack - can cover myriad skill types
int Client::mod_client_damage(int damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemInstance* weapon, Mob* other) { return(damage); }
int Client::mod_client_damage(int64 damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemInstance* weapon, Mob* other) { return(damage); }
//message is char[4096], don't screw it up. Return true for normal behavior, false to return immediately.
// Channels:
@ -137,31 +137,31 @@ float Mob::mod_mitigation_rating(float mitigation_rating, Mob* attacker) { retur
float Mob::mod_attack_rating(float attack_rating, Mob* defender) { return(attack_rating); }
//Kick damage after all other bonuses are applied
int32 Mob::mod_kick_damage(int32 dmg) { return(dmg); }
int64 Mob::mod_kick_damage(int64 dmg) { return(dmg); }
//Slam and bash damage after all other bonuses are applied
int32 Mob::mod_bash_damage(int32 dmg) { return(dmg); }
int64 Mob::mod_bash_damage(int64 dmg) { return(dmg); }
//Frenzy damage after all other bonuses are applied
int32 Mob::mod_frenzy_damage(int32 dmg) { return(dmg); }
int64 Mob::mod_frenzy_damage(int64 dmg) { return(dmg); }
//Special attack damage after all other bonuses are applied.
int32 Mob::mod_monk_special_damage(int32 ndamage, EQ::skills::SkillType skill_type) { return(ndamage); }
int64 Mob::mod_monk_special_damage(int64 ndamage, EQ::skills::SkillType skill_type) { return(ndamage); }
//ndamage - Backstab damage as calculated by default formulas
int32 Mob::mod_backstab_damage(int32 ndamage) { return(ndamage); }
int64 Mob::mod_backstab_damage(int64 ndamage) { return(ndamage); }
//Chance for 50+ archery bonus damage if Combat:UseArcheryBonusRoll is true.
int Mob::mod_archery_bonus_chance(int bonuschance, const EQ::ItemInstance* RangeWeapon) { return(bonuschance); }
int64 Mob::mod_archery_bonus_chance(int bonuschance, const EQ::ItemInstance* RangeWeapon) { return(bonuschance); }
//Archery bonus damage
uint32 Mob::mod_archery_bonus_damage(uint32 MaxDmg, const EQ::ItemInstance* RangeWeapon) { return(MaxDmg); }
uint64 Mob::mod_archery_bonus_damage(uint64 MaxDmg, const EQ::ItemInstance* RangeWeapon) { return(MaxDmg); }
//Final archery damage including bonus if it was applied.
int32 Mob::mod_archery_damage(int32 TotalDmg, bool hasbonus, const EQ::ItemInstance* RangeWeapon) { return(TotalDmg); }
int64 Mob::mod_archery_damage(int64 TotalDmg, bool hasbonus, const EQ::ItemInstance* RangeWeapon) { return(TotalDmg); }
//Thrown weapon damage after all other calcs
uint16 Mob::mod_throwing_damage(uint16 MaxDmg) { return(MaxDmg); }
uint64 Mob::mod_throwing_damage(uint64 MaxDmg) { return(MaxDmg); }
//Spell cast time in milliseconds - will not sync with client cast time bar, but does work.
int32 Mob::mod_cast_time(int32 cast_time) { return(cast_time); }

View File

@ -34,7 +34,7 @@ void Zone::mod_repop() { return; }
void NPC::mod_prespawn(Spawn2 *sp) { return; }
//Base damage from NPC::Attack
int NPC::mod_npc_damage(int damage, SkillType skillinuse, int hand, const Item_Struct* weapon, Mob* other) { return(damage); }
int NPC::mod_npc_damage(int64 damage, SkillType skillinuse, int hand, const Item_Struct* weapon, Mob* other) { return(damage); }
//Mob c has been given credit for a kill. This is called after the regular EVENT_KILLED_MERIT event.
void NPC::mod_npc_killed_merit(Mob* c) { return; }
@ -43,7 +43,7 @@ void NPC::mod_npc_killed_merit(Mob* c) { return; }
void NPC::mod_npc_killed(Mob* oos) { return; }
//Base damage from Client::Attack - can cover myriad skill types
int Client::mod_client_damage(int damage, SkillType skillinuse, int hand, const ItemInst* weapon, Mob* other) { return(damage); }
int Client::mod_client_damage(int64 damage, SkillType skillinuse, int hand, const ItemInst* weapon, Mob* other) { return(damage); }
//message is char[4096], don't screw it up. Return true for normal behavior, false to return immediately.
// Channels:
@ -138,31 +138,31 @@ float Mob::mod_mitigation_rating(float mitigation_rating, Mob* attacker) { retur
float Mob::mod_attack_rating(float attack_rating, Mob* defender) { return(attack_rating); }
//Kick damage after all other bonuses are applied
int32 Mob::mod_kick_damage(int32 dmg) { return(dmg); }
int64 Mob::mod_kick_damage(int64 dmg) { return(dmg); }
//Slam and bash damage after all other bonuses are applied
int32 Mob::mod_bash_damage(int32 dmg) { return(dmg); }
int64 Mob::mod_bash_damage(int64 dmg) { return(dmg); }
//Frenzy damage after all other bonuses are applied
int32 Mob::mod_frenzy_damage(int32 dmg) { return(dmg); }
int64 Mob::mod_frenzy_damage(int64 dmg) { return(dmg); }
//Special attack damage after all other bonuses are applied.
int32 Mob::mod_monk_special_damage(int32 ndamage, SkillType skill_type) { return(ndamage); }
int64 Mob::mod_monk_special_damage(int64 ndamage, EQ::skills::SkillType skill_type) { return(ndamage); }
//ndamage - Backstab damage as calculated by default formulas
int32 Mob::mod_backstab_damage(int32 ndamage) { return(ndamage); }
int64 Mob::mod_backstab_damage(int64 ndamage) { return(ndamage); }
//Chance for 50+ archery bonus damage if Combat:UseArcheryBonusRoll is true.
int Mob::mod_archery_bonus_chance(int bonuschance, const ItemInst* RangeWeapon) { return(bonuschance); }
int64 Mob::mod_archery_bonus_chance(int bonuschance, const ItemInst* RangeWeapon) { return(bonuschance); }
//Archery bonus damage
uint32 Mob::mod_archery_bonus_damage(uint32 MaxDmg, const ItemInst* RangeWeapon) { return(MaxDmg); }
uint64 Mob::mod_archery_bonus_damage(uint64 MaxDmg, const ItemInst* RangeWeapon) { return(MaxDmg); }
//Final archery damage including bonus if it was applied.
int32 Mob::mod_archery_damage(int32 TotalDmg, bool hasbonus, const ItemInst* RangeWeapon) { return(TotalDmg); }
int64 Mob::mod_archery_damage(int64 TotalDmg, bool hasbonus, const ItemInst* RangeWeapon) { return(TotalDmg); }
//Thrown weapon damage after all other calcs
uint16 Mob::mod_throwing_damage(uint16 MaxDmg) { return(MaxDmg); }
uint64 Mob::mod_throwing_damage(uint64 MaxDmg) { return(MaxDmg); }
//Spell cast time in milliseconds - will not sync with client cast time bar, but does work.
int32 Mob::mod_cast_time(int32 cast_time) { return(cast_time); }

View File

@ -887,14 +887,14 @@ bool NPC::Process()
uint32 npc_sitting_regen_bonus = 0;
uint32 pet_regen_bonus = 0;
uint32 npc_regen = 0;
int32 npc_hp_regen = GetNPCHPRegen();
uint64 npc_regen = 0;
int64 npc_hp_regen = GetNPCHPRegen();
if (GetAppearance() == eaSitting) {
npc_sitting_regen_bonus += 3;
}
int32 ooc_regen_calc = 0;
int64 ooc_regen_calc = 0;
if (ooc_regen > 0) { //should pull from Mob class
ooc_regen_calc += GetMaxHP() * ooc_regen / 100;
}
@ -934,7 +934,7 @@ bool NPC::Process()
if (GetMana() < GetMaxMana()) {
if (RuleB(NPC, UseMeditateBasedManaRegen)) {
int32 npc_idle_mana_regen_bonus = 2;
int64 npc_idle_mana_regen_bonus = 2;
uint16 meditate_skill = GetSkill(EQ::skills::SkillMeditate);
if (!IsEngaged() && meditate_skill > 0) {
uint8 clevel = GetLevel();
@ -1818,7 +1818,7 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
uint32 NPC::GetMaxDamage(uint8 tlevel)
{
uint32 dmg = 0;
uint64 dmg = 0;
if (tlevel < 40)
dmg = tlevel*2+2;
else if (tlevel < 50)
@ -2469,7 +2469,7 @@ void NPC::ModifyNPCStat(const char *identifier, const char *new_value)
return;
}
else if (id == "max_hp") {
base_hp = atoi(val.c_str());
base_hp = std::stoull(val.c_str());
CalcMaxHP();
if (current_hp > max_hp) {
@ -2479,7 +2479,7 @@ void NPC::ModifyNPCStat(const char *identifier, const char *new_value)
return;
}
else if (id == "max_mana") {
npc_mana = atoi(val.c_str());
npc_mana = std::stoull(val.c_str());
CalcMaxMana();
if (current_mana > max_mana) {
current_mana = max_mana;
@ -2598,7 +2598,7 @@ void NPC::ModifyNPCStat(const char *identifier, const char *new_value)
return;
}
else if (id == "hp_regen") {
hp_regen = atoi(val.c_str());
hp_regen = strtoll(val.c_str(), nullptr, 10);
return;
}
else if (id == "hp_regen_per_second") {
@ -2606,7 +2606,7 @@ void NPC::ModifyNPCStat(const char *identifier, const char *new_value)
return;
}
else if (id == "mana_regen") {
mana_regen = atoi(val.c_str());
mana_regen = strtoll(val.c_str(), nullptr, 10);
return;
}
else if (id == "level") {
@ -2843,13 +2843,13 @@ void NPC::LevelScale() {
} else {
uint8 scale_adjust = 1;
base_hp += (int)(base_hp * scaling);
max_hp += (int)(max_hp * scaling);
base_hp += (int64)(base_hp * scaling);
max_hp += (int64)(max_hp * scaling);
current_hp = max_hp;
if (max_dmg) {
max_dmg += (int)(max_dmg * scaling / scale_adjust);
min_dmg += (int)(min_dmg * scaling / scale_adjust);
max_dmg += (int64)(max_dmg * scaling / scale_adjust);
min_dmg += (int64)(min_dmg * scaling / scale_adjust);
}
STR += (int)(STR * scaling / scale_adjust);
@ -2884,8 +2884,8 @@ void NPC::LevelScale() {
AC += (int)(AC * scaling);
ATK += (int)(ATK * scaling);
base_hp += (int)(base_hp * scaling);
max_hp += (int)(max_hp * scaling);
base_hp += (int64)(base_hp * scaling);
max_hp += (int64)(max_hp * scaling);
current_hp = max_hp;
STR += (int)(STR * scaling / scale_adjust);
STA += (int)(STA * scaling / scale_adjust);
@ -2907,8 +2907,8 @@ void NPC::LevelScale() {
if (max_dmg)
{
max_dmg += (int)(max_dmg * scaling / scale_adjust);
min_dmg += (int)(min_dmg * scaling / scale_adjust);
max_dmg += (int64)(max_dmg * scaling / scale_adjust);
min_dmg += (int64)(min_dmg * scaling / scale_adjust);
}
}
@ -2965,7 +2965,7 @@ void NPC::SetSwarmTarget(int target_id)
return;
}
int32 NPC::CalcMaxMana()
int64 NPC::CalcMaxMana()
{
if (npc_mana == 0) {
switch (GetCasterClass()) {
@ -3152,11 +3152,11 @@ int NPC::GetScore()
int lv = std::min(70, (int)GetLevel());
int basedmg = (lv*2)*(1+(lv / 100)) - (lv / 2);
int minx = 0;
int basehp = 0;
int64 basehp = 0;
int hpcontrib = 0;
int dmgcontrib = 0;
int spccontrib = 0;
int hp = GetMaxHP();
int64 hp = GetMaxHP();
int mindmg = min_dmg;
int maxdmg = max_dmg;
int final;

View File

@ -118,8 +118,8 @@ public:
static NPC * SpawnZonePointNodeNPC(std::string name, const glm::vec4 &position);
//abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
virtual bool Death(Mob* killerMob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill);
virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None);
virtual bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr);
virtual bool HasRaid() { return false; }
@ -225,7 +225,7 @@ public:
inline void SetPlatinum(uint32 amt) { platinum = amt; }
virtual int32 CalcMaxMana();
virtual int64 CalcMaxMana();
void SetGrid(int32 grid_){ grid=grid_; }
void SetSpawnGroupId(uint32 sg2){ spawn_group_id =sg2; }
void SetWaypointMax(uint16 wp_){ wp_m=wp_; }
@ -283,7 +283,7 @@ public:
content_db.GetFactionIdsForNPC(npc_faction_id, &faction_list, &primary_faction);
}
int32 GetFocusEffect(focusType type, uint16 spell_id, Mob* caster = nullptr);
int64 GetFocusEffect(focusType type, uint16 spell_id, Mob* caster = nullptr);
glm::vec4 m_SpawnPoint;
@ -323,7 +323,7 @@ public:
virtual void DoClassAttacks(Mob *target);
void CheckSignal();
inline bool IsNotTargetableWithHotkey() const { return no_target_hotkey; }
int32 GetNPCHPRegen() const { return hp_regen + itembonuses.HPRegen + spellbonuses.HPRegen; }
int64 GetNPCHPRegen() const { return hp_regen + itembonuses.HPRegen + spellbonuses.HPRegen; }
inline const char* GetAmmoIDfile() const { return ammo_idfile; }
void ModifyStatsOnCharm(bool is_charm_removed);
@ -477,7 +477,7 @@ public:
uint32 GetSpawnKillCount();
int GetScore();
void mod_prespawn(Spawn2 *sp);
int mod_npc_damage(int damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemData* weapon, Mob* other);
int mod_npc_damage(int64 damage, EQ::skills::SkillType skillinuse, int hand, const EQ::ItemData* weapon, Mob* other);
void mod_npc_killed_merit(Mob* c);
void mod_npc_killed(Mob* oos);
void AISpellsList(Client *c);
@ -575,7 +575,7 @@ protected:
virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates = false);
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
AISpellsVar_Struct AISpellVar;
int32 GetFocusEffect(focusType type, uint16 spell_id, Mob* caster, bool from_buff_tic = false);
int64 GetFocusEffect(focusType type, uint16 spell_id, Mob* caster, bool from_buff_tic = false);
uint16 innate_proc_spell_id;
uint32 npc_spells_effects_id;
@ -589,7 +589,7 @@ protected:
int32 accuracy_rating;
int32 avoidance_rating;
int16 attack_count;
uint32 npc_mana;
uint64 npc_mana;
float spellscale;
float healscale;
int32 SpellFocusDMG;

View File

@ -29,7 +29,7 @@ public:
int type;
int level;
int ac;
int hp;
int64 hp;
int accuracy;
int slow_mitigation;
int attack;
@ -49,7 +49,7 @@ public:
int physical_resist;
int min_dmg;
int max_dmg;
int hp_regen_rate;
int64 hp_regen_rate;
int attack_delay;
int spell_scale;
int heal_scale;

View File

@ -607,7 +607,7 @@ XS(XS_Mob_Damage); /* prototype to pass -Wmissing-prototypes */
XS(XS_Mob_Damage) {
dXSARGS;
if (items < 5 || items > 8)
Perl_croak(aTHX_ "Usage: Mob::Damage(THIS, Mob* from, int32 damage, uint16 spell_id, int attack_skill, [bool avoidable = true], [int8 buffslot = -1], [bool buff_tic = false])"); // @categories Script Utility
Perl_croak(aTHX_ "Usage: Mob::Damage(THIS, Mob* from, int64 damage, uint16 spell_id, int attack_skill, [bool avoidable = true], [int8 buffslot = -1], [bool buff_tic = false])"); // @categories Script Utility
{
Mob *THIS;
Mob *from;
@ -711,10 +711,10 @@ XS(XS_Mob_HealDamage); /* prototype to pass -Wmissing-prototypes */
XS(XS_Mob_HealDamage) {
dXSARGS;
if (items < 2 || items > 3)
Perl_croak(aTHX_ "Usage: Mob::HealDamage(THIS, int32 amount, [Mob* caster = 0])"); // @categories Script Utility
Perl_croak(aTHX_ "Usage: Mob::HealDamage(THIS, int64 amount, [Mob* caster = 0])"); // @categories Script Utility
{
Mob *THIS;
int32 heal_amt = (int32) SvIV(ST(1));
int64 heal_amt = (int64) SvIV(ST(1));
Mob *caster = nullptr;
VALIDATE_THIS_IS_MOB;
if (items == 3) {
@ -767,10 +767,10 @@ XS(XS_Mob_SetHP); /* prototype to pass -Wmissing-prototypes */
XS(XS_Mob_SetHP) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Mob::SetHP(THIS, int32 hp)"); // @categories Stats and Attributes
Perl_croak(aTHX_ "Usage: Mob::SetHP(THIS, int64 hp)"); // @categories Stats and Attributes
{
Mob *THIS;
int32 hp = (int32) SvIV(ST(1));
int64 hp = (int32) SvIV(ST(1));
VALIDATE_THIS_IS_MOB;
THIS->SetHP(hp);
}
@ -2210,13 +2210,13 @@ XS(XS_Mob_GetActSpellDamage); /* prototype to pass -Wmissing-prototypes */
XS(XS_Mob_GetActSpellDamage) {
dXSARGS;
if (items != 3)
Perl_croak(aTHX_ "Usage: Mob::GetActSpellDamage(THIS, uint16 spell_id, int32 value)"); // @categories Spells and Disciplines
Perl_croak(aTHX_ "Usage: Mob::GetActSpellDamage(THIS, uint16 spell_id, int64 value)"); // @categories Spells and Disciplines
{
Mob *THIS;
int32 RETVAL;
dXSTARG;
uint16 spell_id = (uint16) SvUV(ST(1));
int32 value = (int32) SvIV(ST(2));
int64 value = (int64) SvIV(ST(2));
VALIDATE_THIS_IS_MOB;
RETVAL = THIS->GetActSpellDamage(spell_id, value);
XSprePUSH;
@ -2229,13 +2229,13 @@ XS(XS_Mob_GetActSpellHealing); /* prototype to pass -Wmissing-prototypes */
XS(XS_Mob_GetActSpellHealing) {
dXSARGS;
if (items != 3)
Perl_croak(aTHX_ "Usage: Mob::GetActSpellHealing(THIS, uint16 spell_id, int32 value)"); // @categories Spells and Disciplines
Perl_croak(aTHX_ "Usage: Mob::GetActSpellHealing(THIS, uint16 spell_id, int64 value)"); // @categories Spells and Disciplines
{
Mob *THIS;
int32 RETVAL;
dXSTARG;
uint16 spell_id = (uint16) SvUV(ST(1));
int32 value = (int32) SvIV(ST(2));
int64 value = (int64) SvIV(ST(2));
VALIDATE_THIS_IS_MOB;
RETVAL = THIS->GetActSpellHealing(spell_id, value);
XSprePUSH;
@ -3579,12 +3579,12 @@ XS(XS_Mob_AddToHateList); /* prototype to pass -Wmissing-prototypes */
XS(XS_Mob_AddToHateList) {
dXSARGS;
if (items < 2 || items > 7)
Perl_croak(aTHX_ "Usage: Mob::AddToHateList(THIS, Mob* other, [int32 hate = 0], [int32 damage = 0], [bool yell_for_help = true], [bool frenzy = false], [bool buff_tic = false])"); // @categories Hate and Aggro
Perl_croak(aTHX_ "Usage: Mob::AddToHateList(THIS, Mob* other, [int64 hate = 0], [int64 damage = 0], [bool yell_for_help = true], [bool frenzy = false], [bool buff_tic = false])"); // @categories Hate and Aggro
{
Mob *THIS;
Mob *other;
int32 hate;
int32 damage;
int64 hate;
int64 damage;
bool iYellForHelp;
bool bFrenzy;
bool iBuffTic;
@ -3600,13 +3600,13 @@ XS(XS_Mob_AddToHateList) {
if (items < 3)
hate = 0;
else {
hate = (int32) SvIV(ST(2));
hate = (int64) SvIV(ST(2));
}
if (items < 4)
damage = 0;
else {
damage = (int32) SvIV(ST(3));
damage = (int64) SvIV(ST(3));
}
if (items < 5)
@ -3636,12 +3636,12 @@ XS(XS_Mob_SetHate); /* prototype to pass -Wmissing-prototypes */
XS(XS_Mob_SetHate) {
dXSARGS;
if (items < 2 || items > 4)
Perl_croak(aTHX_ "Usage: Mob::SetHate(THIS, Mob* other, [int32 hate = 0], [int32 damage = 0])"); // @categories Hate and Aggro
Perl_croak(aTHX_ "Usage: Mob::SetHate(THIS, Mob* other, [int64 hate = 0], [int64 damage = 0])"); // @categories Hate and Aggro
{
Mob *THIS;
Mob *other;
int32 hate;
int32 damage;
int64 hate;
int64 damage;
VALIDATE_THIS_IS_MOB;
if (sv_derived_from(ST(1), "Mob")) {
IV tmp = SvIV((SV *) SvRV(ST(1)));
@ -3654,13 +3654,13 @@ XS(XS_Mob_SetHate) {
if (items < 3)
hate = 0;
else {
hate = (int32) SvIV(ST(2));
hate = (int64) SvIV(ST(2));
}
if (items < 4)
damage = 0;
else {
damage = (int32) SvIV(ST(3));
damage = (int64) SvIV(ST(3));
}
THIS->SetHateAmountOnEnt(other, hate, damage);
@ -5054,7 +5054,7 @@ XS(XS_Mob_SpellEffect) {
}
if (items > 8) { caster_id = (uint32)SvUV(ST(8)); }
if (items > 9) { target_id = (uint32)SvUV(ST(9)); }
if (nullclient) {
THIS->SendSpellEffect(effect, duration, finish_delay, zone_wide, unk20, perm_effect, 0, caster_id, target_id);
}
@ -5674,7 +5674,7 @@ XS(XS_Mob_GetBuffStatValueBySpell) {
Const_char *stat = (Const_char *)SvPV_nolen(ST(2));
dXSTARG;
VALIDATE_THIS_IS_MOB;
RETVAL = THIS->GetBuffStatValueBySpell(spellid, stat);
XSprePUSH;
PUSHi((IV)RETVAL);

View File

@ -252,7 +252,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
}
//Live AA - Elemental Durability
int16 MaxHP = aabonuses.PetMaxHP + itembonuses.PetMaxHP + spellbonuses.PetMaxHP;
int64 MaxHP = aabonuses.PetMaxHP + itembonuses.PetMaxHP + spellbonuses.PetMaxHP;
if (MaxHP){
npc_type->max_hp += (npc_type->max_hp*MaxHP)/100;

View File

@ -1957,9 +1957,9 @@ void QuestManager::clear_zone_flag(int zone_id) {
initiator->ClearZoneFlag(zone_id);
}
void QuestManager::sethp(int hpperc) {
void QuestManager::sethp(int64 hpperc) {
QuestManagerCurrentQuestVars();
int newhp = (owner->GetMaxHP() * (100 - hpperc)) / 100;
int64 newhp = (owner->GetMaxHP() * (100 - hpperc)) / 100;
owner->Damage(owner, newhp, SPELL_UNKNOWN, EQ::skills::SkillHandtoHand, false, 0, false);
}

View File

@ -188,7 +188,7 @@ public:
bool has_zone_flag(int zone_id);
void set_zone_flag(int zone_id);
void clear_zone_flag(int zone_id);
void sethp(int hpperc);
void sethp(int64 hpperc);
bool summonburiedplayercorpse(uint32 char_id, const glm::vec4& position);
bool summonallplayercorpses(uint32 char_id, const glm::vec4& position);
uint32 getplayerburiedcorpsecount(uint32 char_id);
@ -324,7 +324,7 @@ public:
void ClearNPCTypeCache(int npctype_id);
void ReloadZoneStaticData();
std::string secondstotime(int duration);
std::string gethexcolorcode(std::string color_name);
std::string gethexcolorcode(std::string color_name);
double GetAAEXPModifierByCharID(uint32 character_id, uint32 zone_id) const;
double GetEXPModifierByCharID(uint32 character_id, uint32 zone_id) const;
void SetAAEXPModifierByCharID(uint32 character_id, uint32 zone_id, double aa_modifier);

View File

@ -165,7 +165,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQ::skills::SkillType skill, int32 bas
if (who->GetSpecialAbility(IMMUNE_MELEE_EXCEPT_BANE) && skill != EQ::skills::SkillBackstab)
my_hit.damage_done = DMG_INVULNERABLE;
uint32 hate = my_hit.base_damage;
uint64 hate = my_hit.base_damage;
if (hate_override > -1)
hate = hate_override;
@ -293,7 +293,7 @@ void Client::OPCombatAbility(const CombatAbility_Struct *ca_atk)
else
HasteMod = (100 - ClientHaste); //-100% haste = 1/2 as many attacks
int32 dmg = 0;
int64 dmg = 0;
int32 skill_reduction = GetSkillReuseTime(ca_atk->m_skill);
@ -452,7 +452,7 @@ int Mob::MonkSpecialAttack(Mob *other, uint8 unchecked_type)
if (!other)
return 0;
int32 ndamage = 0;
int64 ndamage = 0;
int32 max_dmg = 0;
int32 min_dmg = 0;
int reuse = 0;
@ -609,7 +609,7 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
if (!other)
return;
uint32 hate = 0;
uint64 hate = 0;
// make sure we can hit (bane, magical, etc)
if (IsClient()) {
@ -839,8 +839,8 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQ::ItemInstance *RangeWeapon, co
LogCombat("Ranged attack hit [{}]", other->GetName());
uint32 hate = 0;
int TotalDmg = 0;
uint64 hate = 0;
int64 TotalDmg = 0;
int WDmg = 0;
int ADmg = 0;
if (!weapon_damage) {
@ -941,7 +941,7 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQ::ItemInstance *RangeWeapon, co
}
bool Mob::TryProjectileAttack(Mob *other, const EQ::ItemData *item, EQ::skills::SkillType skillInUse,
uint16 weapon_dmg, const EQ::ItemInstance *RangeWeapon,
uint64 weapon_dmg, const EQ::ItemInstance *RangeWeapon,
const EQ::ItemInstance *Ammo, int AmmoSlot, float speed, bool DisableProcs)
{
if (!other)
@ -1704,7 +1704,7 @@ void NPC::DoClassAttacks(Mob *target) {
if(level >= RuleI(Combat, NPCBashKickLevel)){
if(zone->random.Roll(75)) { //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(EQ::skills::SkillKick);
int64 dmg = GetBaseSkillDamage(EQ::skills::SkillKick);
if (GetWeaponDamage(target, boots) <= 0) {
dmg = DMG_INVULNERABLE;
@ -1716,7 +1716,7 @@ void NPC::DoClassAttacks(Mob *target) {
}
else {
DoAnim(animTailRake, 0, false);
int32 dmg = GetBaseSkillDamage(EQ::skills::SkillBash);
int64 dmg = GetBaseSkillDamage(EQ::skills::SkillBash);
if (GetWeaponDamage(target, (const EQ::ItemData*)nullptr) <= 0)
dmg = DMG_INVULNERABLE;
@ -1755,7 +1755,7 @@ void NPC::DoClassAttacks(Mob *target) {
//kick
if(level >= RuleI(Combat, NPCBashKickLevel)){
DoAnim(animKick, 0, false);
int32 dmg = GetBaseSkillDamage(EQ::skills::SkillKick);
int64 dmg = GetBaseSkillDamage(EQ::skills::SkillKick);
if (GetWeaponDamage(target, boots) <= 0)
dmg = DMG_INVULNERABLE;
@ -1771,7 +1771,7 @@ void NPC::DoClassAttacks(Mob *target) {
case PALADIN: case PALADINGM:{
if(level >= RuleI(Combat, NPCBashKickLevel)){
DoAnim(animTailRake, 0, false);
int32 dmg = GetBaseSkillDamage(EQ::skills::SkillBash);
int64 dmg = GetBaseSkillDamage(EQ::skills::SkillBash);
if (GetWeaponDamage(target, (const EQ::ItemData*)nullptr) <= 0)
dmg = DMG_INVULNERABLE;
@ -1865,7 +1865,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
if(skill_to_use == -1)
return;
int dmg = GetBaseSkillDamage(static_cast<EQ::skills::SkillType>(skill_to_use), GetTarget());
int64 dmg = GetBaseSkillDamage(static_cast<EQ::skills::SkillType>(skill_to_use), GetTarget());
if (skill_to_use == EQ::skills::SkillBash) {
if (ca_target!=this) {
@ -2222,8 +2222,8 @@ void Mob::DoMeleeSkillAttackDmg(Mob *other, uint16 weapon_damage, EQ::skills::Sk
if (skillinuse == EQ::skills::SkillBegging)
skillinuse = EQ::skills::SkillOffense;
int damage = 0;
uint32 hate = 0;
int64 damage = 0;
uint64 hate = 0;
if (hate == 0 && weapon_damage > 1)
hate = weapon_damage;

View File

@ -247,17 +247,17 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
}
// for offensive spells check if we have a spell rune on
int32 dmg = effect_value;
int64 dmg = effect_value;
if(dmg < 0)
{
// take partial damage into account
dmg = (int32) (dmg * partial / 100);
dmg = (int64) (dmg * partial / 100);
//handles AAs and what not...
if(caster) {
if (reflect_effectiveness) {
dmg = caster->GetActReflectedSpellDamage(spell_id, (int32)(spells[spell_id].base_value[i] * partial / 100), reflect_effectiveness);
dmg = caster->GetActReflectedSpellDamage(spell_id, (int64)(spells[spell_id].base_value[i] * partial / 100), reflect_effectiveness);
}
else {
dmg = caster->GetActSpellDamage(spell_id, dmg, this);
@ -301,7 +301,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
// hack fix for client health not reflecting server value
last_hp = 0;
int32 dmg = effect_value;
int64 dmg = effect_value;
//hardcoded for manaburn and life burn
if (spell_id == SPELL_MANA_BURN || spell_id == SPELL_LIFE_BURN)
@ -330,11 +330,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
//normal effects
else {
if (dmg < 0){
dmg = (int32)(dmg * partial / 100);
dmg = (int64)(dmg * partial / 100);
if (caster) {
if (reflect_effectiveness) {
dmg = caster->GetActReflectedSpellDamage(spell_id, (int32)(spells[spell_id].base_value[i] * partial / 100), reflect_effectiveness);
dmg = caster->GetActReflectedSpellDamage(spell_id, (int64)(spells[spell_id].base_value[i] * partial / 100), reflect_effectiveness);
}
else {
dmg = caster->GetActSpellDamage(spell_id, dmg, this);
@ -366,7 +366,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Percental Heal: %+i (%d%% max)", spell.max_value[i], effect_value);
#endif
int32 val = GetMaxHP() * spell.base_value[i] / 100;
int64 val = GetMaxHP() * spell.base_value[i] / 100;
//This effect can also do damage by percent.
if (val < 0) {
@ -401,7 +401,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Complete Heal");
#endif
int val = 7500 * effect_value;
int64 val = 7500 * effect_value;
if (caster) {
val = caster->GetActSpellHealing(spell_id, val, this);
}
@ -2395,11 +2395,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
break;
// for offensive spells check if we have a spell rune on
int32 dmg = effect_value;
int64 dmg = effect_value;
if(dmg < 0)
{
// take partial damage into account
dmg = (int32) (dmg * partial / 100);
dmg = (int64) (dmg * partial / 100);
//handles AAs and what not...
//need a bard version of this prolly...
@ -2584,7 +2584,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
int32 max_mana = spell.base_value[i];
int ratio = spell.limit_value[i];
uint32 heal_amt = 0;
uint64 heal_amt = 0;
if (caster->GetMana() <= max_mana){
heal_amt = ratio*caster->GetMana()/10;
@ -2716,7 +2716,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
{
int32 max_mana = spell.base_value[i];
int ratio = spell.limit_value[i];
int32 dmg = 0;
int64 dmg = 0;
if (caster){
if (caster->GetMana() <= max_mana){
@ -2771,7 +2771,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_AddHatePct:
{
if (IsNPC()){
int32 new_hate = CastToNPC()->GetHateAmount(caster) * (100 + spell.base_value[i]) / 100;
int64 new_hate = CastToNPC()->GetHateAmount(caster) * (100 + spell.base_value[i]) / 100;
if (new_hate <= 0)
new_hate = 1;
@ -2794,7 +2794,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
AddToHateList(caster, effect_value);
}
}else{
int32 newhate = GetHateAmount(caster) + effect_value;
int64 newhate = GetHateAmount(caster) + effect_value;
if (newhate < 1)
SetHateAmountOnEnt(caster,1);
else
@ -2848,7 +2848,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_Instant_Mana_Pct: {
effect_value = spells[spell_id].base_value[i];
int32 amt = abs(GetMaxMana() * effect_value / 10000);
int64 amt = abs(GetMaxMana() * effect_value / 10000);
if (spells[spell_id].max_value[i] && amt > spells[spell_id].max_value[i])
amt = spells[spell_id].max_value[i];
@ -2883,7 +2883,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
*/
case SE_Health_Transfer: {
effect_value = spells[spell_id].limit_value[i];
int32 amt = abs(caster->GetMaxHP() * effect_value / 1000);
int64 amt = abs(caster->GetMaxHP() * effect_value / 1000);
if (effect_value < 0) {
Damage(caster, amt, spell_id, spell.skill, false, buffslot, false);
@ -3321,7 +3321,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
return true;
}
int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, uint32 instrument_mod, Mob *caster,
int64 Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, uint32 instrument_mod, Mob *caster,
int ticsremaining, uint16 caster_id)
{
if (!IsValidSpell(spell_id) || effect_id < 0 || effect_id >= EFFECT_COUNT)
@ -3392,7 +3392,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level,
}
// generic formula calculations
int Mob::CalcSpellEffectValue_formula(int formula, int base_value, int max_value, int caster_level, uint16 spell_id, int ticsremaining)
int64 Mob::CalcSpellEffectValue_formula(int64 formula, int64 base_value, int64 max_value, int caster_level, uint16 spell_id, int ticsremaining)
{
/*
i need those formulas checked!!!!
@ -3421,7 +3421,7 @@ i need those formulas checked!!!!
0x77 = min + level / 8
*/
int result = 0, updownsign = 1, ubase = base_value;
int64 result = 0, updownsign = 1, ubase = base_value;
if(ubase < 0)
ubase = 0 - ubase;
@ -3614,7 +3614,7 @@ snare has both of them negative, yet their range should work the same:
break;
case 138: { // unused on live?
int maxhps = GetMaxHP() / 2;
int64 maxhps = GetMaxHP() / 2;
if (GetHP() <= maxhps)
result = -(ubase * GetHP() / maxhps);
else
@ -3655,7 +3655,7 @@ snare has both of them negative, yet their range should work the same:
{
// These work like splurt, accept instead of being hard coded to 12, it is formula - 1000.
// Formula 1999 seems to have a slightly different effect, so is not included here
int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buff_duration_formula, spells[spell_id].buff_duration) - std::max((ticsremaining - 1), 0);
int64 ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buff_duration_formula, spells[spell_id].buff_duration) - std::max((ticsremaining - 1), 0);
if(ticdif < 0)
ticdif = 0;
@ -3672,7 +3672,7 @@ snare has both of them negative, yet their range should work the same:
}
}
int oresult = result;
int64 oresult = result;
// now check result against the allowed maximum
if (max_value != 0)
@ -3868,7 +3868,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
AddToHateList(caster, effect_value);
}
} else {
int32 newhate = GetHateAmount(caster) + effect_value;
int64 newhate = GetHateAmount(caster) + effect_value;
if (newhate < 1) {
SetHateAmountOnEnt(caster, 1);
} else {
@ -4017,7 +4017,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
case SE_AddHateOverTimePct: {
if (IsNPC()) {
uint32 new_hate = CastToNPC()->GetHateAmount(caster) * (100 + spell.base_value[i]) / 100;
uint64 new_hate = CastToNPC()->GetHateAmount(caster) * (100 + spell.base_value[i]) / 100;
if (new_hate <= 0)
new_hate = 1;
@ -4028,7 +4028,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
case SE_Duration_HP_Pct: {
effect_value = spells[buff.spellid].base_value[i];
int32 amt = abs(GetMaxHP() * effect_value / 100);
int64 amt = abs(GetMaxHP() * effect_value / 100);
if (spells[buff.spellid].max_value[i] && amt > spells[buff.spellid].max_value[i])
amt = spells[buff.spellid].max_value[i];
@ -4534,13 +4534,13 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
CalcBonuses();
}
int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id)
int64 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id)
{
const SPDat_Spell_Struct &spell = spells[spell_id];
bool not_focusable = spells[spell_id].not_focusable;
int32 value = 0;
int64 value = 0;
int lvlModifier = 100;
int spell_level = 0;
int lvldiff = 0;
@ -5287,7 +5287,7 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id)
//given an item/spell's focus ID and the spell being cast, determine the focus ammount, if any
//assumes that spell_id is not a bard spell and that both ids are valid spell ids
int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus, uint16 casterid, Mob *caster)
int64 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus, uint16 casterid, Mob *caster)
{
/*
'this' is always the caster of the spell_id, most foci check for effects on the caster, however some check for effects on the target.
@ -5305,7 +5305,7 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
const SPDat_Spell_Struct &focus_spell = spells[focus_id];
const SPDat_Spell_Struct &spell = spells[spell_id];
int32 value = 0;
int64 value = 0;
int lvlModifier = 100;
int spell_level = 0;
int lvldiff = 0;
@ -6318,15 +6318,15 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
return 0;
}
int32 Client::GetFocusEffect(focusType type, uint16 spell_id, Mob *caster, bool from_buff_tic)
int64 Client::GetFocusEffect(focusType type, uint16 spell_id, Mob *caster, bool from_buff_tic)
{
if (IsBardSong(spell_id) && type != focusFcBaseEffects && type != focusSpellDuration && type != focusReduceRecastTime) {
return 0;
}
int32 realTotal = 0;
int32 realTotal2 = 0;
int32 realTotal3 = 0;
int64 realTotal = 0;
int64 realTotal2 = 0;
int64 realTotal3 = 0;
bool rand_effectiveness = false;
@ -6598,10 +6598,10 @@ int32 Client::GetFocusEffect(focusType type, uint16 spell_id, Mob *caster, bool
return realTotal + realTotal2 + realTotal3 + worneffect_bonus;
}
int32 NPC::GetFocusEffect(focusType type, uint16 spell_id, Mob* caster, bool from_buff_tic) {
int64 NPC::GetFocusEffect(focusType type, uint16 spell_id, Mob* caster, bool from_buff_tic) {
int32 realTotal = 0;
int32 realTotal2 = 0;
int64 realTotal = 0;
int64 realTotal2 = 0;
bool rand_effectiveness = false;
@ -6616,9 +6616,9 @@ int32 NPC::GetFocusEffect(focusType type, uint16 spell_id, Mob* caster, bool fro
const EQ::ItemData* TempItem = nullptr;
const EQ::ItemData* UsedItem = nullptr;
uint16 UsedFocusID = 0;
int32 Total = 0;
int32 focus_max = 0;
int32 focus_max_real = 0;
int64 Total = 0;
int64 focus_max = 0;
int64 focus_max_real = 0;
//item focus
for (int i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invslot::EQUIPMENT_END; i++){
@ -6664,14 +6664,14 @@ int32 NPC::GetFocusEffect(focusType type, uint16 spell_id, Mob* caster, bool fro
if ((RuleB(Spells, NPC_UseFocusFromSpells) || IsTargetedFocusEffect(type)) && spellbonuses.FocusEffects[type]){
//Spell Focus
int32 Total2 = 0;
int32 focus_max2 = 0;
int32 focus_max_real2 = 0;
int64 Total2 = 0;
int64 focus_max2 = 0;
int64 focus_max_real2 = 0;
int buff_tracker = -1;
int buff_slot = 0;
int32 focusspellid = 0;
int32 focusspell_tracker = 0;
int64 focusspellid = 0;
int64 focusspell_tracker = 0;
int buff_max = GetMaxTotalSlots();
for (buff_slot = 0; buff_slot < buff_max; buff_slot++) {
focusspellid = buffs[buff_slot].spellid;
@ -6919,7 +6919,7 @@ bool Mob::TryDeathSave() {
int SuccessChance = 0;
int buffSlot = spellbonuses.DeathSave[SBIndex::DEATH_SAVE_BUFFSLOT];
int32 UD_HealMod = 0;
int HealAmt = 300; //Death Pact max Heal
int64 HealAmt = 300; //Death Pact max Heal
if(buffSlot >= 0){
@ -7070,7 +7070,7 @@ uint16 Mob::GetSympatheticSpellProcID(uint16 spell_id)
bool Mob::DoHPToManaCovert(uint16 mana_cost)
{
if (spellbonuses.HPToManaConvert){
int hp_cost = spellbonuses.HPToManaConvert * mana_cost / 100;
int64 hp_cost = spellbonuses.HPToManaConvert * mana_cost / 100;
if(hp_cost) {
SetHP(GetHP()-hp_cost);
return true;
@ -7081,16 +7081,16 @@ bool Mob::DoHPToManaCovert(uint16 mana_cost)
return false;
}
int32 Mob::GetFcDamageAmtIncoming(Mob *caster, int32 spell_id, bool from_buff_tic)
int64 Mob::GetFcDamageAmtIncoming(Mob *caster, int32 spell_id, bool from_buff_tic)
{
//THIS is target of spell cast
int32 dmg = 0;
int64 dmg = 0;
dmg += GetFocusEffect(focusFcDamageAmtIncoming, spell_id, caster, from_buff_tic); //SPA 297 SE_FcDamageAmtIncoming
dmg += GetFocusEffect(focusFcSpellDamageAmtIncomingPC, spell_id, caster, from_buff_tic); //SPA 484 SE_Fc_Spell_Damage_Amt_IncomingPC
return dmg;
}
int32 Mob::GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spell_id) {
int64 Mob::GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spell_id) {
//**** This can be removed when bot healing focus code is updated ****
@ -7104,7 +7104,7 @@ int32 Mob::GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spel
return 0;
}
int value = 0;
int64 value = 0;
if (spellbonuses.FocusEffects[type]){
@ -7116,7 +7116,7 @@ int32 Mob::GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spel
if((IsValidSpell(buffs[i].spellid) && IsEffectInSpell(buffs[i].spellid, effect))){
int32 focus = caster->CalcFocusEffect(type, buffs[i].spellid, spell_id);
int64 focus = caster->CalcFocusEffect(type, buffs[i].spellid, spell_id);
if (!focus) {
continue;
@ -9402,7 +9402,7 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed) {
return true;
}
void Mob::ResourceTap(int32 damage, uint16 spellid)
void Mob::ResourceTap(int64 damage, uint16 spellid)
{
//'this' = caster
if (!IsValidSpell(spellid))
@ -9434,7 +9434,7 @@ void Mob::ResourceTap(int32 damage, uint16 spellid)
}
}
void Mob::TryTriggerThreshHold(int32 damage, int effect_id, Mob* attacker){
void Mob::TryTriggerThreshHold(int64 damage, int effect_id, Mob* attacker){
if (damage <= 0)
return;
@ -9757,7 +9757,7 @@ bool Mob::CanFocusUseRandomEffectivenessByType(focusType type)
int Mob::GetFocusRandomEffectivenessValue(int focus_base, int focus_base2, bool best_focus)
{
int value = 0;
int64 value = 0;
// This is used to determine which focus should be used for the random calculation
if (best_focus) {
// If the spell does not contain a base2 value, then its a straight non random

View File

@ -2621,7 +2621,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
// lets not consume end for custom items that have disc procs.
// One might also want to filter out USE_ITEM_SPELL_SLOT, but DISCIPLINE_SPELL_SLOT are both #defined to the same thing ...
if (spells[spell_id].endurance_cost && !isproc) {
auto end_cost = spells[spell_id].endurance_cost;
auto end_cost = (int64)spells[spell_id].endurance_cost;
if (mgb)
end_cost *= 2;
SetEndurance(GetEndurance() - EQ::ClampUpper(end_cost, GetEndurance()));
@ -2672,7 +2672,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
recast -= GetAA(aaTouchoftheWicked) * 420;
}
int reduction = CastToClient()->GetFocusEffect(focusReduceRecastTime, spell_id);
int64 reduction = CastToClient()->GetFocusEffect(focusReduceRecastTime, spell_id);
if (reduction) {
recast -= reduction;
@ -4708,11 +4708,11 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
if(caster->GetSpecialAbility(CASTING_RESIST_DIFF))
resist_modifier += caster->GetSpecialAbilityParam(CASTING_RESIST_DIFF, 0);
int focus_resist = caster->GetFocusEffect(focusResistRate, spell_id);
int64 focus_resist = caster->GetFocusEffect(focusResistRate, spell_id);
resist_modifier -= 2 * focus_resist;
int focus_incoming_resist = GetFocusEffect(focusFcResistIncoming, spell_id, caster);
int64 focus_incoming_resist = GetFocusEffect(focusFcResistIncoming, spell_id, caster);
resist_modifier -= focus_incoming_resist;
@ -5702,7 +5702,7 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) {
// adjustments necessary for offensive npc casting behavior
if (bOffensive) {
if (spells[buffs[i].spellid].effect_id[j] == type) {
int16 value =
int64 value =
CalcSpellEffectValue_formula(spells[buffs[i].spellid].buff_duration_formula,
spells[buffs[i].spellid].base_value[j],
spells[buffs[i].spellid].max_value[j],
@ -6775,7 +6775,7 @@ bool Mob::IsFromTriggeredSpell(CastingSlot slot, uint32 item_slot) {
return false;
}
void Mob::SetHP(int32 hp)
void Mob::SetHP(int64 hp)
{
if (hp >= max_hp) {
current_hp = max_hp;

View File

@ -214,7 +214,7 @@ void Trap::Trigger(Mob* trigger)
{
auto outapp = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
CombatDamage_Struct* a = (CombatDamage_Struct*)outapp->pBuffer;
int dmg = zone->random.Int(effectvalue, effectvalue2);
int64 dmg = zone->random.Int(effectvalue, effectvalue2);
trigger->SetHP(trigger->GetHP() - dmg);
a->damage = dmg;
a->hit_heading = 0.0f;

View File

@ -606,7 +606,7 @@ void Mob::TuneGetAccuracyByHitChance(Mob* defender, Mob *attacker, float hit_cha
Tune support functions
*/
int Mob::TuneClientGetMeanDamage(Mob* other, int ac_override, int atk_override, int add_ac, int add_atk)
int64 Mob::TuneClientGetMeanDamage(Mob* other, int ac_override, int atk_override, int add_ac, int add_atk)
{
uint32 total_damage = 0;
int loop_max = 1000;
@ -624,7 +624,7 @@ int Mob::TuneClientGetMeanDamage(Mob* other, int ac_override, int atk_override,
return(total_damage / loop_max);
}
int Mob::TuneClientGetMaxDamage(Mob* other)
int64 Mob::TuneClientGetMaxDamage(Mob* other)
{
uint32 max_hit = 0;
uint32 current_hit = 0;
@ -646,7 +646,7 @@ int Mob::TuneClientGetMaxDamage(Mob* other)
return(max_hit);
}
int Mob::TuneClientGetMinDamage(Mob* other, int max_hit)
int64 Mob::TuneClientGetMinDamage(Mob* other, int max_hit)
{
uint32 min_hit = max_hit;
uint32 current_hit = 0;
@ -688,7 +688,7 @@ float Mob::TuneGetACMitigationPct(Mob* defender, Mob *attacker) {
return tmp_pct_mitigated;
}
int Mob::TuneGetOffense(Mob* defender, Mob *attacker, int atk_override)
int64 Mob::TuneGetOffense(Mob* defender, Mob *attacker, int atk_override)
{
int offense_rating = 0;
if (attacker->IsClient()) {
@ -700,7 +700,7 @@ int Mob::TuneGetOffense(Mob* defender, Mob *attacker, int atk_override)
return offense_rating;
}
int Mob::TuneGetAccuracy(Mob* defender, Mob *attacker, int accuracy_override, int add_accuracy)
int64 Mob::TuneGetAccuracy(Mob* defender, Mob *attacker, int accuracy_override, int add_accuracy)
{
int accuracy = 0;
if (attacker->IsClient()) {
@ -712,7 +712,7 @@ int Mob::TuneGetAccuracy(Mob* defender, Mob *attacker, int accuracy_override, in
return accuracy;
}
int Mob::TuneGetAvoidance(Mob* defender, Mob *attacker, int avoidance_override, int add_avoidance)
int64 Mob::TuneGetAvoidance(Mob* defender, Mob *attacker, int avoidance_override, int add_avoidance)
{
return defender->TuneGetTotalDefense(avoidance_override, add_avoidance);
}
@ -771,7 +771,7 @@ float Mob::TuneGetAvoidMeleeChance(Mob* defender, Mob *attacker, int type)
return chance;
}
int Mob::TuneCalcEvasionBonus(int final_avoidance, int base_avoidance) {
int64 Mob::TuneCalcEvasionBonus(int final_avoidance, int base_avoidance) {
/*
float eb = static_cast<float>(final_avoidance) / static_cast<float>(base_avoidance);
@ -815,7 +815,7 @@ int Mob::TuneCalcEvasionBonus(int final_avoidance, int base_avoidance) {
Calculate from modified attack.cpp functions.
*/
int Mob::TuneNPCAttack(Mob* other, bool no_avoid, bool no_hit_chance, int hit_chance_bonus, int ac_override, int atk_override, int add_ac, int add_atk, bool get_offense, bool get_accuracy,
int64 Mob::TuneNPCAttack(Mob* other, bool no_avoid, bool no_hit_chance, int hit_chance_bonus, int ac_override, int atk_override, int add_ac, int add_atk, bool get_offense, bool get_accuracy,
int avoidance_override, int accuracy_override, int add_avoidance, int add_accuracy)
{
if (!IsNPC()) {
@ -874,7 +874,7 @@ int Mob::TuneNPCAttack(Mob* other, bool no_avoid, bool no_hit_chance, int hit_ch
return my_hit.damage_done;
}
int Mob::TuneClientAttack(Mob* other, bool no_avoid, bool no_hit_chance, int hit_chance_bonus, int ac_override, int atk_override, int add_ac, int add_atk, bool get_offense, bool get_accuracy,
int64 Mob::TuneClientAttack(Mob* other, bool no_avoid, bool no_hit_chance, int hit_chance_bonus, int ac_override, int atk_override, int add_ac, int add_atk, bool get_offense, bool get_accuracy,
int avoidance_override, int accuracy_override, int add_avoidance, int add_accuracy)
{
if (!IsClient()) {
@ -907,7 +907,7 @@ int Mob::TuneClientAttack(Mob* other, bool no_avoid, bool no_hit_chance, int hit
my_hit.damage_done = 1;
my_hit.min_damage = 0;
uint8 mylevel = GetLevel() ? GetLevel() : 1;
uint32 hate = 0;
uint64 hate = 0;
if (weapon)
hate = (weapon->GetItem()->Damage + weapon->GetItem()->ElemDmgAmt);
@ -1028,7 +1028,7 @@ void Mob::TuneMeleeMitigation(Mob *attacker, DamageHitInfo &hit, int ac_override
hit.damage_done = std::max(static_cast<int>(roll * static_cast<double>(hit.base_damage) + 0.5), 1);
}
int Mob::TuneACSum(bool skip_caps, int ac_override, int add_ac)
int64 Mob::TuneACSum(bool skip_caps, int ac_override, int add_ac)
{
int ac = 0; // this should be base AC whenever shrouds come around
ac += itembonuses.AC; // items + food + tribute
@ -1113,7 +1113,7 @@ int Mob::TuneACSum(bool skip_caps, int ac_override, int add_ac)
return ac;
}
int Mob::Tuneoffense(EQ::skills::SkillType skill, int atk_override, int add_atk)
int64 Mob::Tuneoffense(EQ::skills::SkillType skill, int atk_override, int add_atk)
{
int offense = GetSkill(skill);
int stat_bonus = GetSTR();
@ -1235,7 +1235,7 @@ EQ::skills::SkillType Mob::TuneAttackAnimation(int Hand, const EQ::ItemInstance*
return skillinuse;
}
int Mob::Tunecompute_tohit(EQ::skills::SkillType skillinuse, int accuracy_override, int add_accuracy)
int64 Mob::Tunecompute_tohit(EQ::skills::SkillType skillinuse, int accuracy_override, int add_accuracy)
{
int tohit = GetSkill(EQ::skills::SkillOffense) + 7;
tohit += GetSkill(skillinuse);
@ -1262,7 +1262,7 @@ int Mob::Tunecompute_tohit(EQ::skills::SkillType skillinuse, int accuracy_overri
}
// return -1 in cases that always hit
int Mob::TuneGetTotalToHit(EQ::skills::SkillType skill, int chance_mod, int accuracy_override, int add_accuracy)
int64 Mob::TuneGetTotalToHit(EQ::skills::SkillType skill, int chance_mod, int accuracy_override, int add_accuracy)
{
if (chance_mod >= 10000) // override for stuff like SE_SkillAttack
return -1;
@ -1322,7 +1322,7 @@ int Mob::TuneGetTotalToHit(EQ::skills::SkillType skill, int chance_mod, int accu
}
// return -1 in cases that always miss
int Mob::TuneGetTotalDefense(int avoidance_override, int add_avoidance)
int64 Mob::TuneGetTotalDefense(int avoidance_override, int add_avoidance)
{
auto avoidance = Tunecompute_defense(avoidance_override, add_avoidance) + 10; // add 10 in case the NPC's stats are fucked
auto evasion_bonus = spellbonuses.AvoidMeleeChanceEffect; // we check this first since it has a special case
@ -1347,7 +1347,7 @@ int Mob::TuneGetTotalDefense(int avoidance_override, int add_avoidance)
return avoidance;
}
int Mob::Tunecompute_defense(int avoidance_override, int add_avoidance)
int64 Mob::Tunecompute_defense(int avoidance_override, int add_avoidance)
{
int defense = GetSkill(EQ::skills::SkillDefense) * 400 / 225;
defense += (8000 * (GetAGI() - 40)) / 36000;

View File

@ -2378,7 +2378,7 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
t->race = n.race;
t->class_ = n.class_;
t->max_hp = n.hp;
t->current_hp = t->max_hp;
t->current_hp = n.hp;
t->Mana = n.mana;
t->gender = n.gender;
t->texture = n.texture;

View File

@ -36,8 +36,8 @@ struct NPCType
{
char name[64];
char lastname[70];
int32 current_hp;
int32 max_hp;
int64 current_hp;
int64 max_hp;
float size;
float runspeed;
uint8 gender;
@ -60,7 +60,7 @@ struct NPCType
uint32 trap_template;
uint8 light;
uint32 AC;
uint32 Mana; //not loaded from DB
uint64 Mana; //not loaded from DB
uint32 ATK; //not loaded from DB
uint32 STR;
uint32 STA;
@ -104,9 +104,9 @@ struct NPCType
uint8 prim_melee_type;
uint8 sec_melee_type;
uint8 ranged_type;
int32 hp_regen;
int64 hp_regen;
int64 hp_regen_per_second;
int32 mana_regen;
int64 mana_regen;
int32 aggroradius; // added for AI improvement - neotokyo
int32 assistradius; // assist radius, defaults to aggroradis if not set
uint16 see_invis; // See Invis flag added

View File

@ -888,7 +888,7 @@ void Mob::Gate(uint8 bind_number) {
GoToBind(bind_number);
if (RuleB(NPC, NPCHealOnGate) && IsNPC() && GetHPRatio() <= RuleR(NPC, NPCHealOnGateAmount)) {
auto HealAmount = (RuleR(NPC, NPCHealOnGateAmount) / 100);
SetHP(int(GetMaxHP() * HealAmount));
SetHP(int64(GetMaxHP() * HealAmount));
}
}