• 🏆 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
You are allowed to submit contest resources before the contest is over. They can choose to deny a rating until after the contest is over.
Rating is not as important as "free reviews" which most of us had gotten it so far.
It made us to improve scoring even before the judge made a scoring on the spell on the contest, it's like you're taking shortcuts to get an early preview to boost your score.

I think this kind of action should be prohibited in the next contest (not just Spell, but all of them: Techtree, Models, etc)
 
Level 5
Joined
Aug 16, 2010
Messages
97
Third WiP.
- Added A LOT OF comments, ensuring easy configuration and more readability.
- Implemented some tips mentioned by Magtheridon.
- Edited tooltips, all of them.
- Almost 90% complete, unless I change my mind and make a totally new spell...
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 appreciated.
 

Attachments

  • WiP3.w3x
    75.5 KB · Views: 72
RSYkeMSk.jpg

=========================
Dash'n'Slash
=========================

Forces the hero to targeted enemy, When the hero is close enough, this force endsm some damage will be dealt and some shadow copies of the hero will appear around this hero and nearby enemies dealing damage equal to the percentage of damage dealt to the primary target.

Level 1 - 140 damage, clones deal 50% of the damage.
Level 2 - 210 damage, clones deal 65% of the damage.
Level 3 - 280 damage, clones deal 80% of the damage.

=========================
Zephyr Contest #9 entry
by Bowser499 aka [DUOS]
=========================

~~~~~~~~~~~~~~~~~~~~~~~~
JASS:
function Trig_DashAndSlash_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == udg_DnS_RawCode
endfunction

// Constants

function Trig_DashAndSlash_GetDamage takes unit forWhichHero returns real
    // This formula determines the damage that will be dealt to targeted unit.
    return GetUnitAbilityLevel(forWhichHero,udg_DnS_RawCode) * 70. + 70.
endfunction 

function Trig_DashAndSlash_GetPercentage takes unit forWhichHero returns real
    // This formula determines the percentage of damage that will be dealt to targets by shadows.
    return GetUnitAbilityLevel(forWhichHero,udg_DnS_RawCode) * .15 + .35
endfunction 

function Trig_DashAndSlash_GetPercDamage takes unit forWhichHero returns real
    // This formula determines the damage that will be dealt to targets by shadows.
    return Trig_DashAndSlash_GetDamage(forWhichHero) * Trig_DashAndSlash_GetPercentage(forWhichHero)
endfunction 

function Trig_DashAndSlash_IsUnitMatching takes unit castingUnit, unit filterUnit returns boolean
    // The unit matching these conditions will be damaged by shadows.
    return IsUnitEnemy(filterUnit,GetOwningPlayer(castingUnit)) and not IsUnitType(filterUnit,UNIT_TYPE_DEAD) and not IsUnitType(filterUnit,UNIT_TYPE_STRUCTURE) and not IsUnitType(filterUnit,UNIT_TYPE_MAGIC_IMMUNE) 
endfunction 

// Functions

function Trig_DashAndSlash_Timer takes nothing returns nothing
    local timer dashTimer = GetExpiredTimer()
    local integer dashTimerId = GetHandleId(dashTimer)
    local unit castingUnit = LoadUnitHandle(udg_Hash,dashTimerId,0)
    local unit spellTarget = LoadUnitHandle(udg_Hash,dashTimerId,1)
    local real casterX = GetUnitX(castingUnit)
    local real casterY = GetUnitY(castingUnit)
    local real targetX = GetUnitX(spellTarget)
    local real targetY = GetUnitY(spellTarget)
    local real distanceBetweenUnits = SquareRoot((casterX-targetX)*(casterX-targetX)+(casterY-targetY)*(casterY-targetY))
    local real angleBetweenUnits = Atan2(targetY-casterY,targetX-casterX)
    local real casterNewX = casterX + udg_DnS_DashDistanceSegment * Cos(angleBetweenUnits)
    local real casterNewY = casterY + udg_DnS_DashDistanceSegment * Sin(angleBetweenUnits)
    local unit groupUnit
    local unit newClone
    local real cloneAngle
    
    if distanceBetweenUnits < 135. then
        // Damage will be accompanied with a good effect!
        call DestroyEffect(AddSpecialEffectTarget(udg_DnS_DamageEffectPath,spellTarget,"origin"))
        // Damaging the target (after dash).
        call UnitDamageTarget(castingUnit,spellTarget,Trig_DashAndSlash_GetDamage(castingUnit),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
        // Perform clone spawning and damaging.
        call GroupEnumUnitsInRange(bj_lastCreatedGroup,targetX,targetY,udg_DnS_ShadowSpawnAoE,null) 
        loop
            set groupUnit = FirstOfGroup(bj_lastCreatedGroup)
            exitwhen groupUnit == null
            
            // Check if the unit matches the conditions.
            if Trig_DashAndSlash_IsUnitMatching(castingUnit,groupUnit) then
                // We must update target coords since our target is different now.
                set targetX = GetUnitX(groupUnit)
                set targetY = GetUnitY(groupUnit)
                // Setupping the first clone.
                set cloneAngle = angleBetweenUnits * 57.295827 + 135.
                set casterNewX = targetX + 120. * Cos(cloneAngle*.0174532)
                set casterNewY = targetY + 120. * Sin(cloneAngle*.0174532)
                set angleBetweenUnits = Atan2(targetY-casterNewY,targetX-casterNewX)
                set newClone = CreateUnit(GetOwningPlayer(castingUnit),udg_DnS_CloneUnitType,casterNewX,casterNewY,angleBetweenUnits)
                call SetUnitVertexColor(newClone,255,255,255,100)
                call SetUnitAnimation(newClone,udg_DnS_CloneAnim)
                call UnitApplyTimedLife(newClone,'BTLF',udg_DnS_CloneAnimTime+.2)   
                // Setupping the second clone.
                set cloneAngle = cloneAngle - 180.
                set casterNewX = targetX + 120. * Cos(cloneAngle*.0174532)
                set casterNewY = targetY + 120. * Sin(cloneAngle*.0174532)
                set angleBetweenUnits = Atan2(targetY-casterNewY,targetX-casterNewX)
                set newClone = CreateUnit(GetOwningPlayer(castingUnit),udg_DnS_CloneUnitType,casterNewX,casterNewY,angleBetweenUnits)
                call SetUnitVertexColor(newClone,255,255,255,100)
                call SetUnitAnimation(newClone,udg_DnS_CloneAnim)
                call UnitApplyTimedLife(newClone,'BTLF',udg_DnS_CloneAnimTime+.2)     
                // Damaging the target (from shadow clones).
                call UnitDamageTarget(castingUnit,groupUnit,Trig_DashAndSlash_GetPercDamage(castingUnit),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
            endif
            
            call GroupRemoveUnit(bj_lastCreatedGroup,groupUnit)
        endloop
        
        // In the end we must just flush the timer id in hash, pasue and destroy the timer.
        call FlushChildHashtable(udg_Hash,dashTimerId)
        call PauseTimer(dashTimer)
        call DestroyTimer(dashTimer)
    else
        // Move the caster to the target until he will be close enough.
        call SetUnitX(castingUnit,casterNewX)
        call SetUnitY(castingUnit,casterNewY)
        
        // Probably we need to adjust the facing aswell.
        call SetUnitFacing(castingUnit,angleBetweenUnits*57.295827)
        
        // Now, create the effect of dashing in the previous position of caster.
        call DestroyEffect(AddSpecialEffect(udg_DnS_DashEffectPath,casterX,casterY))
    endif
    
    set castingUnit = null
    set spellTarget = null
    set dashTimer = null
endfunction

function Trig_DashAndSlash_Actions takes nothing returns nothing
    local unit castingUnit = GetTriggerUnit()
    local unit spellTarget = GetSpellTargetUnit()
    local timer dashTimer = CreateTimer()
    local integer dashTimerId = GetHandleId(dashTimer)
    
    // Saving units on timer to move them.
    call SaveAgentHandle(udg_Hash,dashTimerId,0,castingUnit)
    call SaveAgentHandle(udg_Hash,dashTimerId,1,spellTarget)
    
    // Starting the timer.
    call TimerStart(dashTimer,.04,true,function Trig_DashAndSlash_Timer)
    
    set castingUnit = null
    set spellTarget = null
    set dashTimer = null
endfunction

//===========================================================================
function InitTrig_DashAndSlash takes nothing returns nothing
    // Globals Init.
    set udg_Hash = InitHashtable()
    set udg_DnS_RawCode = 'A000' // Dash'n'Slash hero ability raw code.
    set udg_DnS_CloneUnitType = 'n000' // dns_shadow unit raw code.
    set udg_DnS_DashDistanceSegment = 40. // Amount of distance per 0.04 seconds.
    set udg_DnS_DashEffectPath = "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" // Effect that will be created during the dash.
    set udg_DnS_ShadowSpawnAoE = 560. // The area from the targeted unit where shadows will appear around enemies.
    set udg_DnS_CloneAnimTime = .966 // The time of shadow animation.
    set udg_DnS_CloneAnim = "Attack - 1" // The animation clone will use.
    set udg_DnS_DamageEffectPath = "Objects\\Spawnmodels\\Orc\\Orcblood\\BattrollBlood.mdl"
    
    // Trigger Init.
    set gg_trg_DashAndSlash = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_DashAndSlash,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_DashAndSlash,Condition(function Trig_DashAndSlash_Conditions))
    call TriggerAddAction(gg_trg_DashAndSlash,function Trig_DashAndSlash_Actions)
endfunction

That's what.
Feedback please)
 

Attachments

  • Zephyr Contest 9 Entry.w3x
    22.9 KB · Views: 165
Level 25
Joined
Jun 5, 2008
Messages
2,572
I present my WIP, still not finished, lacking documentation and whatnot.
I found the spell quite fun even now, need to add proper colision check and all those things.

Also damage and more effects ofc, this is just a shell of how the spell works atm.

Kraken Shell

The assasin has learned how to deal with groups of enemies efficently. Firing off a modified rifle shell which bursts into chains upon hitting the target, assassin is able to use the mass of his enemies into his advantage.
 

Attachments

  • Zephyr.w3x
    49.6 KB · Views: 84
Level 16
Joined
Apr 4, 2011
Messages
995
Rating is not as important as "free reviews" which most of us had gotten it so far.
It made us to improve scoring even before the judge made a scoring on the spell on the contest, it's like you're taking shortcuts to get an early preview to boost your score.

I think this kind of action should be prohibited in the next contest (not just Spell, but all of them: Techtree, Models, etc)

--> http://www.hiveworkshop.com/forums/2189203-post196.html

The judges and contestants give free reviews in the thread anyways.
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
Oh man im proud of myself for this trigger, Thank you calculus <3

  • Assassinate Damage
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to Decieve_Target
      • (Load 3 of Decieve_Key from Decieve_HashTable) Equal to True
    • Actions
      • Set Assassinate_AngleOfAttack = (Facing of (Attacking unit))
      • Set Assassinate_AngleOfAttacked = (Facing of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Assassinate_AngleOfAttacked - Assassinate_AngleOfAttack) Less than or equal to 90.00
              • (Assassinate_AngleOfAttacked - Assassinate_AngleOfAttack) Greater than or equal to 270.00
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is A Hero) Equal to True
            • Then - Actions
              • Unit - Cause Decieve_Dummy to damage (Triggering unit), dealing 300.00 damage of attack type Normal and damage type Normal
            • Else - Actions
              • Unit - Kill (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is A Hero) Equal to True
            • Then - Actions
              • Unit - Cause Decieve_Dummy to damage (Triggering unit), dealing 100.00 damage of attack type Normal and damage type Normal
            • Else - Actions
              • Unit - Cause Decieve_Dummy to damage (Triggering unit), dealing 300.00 damage of attack type Normal and damage type Normal
Reserving post for Final Entry.
 
Level 6
Joined
Jul 8, 2012
Messages
11
how do we post final entry? in new post or edit the first post??

well there it goes, just a simple comment and cleaning, took magtheridon's advice, original post from here
 

Attachments

  • Phantom Glaive v1.1 ~ Zephyr 9# Contest.w3x
    30.8 KB · Views: 169
Last edited:
Level 25
Joined
Jun 5, 2008
Messages
2,572
You can use any enhancing system (xe, IsDestructableTree, Damage detection systems, etc.), as long as the judge(s) and/or host give(s) consent to its usage.

Would recycling systems and dummy casting systems be considered as such? Also systems concerning pathing.

If so, are they allowed?

The ability can be followed by a maximum of one (1) sub-ability, but the latter must not be more effective and/or powerful than the super-ability.

This doesn't stand for dummy abilities, right?

Edit:

Triggers concerning demo/test map are ofc not looked upon?
 
This is my final WiP before i post my Final Entry. I will also post the presentation with the final entry. There are some problems with it that i cannot figure out, and i need to add a few more things.

There is error in custom script:
  • Controller Move
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Triggering unit) Equal to Decieve_Dummy
    • Actions
      • Set Decieve_Temploc = (Target point of issued order)
      • Unit - Order Decieve_Target to Move To Decieve_Temploc
      • Custom script: call RemoveLocation(udg_Decieve_Temploc)
udg_Decieve_Temploc is replaced with udg_Controllor_Temploc, fix that.

Also spell look broken to me, hero is removed from game and I can't see a thing after that...
 
icons_13062_btn.jpg
Spiked Strike

Increases powers of the Impale ability.
Burrow hero to target position, blasting spikes
in all directions, there is 15% chance that
targets below 100 hit points explode and die
instantly.

- Damage and stun values equal to ones from
Impale ability.

JASS:
/****************************************************************************
* Authors: -Kobas-                                                          *
*                                                                           *
* Version: 1.1.0.0                                                          *
* Date: 5 - Aug - 2012                                                     *
*                                                                           *
* Credits: BTNcrBurowSTRIKE Icon created by CRAZYRUSSIAN                    *
*          SlowTarget Model by JetFangInferno                               *
*          SpellEffectEvent by Bribe                                        *
*             - Require (RegisterPlayerUnitEvent by Magtheridon96)          *
*                                                                           *
* Contact: [url]http://www.hiveworkshop.com/forums/members/-kobas-/[/url]              *
 ****************************************************************************/

library SpikedStrike initializer Init requires SpellEffectEvent
//You can include some Timer Lib to handle timers or use Table if You
//have 2 many hashtables already created in your map

    /***************************************************************
     * Configuration
     ***************************************************************/
     
    // Spell Globals, you must edit them. Copy and paste dummy units
    // from object editor into your map and edit ID's
    globals
        private constant integer   ABIL_CODE      = 'AUim'
        private constant integer   ABIL_CODE_BUFF = 'A000'
        
        private constant integer   DUMMY_ID_1     = 'h000'
        private constant integer   DUMMY_ID_2     = 'h001'
        private constant integer   DUMMY_ID_3     = 'h002'
        private constant integer   DUMMY_ID_4     = 'h003'
        private constant integer   DUMMY_CASTER   = 'h004'
    endglobals

    // Math formula used in GetChance function to return chance of
    // triggering Crushing Blow
    private function GetChance takes integer level returns real
        //We will exclude level here and use constant value, but you don't need to
        //Example:
        //return I2R(level) * 0.05 /* increases */ + 0.10 /* Base: 10 */
        return 100. //All units that die will explode
    endfunction
    
    // Here we define min hp, if unit has hit points below this
    // value Crushing Blow will be triggered
    private function GetMinHp takes integer level returns real
        return level * 50. /* increases */ + 50. /* Base: 50. */
    endfunction
    
    // Function will return allowed target for Crushing Blow
    private function GetTargetAllowed takes integer level, unit u, player p returns boolean    
        
        //We exclude structures/buildings
        if IsUnitType(u, UNIT_TYPE_STRUCTURE) then
            return false
        endif
        
        //Effect only hero enemy units
        if IsUnitAlly(u, p) then
            return false
        endif
        
        //Check has unit low hp
        if GetUnitState(u, UNIT_STATE_LIFE) > GetMinHp(level) then
            return false
        endif
        
        return true
    endfunction
    
    // Function will return radius or AOE for Crushing Blow
    private function GetRadius takes integer level returns real
        //We excluded level here but if needed just edit forumla
        //Example: 
        //return level * 200. + 800.
        return 1200. /* Base: 1200. (That's 2 times Impale wave distance) */
    endfunction
    
    /***************************************************************
     * End configuration
     ***************************************************************/
     
    // Don't edit this unless you know what you are doing!
    globals
        private hashtable Hash = InitHashtable()
        private group     G    = CreateGroup()
    endglobals
    
    /***************************************************************
     * Spell Code
     ***************************************************************/
    private function CrushingBlow takes integer level, real x, real y, unit caster returns nothing
        local unit u
        call GroupEnumUnitsInRange(G, x, y, GetRadius(level), null)
        loop
            set u = FirstOfGroup(G)
            exitwhen u == null
            call GroupRemoveUnit(G,u)
            
            if GetTargetAllowed(level, u, GetOwningPlayer(caster)) then
                if GetRandomReal(0.00,1.00) < GetChance(level) then
                    call SetUnitExploded(u, true)
                    call UnitDamageTarget(caster, u, GetMinHp(level) * 10, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, null)
                endif
            endif
        endloop
    endfunction
     
    private function CreateSpike takes integer id, real x, real y returns nothing
        local real r = GetRandomReal(0.500,2.500)
        local unit u = CreateUnit(Player(15), id, x + GetRandomReal(-25.000,25.000), y + GetRandomReal(-25.000,25.000), GetRandomReal(0.000,360.000))
        call UnitApplyTimedLife(u, 'BTLF', 2.0)
        call SetUnitAnimation(u, "birth")
        call SetUnitScale(u, r, r, r)
        set u = null
    endfunction
    
    private function CreateEffect takes nothing returns nothing
        local timer   t  = GetExpiredTimer()
        local integer id = GetHandleId(t)
        local integer i  = 0
            
        local real    x
        local real    y
        local real    angle
            
        local unit    u              = LoadUnitHandle(Hash, id, 0)
        local integer player_id      = LoadInteger(   Hash, id, 1)
        local real    spell_target_x = LoadReal(      Hash, id, 2)
        local real    spell_target_y = LoadReal(      Hash, id, 3)
        local integer level          = LoadInteger(   Hash, id, 4)
        local real    r
        
        call CrushingBlow(level, spell_target_x, spell_target_y, u)
        call FlushChildHashtable(Hash, id)
            
        call SetUnitX(u, spell_target_x)
        call SetUnitY(u, spell_target_y)
            
        set i = 0
        loop
            exitwhen i > 4
            set i = i+1
            call CreateSpike(DUMMY_ID_1, spell_target_x, spell_target_y)
            call CreateSpike(DUMMY_ID_2, spell_target_x, spell_target_y)
            call CreateSpike(DUMMY_ID_3, spell_target_x, spell_target_y)
            call CreateSpike(DUMMY_ID_4, spell_target_x, spell_target_y)
        endloop
            
        call PauseTimer(t)
        call DestroyTimer(t)
        set t  = null
        set u  = null
    endfunction
        
    private function RunFixed takes nothing returns nothing
        local timer   t  = CreateTimer()
        local integer id = GetHandleId(t)
            
        local real    x
        local real    y
        local real    dist
        local real    angle
            
        local unit    caster         = GetTriggerUnit()
            
        local integer i              = 1
        local integer j              = 1
            
        local real    spell_target_x = GetSpellTargetX()
        local real    spell_target_y = GetSpellTargetY()
            
        call SaveUnitHandle(Hash, id, 0, caster)
        call SaveInteger(   Hash, id, 1, GetPlayerId(GetTriggerPlayer()))
        call SaveReal(      Hash, id, 2, spell_target_x)
        call SaveReal(      Hash, id, 3, spell_target_y)
        call SaveInteger(   Hash, id, 4, GetUnitAbilityLevel(caster, ABIL_CODE_BUFF))
            
        loop
            exitwhen i > 8
            set j = 1
            loop
                exitwhen j > 10
                set dist  = 35.00 * I2R(i) + 25
                set angle = (360.00 / 10.00 * I2R(j)) + (10.00 * I2R(i))
                set x = spell_target_x + dist * Cos(angle * bj_DEGTORAD)
                set y = spell_target_y + dist * Sin(angle * bj_DEGTORAD)
                    
                call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\CryptFiendEggsack\\CryptFiendEggsack.mdl", x, y))
                    
                set j = j + 1
            endloop
            set i = i + 1
        endloop
            
        set i = 0
        loop
            exitwhen i > 12
 
            set angle = (360.00 / 12.00 * I2R(i))
            set x = spell_target_x + 300 * Cos(angle * bj_DEGTORAD)
            set y = spell_target_y + 300 * Sin(angle * bj_DEGTORAD)
                    
            set caster = CreateUnit(GetOwningPlayer(GetTriggerUnit()), DUMMY_CASTER, spell_target_x, spell_target_y, 0.000)
            call UnitApplyTimedLife(caster, 'BTLF', 2.0)
            call UnitAddAbility(caster, ABIL_CODE)
            call SetUnitAbilityLevel(caster, ABIL_CODE, GetUnitAbilityLevel(GetTriggerUnit(), ABIL_CODE))
            call IssuePointOrder(caster, "impale", x, y)
                
            set i = i + 1
        endloop
            
        call TimerStart(t, 0.35, false, function CreateEffect)
        set t = null
        set caster = null
    endfunction
        
    private function Run takes nothing returns nothing
        if GetUnitAbilityLevel(GetTriggerUnit(), ABIL_CODE_BUFF) > 0 then
            call RunFixed()
        endif
    endfunction
        
    private function Init takes nothing returns nothing
        call RegisterSpellEffectEvent(ABIL_CODE, function Run)
    endfunction
endlibrary
 

Attachments

  • Zephyr Contest #9 Assassination [-Kobas-].w3x
    49.6 KB · Views: 206
Level 25
Joined
Jun 5, 2008
Messages
2,572
Don't forget guys, the end date is moved because of the legendary fight ^^

Edit:

If i don't make more updates, consider this my final entry.
Future updates will be in this post, so this is the post containing my entry.



Kraken Shell

The assasin fires of a deadly shot aimed to kill a group of enemies quickly. The shell splits into chains upon impact draging nearby enemies towards the target.
Code:
JASS:
//***********************************************************************************************************
//***********************************************************************************************************
//*                     Kraken Shell v1.0 by Kingz                                                          *
//*     Made for Zephyr Contest #9 Assassination                                                            *
//*                                                                                                         *
//*     Used Libraries: TimerUtils,Dummy,RegisterAnyUnitEvent, DummyCast, TerrainPathability, World Bounds  *                                                                       *
//*                                                                                                         *
//***********************************************************************************************************
//***********************************************************************************************************

native UnitAlive takes unit u returns boolean

scope Spell initializer onInit

//***********************************************************************************************************
//*                             Configuration                                                               *
//***********************************************************************************************************

globals
    private constant    integer SPELL_ID    = 'A000'        // spell id, change if needed
    private constant    integer STUN_ID     = 'A001'        // dummy stun id
    private constant    integer CRIPPLE_ID  = 'A002'        // dummy cripple id
    private constant    string  MISSILE     = "Abilities\\Weapons\\BoatMissile\\BoatMissile.mdl"                // model of the actual missile
    private constant    string  HOOK        = "abilities\\weapons\\WyvernSpear\\WyvernSpearMissile.mdl"         // model of the chain piece
    private constant    string  BLEED_EFF   = "Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodPeasant.mdl"  // model of the drag effect
    
    private constant    integer CHAIN_COUNT = 4             // number of units pulled upon explosion
    private constant    real    AoE         = 420.00        // AoE within who are the units pulled, changing this means you need to alter MAX_H_COUNT
    private constant    real    ZOFFSET     = 65.00         // Flying height of the chain pieces
    
    private constant    integer MAX_H_COUNT = 20            // should be a division of AoE, preferably AoE/H_COLISION_SIZE or higher, has to be set up manually
    // max number of chain pieces, in case the target goes away too far from the chain it will retract

    // private constant    real    ELASTIC_FACTOR  = 0.45      // not implemented, yet.
    private constant    real    H_COLISION_SIZE = 32.00     // colision size of chain pieces, used for spacing between pieces
    private constant    real    MISSILE_SPEED   = 72.00     // missile speed
    
    
    private constant    real    COLISION_SIZE   = MISSILE_SPEED + 4.0     // CHANGE ONLY IF THE MISSILE IS MISSING THE TARGET
    //colision size of the unit, should be greater than move speed of the projectile
    
endglobals

//  function used to get damage based on spell level
private function GetHitDamage takes integer i returns real
    return 120.00 + 40*(i-1)
endfunction

// function used to get drag damage based on spell level
private function GetDragDamage takes integer i returns real
    return 60.00 + 20.00*(i-1)
endfunction

// function used to get distance between coords, makes the code easier to read
private  function GetDistance takes real x1, real x2, real y1, real y2 returns real
    return SquareRoot( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))
endfunction

//***********************************************************************************************************
//*                             End of configuration                                                        *
//***********************************************************************************************************

globals
    private             group   ENUM_GROUP = CreateGroup()  // group used for enumeration
    private constant    real    TIMEOUT         = 0.03      // timeout of 1 cycle of operations executed
endglobals


//***********************************************************************************************************
private struct chain

    unit            caster              // caster
    unit            target              // target
    unit    array   hook[MAX_H_COUNT]   // dummy array for chain pieces 
    effect  array   model[MAX_H_COUNT]  // effect array for dummy models
    real            rad                 // direction of the chain in radians
    real            x                   // starting x coordinate of the chain
    real            y                   // starting y coordinate of the chain
    real            dmg                 // damage the chain deals periodically
    boolean         retract             // if true, retract the chain
    boolean         hooked              // if true, deal damage
    integer         count               // counter, used for creating chain pieces with offset and chain movement

    // below is standard struct stuff used for looping through struct instances
    private integer loopIndex
        
    private static thistype array loopInstances
    private static integer loopInstancesCount=0
    private static timer LOOP_TIMER=CreateTimer()
    //***********************************************************************************************************
    
    
    // callback function, executed every TIMEOUT seconds, loops through loopInstancesCount struct instances
    private static method callback takes nothing returns nothing
    local integer i=loopInstancesCount-1
    local thistype this
        loop
            exitwhen i<0
            set this=loopInstances[i]
            
            // if retract is false, create more chain pieces, move then, increase count
            if not .retract then
            
                // increase the count of units, set the facing of the chain
                set .count = .count +1
                set .rad = Atan2( GetUnitY(.target) - .y  , GetUnitX(.target)- .x)
                
                // create the dummy at the needed X,Y,Z coordinates
                set .hook[.count] = Dummy.create(.x, .y, .rad*bj_RADTODEG).unit
                call SetUnitFlyHeight(.hook[.count], GetUnitFlyHeight(.caster)+ZOFFSET, 0.0)
                
                // create dummy model
                set .model[.count ] = AddSpecialEffectTarget(HOOK, .hook[.count], "origin")
                
                // set dummy coordinates
                call SetUnitX(.hook[.count], .x + H_COLISION_SIZE*.count * Cos(.rad))
                call SetUnitY(.hook[.count], .y + H_COLISION_SIZE*count * Sin(.rad))
                
                // check whether the chain did hit the target
                if GetDistance(GetUnitX(.hook[.count]), GetUnitX(.target), GetUnitY(.hook[.count]), GetUnitY(.target)) <= COLISION_SIZE then
                    set .hooked = true      
                    set .retract = true 
                    set .dmg = .dmg / (.count+1)    // redistribute damage to every count instance to make sure exact damage is dealt
                endif
                
                //  secondary evaluation, checks whether the chain failled to get to the target
                if .count >= MAX_H_COUNT or .target==null then
                    set .retract = true
                endif
            else
                // the chain is retracting
                
                // if the target was hit move the target, apply damage, create drag effect
                if .target!= null and .hooked then
                    // if the terrain is walkable, move target
                    if IsTerrainWalkable(GetUnitX(.hook[.count]),GetUnitY(.hook[.count])) then
                        call SetUnitX(.target, GetUnitX(.hook[.count]))
                        call SetUnitY(.target, GetUnitY(.hook[.count]))
                    endif
                    
                    // display drag effect
                    call DestroyEffect(AddSpecialEffectTarget(BLEED_EFF, .target, "chest"))
                    
                    // deal damage to target
                    call UnitDamageTarget(.caster, .target, .dmg, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
                endif
                
                // destroy the last chain piece, and it's model
                call Dummy[.hook[.count]].destroy()
                call DestroyEffect(.model[.count])
                set .model[.count] = null
                set .hook[.count]=null
                
                // decrease the count of existing pieces by 1
                set .count = .count -1
                
                // if the count below 0 is reached, all pieces are gonne, the chain has done it's thing and it's time to clean up
                if .count < 0 then
                
                    // apply dummy slow effect to target, if it was hit
                    if .target != null and .hooked then
                        call DummyCastTarget(.target, CRIPPLE_ID, "cripple")
                    endif
                    
                    // reset variables, destroy instance
                    set .count = 0
                    set .retract = false
                    set .hooked =false
                    set .target = null
                    call .destroy()
                endif
            endif
            
            set i=i-1
            endloop
    endmethod
    
    
    // handles the indexes and struct instances, pauses the timer when needed
    method destroy takes nothing returns nothing
        set loopInstancesCount=loopInstancesCount-1
        set loopInstances[loopIndex]=loopInstances[loopInstancesCount]
        set loopInstances[loopIndex].loopIndex=loopIndex
        if loopInstancesCount==0 then
            call PauseTimer(LOOP_TIMER)
        endif
        call this.deallocate()
    endmethod
    
    
    // sets all the starting values, runs the chain effect
    static method run takes unit cast, real xorigin, real yorigin, unit targ2, real damage returns nothing
        local thistype this= thistype.allocate()
        set loopInstances[loopInstancesCount]=this
        set loopIndex=loopInstancesCount
        set .caster = cast
        set .target = targ2
        set .x = xorigin
        set .y = yorigin
        set .dmg = damage
        set .count = -1
        if loopInstancesCount==0 then
            call TimerStart(LOOP_TIMER, TIMEOUT, true, function thistype.callback)
        endif
        set loopInstancesCount=loopInstancesCount+1
    endmethod
    
endstruct
//***********************************************************************************************************


//***********************************************************************************************************
private struct spell

    unit            caster      // caster unit
    unit            target      // target unit
    unit            missile     // dummy unit
    effect          model       // model of the dummy
    integer         count       // ??
    real            dmg         // damage on impact
    real            dragDmg     // drag damage
    real            rad         // facing of the dummy
    real            x           // dummy x
    real            y           // dummy y
    
    // used for group filter
    private static thistype    tmp

    // below is standard struct stuff used for looping through struct instances
    private integer loopIndex
        
    private static thistype array loopInstances
    private static integer loopInstancesCount=0
    private static timer LOOP_TIMER=CreateTimer()
    //**********************************************************************************************************
    
    // group filter
    static method   FilterGroup takes nothing returns boolean
        local unit f = GetFilterUnit()  // filtering unit
        
        // the actual filter
        if IsUnitEnemy(f, GetOwningPlayer(thistype.tmp.caster)) and UnitAlive(f) and IsUnitType(f, UNIT_TYPE_STRUCTURE)==false and IsUnitType(f, UNIT_TYPE_MECHANICAL)==false and IsUnitType(f, UNIT_TYPE_FLYING)==false and thistype.tmp.count < CHAIN_COUNT and f!=thistype.tmp.target then
            // unit passed the filter, run chain effect
            call chain.run(thistype.tmp.caster, GetUnitX(thistype.tmp.target), GetUnitY(thistype.tmp.target), f, thistype.tmp.dragDmg)
            set thistype.tmp.count = thistype.tmp.count + 1
        endif
        
        // null the filter unit, return false always making no units added to the group
        set f = null
        return false
    endmethod
    
    
    // callback function, executed every TIMEOUT seconds, loops through loopInstancesCount struct instances
    private static method callback takes nothing returns nothing
    local integer i=loopInstancesCount-1
    local thistype this
        loop
            exitwhen i<0
            set this=loopInstances[i]
            
            //  missile movement adjustments
            set .rad = Atan2( GetUnitY(.target) - GetUnitY(.caster), GetUnitX(.target) - GetUnitX(.caster))
            set .x = .x + MISSILE_SPEED * Cos(.rad)
            set .y = .y + MISSILE_SPEED * Sin(.rad)
            call SetUnitX(.missile, .x)
            call SetUnitY(.missile, .y)
            
            // prevents the missile going outside map bounds
            if .x >= WorldBounds.maxX or .x <= WorldBounds.minX or .y >= WorldBounds.maxY or .y <= WorldBounds.minY then
                set .target = null
            endif
            
            // if the distance between the unit and the missile is less than unit's colision size or the target is null, run effect
            if GetDistance(.x, GetUnitX(.target), .y, GetUnitY(.target)) <= COLISION_SIZE or .target==null then
            
                // if the target exists, do the chain effect
                if .target!= null then
                    call UnitDamageTarget(.caster, .target, .dmg, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
                    set thistype.tmp = this
                    call GroupEnumUnitsInRange(ENUM_GROUP, GetUnitX(.target), GetUnitY(.target), AoE, function thistype.FilterGroup)
                    call DummyCastTarget(.target, STUN_ID, "thunderbolt")
                endif
                
                // destroys the dummy model, destroys the dummy instance, nulls the needed variables and destroys this spell instance
                call DestroyEffect(.model)
                call Dummy[.missile].destroy()
                set .caster = null
                set .target = null
                set .missile = null
                call .destroy()
                
            endif
            
            
            set i=i-1
            endloop
    endmethod
    
    
    // handles the indexes and struct instances, pauses the timer when needed
    method destroy takes nothing returns nothing
        set loopInstancesCount=loopInstancesCount-1
        set loopInstances[loopIndex]=loopInstances[loopInstancesCount]
        set loopInstances[loopIndex].loopIndex=loopIndex
        if loopInstancesCount==0 then
            call PauseTimer(LOOP_TIMER)
        endif
        call this.deallocate()
    endmethod
    
    // sets all the starting values, runs the spell
    static method run takes unit cast, unit targ returns nothing
        local thistype this= thistype.allocate()
        set loopInstances[loopInstancesCount]=this
        set loopIndex=loopInstancesCount
        set .caster = cast
        set .target = targ
        set .count = 0
        set .dmg = GetHitDamage(GetUnitAbilityLevel(cast, SPELL_ID))
        set .dragDmg = GetDragDamage(GetUnitAbilityLevel(cast, SPELL_ID))
        set .rad = Atan2( GetUnitY(.target) - GetUnitY(.caster), GetUnitX(.target) - GetUnitX(.caster))
        set .x = GetUnitX(.caster)
        set .y = GetUnitY(.caster)
        set .missile = Dummy.create(.x, .y, .rad*bj_RADTODEG).unit
        call SetUnitFlyHeight(.missile, GetUnitFlyHeight(.caster)+ZOFFSET, 0.0)
        set .model = AddSpecialEffectTarget(MISSILE, .missile, "origin")
        
        if loopInstancesCount==0 then
            call TimerStart(LOOP_TIMER, TIMEOUT, true, function thistype.callback)
        endif
        set loopInstancesCount=loopInstancesCount+1
    endmethod
    
endstruct
//***********************************************************************************************************

//***********************************************************************************************************
// condition for the spell to fire
private function runCheck takes nothing returns boolean
    if GetSpellAbilityId() == SPELL_ID then
        call spell.run(GetTriggerUnit(), GetSpellTargetUnit())
    endif
    return false
endfunction
//***********************************************************************************************************

//***********************************************************************************************************
// register the spell event, add the needed condition
private function onInit takes nothing returns nothing
    call RegisterAnyUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT, function runCheck, null)
endfunction
//***********************************************************************************************************

endscope
 

Attachments

  • Kraken Shell.w3x
    119.9 KB · Views: 421
Last edited:
Here is my submission.
Enjoy.;)

Teleports you in a very short distance, stunning enemies around the casting unit for a very short time and creating an illusion of anything close to it, resulting in the effected unit(s) attacking a random one within 130 range of it. Also takes a slight amount of damage.
Level 1 - 30 damage, 160 AOE and 300 range.
Cost 80 mana, 4.00 seconds cooldown.
Level 2 - 65 damage, 200 AOE and 425 range.
Cost 55 mana, 3.25 seconds cooldown.
Level 3 - 100 damage, 240 AOE and 550 range.
Cost 30 mana, 2.50 seconds cooldown.
  • Starts Effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spasm
    • Actions
      • -------- Sets up a Point so it doesn't leak --------
      • Set Point = (Target point of ability being cast)
      • -------- Adds the casting units owner to a group that will take effect in the trigger 'Transparency' --------
      • Player Group - Add (Triggering player) to CastingPlayers
      • -------- Setting this variable up will allow more efficient and easy use for multiple uses in this strait forward trigger. --------
      • Set IntegerSetup = (Player number of (Triggering player))
      • -------- Sets up a unit group variable for use of transparency(special effect) --------
      • Set EffectedUnits[IntegerSetup] = (Units within (((Real((Level of Spasm for (Triggering unit)))) x 40.00) + 120.00) of Point matching ((Owner of (Matching unit)) Not equal to (Triggering player)))
      • -------- Resets addition --------
      • -------- From use in the trigger 'Transparency'. --------
      • Set Addition[IntegerSetup] = True
      • -------- Turns on the trigger Transparency for use(Note: Read Transparency Trigger trigger comment) --------
      • Trigger - Turn on Transparency <gen>
      • -------- Removes the set up leek --------
      • Custom script: call RemoveLocation(udg_Point)
Due to the dummy spell(Thunder Clap) I am using for this trigger
it has a .33 second (or close enough to) time to actualy cast fully
the whole spell makes me have resort to having to dalay the whole
spell to take .33 seconds to cast(which worker out well in the end
anyway.

Anyway for this to actualy work I needed to be able to create a
dummy unit that uses the edited spell of Thunder Clap right away
at the targeted area when you use the whole spell 'Spasm'.
  • Create Dummy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Spasm
    • Actions
      • -------- Read Trigger Comment --------
      • Set Point = (Target point of ability being cast)
      • Unit - Create 1 Slow Dummy for (Triggering player) at Point facing 0.00 degrees
      • Unit - Set level of Spell Slow/Stun for (Last created unit) to (Level of Spasm for (Triggering unit))
      • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
      • Custom script: call RemoveLocation(udg_Point)
      • -------- Read Trigger Comment --------
      • -------- This will queue how many times this spell is currently being used at once. --------
      • Set DummyUses = (DummyUses + 1)
      • Trigger - Turn on Remove Dummy <gen>
This spell was made to be able to turn off when finished
so that when it isn't needed it won't clash and take any
efficiency when a unit finishes casting a spell.

In other words if this trigger isn't to be turned of in a
real map with lots of spell able to be used, every time
one of those spells finishes casting this spell will be
pointlesely triggering taking up meaningless processing.
'Initially off'
  • Remove Dummy
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spell Slow/Stun
    • Actions
      • Unit - Remove (Triggering unit) from the game
      • Set DummyUses = (DummyUses - 1)
      • -------- Read Trigger Comment --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DummyUses Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
I have figured a formula out myself so that a looping trigger like this one
will not be kept on(turned off) when it is not being used for MUI triggers.
This is made for only one unit at a time for each player to have this spell available!
Don't realy remember ever seeing it used by someone else.
----
It uses a basic function of when the trigger triggers a boolean
is set to False(/True).

If conditions are met with a player or unit
still being in play of using this trigger the boolean will be set to
True(/False).

If no other players/units are triggering
this trigger the boolean will be left as False(/True)

If the trigger is met as being useless it will be turned off.
In this case it will check if the set boolean is False(/True)
and if it is False(/True) the triggering trigger will be
turned off.
-----------------------------------------
Set OnCheck = False
-
if - Conditions
Main Trigger conditions function
Then - Actions
Set OnCheck = True
-
If - Conditions
OnCheck Equal to False
Then - Actions
Trigger - Turn off (This trigger)
-----------------------------------------
'Initially off'
  • Transparency
    • Events
      • Time - Every 0.12 seconds of game time
    • Conditions
    • Actions
      • -------- 'Check Trigger Comment' --------
      • Set OnCheck = False
      • Player Group - Pick every player in CastingPlayers and do (Actions)
        • Loop - Actions
          • Set OnCheck = True
          • Set IntegerSetup = (Player number of (Picked player))
          • -------- Needs to add to itself to gain transparecy --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Addition[IntegerSetup] Equal to True
            • Then - Actions
              • Set Transparency[IntegerSetup] = (Transparency[IntegerSetup] + 11.11)
              • -------- This is the next action taken when the effected units hit max transparency and from when the start changing to be visible again. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Transparency[IntegerSetup] Equal to 111.10
                • Then - Actions
                  • Set Addition[IntegerSetup] = False
                  • Set Transparency[IntegerSetup] = (Transparency[IntegerSetup] - 11.11)
                  • -------- This is when all the targeted units are ordered to attack random ones. --------
                  • Unit Group - Pick every unit in EffectedUnits[IntegerSetup] and do (Actions)
                    • Loop - Actions
                      • Set Point = (Position of (Picked unit))
                      • Custom script: set bj_wantDestroyGroup = true
                      • -------- Considering how messed up this function can be I have made it so that the effected units attack random units that arn't owned by the owner of the casting units --------
                      • -------- Even though the effected units arn't ordered to attack the units owned by the casting unit they will still get targeted in the end. --------
                      • Unit - Order (Picked unit) to Attack (Random unit from (Units within 140.00 of Point matching ((Owner of (Matching unit)) Not equal to (Picked player))))
                      • Custom script: call RemoveLocation(udg_Point)
                • Else - Actions
            • Else - Actions
              • -------- When the variable 'Addition' is set to false the effected units regain thier transparency --------
              • Set Transparency[IntegerSetup] = (Transparency[IntegerSetup] - 11.11)
              • -------- This is when the spell is finished --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Transparency[IntegerSetup] Equal to 0.00
                • Then - Actions
                  • Player Group - Remove (Picked player) from CastingPlayers
                  • Custom script: call DestroyGroup(udg_EffectedUnits[udg_IntegerSetup])
                • Else - Actions
              • -------- -- --------
          • -------- This is where all the units in the targeted area gains an over time transparence --------
          • Unit Group - Pick every unit in EffectedUnits[IntegerSetup] and do (Actions)
            • Loop - Actions
              • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with Transparency[IntegerSetup]% transparency
      • -------- This functions when the trigger is no longer being used. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • OnCheck Equal to False
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 

Attachments

  • ScrSt1.jpg
    ScrSt1.jpg
    158.8 KB · Views: 63
  • ScrSt2.jpg
    ScrSt2.jpg
    166.2 KB · Views: 105
  • ScrSt3.jpg
    ScrSt3.jpg
    161.1 KB · Views: 79
  • ScrSt4.jpg
    ScrSt4.jpg
    141 KB · Views: 95
  • ScrSt5.jpg
    ScrSt5.jpg
    140.7 KB · Views: 96
  • ScrSt6.jpg
    ScrSt6.jpg
    169.1 KB · Views: 80
  • ScrSt7.jpg
    ScrSt7.jpg
    158.9 KB · Views: 82
  • DeathChef[Spasm,Spell].1.w3x
    47.9 KB · Views: 204
Last edited:
Level 17
Joined
Jun 17, 2010
Messages
2,275
Final Entry [If I do not edit it]

Deceive
Background
This Spell is a representation of what i believe makes an Assassin an Assassin. His/her ability to deceive the enemy to get close enough to make the killing blow. The best Assassin is the one you least expect, one of your own. That is what my ability portrays, Disguising oneself as the enemy to take down your target.​
[r] [c]
  • Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ------------------------------------------------------------------------------ --------
      • -------- Creates a Hashtable and sets a variable to it --------
      • -------- ------------------------------------------------------------------------------ --------
      • Hashtable - Create a hashtable
      • Set Deceive_HashTable = (Last created hashtable)
      • -------- ------------------------------------------------------------------------------ --------
  • Deceive
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacking unit) has buff Decieve ) Equal to True
          • ((Triggering unit) is A Hero) Equal to False
          • (Level of (Triggering unit)) Less than 5
          • ((Triggering unit) is Mechanical) Equal to False
        • Then - Actions
          • -------- -------------------------------------------------------------------- --------
          • -------- After the spell is cast, and a unit is attacked. --------
          • -------- -------------------------------------------------------------------- --------
          • -------- Setting the Point for the Dummy Unit --------
          • Set Guise_Controller_Point = (Position of (Triggering unit))
          • -------- Creating a dummy unit and changing its speed so it doesn't lose pace with the target --------
          • Unit - Create 1 Unit Controller for (Owner of (Attacking unit)) at Guise_Controller_Point facing Default building facing degrees
          • Unit - Set (Last created unit) movement speed to (Default movement speed of (Triggering unit))
          • -------- Removing the Assassin and selecting the dummy unit --------
          • Unit - Remove (Attacking unit) from the game
          • Selection - Add (Last created unit) to selection
          • -------- Custom script that retreives the handle of the dummy unit created --------
          • Custom script: set udg_Deceive_Key = GetHandleId(bj_lastCreatedUnit)
          • -------- The dummy unit being added to the group, and then selected, and set to a variable. --------
          • Unit Group - Add (Last created unit) to Deceive_DummyGroup
          • Unit Group - Pick every unit in Deceive_DummyGroup and do (Actions)
            • Loop - Actions
              • Set Deceive_Dummy = (Picked unit)
          • -------- Saving the target unit for later use --------
          • Hashtable - Save Handle Of(Triggering unit) as 0 of Deceive_Key in Deceive_HashTable
          • -------- Cleaning up the Location Leak --------
          • Custom script: call RemoveLocation(udg_Guise_Controller_Point)
          • -------- -------------------------------------------------------------------- --------
          • -------- -------------------------------------------------------------------- --------
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Attacking unit) Equal to Deceive_Dummy
            • Then - Actions
              • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
              • -------- After attacking an enemy with the Dummy Unit, this will order the Target Unit to attack aswell as stopping the Dummy Unit from doing any damage --------
              • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
              • -------- The Stop Order to the Dummy Unit --------
              • Unit - Order (Attacking unit) to Stop
              • -------- The Attack order to the Target Unit --------
              • Unit - Order (Load 0 of Deceive_Key in Deceive_HashTable) to Attack (Triggering unit)
              • -------- A Boolean to ensure the attack command was made by the caster of Deceive, and not of the command from the enemy --------
              • Hashtable - Save True as 1 of Deceive_Key in Deceive_HashTable
              • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
              • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Attacking unit) Equal to (Load 0 of Deceive_Key in Deceive_HashTable)
                  • (Load 1 of Deceive_Key from Deceive_HashTable) Equal to True
                • Then - Actions
                  • -------- -------------------------------------------------------------------------------- --------
                  • -------- The damage calculations to the Assassinated unit. --------
                  • -------- -------------------------------------------------------------------------------- --------
                  • -------- Setting a Temporary Location, and the facing angles of the two units. --------
                  • Set Deceive_Temploc2 = (Position of (Attacking unit))
                  • Set Assassinate_AngleOfAttack = (Facing of (Attacking unit))
                  • -------- Checking if the unit is facing away from the other unit --------
                  • Set Assassinate_AngleOfAttacked = (Facing of (Triggering unit))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Assassinate_AngleOfAttacked - Assassinate_AngleOfAttack) Less than or equal to 90.00
                          • (Assassinate_AngleOfAttacked - Assassinate_AngleOfAttack) Greater than or equal to 270.00
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Triggering unit) is A Hero) Equal to True
                        • Then - Actions
                          • -------- Edit Full damage to heroes --------
                          • Unit - Cause Deceive_Dummy to damage (Triggering unit), dealing 300.00 damage of attack type Normal and damage type Normal
                        • Else - Actions
                          • -------- Edit Kill or Full Damage to units --------
                          • Unit - Kill (Triggering unit)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Triggering unit) is A Hero) Equal to True
                        • Then - Actions
                          • -------- Edit Half Damage to heroes --------
                          • Unit - Cause Deceive_Dummy to damage (Triggering unit), dealing 100.00 damage of attack type Normal and damage type Normal
                        • Else - Actions
                          • -------- Edit Half Damage to units --------
                          • Unit - Cause Deceive_Dummy to damage (Triggering unit), dealing 300.00 damage of attack type Normal and damage type Normal
                  • -------- ---------------------------------------------------- --------
                  • -------- The Assassin returns to the map --------
                  • -------- ---------------------------------------------------- --------
                  • Unit - Create 1 Assassin for (Owner of Deceive_Dummy) at Deceive_Temploc2 facing Default building facing degrees
                  • Unit - Remove (Attacking unit) from the game
                  • Unit - Remove Deceive_Dummy from the game
                  • Unit - Remove Deceive from (Last created unit)
                  • -------- Adding a Dummy Spell --------
                  • Unit - Add Deceive [Unuseable] to (Last created unit)
                  • Hashtable - Save Handle Of(Last created unit) as 2 of Deceive_Key in Deceive_HashTable
                  • -------- Edit Duration of Out Of Combat timer --------
                  • Set Deceive_OutOfCombat = 5.00
                  • Hashtable - Save Deceive_OutOfCombat as 3 of Deceive_Key in Deceive_HashTable
                  • Trigger - Turn on Out Of Combat Timer <gen>
                  • -------- Cleaning up Location Leaks --------
                  • Custom script: call RemoveLocation(udg_Deceive_Temploc2)
                  • -------- ---------------------------------------------------- --------
                  • -------- ---------------------------------------------------- --------
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Triggering unit) Equal to (Load 2 of Deceive_Key in Deceive_HashTable)
                    • Then - Actions
                      • -------- ------------------------------------------------------------------------------ --------
                      • -------- Reseting the Out Of Combat Timer when attacked --------
                      • -------- ------------------------------------------------------------------------------ --------
                      • -------- Edit Duration of Out Of Combat Reset --------
                      • Set Deceive_OutOfCombat = 5.00
                      • Hashtable - Save Deceive_OutOfCombat as 3 of Deceive_Key in Deceive_HashTable
                      • -------- ------------------------------------------------------------------------------ --------
                      • -------- ------------------------------------------------------------------------------ --------
                    • Else - Actions
  • Out Of Combat Timer
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------- --------
      • -------- The timer for the Assassin to be able to cast Deceive again --------
      • -------- --------------------------------------------------------------------------------------------- --------
      • Set Deceive_OutOfCombat = (Load 3 of Deceive_Key from Deceive_HashTable)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Deceive_OutOfCombat Greater than 0.00
        • Then - Actions
          • -------- Counting down on the timer --------
          • Hashtable - Save (Deceive_OutOfCombat - 0.03) as 3 of Deceive_Key in Deceive_HashTable
        • Else - Actions
          • -------- Replacing the Dummy Spell with the Real Spell --------
          • Unit - Remove Deceive [Unuseable] from (Load 2 of Deceive_Key in Deceive_HashTable)
          • Unit - Add Deceive to (Load 2 of Deceive_Key in Deceive_HashTable)
      • -------- --------------------------------------------------------------------------------------------- --------
      • -------- --------------------------------------------------------------------------------------------- --------
  • Controller Move
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Triggering unit) Equal to Deceive_Dummy
    • Actions
      • -------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- When you select to move with the Dummy Unit this trigger orders the Target Unit to move to that same spot --------
      • -------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- A Temporary location is set so that it does not leak --------
      • Set Deceive_Temploc = (Target point of issued order)
      • -------- Ordering the Target Unit defined in the hashtable to move to the location moved to by the Dummy Unit --------
      • Unit - Order (Load 0 of Deceive_Key in Deceive_HashTable) to Move To Deceive_Temploc
      • -------- Cleaning up the Location Leak --------
      • Custom script: call RemoveLocation(udg_Deceive_Temploc)
      • -------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
[c]

Credits to: Defskull and spartipilo for helping me out with Hashtables, Thanks!
 

Attachments

  • Zephyr Contest #9 Deceive - InfinateAnswers.w3x
    35.2 KB · Views: 216
Last edited:
Level 16
Joined
Apr 4, 2011
Messages
995
Deceive
Background
This Spell is a representation of what i believe makes an Assassin an Assassin. His/her ability to deceive the enemy to get close enough to make the killing blow. The best Assassin is the one you least expect, one of your own. That is what my ability portrays, Disguising oneself as the enemy to take down your target.
  • Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ------------------------------------------------------------------------------ --------
      • -------- Creates a Hashtable and sets a variable to it --------
      • -------- ------------------------------------------------------------------------------ --------
      • Hashtable - Create a hashtable
      • Set Deceive_HashTable = (Last created hashtable)
      • -------- ------------------------------------------------------------------------------ --------
  • Deceive Break
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has buff Decieve ) Equal to True
      • ((Triggering unit) is A Hero) Equal to False
      • (Level of (Triggering unit)) Less than 5
      • ((Triggering unit) is Mechanical) Equal to False
    • Actions
      • -------- -------------------------------------------------------------------- --------
      • -------- After the spell is cast, and a unit is attacked. --------
      • -------- -------------------------------------------------------------------- --------
      • -------- Setting the Point for the Dummy Unit --------
      • Set Guise_Controller_Point = (Position of (Triggering unit))
      • -------- Creating a dummy unit and changing its speed so it doesn't lose pace with the target --------
      • Unit - Create 1 Unit Controller for (Owner of (Attacking unit)) at Guise_Controller_Point facing Default building facing degrees
      • Unit - Set (Last created unit) movement speed to (Default movement speed of (Triggering unit))
      • -------- Removing the Assassin and selecting the dummy unit --------
      • Unit - Remove (Attacking unit) from the game
      • Selection - Add (Last created unit) to selection
      • -------- Custom script that retreives the handle of the dummy unit created --------
      • Custom script: set udg_Deceive_Key = GetHandleId(bj_lastCreatedUnit)
      • -------- The dummy unit being added to the group, and then selected, and set to a variable. --------
      • Unit Group - Add (Last created unit) to Deceive_DummyGroup
      • Unit Group - Pick every unit in Deceive_DummyGroup and do (Actions)
        • Loop - Actions
          • Set Deceive_Dummy = (Picked unit)
      • -------- Saving the target unit for later use --------
      • Hashtable - Save Handle Of(Triggering unit) as 0 of Deceive_Key in Deceive_HashTable
      • -------- Cleaning up the Location Leak --------
      • Custom script: call RemoveLocation(udg_Guise_Controller_Point)
      • -------- -------------------------------------------------------------------- --------
      • -------- -------------------------------------------------------------------- --------
  • Controller Move
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Triggering unit) Equal to Deceive_Dummy
    • Actions
      • -------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- When you select to move with the Dummy Unit this trigger orders the Target Unit to move to that same spot --------
      • -------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- A Temporary location is set so that it does not leak --------
      • Set Deceive_Temploc = (Target point of issued order)
      • -------- Ordering the Target Unit defined in the hashtable to move to the location moved to by the Dummy Unit --------
      • Unit - Order (Load 0 of Deceive_Key in Deceive_HashTable) to Move To Deceive_Temploc
      • -------- Cleaning up the Location Leak --------
      • Custom script: call RemoveLocation(udg_Deceive_Temploc)
      • -------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
  • Assassinate Cast
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to Deceive_Dummy
    • Actions
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- After attacking an enemy with the Dummy Unit, this will order the Target Unit to attack aswell as stopping the Dummy Unit from doing any damage --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- The Stop Order to the Dummy Unit --------
      • Unit - Order (Attacking unit) to Stop
      • -------- The Attack order to the Target Unit --------
      • Unit - Order (Load 0 of Deceive_Key in Deceive_HashTable) to Attack (Triggering unit)
      • -------- A Boolean to ensure the attack command was made by the caster of Deceive, and not of the command from the enemy --------
      • Hashtable - Save True as 1 of Deceive_Key in Deceive_HashTable
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
  • Assassinate Damage
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to (Load 0 of Deceive_Key in Deceive_HashTable)
      • (Load 1 of Deceive_Key from Deceive_HashTable) Equal to True
    • Actions
      • -------- -------------------------------------------------------------------------------- --------
      • -------- The damage calculations to the Assassinated unit. --------
      • -------- -------------------------------------------------------------------------------- --------
      • -------- Setting a Temporary Location, and the facing angles of the two units. --------
      • Set Deceive_Temploc2 = (Position of (Attacking unit))
      • Set Assassinate_AngleOfAttack = (Facing of (Attacking unit))
      • Set Assassinate_AngleOfAttacked = (Facing of (Triggering unit))
      • -------- Checking if the unit is facing away from the other unit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Assassinate_AngleOfAttacked - Assassinate_AngleOfAttack) Less than or equal to 90.00
              • (Assassinate_AngleOfAttacked - Assassinate_AngleOfAttack) Greater than or equal to 270.00
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is A Hero) Equal to True
            • Then - Actions
              • -------- Edit Full damage to heroes --------
              • Unit - Cause Deceive_Dummy to damage (Triggering unit), dealing 300.00 damage of attack type Normal and damage type Normal
            • Else - Actions
              • -------- Edit Kill or Full Damage to units --------
              • Unit - Kill (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is A Hero) Equal to True
            • Then - Actions
              • -------- Edit Half Damage to heroes --------
              • Unit - Cause Deceive_Dummy to damage (Triggering unit), dealing 100.00 damage of attack type Normal and damage type Normal
            • Else - Actions
              • -------- Edit Half Damage to units --------
              • Unit - Cause Deceive_Dummy to damage (Triggering unit), dealing 300.00 damage of attack type Normal and damage type Normal
      • -------- ---------------------------------------------------- --------
      • -------- The Assassin returns to the map --------
      • -------- ---------------------------------------------------- --------
      • Unit - Create 1 Assassin for (Owner of Deceive_Dummy) at Deceive_Temploc2 facing Default building facing degrees
      • Unit - Remove (Attacking unit) from the game
      • Unit - Remove Deceive_Dummy from the game
      • Unit - Remove Deceive from (Last created unit)
      • -------- Adding a Dummy Spell --------
      • Unit - Add Deceive [Unuseable] to (Last created unit)
      • Hashtable - Save Handle Of(Last created unit) as 2 of Deceive_Key in Deceive_HashTable
      • -------- Edit Duration of Out Of Combat timer --------
      • Set Deceive_OutOfCombat = 5.00
      • Hashtable - Save Deceive_OutOfCombat as 3 of Deceive_Key in Deceive_HashTable
      • Trigger - Turn on Out Of Combat Timer <gen>
      • -------- Cleaning up Location Leaks --------
      • Custom script: call RemoveLocation(udg_Deceive_Temploc2)
      • -------- ---------------------------------------------------- --------
      • -------- ---------------------------------------------------- --------
  • Out Of Combat Timer
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------- --------
      • -------- The timer for the Assassin to be able to cast Deceive again --------
      • -------- --------------------------------------------------------------------------------------------- --------
      • Set Deceive_OutOfCombat = (Load 3 of Deceive_Key from Deceive_HashTable)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Deceive_OutOfCombat Greater than 0.00
        • Then - Actions
          • -------- Counting down on the timer --------
          • Hashtable - Save (Deceive_OutOfCombat - 0.03) as 3 of Deceive_Key in Deceive_HashTable
        • Else - Actions
          • -------- Replacing the Dummy Spell with the Real Spell --------
          • Unit - Remove Deceive [Unuseable] from (Load 2 of Deceive_Key in Deceive_HashTable)
          • Unit - Add Deceive to (Load 2 of Deceive_Key in Deceive_HashTable)
      • -------- --------------------------------------------------------------------------------------------- --------
      • -------- --------------------------------------------------------------------------------------------- --------
  • In Combat Reset
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Triggering unit) Equal to (Load 2 of Deceive_Key in Deceive_HashTable)
    • Actions
      • -------- ------------------------------------------------------------------------------ --------
      • -------- Reseting the Out Of Combat Timer when attacked --------
      • -------- ------------------------------------------------------------------------------ --------
      • -------- Edit Duration of Out Of Combat Reset --------
      • Set Deceive_OutOfCombat = 5.00
      • Hashtable - Save Deceive_OutOfCombat as 3 of Deceive_Key in Deceive_HashTable
      • -------- ------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------ --------

Credits to: Defskull and spartipilo for helping me out with Hashtables, Thanks!

Doing that actually makes reading your triggers so hard. I know you centered it, so use the align left button right for the triggers.
 
Status
Not open for further replies.
Top