• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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)

Level 10
Joined
Aug 21, 2010
Messages
316
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:
Top