mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Decouple zone calls, cleanup logic
This commit is contained in:
+13
-13
@@ -283,7 +283,7 @@ bool Mob::CheckHitChance(Mob* other, DamageHitInfo &hit)
|
||||
bool lua_ret = false;
|
||||
bool ignoreDefault = false;
|
||||
lua_ret = LuaParser::Instance()->CheckHitChance(this, other, hit, ignoreDefault);
|
||||
|
||||
|
||||
if(ignoreDefault) {
|
||||
return lua_ret;
|
||||
}
|
||||
@@ -323,7 +323,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
|
||||
bool lua_ret = false;
|
||||
bool ignoreDefault = false;
|
||||
lua_ret = LuaParser::Instance()->AvoidDamage(this, other, hit, ignoreDefault);
|
||||
|
||||
|
||||
if (ignoreDefault) {
|
||||
return lua_ret;
|
||||
}
|
||||
@@ -866,7 +866,7 @@ int Mob::GetBestMeleeSkill()
|
||||
{ EQEmu::skills::Skill1HBlunt,
|
||||
EQEmu::skills::Skill1HSlashing,
|
||||
EQEmu::skills::Skill2HBlunt,
|
||||
EQEmu::skills::Skill2HSlashing,
|
||||
EQEmu::skills::Skill2HSlashing,
|
||||
EQEmu::skills::SkillHandtoHand,
|
||||
EQEmu::skills::Skill1HPiercing,
|
||||
EQEmu::skills::Skill2HPiercing,
|
||||
@@ -879,7 +879,7 @@ int Mob::GetBestMeleeSkill()
|
||||
value = GetSkill(meleeSkills[i]);
|
||||
bestSkill = std::max(value, bestSkill);
|
||||
}
|
||||
|
||||
|
||||
return bestSkill;
|
||||
}
|
||||
|
||||
@@ -892,7 +892,7 @@ int Mob::offense(EQEmu::skills::SkillType skill)
|
||||
case EQEmu::skills::SkillArchery:
|
||||
case EQEmu::skills::SkillThrowing:
|
||||
stat_bonus = GetDEX();
|
||||
break;
|
||||
break;
|
||||
|
||||
// Mobs with no weapons default to H2H.
|
||||
// Since H2H is capped at 100 for many many classes,
|
||||
@@ -943,7 +943,7 @@ void Mob::MeleeMitigation(Mob *attacker, DamageHitInfo &hit, ExtraAttackOptions
|
||||
#ifdef LUA_EQEMU
|
||||
bool ignoreDefault = false;
|
||||
LuaParser::Instance()->MeleeMitigation(this, attacker, hit, opts, ignoreDefault);
|
||||
|
||||
|
||||
if (ignoreDefault) {
|
||||
return;
|
||||
}
|
||||
@@ -1735,7 +1735,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::Sk
|
||||
if (!RuleB(Character, UseDeathExpLossMult)) {
|
||||
exploss = (int)(GetLevel() * (GetLevel() / 18.0) * 12000);
|
||||
}
|
||||
|
||||
|
||||
if (RuleB(Zone, LevelBasedEXPMods)) {
|
||||
// Death in levels with xp_mod (such as hell levels) was resulting
|
||||
// in losing more that appropriate since the loss was the same but
|
||||
@@ -1893,7 +1893,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::Sk
|
||||
dead_timer.Start(5000, true);
|
||||
m_pp.zone_id = m_pp.binds[0].zoneId;
|
||||
m_pp.zoneInstance = m_pp.binds[0].instance_id;
|
||||
database.MoveCharacterToZone(this->CharacterID(), content_db.GetZoneName(m_pp.zone_id));
|
||||
database.MoveCharacterToZone(this->CharacterID(), m_pp.zone_id);
|
||||
Save();
|
||||
GoToDeath();
|
||||
}
|
||||
@@ -2452,7 +2452,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::Skil
|
||||
|
||||
bool allow_merchant_corpse = RuleB(Merchant, AllowCorpse);
|
||||
bool is_merchant = (class_ == MERCHANT || class_ == ADVENTUREMERCHANT || MerchantType != 0);
|
||||
|
||||
|
||||
if (!HasOwner() && !IsMerc() && !GetSwarmInfo() && (!is_merchant || allow_merchant_corpse) &&
|
||||
((killer && (killer->IsClient() || (killer->HasOwner() && killer->GetUltimateOwner()->IsClient()) ||
|
||||
(killer->IsNPC() && killer->CastToNPC()->GetSwarmInfo() && killer->CastToNPC()->GetSwarmInfo()->GetOwner() && killer->CastToNPC()->GetSwarmInfo()->GetOwner()->IsClient())))
|
||||
@@ -4093,7 +4093,7 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
if (IsPet() && hand != EQEmu::invslot::slotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets)
|
||||
continue; // If pets ever can proc from off hand, this will need to change
|
||||
|
||||
if (SpellProcs[i].base_spellID == POISON_PROC &&
|
||||
if (SpellProcs[i].base_spellID == POISON_PROC &&
|
||||
(!weapon || weapon->ItemType != EQEmu::item::ItemType1HPiercing))
|
||||
continue; // Old school poison will only proc with 1HP equipped.
|
||||
|
||||
@@ -4113,7 +4113,7 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
// Spell procs (buffs)
|
||||
if (SpellProcs[i].spellID != SPELL_UNKNOWN) {
|
||||
if (SpellProcs[i].base_spellID == POISON_PROC) {
|
||||
poison_slot=i;
|
||||
poison_slot=i;
|
||||
continue; // Process the poison proc last per @mackal
|
||||
}
|
||||
|
||||
@@ -4160,7 +4160,7 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
RemoveProcFromWeapon(spell_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (HasSkillProcs() && hand != EQEmu::invslot::slotRange) { //We check ranged skill procs within the attack functions.
|
||||
uint16 skillinuse = 28;
|
||||
@@ -4696,7 +4696,7 @@ void Mob::ApplyDamageTable(DamageHitInfo &hit)
|
||||
#ifdef LUA_EQEMU
|
||||
bool ignoreDefault = false;
|
||||
LuaParser::Instance()->ApplyDamageTable(this, hit, ignoreDefault);
|
||||
|
||||
|
||||
if (ignoreDefault) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user