• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Zephyr Contest #9 - Assassination

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Wait, all freeze !

Why Radamantus got banned ?

Is it because his spell is uploaded to the Spells Section and the same spell gonna be used in this Contest (avoid getting early judgement and he will have a higher score by the time his spell has been fixed for several times) ?

I wanna clear my confusion.
 
Level 5
Joined
Aug 16, 2010
Messages
97
First WiP

First WiP incoming... (Nothing big just the basic trigger)

Spell Code:
JASS:
library MySpell requires AutoIndex, TimerUtils

//-------------------------------------------------------------------------------------------
//      Hunter's Instinct
//
//        by Dr.Killer
//
// The Warden uses her unatural instincts to locate wounded enemies.
// Then she chooses one target and gains the ability to become invisible
// when near her target. She can backstab her victim 3 times before revealing
// herself, the last of which deals bonus pure damage based on Warden's distance
// from her target at the time of casting.
//-------------------------------------------------------------------------------------------


//-------------------------------------------------------------------------------------------
//      Configuration
//-------------------------------------------------------------------------------------------
globals
    private constant integer MAIN_SPELL_ID              =   'A001'
    private constant integer VISION_SPELL_ID            =   'A002'
    private constant integer DUMMY_ID                   =   'e000'
    
    private constant boolean CONFIG_RANGE               =   false           //Determines whether or not to use a constant value for range
    private constant real    RANGE                      =   99999.
    private constant real    DURATION                   =   8.
    
    private constant integer ARRAY_SIZE                 =   100             //Determines the number of spells which can be run simultaneously (MUI threshold)  
endglobals

private function Range takes integer lvl returns real
    return 1000.+I2R(lvl)*200.
endfunction

private function HpThreshold takes integer lvl returns real
    return (10.+10.*I2R(lvl))/100.
endfunction
//-------------------------------------------------------------------------------------------
//      End of Configuration
//-------------------------------------------------------------------------------------------

globals
    private boolean array flag [ARRAY_SIZE][ARRAY_SIZE]
endglobals


//-------------------------------------------------------------------------------------------
//      Spell's main struct, holds all of spell's properties for later use
//-------------------------------------------------------------------------------------------
private struct SpellData
    private unit        caster
    private unit        dummy
    private integer     lvl
    private group       targets
    private timer       main_timer
    private real        casterX
    private real        casterY
    private real array  dist[ARRAY_SIZE]
    private boolean     success

//-------------------------------------------------------------------------------------------
//      This method runs when spell duration ends; does cleanups, effect removal, etc.
//-------------------------------------------------------------------------------------------
    private static method onFinish takes nothing returns nothing
        local unit      u            = null
        local SpellData object       = GetTimerData(GetExpiredTimer())
        local integer   i            = 0
        local integer   id           = 0
        local boolean   grant_vision = false
        
        loop
            set i=i+1
            exitwhen i>100
            set flag[object][i] = false
        endloop
        set i=0
        
        loop
            set u = FirstOfGroup(object.targets)
            exitwhen u == null
            set id = GetUnitId(u)
            
            loop
                set i=i+1
                exitwhen (i>100 or grant_vision == true)
                if (flag[i][id] == true) then
                    set grant_vision = true
                else
                    set grant_vision = false
                endif
            endloop
            
            if (grant_vision == false) then
                call UnitShareVision(u, GetOwningPlayer(object.caster), false)
            else
                call UnitShareVision(u, GetOwningPlayer(object.caster), true)
            endif
            call GroupRemoveUnit(object.targets, u)
        endloop
        
        call DestroyGroup(object.targets)
        set object.caster = null
        call RemoveUnit(object.dummy)
        set object.dummy = null
        call object.destroy()
    endmethod
    
//-------------------------------------------------------------------------------------------
//      This method sets the needed variables for struct's instance
//-------------------------------------------------------------------------------------------
    private static method onCast takes nothing returns nothing
        local SpellData object          = SpellData.create()
        local group     tempGroup       = CreateGroup()
        local unit      u               = null
        
        set object.targets = CreateGroup()
        set object.caster  = GetTriggerUnit()
        set object.casterX = GetUnitX(object.caster)
        set object.casterY = GetUnitY(object.caster)
        set object.lvl     = GetUnitAbilityLevel(object.caster, MAIN_SPELL_ID)
        call GroupEnumUnitsInRange(tempGroup, object.casterX, object.casterY, RANGE, null)
        loop
            set u = FirstOfGroup(tempGroup)
            exitwhen u == null
            if (IsUnitType(u, UNIT_TYPE_HERO) and (GetUnitState(u, UNIT_STATE_LIFE) <= (GetUnitState(u, UNIT_STATE_MAX_LIFE)*HpThreshold(object.lvl))) and IsUnitEnemy(u, GetOwningPlayer(object.caster))) then
                call GroupRemoveUnit(tempGroup, u)
                call GroupAddUnit(object.targets, u)
                set object.dist[GetUnitId(u)] = GetDistUnits(object.caster, u)
                set flag[object][GetUnitId(u)] = true
            else
                call GroupRemoveUnit(tempGroup, u)
            endif
        endloop
        call DestroyGroup(tempGroup)
        call object.runSpell()
    endmethod

//-------------------------------------------------------------------------------------------
//      Core method; which actually does the job
//-------------------------------------------------------------------------------------------
    private method runSpell takes nothing returns nothing
        local group tempGroup = CreateGroup()           
        local unit  u         = null
        
        call GroupAddGroup(.targets, tempGroup)
        
        loop
            set u = FirstOfGroup(tempGroup)
            exitwhen u == null
            call UnitShareVision(u, GetOwningPlayer(.caster), true)
            call GroupRemoveUnit(tempGroup, u)
        endloop
        
        set .main_timer = NewTimer()
        call SetTimerData(.main_timer, this)
        call TimerStart(.main_timer, DURATION, false, function thistype.onFinish)
        call DestroyGroup(tempGroup)
    endmethod

//-------------------------------------------------------------------------------------------
//      Self-explanatory
//-------------------------------------------------------------------------------------------
    private static method castCondition takes nothing returns boolean
        return GetSpellAbilityId() == MAIN_SPELL_ID
    endmethod
    
    private static method onInit takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        local integer j = 0
        
        loop
            set i=i+1
            exitwhen i>100
            loop
                set j=j+1
                exitwhen j>100
                set flag[i][j] = false
            endloop
        endloop
         
        call BJDebugMsg("out of loop")
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(t, Condition(function thistype.castCondition))
        call TriggerAddAction(t, function thistype.onCast)
    endmethod
endstruct

endlibrary
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
By the way, I got a problem with UnitShareVision function. Can I ask it here or I should post the trigger elsewhere?
I believe it belongs to Triggers & Scripts Section.

EDIT:
Well I decided to scrap my old idea and created a new one, it's called Stringed Shuriken.

Spell Description
I haven't got an idea how to describe it yet (I even left it blank on Object Editor).

Triggers
  • SD Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to StringedDagger
    • Actions
      • Custom script: local real x1
      • Custom script: local real x2
      • Custom script: local real y1
      • Custom script: local real y2
      • Custom script: local real z1
      • Custom script: local real z2
      • Set SD_Caster = (Triggering unit)
      • Set TempLoc = (Position of SD_Caster)
      • Set TempUnit = (Target unit of ability being cast)
      • Set TempLoc2 = (Position of TempUnit)
      • Set TempReal = (Angle from TempLoc to TempLoc2)
      • Set TempInteger = (Level of StringedDagger for SD_Caster)
      • Set SD_Duration = (SD_BaseDuration + (SD_DurationPerLevel x (Real(TempInteger))))
      • Custom script: set udg_SD_Key = GetHandleId(udg_TempUnit)
      • Unit - Create 1 SD_DaggerDummy for (Triggering player) at TempLoc facing TempReal degrees
      • Set TempUnit = (Last created unit)
      • Unit Group - Add TempUnit to SD_Group
      • Custom script: set x1 = GetUnitX(udg_SD_Caster)
      • Custom script: set y1 = GetUnitY(udg_SD_Caster)
      • Custom script: set x2 = GetUnitX(udg_TempUnit)
      • Custom script: set y2 = GetUnitY(udg_TempUnit)
      • Custom script: set z2 = GetLocationZ(udg_TempLoc) + GetUnitFlyHeight(udg_TempUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SD_Caster is A ground unit) Equal to True
        • Then - Actions
          • Custom script: set z1 = GetLocationZ(udg_TempLoc) + GetUnitFlyHeight(udg_TempUnit)
        • Else - Actions
          • Custom script: set z1 = GetLocationZ(udg_TempLoc) + GetUnitFlyHeight(udg_SD_Caster)
      • Custom script: set udg_SD_Lightning = AddLightningEx(udg_SD_LightningName, true, x1, y1, z1, x2, y2, z2)
      • Custom script: set udg_SD_Key = GetHandleId(udg_TempUnit)
      • Hashtable - Save Handle OfSD_Lightning as 0 of SD_Key in SD_Hashtable
      • Hashtable - Save Handle OfSD_Caster as 1 of SD_Key in SD_Hashtable
      • Hashtable - Save SD_Duration as 3 of SD_Key in SD_Hashtable
      • Trigger - Turn on SD Loop <gen>
  • SD Loop
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SD_Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in SD_Group and do (Actions)
            • Loop - Actions
              • Custom script: local real x1
              • Custom script: local real x2
              • Custom script: local real y1
              • Custom script: local real y2
              • Custom script: local real z1
              • Custom script: local real z2
              • Set TempUnit = (Picked unit)
              • Custom script: set udg_SD_Key = GetHandleId(udg_TempUnit)
              • Set SD_Duration = (Load 3 of SD_Key from SD_Hashtable)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SD_Duration Greater than 0.00
                • Then - Actions
                  • Set SD_Caster = (Load 1 of SD_Key in SD_Hashtable)
                  • Set SD_Lightning = (Load 0 of SD_Key in SD_Hashtable)
                  • Set TempLoc = (Position of TempUnit)
                  • Set TempLoc2 = (Position of SD_Caster)
                  • Set TempReal = (Facing of TempUnit)
                  • Custom script: set x1 = GetUnitX(udg_SD_Caster)
                  • Custom script: set y1 = GetUnitY(udg_SD_Caster)
                  • Custom script: set x2 = GetUnitX(udg_TempUnit)
                  • Custom script: set y2 = GetUnitY(udg_TempUnit)
                  • Custom script: set z2 = GetLocationZ(udg_TempLoc) + GetUnitFlyHeight(udg_TempUnit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (SD_Caster is A ground unit) Equal to True
                    • Then - Actions
                      • Custom script: set z1 = GetLocationZ(udg_TempLoc) + GetUnitFlyHeight(udg_TempUnit)
                    • Else - Actions
                      • Custom script: set z1 = GetLocationZ(udg_TempLoc) + GetUnitFlyHeight(udg_SD_Caster)
                  • Custom script: call SetUnitX(udg_TempUnit, x2 + udg_SD_DaggerSpeedPerInterval * Cos(udg_TempReal * bj_DEGTORAD))
                  • Custom script: call SetUnitY(udg_TempUnit, y2 + udg_SD_DaggerSpeedPerInterval * Sin(udg_TempReal * bj_DEGTORAD))
                  • Custom script: call MoveLightningEx(udg_SD_Lightning, true, x1, y1, z1, x2, y2, z2)
                  • Hashtable - Save (SD_Duration - SD_Interval) as 3 of SD_Key in SD_Hashtable
                • Else - Actions
                  • Unit - Kill TempUnit
The trigger is not optimized yet, as you can see many leaks here and there.
Consider that as a WiP from me, defskull :)

EDIT 2:
Okay, here's a test map for my WiP :)
Still, no description for the spell yet, haha too lazy to write it down.

There are few things to do before the spell is complete, it's like 30% left from completion :)

Oh and I almost forgot, if you want to allow that Warden enemy Hero to use the spell on you, press ESC key, but first, you must have the Warden to acquire target onto you first before order it to cast the spell.

Enjoy.
 

Attachments

  • Zephyr Contest #9 Assassination - Stringed Shuriken by defskull.w3x
    36 KB · Views: 80
Last edited:
Im Back !!

Also Updated Shadow Shroud v3 to v4

I was able to cast ability even with no charges and deal bonus damage, gain massive bonuses, invulnerably (or whatever)...

Maybe increase charges after kills.

Also care not to overpower ability, right now it's like 5 times stronger than regular evasion ability.
 
-Kobas- said:
I was able to cast ability even with no charges and deal bonus damage
i did it on that way,even in version 1 because windwalk doesnt have any casting time.
-Kobas- said:
gain massive bonuses
What Massive Bonuses?
-Kobas- said:
invulnerably (or whatever)..
You mean the Invisibility right??i originally made it without fading.
-Kobas- said:
Also care not to overpower ability, right now it's like 5 times stronger than regular evasion ability.
Okay ill reduce it
-Kobas- said:
Maybe increase charges after kills.
Thats a good idea Thank you!
 
Consider this my WiP for my new idea.

  • Fan of Knives
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fan of Knives
    • Actions
      • Set caster = (Triggering unit)
      • Set level = (Level of Fan of Knives for caster)
      • Set point1 = (Target point of ability being cast)
      • Set point2 = (Position of caster)
      • For each (Integer i) from 1 to (8 x (Level of Fan of Knives for caster)), do (Actions)
        • Loop - Actions
          • Unit - Create 1 Fan of Knives for (Owner of caster) at point2 facing Default building facing degrees
          • Set target = (Last created unit)
          • Animation - Change target flying height to (Random real number between 20.00 and 200.00) at 0.00
          • Unit Group - Add target to FanofKnivesGroup
          • Custom script: set udg_handle = GetHandleId(udg_target)
          • Set point3 = (point1 offset by (Random real number between 0.00 and 160.00) towards (Random angle) degrees)
          • Set angle = (Angle from point2 to point3)
          • Set timer = 0.90
          • Hashtable - Save angle as 1 of handle in FoK_hashtable
          • Hashtable - Save timer as 2 of handle in FoK_hashtable
          • Hashtable - Save Handle Ofcaster as 3 of handle in FoK_hashtable
          • Custom script: call RemoveLocation(udg_point3)
      • Custom script: call RemoveLocation(udg_point1)
      • Custom script: call RemoveLocation(udg_point2)
Once I finish my movement trigger I'll go back through and make the whole thing more customizable and easy for the user. This feels like a lot more serious idea than my john wilkes booth one so yeah.
 
Jazztastic Presents
Fan of Knives
Spell Specs
-MUI
-2 Main triggers + 1 Variable trigger
-1200 range
-The user can easily edit the duration,
# of daggers, damage, area of effect, and speed.
204466-albums4802-picture59627.jpg
Uses and Theme
This spell fits the theme because it involves
the throwing of daggers at enemies, a skill
any assassin worth his salt could do. Instead
of throwing one tiny dagger that somehow
deals tons of damage, I decided my assassin
would spam a ton of knives at low damage
each. Just click on a unit or point and the
assassin will throw the knives. You can also
click on yourself and it will go in a circle.
204466-albums4802-picture59626.jpg

204466-albums4802-picture59625.jpg

204466-albums4802-picture59624.jpg

  • Hashtable Variables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set FoK_hashtable = (Last created hashtable)
      • -------- ------------- --------
      • -------- ------------- --------
      • -------- To use this ability past level 4 you must extend these arrays so they have values --------
      • -------- If you change the aoe here you should probably also change it on the OE skill, so they match --------
      • -------- ------------- --------
      • -------- ------------- --------
      • -------- Edit the number of knives spawned --------
      • Set knivecount[1] = 6
      • Set knivecount[2] = 12
      • Set knivecount[3] = 18
      • Set knivecount[4] = 24
      • -------- Edit the area of effect --------
      • Set knivesaoe[1] = 160.00
      • Set knivesaoe[2] = 160.00
      • Set knivesaoe[3] = 160.00
      • Set knivesaoe[4] = 160.00
      • -------- Edit the area of effect of the damage --------
      • -------- This value is used to pick a random unit within its range. --------
      • -------- If it's too large the knives will do their damage and be destroyed before they "reach" their target --------
      • Set knivesdamageaoe[1] = 80.00
      • Set knivesdamageaoe[2] = 80.00
      • Set knivesdamageaoe[3] = 80.00
      • Set knivesdamageaoe[4] = 80.00
      • -------- Edit the damage per knife --------
      • Set knivesdamage[1] = 10.00
      • Set knivesdamage[2] = 10.00
      • Set knivesdamage[3] = 10.00
      • Set knivesdamage[4] = 10.00
      • -------- Edit the duration of the knives --------
      • Set knivesduration[1] = 1.20
      • Set knivesduration[2] = 1.20
      • Set knivesduration[3] = 1.20
      • Set knivesduration[4] = 1.20
      • -------- Edit the projectile speed of the knives --------
      • Set knivesspeed[1] = 30.00
      • Set knivesspeed[2] = 30.00
      • Set knivesspeed[3] = 30.00
      • Set knivesspeed[4] = 30.00
      • -------- Edit the random height of the projectiles. The first value is the minimum, the second is the maximum. --------
      • Set flyingheight[1] = 20.00
      • Set flyingheight[2] = 200.00
  • Fan of Knives
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fan of Knives
    • Actions
      • -------- Setting variables --------
      • Set caster = (Triggering unit)
      • Set level = (Level of Fan of Knives for caster)
      • Set point1 = (Target point of ability being cast)
      • Set point2 = (Position of caster)
      • -------- Creates the knives --------
      • For each (Integer i) from 1 to knivecount[level], do (Actions)
        • Loop - Actions
          • Unit - Create 1 Fan of Knives for (Owner of caster) at point2 facing Default building facing degrees
          • Set target = (Last created unit)
          • Animation - Change target flying height to (Random real number between flyingheight[1] and flyingheight[2]) at 0.00
          • Unit Group - Add target to FanofKnivesGroup
          • Custom script: set udg_handle = GetHandleId(udg_target)
          • Set point3 = (point1 offset by (Random real number between 0.00 and knivesaoe[level]) towards (Random angle) degrees)
          • Set angle = (Angle from point2 to point3)
          • Set timer = knivesduration[level]
          • Hashtable - Save angle as 1 of handle in FoK_hashtable
          • Hashtable - Save timer as 2 of handle in FoK_hashtable
          • Hashtable - Save Handle Ofcaster as 3 of handle in FoK_hashtable
          • Custom script: call RemoveLocation(udg_point3)
      • -------- Clearing point leaks --------
      • Custom script: call RemoveLocation(udg_point1)
      • Custom script: call RemoveLocation(udg_point2)
      • Trigger - Turn on Fan of Knives Loop <gen>
  • Fan of Knives Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FanofKnivesGroup and do (Actions)
        • Loop - Actions
          • -------- Setting variables --------
          • Set target = (Picked unit)
          • Custom script: set udg_handle = GetHandleId(udg_target)
          • Set timer = (Load 2 of handle from FoK_hashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • timer Greater than 0.00
            • Then - Actions
              • Set caster = (Load 3 of handle in FoK_hashtable)
              • Set ownerplayer = (Owner of caster)
              • Set level = (Level of Fan of Knives for caster)
              • Set point1 = (Position of target)
              • Set angle = (Load 1 of handle from FoK_hashtable)
              • Set point2 = (point1 offset by knivesspeed[level] towards angle degrees)
              • Unit - Move target instantly to point2, facing angle degrees
              • -------- Checking to see if the knife should deal its damage --------
              • Custom script: set bj_wantDestroyGroup = true
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units within knivesdamageaoe[level] of point2 matching ((((Matching unit) belongs to an enemy of ownerplayer) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))) Greater than 0
                • Then - Actions
                  • -------- Deal the damage --------
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit - Cause caster to damage (Random unit from (Units within knivesdamageaoe[level] of point2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of ownerplayer) Equal to True))))), dealing knivesdamage[level] damage of attack type Pierce and damage type Normal
                  • -------- Clear leaks --------
                  • Unit - Kill target
                  • Hashtable - Clear all child hashtables of child handle in FoK_hashtable
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in FanofKnivesGroup) Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • Hashtable - Save (timer - 0.03) as 2 of handle in FoK_hashtable
            • Else - Actions
              • -------- Clear leaks --------
              • Unit - Kill target
              • Hashtable - Clear all child hashtables of child handle in FoK_hashtable
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in FanofKnivesGroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions

[self=http://www.hiveworkshop.com/forums/2187444-post161.html]This is my Work in Progress.[/self]
 

Attachments

  • Fan of Knives THW Zephyr Contest #9.w3x
    20.5 KB · Views: 122
Last edited:
Level 29
Joined
Mar 10, 2009
Messages
5,016
WIP = 60%

Spell Name: Obscuration
Description: ?????


  • Obscuration
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to OB_CastInvisibility
          • (Ability being cast) Equal to OB_CastMine
    • Actions
      • Set OB_Caster = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to OB_CastInvisibility
        • Then - Actions
          • Set OB_Level = (Level of OB_CastInvisibility for OB_Caster)
          • Custom script: call ExecuteFunc("OB_CastInvisibility")
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to OB_CastMine
            • Then - Actions
              • Custom script: call ExecuteFunc("OB_Teleporting")
            • Else - Actions
      • Custom script: endfunction
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • Custom script: function OB_TeleportingLoop takes nothing returns nothing
      • For each (Integer OBT_IndexLOOP) from 1 to OBT_Index1, do (Actions)
        • Loop - Actions
          • Set OBT_Index2 = OBT_IndexARRAY[OBT_IndexLOOP]
          • Set OBT_Waiting[OBT_Index2] = (OBT_Waiting[OBT_Index2] + 0.20)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (OBT_Caster[OBT_Index2] is alive) Equal to True
              • (OBT_Target[OBT_Index2] is alive) Equal to True
              • OBT_Waiting[OBT_Index2] Less than or equal to 7.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • OBT_Waiting[OBT_Index2] Equal to 1.00
                • Then - Actions
                  • Game - Display to (All players) the text: ANIMATION
                  • Animation - Play OBT_Portal[OBT_Index2]'s stand animation
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • OBT_Waiting[OBT_Index2] Equal to 2.00
                    • Then - Actions
                      • Game - Display to (All players) the text: CAST NET
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • OBT_Waiting[OBT_Index2] Equal to 6.00
                        • Then - Actions
                          • Game - Display to (All players) the text: START TELEPORT
                          • Set OB_Loc1 = (Position of OBT_Portal[OBT_Index2])
                          • Special Effect - Create a special effect at OB_Loc1 using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation(udg_OB_Loc1)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • OBT_Waiting[OBT_Index2] Equal to 6.80
                            • Then - Actions
                              • Game - Display to (All players) the text: MOVE NOW
                              • Unit - Kill OBT_Portal[OBT_Index2]
                              • Set OB_Loc1 = (Position of OBT_Caster[OBT_Index2])
                              • Special Effect - Create a special effect at OB_Loc1 using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
                              • Special Effect - Destroy (Last created special effect)
                              • Unit - Move OBT_Target[OBT_Index2] instantly to OB_Loc1, facing Default building facing degrees
                              • Custom script: call RemoveLocation(udg_OB_Loc1)
                            • Else - Actions
            • Else - Actions
              • Game - Display to (All players) the text: END
              • Unit - Unpause OBT_Target[OBT_Index2]
              • -------- Recycle --------
              • Set OBT_IndexARRAY[OBT_IndexLOOP] = OBT_IndexARRAY[OBT_Index1]
              • Set OBT_IndexARRAY[OBT_Index1] = OBT_Index2
              • Set OBT_IndexLOOP = (OBT_IndexLOOP - 1)
              • Set OBT_Index1 = (OBT_Index1 - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • OBT_Index1 Equal to 0
                • Then - Actions
                  • Game - Display to (All players) the text: TIMER PAUSED
                  • Custom script: call PauseTimer(udg_OBT_Timer)
                • Else - Actions
      • Custom script: endfunction
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • Custom script: function OB_Teleporting takes nothing returns nothing
      • Set OB_Loc1 = (Position of (Target unit of ability being cast))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • OBT_Index1 Equal to 0
        • Then - Actions
          • Custom script: call TimerStart(udg_OBT_Timer, 0.2, true, function OB_TeleportingLoop)
        • Else - Actions
      • Set OBT_Index1 = (OBT_Index1 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • OBT_Index1 Greater than OBT_IndexMAX
        • Then - Actions
          • Set OBT_IndexARRAY[OBT_Index1] = OBT_Index1
          • Set OBT_IndexMAX = OBT_Index1
        • Else - Actions
      • Set OBT_Index2 = OBT_IndexARRAY[OBT_Index1]
      • -------- setting all --------
      • Set OBT_Caster[OBT_Index2] = OB_Caster
      • Set OBT_Target[OBT_Index2] = (Target unit of ability being cast)
      • Unit - Pause OBT_Target[OBT_Index2]
      • Unit - Create 1 OB_Teleporter for (Triggering player) at OB_Loc1 facing Default building facing degrees
      • Custom script: call UnitRemoveAbility(bj_lastCreatedUnit,'Amov')
      • Animation - Play (Last created unit)'s birth animation
      • Set OBT_Portal[OBT_Index2] = (Last created unit)
      • Set OBT_Waiting[OBT_Index2] = 0.00
      • Custom script: call RemoveLocation(udg_OB_Loc1)
      • Custom script: endfunction
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • -------- BELOW THIS LINE IS OK --------
      • Custom script: function OB_Looper takes nothing returns nothing
      • For each (Integer OB_InstanceLOOP) from 1 to OB_Instance1, do (Actions)
        • Loop - Actions
          • Set OB_Instance2 = OB_InstanceARRAY[OB_InstanceLOOP]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (OB_CasterAR[OB_Instance2] is alive) Equal to True
              • OB_Dur[OB_Instance2] Greater than or equal to 0.00
              • (Level of OB_InvisibilityAbil for OB_CasterAR[OB_Instance2]) Greater than 0
            • Then - Actions
              • Set OB_Dur[OB_Instance2] = (OB_Dur[OB_Instance2] - 0.10)
            • Else - Actions
              • Unit - Remove OB_InvisibilityAbil from OB_CasterAR[OB_Instance2]
              • Unit - Remove OB_DisableAttackAbil from OB_CasterAR[OB_Instance2]
              • Unit - Remove OB_CastMine from OB_CasterAR[OB_Instance2]
              • Unit Group - Remove OB_CasterAR[OB_Instance2] from OB_Group
              • -------- Recycle --------
              • Set OB_InstanceARRAY[OB_InstanceLOOP] = OB_InstanceARRAY[OB_Instance1]
              • Set OB_InstanceARRAY[OB_Instance1] = OB_Instance2
              • Set OB_InstanceLOOP = (OB_InstanceLOOP - 1)
              • Set OB_Instance1 = (OB_Instance1 - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • OB_Instance1 Equal to 0
                • Then - Actions
                  • Custom script: call PauseTimer(udg_OB_Timer)
                • Else - Actions
      • Custom script: endfunction
      • -------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
      • Custom script: function OB_CastInvisibility takes nothing returns nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (OB_Caster is in OB_Group) Equal to False
        • Then - Actions
          • Unit - Add OB_InvisibilityAbil to OB_Caster
          • Unit - Add OB_DisableAttackAbil to OB_Caster
          • Unit - Add OB_CastMine to OB_Caster
          • Unit - Set level of OB_CastMine for OB_Caster to OB_Level
          • Unit Group - Add OB_Caster to OB_Group
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • OB_Instance1 Equal to 0
            • Then - Actions
              • Custom script: call TimerStart(udg_OB_Timer, 0.1, true, function OB_Looper)
            • Else - Actions
          • Set OB_Instance1 = (OB_Instance1 + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • OB_Instance1 Greater than OB_InstanceMAX
            • Then - Actions
              • Set OB_InstanceARRAY[OB_Instance1] = OB_Instance1
              • Set OB_InstanceMAX = OB_Instance1
            • Else - Actions
          • Set OB_Instance2 = OB_InstanceARRAY[OB_Instance1]
          • -------- setting all --------
          • Set OB_CasterAR[OB_Instance2] = OB_Caster
          • Set OB_Dur[OB_Instance2] = OB_InvisibilityDuration
          • Set OB_CheckFunc[OB_Instance2] = True
        • Else - Actions
          • Unit - Remove OB_InvisibilityAbil from OB_Caster
          • Unit - Remove OB_DisableAttackAbil from OB_Caster
          • Unit - Remove OB_CastMine from OB_Caster
          • Unit Group - Remove OB_Caster from OB_Group
 

Attachments

  • Zephyr#9_Mckill2009.w3x
    48.9 KB · Views: 57
Level 6
Joined
Jul 8, 2012
Messages
11
does the trigger must be in WiP post? i'm thinking of doing something but only came up with a name or sort, no triggering yet
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
@Chukkyjr, I don't think you would need to provide the triggers for the wip, nor a map (but of course I might be wrong).
But perhaps it should show something in progress, eg. an image of something basic that you have working.

I've been off for quite some time, only recently lurking on the site, and found that another Zephyr contest was live. That was a while ago too!
After some thinking, I've been very tempted to join, but I've stumbled upon a few issues which will unfortunately let me pass this time.
Such issues are for example: Lack of time, rusty jass/vjass skills, empty on ideas on the current theme, and to have moved on from Wc3 since a while back.

I wish the contestants the best luck though. Perhaps I will install Wc3 to watch the submissions later, if time accepts that.

OffTopic: I hate these damn cakes and muffins still plaguing the Terran site theme.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Okay, I updated my spell to v1.1 now.

attachment.php


I've got a question regarding this statement;
All spells must have documentation, regarding the use of each variable and/or actions (if needed). This will ensure readability and easier configuration for testing purposes.
Does the documentation applies only to setup trigger, or all trigger needs documentation ? Cast, Loop, etc ?
Currently I only implement documentation over at Setup Trigger.
 

Attachments

  • Stringed Shuriken v1.1.w3x
    40.9 KB · Views: 54
  • Stringed Shuriken.jpg
    Stringed Shuriken.jpg
    571.3 KB · Views: 185
Dr.Killer said:
Does this apply to variables whose function is obvious or is clearly understandable by their name?

Sometimes, I find myself wondering whether I should write a comment concerning a variable with a very understandable name, then I end up writing an entire paragraph explaining it inside comment delimiters :p
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
Spell Name: Obscuration
Description:

The hero will be invisible but can't attack and use other spells. In this state, he has a sub ability to teleport an enemy ground unit to the caster's position.
The target is invulnerable and can't move when teleported state and stuns nearby enemy units for 5 seconds. After teleporting, 6 firebolts will hit the target, dealing damage and stun.

|cffffcc00Teleport timer:|r 14 seconds or you can use the Obscuration ability to teleport prematurely and disables the Teleport ability.

|cffffcc00Level 1|r - Invisibility lasts 10 seconds, fire damage deals 5 each.
|cffffcc00Level 2|r - Invisibility lasts 15 seconds, fire damage deals 10 each.
|cffffcc00Level 3|r - Invisibility lasts 20 seconds, fire damage deals 15 each.
|cffffcc00Level 4|r - Invisibility lasts 25 seconds, fire damage deals 20 each.
|cffffcc00Level 5|r - Invisibility lasts 30 seconds, fire damage deals 25 each.

This is my final entry...
 

Attachments

  • Obscuration.w3x
    55.5 KB · Views: 181
Level 29
Joined
Mar 10, 2009
Messages
5,016
Which contest was it mckill ?

this >>> Solo Mini-Mapping #7

browser, I don't blame you but the thing is if the entry/judging is finished then submit it, so that #7 will be done and Solo Mini-Mapping #8 may come...

anyway this is a little bit of offtopic here but since somebody opened it, I'm just sharing my thoughts...

EDIT:
not only that, Hero Contest#5 takes about 6 months to end...
 
Level 6
Joined
Jul 8, 2012
Messages
11
here is my entry for the contest

Phantom Glaive
Ability_UpgradeMoonGlaive.gif
Hurls a poisoned, darkness-shrouded glaive to an enemy.
Any enemy that gets into contact will be damaged by and
slowed and enemy takes double damage if it is damaged
from behind. Upon finishing the spell, assassin will gains
invisibilty for 2 seconds and leave behind an after image
Level 1 - 50 damage and 10% slow
Level 2 - 100 damage and 20% slow
Level 3 - 150 damage and 30% slow
Level 4 - 200 damage and 40% slow
PhantomGlaive.gif

  • PG init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set hashtable01 = (Last created hashtable)
      • -------- Movement speed of projectile per 0.04 seconds --------
      • Set PG_speed = 40.00
      • -------- Damage --------
      • Set PG_damage[1] = 50.00
      • Set PG_damage[2] = 100.00
      • Set PG_damage[3] = 150.00
      • Set PG_damage[4] = 200.00
  • PG start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Phantom Glaive
    • Actions
      • Set shuriken_caster = (Triggering unit)
      • Set shuriken_target = (Target unit of ability being cast)
      • Set shuriken_point1 = (Position of shuriken_caster)
      • -------- invisibility setup --------
      • Set PG_invisible = 2.00
      • Set HandleId = (Key (Triggering unit))
      • Unit - Add Glaive Invisibility to (Triggering unit)
      • Unit Group - Add (Triggering unit) to PG_invisible_group
      • Hashtable - Save PG_invisible as 1 of HandleId in (Last created hashtable)
      • -------- invisibility ends --------
      • -------- After image setup --------
      • Set PG_image_duration = 2.00
      • Unit - Create 1 dummy caster for (Owner of (Triggering unit)) at shuriken_point1 facing (Facing of (Triggering unit)) degrees
      • Custom script: set udg_HandleId=GetHandleId(GetLastCreatedUnit())
      • Hashtable - Save PG_image_duration as 1 of HandleId in hashtable01
      • Set PG_image = (Last created unit)
      • Unit Group - Add PG_image to PG_image_group
      • -------- after image setup ends --------
      • -------- projectile setup starts --------
      • Unit - Create 1 dummy projectile for (Owner of shuriken_caster) at shuriken_point1 facing (Facing of shuriken_caster) degrees
      • Set shuriken_dummy = (Last created unit)
      • Custom script: set udg_HandleId=GetHandleId(udg_shuriken_dummy)
      • Unit Group - Add shuriken_dummy to shuriken_group
      • -------- projectile setup ends --------
      • Hashtable - Save Handle OfPG_image as 4 of HandleId in hashtable01
      • Hashtable - Save (Level of Phantom Glaive for (Triggering unit)) as 3 of HandleId in hashtable01
      • Hashtable - Save Handle Ofshuriken_caster as 2 of HandleId in hashtable01
      • Hashtable - Save Handle Ofshuriken_target as 1 of HandleId in hashtable01
      • Custom script: call RemoveLocation(udg_shuriken_point1)
      • Trigger - Turn on PG loop <gen>
  • PG loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in PG_invisible_group and do (Actions)
        • Loop - Actions
          • Set HandleId = (Key (Picked unit))
          • Set PG_invisible = (Load 1 of HandleId from hashtable01)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PG_invisible Greater than 0.00
            • Then - Actions
              • Set PG_invisible = (PG_invisible - 0.04)
              • Hashtable - Save PG_invisible as 1 of HandleId in hashtable01
            • Else - Actions
              • Unit - Remove Glaive Invisibility from (Picked unit)
              • Unit Group - Remove (Picked unit) from PG_invisible_group
              • Hashtable - Clear all child hashtables of child HandleId in hashtable01
      • Unit Group - Pick every unit in PG_image_group and do (Actions)
        • Loop - Actions
          • Custom script: set udg_HandleId=GetHandleId(GetEnumUnit())
          • Set PG_image_duration = (Load 1 of HandleId from hashtable01)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PG_image_duration Greater than 0.00
            • Then - Actions
              • Set PG_image_duration = (PG_image_duration - 0.04)
              • Animation - Change PG_image's vertex coloring to (100.00%, 100.00%, 100.00%) with (100.00 - (PG_image_duration x 100.00))% transparency
              • Hashtable - Save PG_image_duration as 1 of HandleId in hashtable01
            • Else - Actions
              • Unit - Kill PG_image
              • Unit Group - Remove PG_image from PG_image_group
              • Hashtable - Clear all child hashtables of child HandleId in hashtable01
      • Unit Group - Pick every unit in shuriken_group and do (Actions)
        • Loop - Actions
          • Set shuriken_dummy = (Picked unit)
          • Custom script: set udg_HandleId=GetHandleId(udg_shuriken_dummy)
          • Set shuriken_target = (Load 1 of HandleId in hashtable01)
          • Set shuriken_caster = (Load 2 of HandleId in hashtable01)
          • Set PG_level = (Load 3 of HandleId from hashtable01)
          • Set PG_image = (Load 4 of HandleId in hashtable01)
          • Set shuriken_point1 = (Position of shuriken_dummy)
          • Unit - Create 1 dummy projectile shadow for (Owner of shuriken_dummy) at shuriken_point1 facing (Facing of shuriken_dummy) degrees
          • Animation - Change (Last created unit)'s vertex coloring to (30.00%, 30.00%, 30.00%) with 0.00% transparency
          • Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
          • Set shuriken_point2 = (Position of shuriken_target)
          • Set shuriken_angle = (Angle from shuriken_point1 to shuriken_point2)
          • Set shuriken_point3 = (shuriken_point1 offset by PG_speed towards shuriken_angle degrees)
          • Unit - Move shuriken_dummy instantly to shuriken_point3
          • Set temp_group = (Units within 110.00 of shuriken_point3 matching (((Matching unit) belongs to an enemy of (Owner of shuriken_dummy)) Equal to True))
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • Set PG_temp_point = (Position of (Picked unit))
              • Set temp_int = (Key (Picked unit))
              • Set temp_int2 = (Load temp_int of HandleId from hashtable01)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • temp_int2 Not equal to 1
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Equal to shuriken_target
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Abs((((Angle from shuriken_point2 to shuriken_point3) mod 360.00) - ((Facing of shuriken_target) mod 360.00)))) Greater than 120.00
                          • (Abs((((Angle from shuriken_point2 to shuriken_point3) mod 360.00) - ((Facing of shuriken_target) mod 360.00)))) Less than 240.00
                        • Then - Actions
                          • Unit - Cause shuriken_caster to damage shuriken_target, dealing (2.00 x PG_damage[PG_level]) damage of attack type Spells and damage type Normal
                        • Else - Actions
                          • Unit - Cause shuriken_caster to damage shuriken_target, dealing PG_damage[PG_level] damage of attack type Spells and damage type Normal
                      • Unit - Kill shuriken_dummy
                      • Unit Group - Remove shuriken_dummy from shuriken_group
                      • Custom script: call RemoveLocation(udg_shuriken_point1)
                      • Custom script: call RemoveLocation(udg_shuriken_point2)
                      • Custom script: call RemoveLocation(udg_shuriken_point3)
                      • Unit - Create 1 dummy slow caster for (Owner of shuriken_dummy) at PG_temp_point facing Default building facing degrees
                      • Unit - Add Glaive Slow to (Last created unit)
                      • Unit - Set level of Glaive Slow for (Last created unit) to PG_level
                      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Picked unit)
                      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                      • Custom script: call RemoveLocation(udg_PG_temp_point)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Abs((((Angle from shuriken_point2 to PG_temp_point) mod 360.00) - ((Facing of (Picked unit)) mod 360.00)))) Greater than 120.00
                          • (Abs((((Angle from shuriken_point2 to PG_temp_point) mod 360.00) - ((Facing of (Picked unit)) mod 360.00)))) Less than 240.00
                        • Then - Actions
                          • Unit - Cause shuriken_dummy to damage (Picked unit), dealing (2.00 x PG_damage[PG_level]) damage of attack type Normal and damage type Normal
                          • Hashtable - Save 1 as temp_int of HandleId in hashtable01
                        • Else - Actions
                          • Unit - Cause shuriken_caster to damage (Picked unit), dealing PG_damage[PG_level] damage of attack type Spells and damage type Normal
                          • Hashtable - Save 1 as temp_int of HandleId in hashtable01
                      • Unit - Create 1 dummy slow caster for (Owner of shuriken_dummy) at PG_temp_point facing Default building facing degrees
                      • Unit - Add Glaive Slow to (Last created unit)
                      • Unit - Set level of Glaive Slow for (Last created unit) to PG_level
                      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Picked unit)
                      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                      • Custom script: call RemoveLocation(udg_PG_temp_point)
                • Else - Actions
          • Unit Group - Remove all units from temp_group
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (shuriken_dummy is alive) Equal to False
            • Then - Actions
              • Hashtable - Clear all child hashtables of child HandleId in hashtable01
            • Else - Actions
          • Custom script: call RemoveLocation(udg_shuriken_point1)
          • Custom script: call RemoveLocation(udg_shuriken_point2)
          • Custom script: call RemoveLocation(udg_shuriken_point3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in shuriken_group) Equal to 0
          • (Number of units in PG_image_group) Equal to 0
          • (Number of units in PG_invisible_group) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Clean up
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to dummy projectile shadow
          • (Unit-type of (Triggering unit)) Equal to dummy slow caster
          • (Unit-type of (Triggering unit)) Equal to dummy caster
    • Actions
      • Unit - Remove (Triggering unit) from the game

Usage
  • 1 Initialization trigger + 2 action trigger + 1 clean up trigger
  • MUI
  • Fully customizable (speed, aoe, damage)
Theme
The most basic ability of an assassin, throwing sharp object from afar to kill the target.
Uses Glaive because i just like Night Elf, but model and name can be easily changed for liking.
The bread of butter of and assassin is a poison, i added it to this attack so neither
the enemy can run or catch her, and also she'll disappear in an instant as soon as she cast this ability.
i was going to use shuriken (those variable name proves it lol) but seems like overused.


version 1.0
  • Added test map with gibberish text and almost no explanation on the trigger
version 1.1
  • Added commentary and clean the code a bit
 

Attachments

  • Phantom Glaive ~ Zephyr 9# Contest.w3x
    28.8 KB · Views: 49
Last edited:
Level 5
Joined
Aug 16, 2010
Messages
97
I guess it's allowed, AFTER the contest, that is.

EDIT: My second WiP. I'm almost done with the spell, but still there are some leaks scattered throughout the trigger. Also the terrain still needs work.
JASS:
library MySpell requires AutoIndex, TimerUtils, GetDistance

//-------------------------------------------------------------------------------------------
//      Hunter's Instinct
//
//        by Dr.Killer
//
// The Warden uses her unatural instincts to locate wounded enemies.
// Then, she gains bonus movement speed and the ability to become invisible.
// She inflicts bonus damage upon her victim based on her distance from her 
// farthest target at the time of casting.
//-------------------------------------------------------------------------------------------


//-------------------------------------------------------------------------------------------
//      Configuration
//-------------------------------------------------------------------------------------------
globals
    private constant integer MAIN_SPELL_ID              =   'A001'          //Raw code of spell
    private constant integer INVIS_ID_1                 =   'A003'          //Raw codes for wind walk abilities (3 levels)
    private constant integer INVIS_ID_2                 =   'A004'
    private constant integer INVIS_ID_3                 =   'A005'
    private constant integer INVIS_BUFF_ID              =   'BOwk'          //Wind walk buff raw code
    
    private constant real    RANGE                      =   5100.           //The radius in which targets are picked
    private constant real    DURATION                   =   15.             //Spell duration
    private constant integer ARRAY_SIZE                 =   90              //Determines the number of spells which can be run simultaneously by different units
    private constant real    UNIT_MAX_SPEED             =   522.            //Unit's maximum speed in your map (neccessary)
    private          group   tempGroup                                      //A group used for enumerationa and stuff.
endglobals

private function HpThreshold takes integer lvl returns real                 //Enemies whose hit points are below this percent, will be added to targets group
    return (10.+10.*I2R(lvl))/100.
endfunction

private function SpeedBonus takes integer lvl returns real                  //Amount of bonus speed given to Warden upon casting (in percent)
    return (20.+10.*I2R(lvl))/100.
endfunction
//-------------------------------------------------------------------------------------------
//      End of Configuration
//-------------------------------------------------------------------------------------------

globals
    private boolean array flag [ARRAY_SIZE][ARRAY_SIZE]                     //Each target unit has a flag to see if the corresponding spell' duration cast on him has ended. Makes it possible for this spell to be MUI.
    private boolean array invis_flag                                        //Checks whether the wind walk ability has been added to warden or not. Useful for preventing the Warden from getting more than 1 wind walk ability
endglobals

//-------------------------------------------------------------------------------------------
//      Spell's main struct, holds all of spell's properties for later use
//-------------------------------------------------------------------------------------------

private struct SpellData                                                    //Struct variable names should be pretty self-explanatory
    private unit        caster
    private integer     casterId
    private player      owner
    private integer     lvl
    private group       targets                                             //A group which holds all the targets of the spell.                                  
    private timer       main_timer    
    private real        casterX
    private real        casterY
    private real        maxDist                                             //To determine the wind walk ability level, I store Warden's distance of the farthest target in this
    private real        speedBonus                                          //Amount of speed bonus given to Warden (the real value which is actually added to her speed)

//-------------------------------------------------------------------------------------------
//      This method runs when spell duration ends; does cleanups, effect removal, etc.
//-------------------------------------------------------------------------------------------
    private static method onFinish takes nothing returns nothing
        local unit      u            = null                                 //A temp unit used in some loops.
        local SpellData object       = GetTimerData(GetExpiredTimer())      //An instance of SpellData struct which holds all of spell's variables, such as caster, targets, etc.
        local SpellData temp                                                //Used in the Vision Management section. More info below.
        local integer   i            = 0                                    //I & J are simple counters used in loops.
        local integer   j            = 0
        local integer   target_id    = 0                                    //UnitId of the currently picked target (More info below)
        local boolean   grant_vision = false                                //Determines whether shared vision of the currently picked should be denied or granted. Used in making this MUI.
        local integer   owner_id     = GetPlayerId(object.owner)
        
        //----------------------------------------------------------------------------------
        //      Falsing flag related to this spell. Pretty obvious. Prevents this spell
        //      from granting vision of targets any longer.
        //----------------------------------------------------------------------------------
        loop
            set i=i+1
            exitwhen i>ARRAY_SIZE
            set flag[object][i] = false
        endloop
        set i=0
        
        //----------------------------------------------------------------------------------
        //      Vision Management section. Here, I pick the targets one by one, check if
        //      they are under the effect of a same spell (of another source). If that's
        //      true, I see if the owning player of that spell is the same as owner of this
        //      one. If that's also true, vision of that target is granted to the corresponding
        //      player and the grant_vision boolean is set to true.
        //      If not, vision is denied because with no Hunter's Instinct active, 
        //      there is no reason for them to have vision of enemy heroes.
        //      The 'temp' instance, is used to convey info of the other active spell to this
        //      method, so I can have access to its caster, owning player, etc.
        //----------------------------------------------------------------------------------
        loop
            set u = FirstOfGroup(object.targets)
            exitwhen u == null
            set target_id = GetUnitId(u)
            
            loop
                set j=j+1
                exitwhen (j>ARRAY_SIZE or grant_vision == true)
                set temp = SpellData.create()
                if (flag[j][target_id] == true) then
                    set temp = j
                    if (GetOwningPlayer(temp.caster) == object.owner) then
                        set grant_vision = true
                        call UnitShareVision(u, object.owner, true)
                    endif
                endif
                call temp.destroy()
            endloop
            
            if (not grant_vision) then
                call UnitShareVision(u, object.owner, false)
            endif
            call GroupRemoveUnit(object.targets, u)
            set j=0
        endloop
        
        //----------------------------------------------------------------------------------
        //      Cleanup section. Removes leaks, nullifies handles, etc.
        //      I also set the invis_flag of the caster to false, cause she no longer
        //      possesses the wind walk ability and even if she is in the middle of one,
        //      the buff is removed, so she becomes visible.
        //      I also remove the speed bonus here.
        //----------------------------------------------------------------------------------
        set invis_flag[object.casterId] = false
        call UnitRemoveAbility(object.caster, INVIS_ID_1)
        call UnitRemoveAbility(object.caster, INVIS_ID_2)
        call UnitRemoveAbility(object.caster, INVIS_ID_3)
        call UnitRemoveAbility(object.caster, INVIS_BUFF_ID)
        call SetUnitMoveSpeed(object.caster, GetUnitMoveSpeed(object.caster)-object.speedBonus)    
        call DestroyGroup(object.targets)
        call PauseTimer(GetExpiredTimer())
        call ReleaseTimer(GetExpiredTimer())
        set object.caster = null
    endmethod

//-------------------------------------------------------------------------------------------
//      Core method; sets needed variables, runs the spell, etc.
//-------------------------------------------------------------------------------------------
    private static method onCast takes nothing returns nothing
        local SpellData object          = SpellData.create()                                //Same as above, holds all needed variables for a spell.
        local unit      u               = null                                              //A temp unit used in loops.
        local real      dist            = 0.                                                //Warden's distance form the picked target. Mre info below.
        local real      finalSpeed      = 0.                                                //Warden's final speed, after applying the bonuses.
        local real      originalSpeed   = 0.                                                //Warden's original speed, before applying the bonuses. 
        
        set object.targets              = CreateGroup()
        set object.caster               = GetTriggerUnit()
        set object.casterId             = GetUnitId(object.caster)
        set object.owner                = GetOwningPlayer(object.caster)
        set object.casterX              = GetUnitX(object.caster)
        set object.casterY              = GetUnitY(object.caster)
        set object.lvl                  = GetUnitAbilityLevel(object.caster, MAIN_SPELL_ID)
        
        call GroupEnumUnitsInRange(tempGroup, object.casterX, object.casterY, RANGE, null)  //Aquires all potential targets. Invalid ones are filtered out below.
        
        //----------------------------------------------------------------------------------
        //      Target Validation section. Throws non-hero and non-enemy units. Also 
        //      dissmissed units whose HP is more than the required threshold which differs
        //      for each level. Also set required 'flag' slots to true. If a unit's flag
        //      is true, it means than they are under the effect of Hunter's Instinct.
        //      Besides, I store the farthest target's distance in maxDist variable, using
        //      some kind of Bubble Sort method to find it in the first place.
        //----------------------------------------------------------------------------------
        loop
            set u = FirstOfGroup(tempGroup)
            exitwhen u == null
            if (IsUnitType(u, UNIT_TYPE_HERO) and (GetUnitState(u, UNIT_STATE_LIFE) <= (GetUnitState(u, UNIT_STATE_MAX_LIFE)*HpThreshold(object.lvl))) and IsUnitEnemy(u, GetOwningPlayer(object.caster))) then
                call GroupAddUnit(object.targets, u)
                set dist = GetDistUnits(u, object.caster)
                if dist>object.maxDist then
                    set object.maxDist = dist
                endif
                set dist = 0.
                set flag[object][GetUnitId(u)] = true
            else
                set flag[object][GetUnitId(u)] = false
            endif
            call GroupRemoveUnit(tempGroup, u)
        endloop
        
        //----------------------------------------------------------------------------------
        //      This part adds the speed bonus. Also if the bonus causes Warden's speed
        //      to go beyond the maximum allowed speed, this corrects the bonus amount
        //      and removes the excess value.
        //----------------------------------------------------------------------------------
        if not IsUnitGroupEmptyBJ(object.targets) then 
            set originalSpeed     = GetUnitMoveSpeed(object.caster)
            set object.speedBonus = originalSpeed*SpeedBonus(object.lvl)
            set finalSpeed = object.speedBonus+originalSpeed
            if (finalSpeed > UNIT_MAX_SPEED) then 
                set object.speedBonus = object.speedBonus - finalSpeed + UNIT_MAX_SPEED
                set finalSpeed = UNIT_MAX_SPEED
                call SetUnitMoveSpeed(object.caster, UNIT_MAX_SPEED)
            endif
            call SetUnitMoveSpeed(object.caster, finalSpeed)
        endif
        
        //----------------------------------------------------------------------------------
        //      Vision Management section, again. Picks each individual unit present
        //      in the 'targets' group and grants shared vision of that unit to 
        //      the owning player of caster.
        //----------------------------------------------------------------------------------
        call GroupClear(tempGroup)
        call GroupAddGroup(object.targets, tempGroup)
        
        loop
            set u = FirstOfGroup(tempGroup)
            exitwhen u == null
            call UnitShareVision(u, GetOwningPlayer(object.caster), true)
            call GroupRemoveUnit(tempGroup, u)
        endloop
        
        //----------------------------------------------------------------------------------
        //      Here, I add the windwalk ability based on Warden's distance from her 
        //      farthest target, which is stored in 'maxDist' variable.
        //----------------------------------------------------------------------------------
        if not invis_flag[object.casterId] then
            if (object.maxDist <= 1700.) then
                call UnitAddAbility(object.caster, INVIS_ID_1)
            elseif (object.maxDist <= 2400.) then
                call UnitAddAbility(object.caster, INVIS_ID_2)
            else
                call UnitAddAbility(object.caster, INVIS_ID_3)
            endif
        endif
        set invis_flag[object.casterId] = true
        
        //----------------------------------------------------------------------------------
        //      Fires a timer to call the onFinish method at the of spell duration.
        //----------------------------------------------------------------------------------
        set  object.main_timer = NewTimer()
        call SetTimerData(object.main_timer, object)
        call TimerStart(object.main_timer, DURATION, true, function thistype.onFinish)
        set u = null
    endmethod

//-------------------------------------------------------------------------------------------
//      Self-explanatory
//-------------------------------------------------------------------------------------------
    private static method castCondition takes nothing returns boolean
        return GetSpellAbilityId() == MAIN_SPELL_ID
    endmethod
    
    private static method onInit takes nothing returns nothing
        local trigger t        = CreateTrigger()
        
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(t, Condition(function thistype.castCondition))
        call TriggerAddAction(t, function thistype.onCast)
        set tempGroup = CreateGroup()
    endmethod
endstruct

endlibrary

Feedback is much appreciated. :grin:
 
Last edited:
here is my entry for the contest

Phantom Glaive
Ability_UpgradeMoonGlaive.gif
Hurls a poisoned, darkness-shrouded glaive to an enemy.
Any enemy that gets into contact will be damaged by and
slowed and enemy takes double damage if it is damaged
from behind. Upon finishing the spell, assassin will gains
invisibilty for 2 seconds and leave behind an after image
Level 1 - 50 damage and 10% slow
Level 2 - 100 damage and 20% slow
Level 3 - 150 damage and 30% slow
Level 4 - 200 damage and 40% slow
PhantomGlaive.gif

  • PG init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set hashtable01 = (Last created hashtable)
      • -------- Movement speed of projectile per 0.04 seconds --------
      • Set PG_speed = 40.00
      • -------- Damage --------
      • Set PG_damage[1] = 50.00
      • Set PG_damage[2] = 100.00
      • Set PG_damage[3] = 150.00
      • Set PG_damage[4] = 200.00
  • PG start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Phantom Glaive
    • Actions
      • Set shuriken_caster = (Triggering unit)
      • Set shuriken_target = (Target unit of ability being cast)
      • Set shuriken_point1 = (Position of shuriken_caster)
      • -------- invisibility setup --------
      • Set PG_invisible = 2.00
      • Set HandleId = (Key (Triggering unit))
      • Unit - Add Glaive Invisibility to (Triggering unit)
      • Unit Group - Add (Triggering unit) to PG_invisible_group
      • Hashtable - Save PG_invisible as 1 of HandleId in (Last created hashtable)
      • -------- invisibility ends --------
      • -------- After image setup --------
      • Set PG_image_duration = 2.00
      • Unit - Create 1 dummy caster for (Owner of (Triggering unit)) at shuriken_point1 facing (Facing of (Triggering unit)) degrees
      • Custom script: set udg_HandleId=GetHandleId(GetLastCreatedUnit())
      • Hashtable - Save PG_image_duration as 1 of HandleId in hashtable01
      • Set PG_image = (Last created unit)
      • Unit Group - Add PG_image to PG_image_group
      • -------- after image setup ends --------
      • -------- projectile setup starts --------
      • Unit - Create 1 dummy projectile for (Owner of shuriken_caster) at shuriken_point1 facing (Facing of shuriken_caster) degrees
      • Set shuriken_dummy = (Last created unit)
      • Custom script: set udg_HandleId=GetHandleId(udg_shuriken_dummy)
      • Unit Group - Add shuriken_dummy to shuriken_group
      • -------- projectile setup ends --------
      • Hashtable - Save Handle OfPG_image as 4 of HandleId in hashtable01
      • Hashtable - Save (Level of Phantom Glaive for (Triggering unit)) as 3 of HandleId in hashtable01
      • Hashtable - Save Handle Ofshuriken_caster as 2 of HandleId in hashtable01
      • Hashtable - Save Handle Ofshuriken_target as 1 of HandleId in hashtable01
      • Custom script: call RemoveLocation(udg_shuriken_point1)
      • Trigger - Turn on PG loop <gen>
  • PG loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in PG_invisible_group and do (Actions)
        • Loop - Actions
          • Set HandleId = (Key (Picked unit))
          • Set PG_invisible = (Load 1 of HandleId from hashtable01)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PG_invisible Greater than 0.00
            • Then - Actions
              • Set PG_invisible = (PG_invisible - 0.04)
              • Hashtable - Save PG_invisible as 1 of HandleId in hashtable01
            • Else - Actions
              • Unit - Remove Glaive Invisibility from (Picked unit)
              • Unit Group - Remove (Picked unit) from PG_invisible_group
              • Hashtable - Clear all child hashtables of child HandleId in hashtable01
      • Unit Group - Pick every unit in PG_image_group and do (Actions)
        • Loop - Actions
          • Custom script: set udg_HandleId=GetHandleId(GetEnumUnit())
          • Set PG_image_duration = (Load 1 of HandleId from hashtable01)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PG_image_duration Greater than 0.00
            • Then - Actions
              • Set PG_image_duration = (PG_image_duration - 0.04)
              • Animation - Change PG_image's vertex coloring to (100.00%, 100.00%, 100.00%) with (100.00 - (PG_image_duration x 100.00))% transparency
              • Hashtable - Save PG_image_duration as 1 of HandleId in hashtable01
            • Else - Actions
              • Unit - Kill PG_image
              • Unit Group - Remove PG_image from PG_image_group
              • Hashtable - Clear all child hashtables of child HandleId in hashtable01
      • Unit Group - Pick every unit in shuriken_group and do (Actions)
        • Loop - Actions
          • Set shuriken_dummy = (Picked unit)
          • Custom script: set udg_HandleId=GetHandleId(udg_shuriken_dummy)
          • Set shuriken_target = (Load 1 of HandleId in hashtable01)
          • Set shuriken_caster = (Load 2 of HandleId in hashtable01)
          • Set PG_level = (Load 3 of HandleId from hashtable01)
          • Set PG_image = (Load 4 of HandleId in hashtable01)
          • Set shuriken_point1 = (Position of shuriken_dummy)
          • Unit - Create 1 dummy projectile shadow for (Owner of shuriken_dummy) at shuriken_point1 facing (Facing of shuriken_dummy) degrees
          • Animation - Change (Last created unit)'s vertex coloring to (30.00%, 30.00%, 30.00%) with 0.00% transparency
          • Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
          • Set shuriken_point2 = (Position of shuriken_target)
          • Set shuriken_angle = (Angle from shuriken_point1 to shuriken_point2)
          • Set shuriken_point3 = (shuriken_point1 offset by PG_speed towards shuriken_angle degrees)
          • Unit - Move shuriken_dummy instantly to shuriken_point3
          • Set temp_group = (Units within 110.00 of shuriken_point3 matching (((Matching unit) belongs to an enemy of (Owner of shuriken_dummy)) Equal to True))
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • Set PG_temp_point = (Position of (Picked unit))
              • Set temp_int = (Key (Picked unit))
              • Set temp_int2 = (Load temp_int of HandleId from hashtable01)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • temp_int2 Not equal to 1
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Equal to shuriken_target
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Abs((((Angle from shuriken_point2 to shuriken_point3) mod 360.00) - ((Facing of shuriken_target) mod 360.00)))) Greater than 120.00
                          • (Abs((((Angle from shuriken_point2 to shuriken_point3) mod 360.00) - ((Facing of shuriken_target) mod 360.00)))) Less than 240.00
                        • Then - Actions
                          • Unit - Cause shuriken_caster to damage shuriken_target, dealing (2.00 x PG_damage[PG_level]) damage of attack type Spells and damage type Normal
                        • Else - Actions
                          • Unit - Cause shuriken_caster to damage shuriken_target, dealing PG_damage[PG_level] damage of attack type Spells and damage type Normal
                      • Unit - Kill shuriken_dummy
                      • Unit Group - Remove shuriken_dummy from shuriken_group
                      • Custom script: call RemoveLocation(udg_shuriken_point1)
                      • Custom script: call RemoveLocation(udg_shuriken_point2)
                      • Custom script: call RemoveLocation(udg_shuriken_point3)
                      • Unit - Create 1 dummy slow caster for (Owner of shuriken_dummy) at PG_temp_point facing Default building facing degrees
                      • Unit - Add Glaive Slow to (Last created unit)
                      • Unit - Set level of Glaive Slow for (Last created unit) to PG_level
                      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Picked unit)
                      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                      • Custom script: call RemoveLocation(udg_PG_temp_point)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Abs((((Angle from shuriken_point2 to PG_temp_point) mod 360.00) - ((Facing of (Picked unit)) mod 360.00)))) Greater than 120.00
                          • (Abs((((Angle from shuriken_point2 to PG_temp_point) mod 360.00) - ((Facing of (Picked unit)) mod 360.00)))) Less than 240.00
                        • Then - Actions
                          • Unit - Cause shuriken_dummy to damage (Picked unit), dealing (2.00 x PG_damage[PG_level]) damage of attack type Normal and damage type Normal
                          • Hashtable - Save 1 as temp_int of HandleId in hashtable01
                        • Else - Actions
                          • Unit - Cause shuriken_caster to damage (Picked unit), dealing PG_damage[PG_level] damage of attack type Spells and damage type Normal
                          • Hashtable - Save 1 as temp_int of HandleId in hashtable01
                      • Unit - Create 1 dummy slow caster for (Owner of shuriken_dummy) at PG_temp_point facing Default building facing degrees
                      • Unit - Add Glaive Slow to (Last created unit)
                      • Unit - Set level of Glaive Slow for (Last created unit) to PG_level
                      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Picked unit)
                      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                      • Custom script: call RemoveLocation(udg_PG_temp_point)
                • Else - Actions
          • Unit Group - Remove all units from temp_group
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (shuriken_dummy is alive) Equal to False
            • Then - Actions
              • Hashtable - Clear all child hashtables of child HandleId in hashtable01
            • Else - Actions
          • Custom script: call RemoveLocation(udg_shuriken_point1)
          • Custom script: call RemoveLocation(udg_shuriken_point2)
          • Custom script: call RemoveLocation(udg_shuriken_point3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in shuriken_group) Equal to 0
          • (Number of units in PG_image_group) Equal to 0
          • (Number of units in PG_invisible_group) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Clean up
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to dummy projectile shadow
          • (Unit-type of (Triggering unit)) Equal to dummy slow caster
          • (Unit-type of (Triggering unit)) Equal to dummy caster
    • Actions
      • Unit - Remove (Triggering unit) from the game

Usage
  • 1 Initialization trigger + 2 action trigger + 1 clean up trigger
  • MUI
  • Fully customizable (speed, aoe, damage)
Theme
The most basic ability of an assassin, throwing sharp object from afar to kill the target.
Uses Glaive because i just like Night Elf, but model and name can be easily changed for liking.
The bread of butter of and assassin is a poison, i added it to this attack so neither
the enemy can run or catch her, and also she'll disappear in an instant as soon as she cast this ability.
i was going to use shuriken (those variable name proves it lol) but seems like overused.


version 1.0
  • Added test map with gibberish text and almost no explanation on the trigger

The way you handle the invisibility is actually quite genius. Using a permanent invisiblity then simply timing it through a trigger requires less legwork for the user, since all they have to do it change a value instead of going fishing in the object editor.
 
@Dr. Killer:
I would totally recommend optimizing the script by removing all those silly GUI-like blocks of code (In JASS, we don't need bj_wantDestroyGroup, we can do everything on our own without depending on blizzard.j)

Also, bro-tips:

- Local groups are a no-no. (Use global groups that you only have to create once and never destroy, as long as you use them without all the silly BJs)
- call GroupRemoveUnit(tempGroup, u)[icode=jass] can be moved outside of the if block when you're doing a FirstOfGroup loop. - You don't need to size an array if it's one-dimensional. Sizing it might cause some extra overhead that I don't know of or it might just do nothing. Still pointless though. - 2D Arrays can't be sized [100][100]. That's 10000 slots, and the max is 8192. You can use a Table instead. (Table by Bribe) - I2R is useless most of the time :P - The only troublesome block of code you have: [hidden=JASS Code][code=jass] set bj_wantDestroyGroup = false if not IsUnitGroupEmptyBJ(object.targets) then set object.speedBonus = GetUnitMoveSpeed(object.caster)*SpeedBonus(object.lvl)) set finalSpeed = object.speedBonus+GetUnitMoveSpeed(object.caster) if (finalSpeed > UNIT_MAX_SPEED) then set object.speedBonus = object.speedBonus - (finalSpeed-UNIT_MAX_SPEED) set finalSpeed = UNIT_MAX_SPEED call SetUnitMoveSpeed(object.caster, UNIT_MAX_SPEED) endif call SetUnitMoveSpeed(object.caster, finalSpeed) endif set object.targetCount = CountUnitsInGroup(object.targets) //---------------------------------------------------------------------------------- // Below, the spell acctual casting process will be done //---------------------------------------------------------------------------------- call GroupClear(tempGroup) call GroupAddGroup(object.targets, tempGroup) set u = null[/code][/hidden] It can be heavily optimized and cleaned to be more readable ;/ GroupAddGroup can be inlined (It's not very efficient). Still, good job on the comments ^_^ More would always be better though :D [b]edit[/b] Oh and one other thing: Arrays in JASS have default values: boolean array -> false integer array -> 0 real array -> 0 string array -> "" handle array -> null So this: [hidden=Block][code=jass] loop set i=i+1 exitwhen i>100 loop set j=j+1 exitwhen j>100 set flag[i][j] = false endloop endloop[/code][/hidden] is useless <: (It also goes out of the array bounds) [b]edit[/b] @chukkyjr: How about caching things into temporary variables so you can avoid repeating the calls over and over again. (Triggering unit, Last created unit, etc...) Other than that, looking good ^.^
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I asked them, but never got an answer saying it's forbidden to post it in the Spells Section while the contest is going on.
Also, they can't suddenly change their mind to disqualify to those who already did submit it to Spells Section (Radamantus, me, mckill, etc), it's not stated in the rules on the first post.
So, what the heck ;p
 
Status
Not open for further replies.
Top