mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 08:39:11 +00:00
3082fade1d
* 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.
23 lines
531 B
Ruby
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
|