Spell Immolation

Cohadar

master of fugue
Reaction score
209
JASS:
//===========================================================================
//  Demo spell for use of ABC timer attaching and PUI unit attaching
//  Author: Cohadar.
//  Date: 01.December.2007
//
//  How to implement:
//  Copy triggers ABC, PUI, CSSafety, and this trigger in your map
//  Copy all units and abilities into your map, then change raw codes in triggers
//  Make sure your trigger names are the same as scope names
//  or spells will not work. (I used local triggers)
//===========================================================================

scope Immolation

globals
    private constant real PERIOD = 1.0
    
    private constant integer AID_IMMOLATION = 'A000'
    private constant integer AID_DUMMY_BURNING = 'A001'
    
    private constant integer OID_flamestrike  = 852488
    private constant integer OID_immolation   = 852177
    private constant integer OID_unimmolation = 852178    
    
    private constant integer UID_DUMMY = 'h000'
    
    private constant integer GENERIC_EXPIRATION_TIMER = 'BTLF'
endglobals

//===========================================================================
//  Struct containing immolation data attached to our firelord heroes
//===========================================================================
private struct Data
    unit hero
    static Data array PUI
    
    private timer tim
    
    // instances of this struct are created with Get method
    // This ensures that if hero does not use immolaton,
    // he has no unneded stuff attached
    private static method create takes unit hero returns Data
        local Data ret = Data.allocate()
        set ret.hero = hero
        set ret.tim = NewTimer() // CSSafety
        call SetTimerStructA(ret.tim, ret) // ABC
        set Data.PUI[GetUnitIndex(hero)] = ret // PUI
        return ret
    endmethod
    
    static method Get takes unit hero returns Data
        local integer index
    
        set index = GetUnitIndex(hero) // PUI
        if Data.PUI[index] == 0 then
            debug call BJDebugMsg("|c00FFCC00"+"Immolation struct created on first use for hero: " + GetHeroProperName(hero))
            return Data.create(hero)
        endif
        
        return Data.PUI[index]
    endmethod
    
    // You should destroy instances of this struct 
    // only if hero is removed from game
    // and before hero is removed from game
    // In standard maps heroes are never removed
    // so you basically don't have to worry about this
    method onDestroy takes nothing returns nothing
        call ClearTimerStructA(.tim) // ABC
        call ReleaseTimer(.tim) // CSSafety
        set Data.PUI[GetUnitIndex(.hero)] = 0 // PUI
    endmethod
    
    static method periodic takes nothing returns nothing
        local Data dat = GetTimerStructA(GetExpiredTimer()) // ABC

        // dummy casting flame strike
        set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(dat.hero), UID_DUMMY, 0, 0, 0)
        call UnitAddAbility(bj_lastCreatedUnit, AID_DUMMY_BURNING)
        call SetUnitAbilityLevel(bj_lastCreatedUnit, AID_DUMMY_BURNING, GetUnitAbilityLevel(dat.hero, AID_IMMOLATION))
        call UnitApplyTimedLife(bj_lastCreatedUnit, GENERIC_EXPIRATION_TIMER, 1.0)
        call IssuePointOrderById(bj_lastCreatedUnit, OID_flamestrike, GetUnitX(dat.hero), GetUnitY(dat.hero))
    endmethod
    
    method start takes nothing returns nothing
        call TimerStart(.tim, PERIOD, true, function Data.periodic)
    endmethod
    
    method stop takes nothing returns nothing
        call PauseTimer(.tim)
    endmethod
endstruct


//===========================================================================
public function ActionON takes nothing returns nothing
    //call DisplayTextToForce( GetPlayersAll(), "ON" )
    call Data.Get(GetOrderedUnit()).start()
endfunction

//===========================================================================
public function ActionOFF takes nothing returns nothing
    //call DisplayTextToForce( GetPlayersAll(), "OFF" )
    call Data.Get(GetOrderedUnit()).stop()
endfunction

//===========================================================================
public function ConditionON takes nothing returns boolean
    return GetIssuedOrderId() == OID_immolation
endfunction

public function ConditionOFF takes nothing returns boolean
    return GetIssuedOrderId() == OID_unimmolation
endfunction

//===========================================================================
public function InitTrig takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( trig, Condition( function ConditionON ) )
    call TriggerAddAction( trig, function ActionON )
    
    set trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( trig, Condition( function ConditionOFF ) )
    call TriggerAddAction( trig, function ActionOFF )
endfunction

endscope


Firelord starts to radiate massive amounts of heat from his body scourching everything in his path.
Enemies who stand on burning ground will be cought on fire.

While this destoys his enemies loss of heat weakens Firelord and he loses hit points.

It also destroys trees and such....
 

Attachments

  • Immolation.w3x
    54 KB · Views: 506
  • immolation.PNG
    immolation.PNG
    362.2 KB · Views: 848

NapaHero

Back from the dead...
Reaction score
43
What exactly this spell does? :confused:

Where's the screenshots? :banghead:

Does your code need that bj_LastCreatedUnit? :eek:

It's possible to make this spell in GUI? :p

These are my questions. They need precise awnsers.
 
D

Dr4gonL0rd

Guest
Just a guess from looking at the code (still an extremely new JASS user): Does it create dummy units that cast flame strike nearby the caster?

I'm getting that idea from this:
JASS:
// dummy casting flame strike


Edit: >define possible..
Is it possible that create this spell that does the same exact thing, but just in GUI and not JASS?
 

NapaHero

Back from the dead...
Reaction score
43
>> It immolates.

What a great description :p

Really, describe the spell better. Make a tooltip that shows what exactly this does.
 

waaaks!

Zinctified
Reaction score
255
so when firelord walks, there will be immolations following him?
i havent tried the map yet, because i dont have we in this pc
 

Fluffball

Well-Known Member
Reaction score
35
A very nice spell... you could make it disable when on 10% health though.. but still, very good. Well done.
 
Reaction score
91
I think this needs a fix or two. For example, the dummies continue to cast Flame Strike even when the Hero is out of mana and the ability is toggled off by itself. You could also free this from being activated with every Immolation based spell and use a better example with PUI - the textmacros.
 

Romek

Super Moderator
Reaction score
963
> You could also free this from being activated with every Immolation based spell and use a better example with PUI - the textmacros.
Check the date of this.
I'm not even sure PUI had textmacros back then. :p
 

Sim

Forum Administrator
Staff member
Reaction score
534
Is it due to the test map or the spell?

Looks like an out-dated PUI to me.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top