Spell Burning Steps

I

IKilledKEnny

Guest
This is my newly made JASS spell, "Burning Steps". Took me about 20 minutes to make it, but I still thinks it's decent. :)

What does it do:

Once the spell have been casted it will last for 5 / 10 / 15 seconds. Druing that time
The hero's speed will increase by 20% / 30% / 35%, also after the hero there will be a
trail of flames left, each flame created will cost 0.5 / 1 / 1.5 mana for the caster.
When an enemy unit will step into the flames, it will be dealt damage of 15 / 20 / 30 per
second. Once created flames will be removed only after 4 / 5 / 6 seconds.

BurningSteps.jpg


BurningSteps2.jpg


BurningSteps3.jpg


BurningSteps4.jpg


The Trigger:

JASS:

constant function BurningStepsId takes nothing returns integer 
  // This function will return the base Id of the burning steps spell.
  return 'A000'
  // You need to edit 'A000' to burning step's Id in your map.
endfunction

constant function BurningStepsImmolationId takes nothing returns integer
  // This function will return the base Id of the burning steps immolation spell.
  return 'A001'
  // You need to edit 'A001' to burning steps immolation's Id in your map.
endfunction

constant function BurningStepsDummyId takes nothing returns integer
  // This function will return the base Id of the dummy.
  return 'h000'
  // You need to edit 'h000' to dummy's Id in your map.
endfunction

function BurningStepsDummyTime takes integer abilitylevel returns real
  // This function will return the life time of the flames
  return I2R(abilitylevel * 3 + 1)
  // At the moment it returns 4 / 5 / 6.  
endfunction

constant function BurningStepsRedo takes unit caster returns real
  // This function will return the time which will take the timer to run the new function
  return (20/GetUnitMoveSpeed(caster))
  // I suggest making this equal to immolation AoE divided by move speed although it's not a have to.
endfunction

function BurningStepsWaitTime takes integer abilitylevel returns real
  // This function will return the dauration of the spell
  return I2R(abilitylevel*5)
  // At the moment it returns 5 / 10 / 15.
endfunction

constant function BurningStepsNewMana takes real mana, integer abilitylevel returns real
  // This function will return the mana cost per flamce
  return mana-abilitylevel*0.5
  // At the moment it's current mana - .5 / 1 / 1.5
endfunction

function BurningStepsCon takes nothing returns boolean
  // This function will return true if the spell that was caster is burning steps.
  return GetSpellAbilityId()==BurningStepsId()
  // If this returns flase the action triggers will not run.
endfunction

function BurningSteps takes nothing returns nothing
  // This function will create the flames at the hero's feet
  local timer caller=GetExpiredTimer() // The timer which triggered the function
  local unit caster=GetHandleUnit(caller,"caster") // We get the caster through it's link with the timer
  local real casterX=GetUnitX(caster) // We get the unit's X. X + Y = location
  local real casterY=GetUnitY(caster) // We get the unit's Y. X + Y = location
  local player owner=GetOwningPlayer(caster) // We get the owner of the caster
  local unit FlameDummy // This will serve as the flame when the time comes
  local integer AbilityLevel=GetUnitAbilityLevel(caster,BurningStepsId()) // This gets the level of burning steps for the caster
  local real mana=GetUnitState(caster, UNIT_STATE_MANA) // This get's the caster's current mana
  local real NewMana=BurningStepsNewMana(mana,AbilityLevel) // This get's it's new mana
  local real counter=GetHandleReal(caller,"counter") // We get counter through it's link with the timer
  local real adder=GetHandleReal(caller,"adder")  // We get adder through it's link with the timer
  local real cap=GetHandleReal(caller,"cap")  // We get cap through it's link with the timer

  set counter=counter+adder // We set the new value of counter 
  if counter >=cap then // We check if it is equal to cap or bigger
    call PauseTimer(caller) // We are pausing the timer so we could destroy safely.
    call FlushHandleLocals(caller) // We destroy the linkage between caster and timer
    call DestroyTimer(caller) // We destroy timer

    // Leaks removal (we null stuff)

    set FlameDummy=null 
    set owner=null
    set caller=null
    set caster=null
  endif

  if NewMana > 0 then // We check if the caster's new mana is more then 0 if it is then (else we do nothing):
    set FlameDummy=CreateUnit(owner,BurningStepsDummyId(),casterX,casterY,0) // This creates a flame for owner in the caster's location.
    call SetUnitState(caster,UNIT_STATE_MANA, NewMana) // This set's the caster's mana to NewMana
    call UnitAddAbility(FlameDummy,BurningStepsImmolationId()) // We add immolation to the flame
    call SetUnitAbilityLevel(FlameDummy,BurningStepsImmolationId(),AbilityLevel) // We set immolation's level to the burning step's level for the caster.
    call UnitApplyTimedLife(FlameDummy,'BTLF',BurningStepsDummyTime(AbilityLevel)) // We add timed life to the flame so it will not live forever.   
  endif
  call SetHandleReal(caller,"counter",counter)

  // Leaks removal, nulling stuff

  set FlameDummy=null
  set owner=null
  set caller=null
  set caster=null
endfunction

function BurningStepsMain takes nothing returns nothing
  // This the main function that will be triggered when the caster cast's burning steps
  local timer caller=CreateTimer() // We create a timer
  local unit caster=GetTriggerUnit() // We get triggering unit
  local real redo=BurningStepsRedo(caster) // We get the time between each function call of function Burning Steps.
  local integer AbilityLevel=GetUnitAbilityLevel(caster,BurningStepsId()) // We get the level of burning steps for the caster
  local real cap=BurningStepsWaitTime(AbilityLevel) // We set the spell's dauration
  local real adder=redo // This will be used for stoping the spell at the right time. We will increase counter by the adder (which is redo).
  local real counter=0 // We will use counter to count number of seconds the spell is running and if it ran too much, then we will stop it.
  
  call SetHandleHandle(caller,"caster",caster) // We create linkage between caster and timer
  call SetHandleReal(caller,"counter",counter) // We create linkage between counter and timer
  call SetHandleReal(caller,"adder",adder) // We create linkage between adder and timer
  call SetHandleReal(caller,"cap",cap)  // We create linkage between cap and timer
  call TimerStart(caller,redo,true,function BurningSteps) // We start timer that will run every "redo" time and will call BurningSteps function.

  set caster=null
endfunction

//===========================================================================
function InitTrig_BurningSteps takes nothing returns nothing
  // This function will create, and then set the trigger.
  set gg_trg_BurningSteps=CreateTrigger()
  call TriggerRegisterAnyUnitEventBJ(gg_trg_BurningSteps,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_BurningSteps,Condition(function BurningStepsCon))
  call TriggerAddAction(gg_trg_BurningSteps,function BurningStepsMain)
endfunction


This is the READ ME:

Code:
Spell made by ~IKilledKenny~

================================================================================================

>> Please follow these rules:
    
    > You may import this spell freely into your map, with no credits needed, so don't worry
      about that. However, when importing it, make sure you follow the importing instructions
      or problems may occur becuase of this spell.

    > While you may use this spell freely in your maps, please don't state in another websites
      that this was made by you. It's called stealing, and usually it is not moral to do so.

================================================================================================

>> Description:

    > Once the spell have been casted it will last for 5 / 10 / 15 seconds. Druing that time
      The hero's speed will increase by 20% / 30% / 35%, also after the hero there will be a
      trail of flames left, each flame created will cost 0.5 / 1 / 1.5 mana for the caster.
      When an enemy unit will step into the flames, it will be dealt damage of 15 / 20 / 30 per
      second. Once created flames will be removed only after 4 / 5 / 6 seconds.

================================================================================================

>> The Trigger:

    > The trigger is made of many functions. There will be 7 functions that are used for 
      editing values of the spell (flame's life time, spell Id and so on), 5 of them are
      constant. Those 7 functions will be used by the last 4 which will use them in order 
      to define actions, conditions and events.

    > If you are having a hard time reading the trigger for any reason, read the detailed
      comments around it which say what each line does. Comments are written after "//".

    > Note: I'm using KaTTaNa's handle system, but only part of the functions, not all. The
      vesion I'm using of the Handle System is located in the header of the map.

================================================================================================

>>> The map:

    >> In the map there will be certain helpful features which will aid you in testing the
       spell and having fun with it. The features will be triggered by typing in a certain
       command, here is the least of all features that they can be found in the map and how 
       they will be triggered:

           > "level": Will increase your hero's level by one.
           > "creeps": This will create few creeps that will serve as training puppets.
           > "revive: If your hero died, typing revive will revive him.
           > "heal": Will get you mana and health values to the maximum.

    >> There is no need to copy those triggers, they are there just to help you while testing
       the spell in this template. The map triggers differently from the spell are made in GUI
       and they leak as well.

================================================================================================

>>> The spells, buffes and units.

    >> Spells

        > Burning Steps is based on berserk. Burning Steps can be found in the object editor 
          under Spells > Custom Abilities > Human > Hero.

        > Immolation (Burning Steps) is based on Permanent Immolation and can be found in the
          the object editor under Spells > Custom Abilities > Human > Units.

    >> Buffes

        > Burning steps can be found in the object editor > Buffs > Custom buffs > Human
          > Units.

        > Burning steps (immolation) can be found in the object editor > Buffs > Custom buffs
          > Special > Units

    >> Units

        > The demon (the tester) can be found under units > Custom units > Humans > Melee 
          >Heros.

        > The dummy can be found under units > Custom units > Humans > Melee > Units.

================================================================================================

>> Importing Instructions

    > Firstly, go on and import both buffs, their location can be found above. You can copy
      buffs my clicking ctrl + c on them and then going into your buffs manager in your map and 
      pressing ctrl + v.

    > After you have done that, copy both spells, their location can be found above. You can 
      copy spells my clicking ctrl + c on them and then going into your spellss manager in your 
      map and pressing ctrl + v.

    > Now you need to copy the dummy unit, you may also copy the demon if you want, but you don't
      have to, their location can be found above. You can copy units by clicking ctrl + c on 
      them and then going into your units manager in your map and pressing ctrl + v.

    > After you copied everything from the object editor into your map go to the map header
     (where it says Burning Steps.w3x) and copy everything in there into your map header. Make
     sure you copy everything there.

    > After all those steps have been done of create new trigger named "BurningSteps" (case 
      sensitive) and copy every bit of the tirgger to it.

    > Lastly go to the object editor and click on ctrl + d, you could see the raw data of 
      everything. Using this information edit the dummy's, spell's and immolation's Ids in the
      trigger so it won't refer to other handles by mistake. 

================================================================================================

>> Last words

    > If you have any suggestion, questions or bugs found you can contact me via private 
      massage in thehelper.net webiste, nickname IKilledKEnny. If you wish you can also send
      E-mail to [email protected].

    > Enjoy!
      Your favoriate murderer,
      IKilledKenny

Enjoy, and please comment.
 

Attachments

  • Burning Steps.w3x
    23.1 KB · Views: 562

Sooda

Diversity enchants
Reaction score
318
Just move some essential things to constant functions like ability raw id and unit id. Then store at start them to locals and use these instead.
Code:
  set d=null
  set p=null
  set t=null
  set c=null
Isn' t really good variable names (Variable ames should give info about stored thing.
Otherwise nothing bad to say. You used handle vars (Or what ever) I haven' t bade it so far. Trying to learn CS Cache myself.

EDIT: Screenshot looks nice.
 
I

IKilledKEnny

Guest
> Just move some essential things to constant functions

I don't like functions if you can avoid it, I find they make the reading process longer.

> Isn' t really good variable names

Yeah, I guess I could use more informative ones but if you think about it:

t=timer
c=caster
d=dummy
p=player
w=wait
l=level
y=y
x=x
m=mana
nm= new mana
r=real.

And anyway I got comments all around the trigger so it should be clear.

> Screenshot looks nice

Thanks. I espcially like to make loops when I got this ability, real eye-candy. :)
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
Nice spell (+Rep :p)
one question:
did u make the fire dummies with immolation or something like that? (im too lazy to check alone :p)
 
I

IKilledKEnny

Guest
> call UnitAddAbility(d,'A001') // We add to d (last created unit) Immolation

So, yes I did. :) At the start I thought I would also need to pick all units around the flames every second and damage them, but immolation, is simpler I believe. :p
 
L

Lors

Guest
Awesome spell! Good job! It's so fun to make shapes with it and own creeps. :p
 

Tom Jones

N/A
Reaction score
437
>I don't like functions if you can avoid it, I find they make the reading process longer.

You might not like functions, but think of the poor gui guy who imported your spell and wants to modify it. Would you have been able to modify this just two months ago?
 

Duwenbasden

Ver 6 CREATE energy AS SELECT * FROM u.energy
Reaction score
165
If I am a prof marking this I give you 2/15 for documentation:

Examples:
Code:
set w=10 // w=10
Code:
call TriggerSleepAction(w) // wait w seconds
These are useless -- I can see that from the code. Good comments tells the reader what the segment of code is used for or to clarify the line, not repeating what the code already told me.

Code:
 local real w // real
What the hell does "w" mean? watershed? waldo?

Code:
  local unit d // Nulled unit
I shouldn't be tracing your code to find out what this means. A better way:
Code:
 local unit dummyflame // dummy unit for the footprint

Anyway, good spell, though the model could be better (looks like someone's leaking stuff rather than footprints)
 

Sim

Forum Administrator
Staff member
Reaction score
534
You have an odd way of doing things... :p

You need more constant functions in the trigger. At the moment it isn't levelable, or barely.

> call UnitApplyTimedLifeBJ(2.00,'BTLF',d)

2 seconds isn't enough. If units stepped on the fire after 2 seconds it had been created, they didn't take damage. Set the time to 10, or 15, or ( 5 + l * 5) or a constant function :p

Also, UnitApplyTimedLifeBJ simply calls UnitApplyTimedLife with inverted parameters, so use the native instead.

The AoE is too small, raise it to 50 or even 75.

Other than that... Nice.
 

substance

New Member
Reaction score
34
Sweet, I was going to do something like this. This is a good start.

*edit: k, I looked around a bit and there were a few things:

-The timed life on the footsteps is way too short, and you could also up the radius of immolation
-A nice effect would be a combination of illidan's footsteps and the fire effect you used (maybe with a level of transparency)
-Checking to see if the area where the caster is standing is already on fire would optimise this effect, so you dont create a bunch of units in one spot (and im not sure, but this might cause the immolation damage to stack?)

As far as the code, it works, but it's not ideal for a spell to be released on forums. There's not much documentation and your variable names are not helpfull. Also you should pause timers before you destroy them. Oh and I THINK you're supposed to flush the handles within the timer?
 

Sim

Forum Administrator
Staff member
Reaction score
534
I think he didn't mean it to be footprints, just fire behind (as in Diablo 2, the spell Blaze, Sorceress)
 

elmstfreddie

The Finglonger
Reaction score
203
Uhmm... What's this thread called?
[Spell] Burning Steps
Lol
I don't play diablo II (well I used to, I had a necromancer... Then I died in this really difficult place I wasn't supposed to be, and I died on the way getting my gear, pretty much I lost everything so it was pointless. I started a pally and got stuck in a place that I didn't get stuck on with my necro lol)
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Since you have a repeating timer and you can calculate the amount of time it runs, wouldn't it be smarter to attach an integer counter variable to the timer and decrease it each time the timer runs?

This would eliminate the need for the PolledWait(w), and would be much more reliable.
 

Arkan

Nobody rides for free
Reaction score
92
Why is everyone so fixed on constant functions? I thought less function calls = better code. And if it's all about readability when importing the spell, the comments really explain what to do, so what's up with that?

Nice spell btw.
 

Tinki3

Special Member
Reaction score
418
>Why is everyone so fixed on constant functions?
Because they make general editing much easier.

For example, would you want to go through an entire trigger, just to find one little line which contains the amount of damage that is dealt? Or would you rather just change the figure inside some easily noticeable constant function?

>I thought less function calls = better code.
Not better, shorter :p.

Anyway, nice accomplishment KEnny :)

Note: You don't have to add an expiration timer to the dummy unit->just set its HP to 2 in the Object Editor, then give it -1 regeneration.
 
I

IKilledKEnny

Guest
> Tom Jones.

You are right. I will work on functions, but it might take time until I could update the spell.

> Duwenbasden

I will change variables' names and comments.

> Daxtreme

Thanks I forgot to remove this BJ. I like the fact that the flame's life time is short, but you can modify it easily. As for AoE, you should be damaged only when stepping into the flames. So 20 AoE should be ok. Also if I make it AoE of 75, the distance between the flames will be big and it won't look nice.

> elmstfreddie

It simply leaves a trail of fire behind you.

> Pyrogasm

The wait is fine, the way you are suggesting would make the trigger longer and require another function or global, no need for that.

> Arkan

Yes I agree with you, but it seems like people prefer functions.

> Tinki3 & Waaaks!

Thanks. :)

Edit:

Trigger clearer now.
 

substance

New Member
Reaction score
34
> Pyrogasm

The wait is fine, the way you are suggesting would make the trigger longer and require another function or global, no need for that.

eh?

PHP:
function BurningStepsAct takes nothing returns nothing
YOURCODEHERE
  call SetHandleInt(t,"i",0)
endfunction

PHP:
function BurningStepsDo takes nothing returns nothing
  local integer i = GetHandleInt(t,"i")
    call SetHandleInt(t, "i", i + 1)

    if i >= YOURMAXHERE then
       (PAUSE TIMER, DESTROY TIMER)
    endif
endfunction
 
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