• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

OxygenD KnockJump 1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
===========================================================
Every second, you will appear remarks near the mine that will live approximately 8 seconds, and then blow up and throw away the enemy.
(this spell not deal damage.Only stun and knockJump)
Last: 8 sec
Coldawn: 12 sec.

===========================================================
IF YOU USE MY SYSTEM IN YOU MAP, WRITE ME IN CREDIT!!!
===========================================================



JASS:
function Trig_Init_Actions takes nothing returns nothing
    call DisplayTextToForce( GetPlayersAll(), "|cFF00C000OxygenD KnockJump 1.0" )
     set udg_Hashtable = InitHashtable()
endfunction

//===========================================================================
function InitTrig_Init takes nothing returns nothing
    set gg_trg_Init = CreateTrigger()
    call TriggerRegisterTimerEvent(gg_trg_Init,0.00,false)
    call TriggerAddAction(gg_trg_Init,function Trig_Init_Actions)
endfunction

  • Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Knock Jump
    • Actions
      • Set MIndex = (MIndex + 1)
      • Set MMax = (MMax + 1)
      • Set MCaster[MIndex] = (Triggering unit)
      • Set MMineOn[MIndex] = True


  • CreateMine
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • MMineOn[MIndex] Equal to True
    • Actions
      • For each (Integer A) from 1 to MMax, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Mine for (Owner of MCaster[MIndex]) at (Position of MCaster[MIndex]) facing Default camera angle of attack degrees
          • Set MlastCreatedMine[MIndex] = (Last created unit)
          • Unit - Add a 8.00 second Generic expiration timer to MlastCreatedMine[MIndex]
          • Set MMineCreated[MIndex] = (MMineCreated[MIndex] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MMineCreated[MIndex] Greater than 8
            • Then - Actions
              • Set MMineOn[MIndex] = False
              • Set MMineCreated[MIndex] = 0
              • Set MIndex = (MIndex - 1)
              • Set MMax = (MMax - 1)
            • Else - Actions
              • Do nothing

  • MineDie
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Mine
    • Actions
      • Trigger - Run KnockBack <gen> (ignoring conditions)

JASS:
function Trig_Mass_Flying_Knockback_Group takes nothing returns nothing
    local timer t = CreateTimer()
    local unit e = GetEnumUnit()
    call KnockBackUnit(e,600.,1.3,57.295827 * Atan2(GetUnitY(e) - GetUnitY(GetTriggerUnit()),GetUnitX(e) - GetUnitX(GetTriggerUnit())),0.04)
    call UnitAddAbility(e,'Amrf')
    call UnitRemoveAbility(e,'Amrf')
    call SetUnitFlyHeight(e,350.,400.)
    call SaveUnitHandle(udg_Hashtable,GetHandleId(t),0,e)
    call TimerStart(t,1.3 / 2,false,function Trig_Mass_Flying_Knockback_Timer)
    set t = null
endfunction

function Trig_Mass_Flying_Knockback_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local group g = CreateGroup()
    call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl",caster,"origin"))
    call GroupEnumUnitsInRange(g,GetUnitX(caster),GetUnitY(caster),300.,Filter(function Trig_Mass_Flying_Knockback_Filter))
    call ForGroup(g,function Trig_Mass_Flying_Knockback_Group)
    call DestroyGroup(g)
    set caster = null
    set g = null
endfunction

//===========================================================================
function InitTrig_KnockBack takes nothing returns nothing
    set gg_trg_KnockBack = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_KnockBack,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_KnockBack,Condition(function Trig_Mass_Flying_Knockback_Conditions))
    call TriggerAddAction(gg_trg_KnockBack,function Trig_Mass_Flying_Knockback_Actions)
endfunction

Keywords:
Jass, GUI, MUI, Mine, KnockBack, KnockJump, Jump, Boom, OxygenD.
Contents

OxygenD Mine KnockJump 1.0 (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 15:09, 28th Jun 2011 Maker: CreateMine shouldn't be on all the time. CreateMine has location leak and remove the Do nothing. MineDie could be turned off when there are no mines...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For long time as NeedsFix. Rejected.

15:09, 28th Jun 2011
Maker:
CreateMine shouldn't be on all the time.
CreateMine has location leak and remove the Do nothing.
MineDie could be turned off when there are no mines around.
You're not nulling units in KnockBack.
Why are KnockBackUnit_Timer and KnockBackUnit in the map header?
 
Level 12
Joined
Apr 16, 2010
Messages
584
This PHP code hurts my eyes... Please use JASS tags. List of [self="http://www.hiveworkshop.com/forums/misc.php?do=bbcode"]List of BB codes[/self]. Also it would be nice if i could understand in what language is that... Also i can see that you leak locations and use Do Nothing maybe something more but can't understand anything else.
 
Level 12
Joined
Apr 16, 2010
Messages
584
Okay so you wanna review? Here it is :p
Review

-why Init trigger is in JASS? no need, and if you made it in JASS then make all in JASS,then merge them and use locals instead of variables;
-in second trigger you leak location here> Unit - Create 1 Mine for (Owner of MCaster[MIndex]) at (Position of MCaster[MIndex]) facing Default camera angle of attack degrees, (Position of MCaster[MIndex]) should be stored into variable and then destroyed;
-in same trigger you use Do Nothing action; get rid of it;
-in trigger KnockJump cannot tell much sine i just learn vJASS, expect someone else to review last trigger
And design is important since a lot of us don't even use WE to test spells! All comes from the code in description... Also i can hardly understand the system description...
Don't know what to give it since i don't find this useful...
 
Remove that "Do Nothing" ... Isn't obvious that a Do Nothing action literally does nothing but kill your performance?? :p

Also, don't use integer A.
Use integer Variable (Integer A can cause bugs :))

One other thing... you're missing a function:
function Trig_Mass_Flying_Knockback_Filter

And also, you don't HAVE to use 57.295827.
You can simply use bj_RADTODEG :)
It's fine this way though :p

I found 2 other missing functions :p

function Trig_Mass_Flying_Knockback_Timer

and

call KnockBackUnit(..)

Post triggers correctly >.>
 
Top