• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Damage and Spell Floating Text

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: deepstrasz
Damage and Spell Floating Text
Import all of triggers on your to show number of dealing damage when attacking and show name of casting spell!
Hint: first you must go to "preferences" of your world editor and then Active: "Automatically create unknown variables while pasting trigger data" and please don't delete or rename anything!
Enjoy!
Created by (Lord Mahdi)
Contents

Damage and Spell Floating Text (Map)

JASS:
function Trig_Floating_Damage_Taken_Conditions takes nothing returns boolean
    if ( not ( udg_GDD_Damage > 1.00 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Floating_Damage_Taken_Actions takes nothing returns nothing
    call CreateTextTagUnitBJ( ( udg_PlayerColors[GetConvertedPlayerId(GetOwningPlayer(udg_GDD_DamageSource))] + I2S(R2I(udg_GDD_Damage)) ), udg_GDD_DamagedUnit, 0.00, udg_TextSize_dmg, 100.00, 15.00, 0.00, 0 )
    call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 100.00, 90.00 )
    call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
    call SetTextTagLifespanBJ( GetLastCreatedTextTag(), udg_Text_Duration )
    call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 0.65 )
endfunction

//===========================================================================
function InitTrig_Floating_Damage_Taken takes nothing returns nothing
    set gg_trg_Floating_Damage_Taken = CreateTrigger(  )
    call TriggerRegisterVariableEvent( gg_trg_Floating_Damage_Taken, "udg_GDD_Event", EQUAL, 0 )
    call TriggerAddCondition( gg_trg_Floating_Damage_Taken, Condition( function Trig_Floating_Damage_Taken_Conditions ) )
    call TriggerAddAction( gg_trg_Floating_Damage_Taken, function Trig_Floating_Damage_Taken_Actions )
endfunction

function Trig_Floating_Spell_Name_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) != 'hpea' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Floating_Spell_Name_Actions takes nothing returns nothing
    call CreateTextTagUnitBJ( ( udg_PlayerColors[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] + GetAbilityName(GetSpellAbilityId()) ), GetTriggerUnit(), 0.00, udg_TextSize_spells, 100.00, 100.00, 100.00, 0 )
    call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 100.00, 90.00 )
    call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
    call SetTextTagLifespanBJ( GetLastCreatedTextTag(), udg_Text_Duration )
    call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 0.65 )
endfunction

//===========================================================================
function InitTrig_Floating_Spell_Name takes nothing returns nothing
    set gg_trg_Floating_Spell_Name = CreateTrigger(  )
    call TriggerAddCondition( gg_trg_Floating_Spell_Name, Condition( function Trig_Floating_Spell_Name_Conditions ) )
    call TriggerAddAction( gg_trg_Floating_Spell_Name, function Trig_Floating_Spell_Name_Actions )
endfunction
Awesome system :)I can not believe...hahaha. Is this a joke?
Listen kid, read the rules first and then add something here.
 
Last edited:
Back
Top