Skill help

Lmfaocj

Active Member
Reaction score
1
I was trying to make a skill but it doesn't seem to be working
i am noob and don't know about jass much can anyone tell me what I did wrong?

JASS:
function QE_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A010' ) ) then
        return false
    endif
    return true
endfunction

function QE_Actions takes nothing returns nothing
    local location p=GetSpellTargetLoc()
    local location o=null
    local real f=GetUnitFacing(GetTriggerUnit())
    // -------- 1 --------
    call CreateNUnitsAtLoc( 1, 'hfoo', GetOwningPlayer(GetTriggerUnit()), p, f)
    call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
    call UnitAddAbilityBJ( 'A012', GetLastCreatedUnit() )
    call SetUnitAbilityLevelSwapped( 'A012', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A010', GetTriggerUnit()) )
    call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
    set o = PolarProjectionBJ( p, 120.00, f)
    call RemoveLocation(p)
    set p = o
    call RemoveLocation(o)
    // -------- 2 --------
    call TriggerSleepAction( 0.50 )
    call CreateNUnitsAtLoc( 1, 'hfoo', GetOwningPlayer(GetTriggerUnit()), p, f)
    call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
    call UnitAddAbilityBJ( 'A012', GetLastCreatedUnit() )
    call SetUnitAbilityLevelSwapped( 'A012', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A010', GetTriggerUnit()) )
    call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
    set o = PolarProjectionBJ( p, 120.00, f)
    call RemoveLocation(p)
    set p = o
    call RemoveLocation(o)
    // -------- 3 --------
    call TriggerSleepAction( 0.50 )
    call CreateNUnitsAtLoc( 1, 'hfoo', GetOwningPlayer(GetTriggerUnit()), p, f)
    call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
    call UnitAddAbilityBJ( 'A012', GetLastCreatedUnit() )
    call SetUnitAbilityLevelSwapped( 'A012', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A010', GetTriggerUnit()) )
    call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
    call RemoveLocation(p)
    set p = o
    call RemoveLocation(o)
    // -------- 4 --------
    call TriggerSleepAction( 0.50 )
    call CreateNUnitsAtLoc( 1, 'hfoo', GetOwningPlayer(GetTriggerUnit()), p, f)
    call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
    call UnitAddAbilityBJ( 'A012', GetLastCreatedUnit() )
    call SetUnitAbilityLevelSwapped( 'A012', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A010', GetTriggerUnit()) )
    call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
    set o = PolarProjectionBJ( p, 120.00, f)
    call RemoveLocation(p)
    set p = o
    call RemoveLocation(o)
    // -------- 5 --------
    call TriggerSleepAction( 0.50 )
    call CreateNUnitsAtLoc( 1, 'hfoo', GetOwningPlayer(GetTriggerUnit()), p, f)
    call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
    call UnitAddAbilityBJ( 'A012', GetLastCreatedUnit() )
    call SetUnitAbilityLevelSwapped( 'A012', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A010', GetTriggerUnit()) )
    call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )

    
    set p=null
    set o=null
    set f=0.00
endfunction

//===========================================================================
function InitTrig_Quake takes nothing returns nothing
    local trigger t= CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, function QE_Conditions )
    call TriggerAddAction( t, function QE_Actions )
endfunction
 

Joshman_09

New Member
Reaction score
2
hmm i dont rlly know then sorry, im a noob when it comes to jass just as well, have u tryed postin this in the Jass Help section?
 

luorax

Invasion in Duskwood
Reaction score
67
JASS:
function QE_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A010'
endfunction

function QE_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local player p = GetOwningPlayer(caster)
    local integer lvl = GetUnitAbilityLevel(caster, GetSpellAbilityId())
    local real tx = GetSpellTargetX()
    local real ty = GetSpellTargetY()
    local real face = GetUnitFacing(caster)
    local unit dummy
    local real x = tx
    local real y = ty
    local integer li = 0
    
    loop
        exitwhen li > 4
        set dummy = CreateUnit(p, 'hfoo', x, y, face)
        call UnitAddAbility(dummy, 'A012')
        call SetUnitAbilityLevel(dummy, 'A012', lvl)
        call IssueImmediateOrder(dummy, "stomp")
        call UnitApplyTimedLife(dummy, 'BTLF', 0.)
        
        set x = x + 120. * Cos(face * bj_DEGTORAD)
        set y = y + 120. * Sin(face * bj_DEGTORAD)

        call TriggerSleepAction( 0.50 )
        
        set li = li + 1
    endloop
    
    set caster = null
    set dummy = null
    set p = null
endfunction

//===========================================================================
function InitTrig_Quake takes nothing returns nothing
    local trigger t= CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, function QE_Conditions )
    call TriggerAddAction( t, function QE_Actions )
endfunction


I think this will work.
 

Lmfaocj

Active Member
Reaction score
1
I am going to try it out right now
and also thank you for making the id's same so i won't have to edit it :3
 

luorax

Invasion in Duskwood
Reaction score
67
Also, after making the code just like a machine, I got an "idea" (I found something)
Creating the dummy dynamically is unnecessary. But it doesn't really matter now. The script'll work, but will slower a bit. But it's quite hard to detect it, so don't worry. And mine is much faster than the converted one :D
 

Lmfaocj

Active Member
Reaction score
1
Also, after making the code just like a machine, I got an "idea" (I found something)
Creating the dummy dynamically is unnecessary. But it doesn't really matter now. The script'll work, but will slower a bit. But it's quite hard to detect it, so don't worry. And mine is much faster than the converted one :D

:3 thank you it worked, I wanted the dummy because i made the dummy a blade master doing slam >=3
 

luorax

Invasion in Duskwood
Reaction score
67
I meant creating a new dummy unit in each iteration is useless. So:

JASS:
function QE_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A010'
endfunction

function QE_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local player p = GetOwningPlayer(caster)
    local integer lvl = GetUnitAbilityLevel(caster, GetSpellAbilityId())
    local real tx = GetSpellTargetX()
    local real ty = GetSpellTargetY()
    local real face = GetUnitFacing(caster)
    local unit dummy = CreateUnit(p, 'hfoo', x, y, face)
    local real x = tx
    local real y = ty
    local integer li = 0
    
    call UnitAddAbility(dummy, 'A012')
    call SetUnitAbilityLevel(dummy, 'A012', lvl)

    loop
        exitwhen li > 4
        call SetUnitX(dummy, x)
        call SetUnitY(dummy, y)
        call IssueImmediateOrder(dummy, "stomp")
        
        set x = x + 120. * Cos(face * bj_DEGTORAD)
        set y = y + 120. * Sin(face * bj_DEGTORAD)

        call TriggerSleepAction( 0.50 )
        
        set li = li + 1
    endloop
    call UnitApplyTimedLife(dummy, 'BTLF', .1)    

    set caster = null
    set dummy = null
    set p = null
endfunction

//===========================================================================
function InitTrig_Quake takes nothing returns nothing
    local trigger t= CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, function QE_Conditions )
    call TriggerAddAction( t, function QE_Actions )
endfunction


Do you see it? Creating a new dummy is useless. We can use only one dummy to cast the spell each time.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top