Files
apollo/data/plugins/combat/widgets/special_bar.rb
Gary Tierney 3082fade1d Add ranged combat support
* Clean up the CombatAction and Attack code to make it easier to use for
  range.

* Add collision detection to the distance checks before attacking in the
  CombatAction.

* Create a Ruby DSL for defining projectile types and fix the
  ProjectileUpdateOperation so it uses the correct position offset.

* Fix the packet structure of the HintIconMessageEncoder.
2016-02-29 22:24:26 +00:00

23 lines
531 B
Ruby

java_import 'org.apollo.game.message.impl.ConfigMessage'
def update_special_bar(player)
player.send(ConfigMessage.new(300, player.special_energy * 10)) # special energy
player.send(ConfigMessage.new(301, player.using_special ? 1 : 0)) # special enabled
end
on :login do |event|
player = event.player
update_special_bar player
schedule 25 do |task|
unless player.is_active
task.stop
next
end
player.special_energy = [player.special_energy + 5, 100].min
update_special_bar player
end
end