• 🏆 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!

Spell sometimes bugged

Status
Not open for further replies.
Level 18
Joined
Nov 21, 2012
Messages
835
Hi, idea of this spell is:
1. make hero invulnerable
2. add/remove crow form and set fly height
3. dummy cast soul burn to hero (so he can't use other spells during AntiGravity)
4. after 2sec add passive skill level to damage enemies around hero position (it is named: HarbringerOfNibiru)
5. 2sec before spell ends - set hero fly height to 0

And I got few reports from players that this spell sometimes cause bug - they say hero can't move. Is this idea wrong or wrong executed? I mean with fly.
Here spell:

JASS:
function Trig_AntiGravity_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0DF'
endfunction
//------------------------

function Trig_AntiGravity_Actions takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local unit d = CreateUnit(GetTriggerPlayer(), 'n010', x, y, 0.00) // dummy
local integer id = GetUnitUserData(d)
local real r

    set udg_Spell_Caster[id] = GetTriggerUnit()
    set udg_Spell_Level[id] = GetUnitAbilityLevel(udg_Spell_Caster[id], GetSpellAbilityId())
    set r = I2R(udg_Spell_Level[id])
    set udg_Spell_Damage[id] = ( ( 0.20 * r ) + 2.20 )
    set udg_Spell_Duration[id] = ( 3.50 + ( 0.50 * r ) )
    set udg_Spell_Counter[id] = 0
    
     call SetUnitInvulnerable( udg_Spell_Caster[id], true ) //set invun

 
 
    call UnitAddAbility(udg_Spell_Caster[id] , 'Amrf')  //crow form
    call UnitRemoveAbility(udg_Spell_Caster[id], 'Amrf')
    
    //  
    call UnitAddAbility(d, 'A0C4')  //soul burn
    call SetUnitAbilityLevel(d, 'A0C4', udg_Spell_Level[id])
    call IssueTargetOrderBJ( d, "soulburn", udg_Spell_Caster[id] )
    

    call SetUnitFlyHeightBJ( udg_Spell_Caster[id], 300.00, 150.00 )  //fly heigh
    //  
    //  
    if IsUnitGroupEmptyBJ(udg_Spell_Group_array[142]) then
        call EnableTrigger( gg_trg_LoopAntiGravity )
    endif
    call GroupAddUnit(udg_Spell_Group_array[142], d )
    //  

    
set d=null
endfunction

//===========================================================================
function InitTrig_AntiGravity takes nothing returns nothing
    set gg_trg_AntiGravity = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_AntiGravity, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_AntiGravity, Condition( function Trig_AntiGravity_Conditions ) )
    call TriggerAddAction( gg_trg_AntiGravity, function Trig_AntiGravity_Actions )
endfunction

and loop trigger:

JASS:
//========================================
function Trig_LoopAntiGravity_Func001A takes nothing returns nothing
local unit d = GetEnumUnit()
local integer id = GetUnitUserData(d)
local player pla = GetOwningPlayer(d)
local real x
local real y
local integer harbringer
local real dmg
local unit u

    // Harbringer of Nibiru -------
    // Harbringer of Nibiru -------
if (udg_Spell_Counter[id] == 8) and (GetUnitAbilityLevel(udg_Spell_Caster[id], 'A0C7') > 0) then
    set x = GetUnitX(udg_Spell_Caster[id])
    set y = GetUnitY(udg_Spell_Caster[id])

        set harbringer = GetUnitAbilityLevel(udg_Spell_Caster[id], 'A0C7')
        
        set dmg = ( ( 10.00 * I2R(( harbringer * harbringer )) ) + 60.00 )
        // ---increase spell by RobeOfTheMagi and InternallIntelligence  -----
    if HasItemZibi(udg_Spell_Caster[id], 'ward') then
    set dmg = dmg  * 1.25
    elseif HasItemZibi(udg_Spell_Caster[id], 'arsc') then
    set dmg = dmg  * 1.50
    endif
    
set bj_lastCreatedUnit = CreateUnit(pla, 'e01O', x, y, 0.00)
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 2.00)
        //  
        
call GroupEnumUnitsInRange(udg_ug, x, y, 400.00, null)
loop
set u = FirstOfGroup(udg_ug) 
exitwhen u == null
if IsUnitEnemy(u, pla) and IsUnitType(u, UNIT_TYPE_STRUCTURE) == false then
// --------dmg ----------
call UnitDamageTargetBJ( d, u, dmg, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_UNIVERSAL )
//  
endif    
call GroupRemoveUnit(udg_ug, u)
endloop
call GroupClear (udg_ug) 
        
        
endif
    //  
    //  
    //  
    if udg_Spell_Counter[id] == ( udg_Spell_Level[id] * 2 ) + 6 then
        call SetUnitFlyHeightBJ( udg_Spell_Caster[id], 0.00, 150.00 )
    endif
    //  
    //  
    //  
    //  
    //  
    set udg_Spell_Counter[id] = ( udg_Spell_Counter[id] + 1 )
    set udg_Spell_Duration[id] = ( udg_Spell_Duration[id] - 0.25 )
    // When the duration reaches 0 it means the spell is done
     if udg_Spell_Duration[id] <= 0.00 then
        // Clean up any data attached to this spell
        call SetUnitInvulnerable( udg_Spell_Caster[id], false )
        set udg_Spell_Counter[id] = 0
        // Remove the dummy from the group and from the game
        //  
        call GroupRemoveUnit(udg_Spell_Group_array[142], d )
        call RemoveUnit( d )
        if IsUnitGroupEmptyBJ(udg_Spell_Group_array[142]) then
            call DisableTrigger( GetTriggeringTrigger() )
        endif
    endif
    
    
set d=null
set u=null
set pla=null
endfunction

//------------------------------------------
function Trig_LoopAntiGravity_Actions takes nothing returns nothing
    call ForGroup( udg_Spell_Group_array[142], function Trig_LoopAntiGravity_Func001A )
endfunction

//===========================================================================
function InitTrig_LoopAntiGravity takes nothing returns nothing
    set gg_trg_LoopAntiGravity = CreateTrigger(  )
    call DisableTrigger( gg_trg_LoopAntiGravity )
    call TriggerRegisterTimerEventPeriodic( gg_trg_LoopAntiGravity, 0.25 )
    call TriggerAddAction( gg_trg_LoopAntiGravity, function Trig_LoopAntiGravity_Actions )
endfunction

zibi

edit
I decided to abandom this 'Fly' ability. It has been deleted in new version of Ashenvale map. Also as i see noone got idea what could be wrong with this spell above.
zibi
 
Last edited:
Status
Not open for further replies.
Top