Overhead Alerts

edited September 2016 in Tutorials

I found the function SendOverheadEventMessage() which is used for the gold effect when the player picks up a coin in the overthrow sample and couldn't find any documentation surrounding " OVERHEAD_ALERT_ " so i decided to investigate.

SendOverheadEventMessage(handle player, int overhead_alert_index, handle target_entity, int int value, handle source_player)



Indexes

  • 0 OVERHEAD_ALERT_GOLD (has a sound effect)
  • 1 OVERHEAD_ALERT_DENY
  • 2 OVERHEAD_ALERT_CRITICAL
  • 3 OVERHEAD_ALERT_XP
  • 4 OVERHEAD_ALERT_BONUS_SPELL_DAMAGE
  • 5 OVERHEAD_ALERT_MISS
  • 6 OVERHEAD_ALERT_DAMAGE
  • 7 OVERHEAD_ALERT_EVADE
  • 7 PATTACH_OVERHEAD_FOLLOW
  • 8 OVERHEAD_ALERT_BLOCK
  • 9 OVERHEAD_ALERT_BONUS_POISON_DAMAGE
  • 10 OVERHEAD_ALERT_HEAL
  • 11 OVERHEAD_ALERT_MANA_ADD
  • 12 OVERHEAD_ALERT_MANA_LOSS
  • 13 OVERHEAD_ALERT_LAST_HIT_EARLY
  • 14 OVERHEAD_ALERT_LAST_HIT_CLOSE
  • 15 OVERHEAD_ALERT_LAST_HIT_MISS
  • 16 OVERHEAD_ALERT_MAGICAL_BLOCK

Example

The function OnItemPickUp is being called when an item is picked up from listening to the game event dota_item_picked_up

ListenToGameEvent( "dota_item_picked_up", Dynamic_Wrap( GhostGameMode, "OnItemPickUp"), self )
...
...

function GhostGameMode:OnItemPickUp( event )
    local item = EntIndexToHScript( event.ItemEntityIndex )
    local player = EntIndexToHScript( event.HeroEntityIndex )
    value = 15
    if event.itemname == "item_bag_of_gold" then
        SendOverheadEventMessage( player, OVERHEAD_ALERT_MANA_ADD , player, value, nil )
        player:GiveMana(value)
    end
end

Comments