Warcraft III resources & community, 2003–2006 · archived

Why dont work this script pls help :)

4 posts
#1

Why dont work this script pls help :)

function Trig_Nova_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Nova_Actions takes nothing returns nothing
    local unit caster = GetSpellAbilityUnit()
    local real MaxRange = 900.00
    local real StartRange = 0.00
    local real RangeJumps = 50.00
    local effect NovaEffect
    local string EffectPreBase
    local real Arrounder
    local location NovaPoint

    set NovaPoint = (GetUnitLoc(caster))
    set EffectPreBase = "Abilities\\Spells\\Other\\ImmolationRed\\ImmolationRedDamage.mdl"
    loop
        exitwhen StartRange == MaxRange
        call TriggerSleepAction(0.01)
        loop
            exitwhen Arrounder == 360.00
            call TriggerSleepAction(0.01)
            set Arrounder = Arrounder + 12.00
            call DestroyEffect(NovaEffect)
            call AddSpecialEffectLocBJ( PolarProjectionBJ(NovaPoint, StartRange, Arrounder), EffectPreBase )
            set NovaEffect = GetLastCreatedEffectBJ()
        endloop
        set StartRange = StartRange + RangeJumps
    endloop
    call RemoveLocation(NovaPoint)
    set Arrounder = 0.00
    set caster = null
endfunction

//===========================================================================
function InitTrig_Nova takes nothing returns nothing
    set gg_trg_Nova = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Nova, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Nova, Condition( function Trig_Nova_Conditions ) )
    call TriggerAddAction( gg_trg_Nova, function Trig_Nova_Actions )
endfunction

I dont know whats false :(
#2
You must be more specific in what doesn't work if you are going to get any help with this.
#3
yo ok it completely dont works. I have casted the spell and nothing transpires it should create a nova :cry:
#4
Make the spell display text in the game at some specific actions so you know how much that works. I always do that. Set some text after the variables has been defined so you know that the script works so far and some text in the loop telling what happens. This will help you figure out what part is wrong.