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: 517
  • immolation.PNG
    immolation.PNG
    362.2 KB · Views: 860

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
256
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
964
> 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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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