mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-05 00:38:14 +00:00
Add initial combat spell support
This commit is contained in:
committed by
Gary Tierney
parent
9f47fae6a9
commit
ec248a185b
@@ -1,7 +1,7 @@
|
||||
java_import 'org.apollo.game.message.impl.HintIconMessage'
|
||||
|
||||
on :message, :npc_action do |player, message|
|
||||
target = $world.npc_repository.get message.index
|
||||
target = $world.npc_repository.get message.index
|
||||
|
||||
# unless target.attacking
|
||||
# target_combat_state = get_combat_state target
|
||||
@@ -10,12 +10,28 @@ on :message, :npc_action do |player, message|
|
||||
# target.start_action CombatAction.new(target)
|
||||
# end
|
||||
|
||||
player_combat_state = player.get_combat_state
|
||||
player_combat_state = player.get_combat_state
|
||||
player_combat_state.target = target
|
||||
|
||||
player.send HintIconMessage.for_npc(target.index)
|
||||
player.walking_queue.clear
|
||||
player.start_action CombatAction.new(player) unless player_combat_state.is_attacking?
|
||||
player.start_action CombatAction.new(player)
|
||||
end
|
||||
|
||||
on :message, :magic_on_mob do |player, message|
|
||||
target = $world.npc_repository.get(message.index)
|
||||
|
||||
player_combat_state = player.get_combat_state
|
||||
player_combat_state.target = target
|
||||
|
||||
spellbook = spellbook_for(message.interface_id)
|
||||
spell = spell_for(spellbook, message.spell_id)
|
||||
|
||||
player.walking_queue.clear
|
||||
player.start_action CombatAction.new(player)
|
||||
|
||||
magic_attack = MagicAttack.new(spell)
|
||||
player_combat_state.queue_attack(magic_attack)
|
||||
end
|
||||
|
||||
on :message, :player_action do |player, message|
|
||||
|
||||
Reference in New Issue
Block a user