• 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.

[JASS] Need Help

Status
Not open for further replies.
Level 8
Joined
Nov 20, 2008
Messages
445
Cant create unit. Need help

JASS:
function Trig_FloatAttack_Condition takes nothing returns boolean
    if ( not ( IsUnitType(GetEventDamageSource(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_FloatAttack_Actions takes nothing returns nothing
    local location l
    set l = GetUnitLoc(GetTriggerUnit())
    if udg_CritChance[GetConvertedPlayerId(GetOwningPlayer(GetEventDamageSource()))] > GetRandomInt(0, 100) then
    call CreateUnitAtLoc(GetOwningPlayer(GetEventDamageSource()), 'h002', l, bj_UNIT_FACING )
    call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
    call UnitDamageTargetBJ( GetLastCreatedUnit(), GetTriggerUnit(), GetEventDamage(), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
    call CreateTextTagUnitBJ((I2S(R2I((GetEventDamage()*2)))), GetTriggerUnit(), 0, 10.00, 100, 100, 100.00, 0 )
    call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
    call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 90.00, 90 )
    call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
    else
    call CreateTextTagUnitBJ( I2S(R2I(GetEventDamage())), GetTriggerUnit(), 0, 8.00, 100, 100, 100.00, 0 )
    call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
    call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 90.00, 90 )
    call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
    endif
    set l = null
endfunction

I managed to find what was the cause and now im trying to find how to do it so can u tell me why the function i created bugs(it doesnt create the dummy unit)
 
Last edited:
Status
Not open for further replies.
Top