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

GUI/JASS ability. Can't get it to work.. very weird.

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
Hey readers.

I've got a problem with my spell.

This is the spell:

Cold Smash
Smashes the target with a cold melee attack. Deals (180-210 + Strength) frost damage. The target also has a chance to freeze for 5 seconds after getting hit by Cold Smash.


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


function Trig_ColdSmash_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit t = GetSpellTargetUnit()
    local integer d = 20 + GetHeroStr(u, true) + udg_SpellDamage_Frost[GetConvertedPlayerId(GetOwningPlayer(u))]+(GetRandomInt(80, 95) * GetUnitAbilityLevelSwapped('A02L', u))
    
    call UnitDamageTargetEx(u, t, I2R(d), ATTACK_TYPE_MAGIC, DAMAGE_TYPE_SPELLCAST, false)
    
    set u = null
    set t = null
endfunction

//===========================================================================
function InitTrig_ColdSmash takes nothing returns nothing
    set gg_trg_ColdSmash = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_ColdSmash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_ColdSmash, Condition( function Trig_ColdSmash_Conditions ) )
    call TriggerAddAction( gg_trg_ColdSmash, function Trig_ColdSmash_Actions )
endfunction

(The Damage thingy is from a system from Rising_Dusk. The damage thing isn't the problem it just deals the damage amount I want.)


  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to (==) Cold Smash (Guardian)
  • Actions
    • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
    • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
    • Unit - Order (Last restored unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
The real Cold Smash spell is a Chain Lightning spell with just 1 target etc.. blablabla...
The dummy Cold Smash spell is a storm bolt spell with no mana cost (for the dummy) 9999999 range. 0.00 cast time.. and a 5sec stun. The stun effect looks like Freezing Breath..

Before I had a condition with if random integer between 1 - 100 <= 30 or something. But I removed this to test things out better.


My problem is:

When I cast this spell, it just deals the damage I want but it doesn't freeze my target. What am I doing wrong?!
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
Omg o_O

Don't need help anymore:grin:

This was the problem:

  • Unit - Order (Last restored unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
Must Become:

  • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
 
Status
Not open for further replies.
Top