Fix combat not working after logout; Fix DDS hits

* Removes the use of the MOB_STATE_CACHE and instead monkey patches a
  get_combat_state method onto Mob.
This commit is contained in:
Gary Tierney
2016-01-03 23:31:34 +00:00
parent 3082fade1d
commit 9f47fae6a9
5 changed files with 17 additions and 22 deletions
+3 -3
View File
@@ -93,9 +93,9 @@ class AttackDSL
##
# Deal melee damage.
def damage!(damage_modifier: 1, delay: 0)
def damage!(damage_modifier: 1, delay: 0, secondary: false)
@subattacks.push lambda { |source, target|
do_damage! source, target, 1, delay
do_damage! source, target, 1, delay, secondary
}
end
@@ -124,7 +124,7 @@ def do_damage!(source, target, amount, delay = 0, secondary = false, &_block)
schedule delay do |task|
task.stop && return if source.dead || target.dead
target_combat_state = get_combat_state target
target_combat_state = target.get_combat_state
target_hitpoints = target.skill_set.get_skill(Skill::HITPOINTS).get_current_level
amount = target_hitpoints if target_hitpoints < amount