• 🏆 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!

Backtrack v1.1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: baassee
Idea taken from DotA. A DotA-like Backtrack, which gives a percentage chance to dodge a incoming damage, whether or not it is magical or physical.

Keywords:
Backtrack, Kuwagata
Contents

Backtrack v1.1 (Map)

Reviews
15:04, 16th Jun 2010 Hanky: Your spell is leaking and also to simple to get approved. Next time read the spell submission rules first please.

Moderator

M

Moderator

15:04, 16th Jun 2010
Hanky:
Your spell is leaking and also to simple to get approved. Next time read the spell submission rules first please.
 
Could you provide some triggers, please?

I'll do that for you...

  • Backtrack Setup
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Backtrack
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Backtrack for (Learning Hero)) Equal to 1
        • Then - Actions
          • Unit Group - Add (Learning Hero) to Backtrack_Grp
          • Trigger - Add to Backtrack <gen> the event (Unit - (Triggering unit) Takes damage)
        • Else - Actions
  • Backtrack
    • Events
    • Conditions
    • Actions
      • Set Temp_Int = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Temp_Int Less than or equal to (5 + (5 x (Level of Backtrack for (Triggering unit))))
              • ((Triggering unit) is in Backtrack_Grp) Equal to True
        • Then - Actions
          • Hero - Create Backtrack and give it to (Triggering unit)
        • Else - Actions
It seems to be working ingame.
 
Level 12
Joined
May 21, 2009
Messages
994
  • Backtrack Setup
    • Events
    • Unit - A unit Learns a skill
    • Conditions
    • (Learned Hero Skill) Equal to Backtrack
    • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Level of Backtrack for (Learning Hero)) Equal to 1
    • Then - Actions
    • Unit Group - Add (Learning Hero) to Backtrack_Grp
    • Trigger - Add to Backtrack <gen> the event (Unit - (Triggering unit) Takes damage)
    • Else - Actions
  • Backtrack
    • Events
    • Conditions
    • Actions
    • Set Temp_Int = (Random integer number between 1 and 100)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • And - All (Conditions) are true
    • Conditions
    • Temp_Int Less than or equal to (5 + (5 x (Level of Backtrack for (Triggering unit))))
    • ((Triggering unit) is in Backtrack_Grp) Equal to True
    • Then - Actions
    • Hero - Create Backtrack and give it to (Triggering unit)
    • Else - Actions
  • Unit Group - Add (Learning Hero) to Backtrack_Grp
LEAKS! :(
fixing with
  • call DestroyGroup(udg_Backtrack_Grp)
btw you dont even need the group ??
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Backtrack Setup
    • Events
    • Unit - A unit Learns a skill
    • Conditions
    • (Learned Hero Skill) Equal to Backtrack
    • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Level of Backtrack for (Learning Hero)) Equal to 1
    • Then - Actions
    • Unit Group - Add (Learning Hero) to Backtrack_Grp
    • Trigger - Add to Backtrack <gen> the event (Unit - (Triggering unit) Takes damage)
    • Else - Actions
  • Backtrack
    • Events
    • Conditions
    • Actions
    • Set Temp_Int = (Random integer number between 1 and 100)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • And - All (Conditions) are true
    • Conditions
    • Temp_Int Less than or equal to (5 + (5 x (Level of Backtrack for (Triggering unit))))
    • ((Triggering unit) is in Backtrack_Grp) Equal to True
    • Then - Actions
    • Hero - Create Backtrack and give it to (Triggering unit)
    • Else - Actions
  • Unit Group - Add (Learning Hero) to Backtrack_Grp
LEAKS! :(
fixing with
  • call DestroyGroup(udg_Backtrack_Grp)
btw you dont even need the group ??

If you destroy the group the trigger will malfunction, returning always false, thus it will never block the damage.
 
Level 13
Joined
May 10, 2009
Messages
868
JASS:
//============================================================================
// Native types. All native functions take extended handle types when
// possible to help prevent passing bad values to native functions
//
type event              extends     handle  // a reference to an event registration
type player             extends     handle  // a single player reference
type widget             extends     handle  // an interactive game object with life
type unit               extends     widget  // a single unit reference
type destructable       extends     widget
type item               extends     widget
type ability            extends     handle
type buff               extends     ability
type force              extends     handle
type group              extends     handle
type trigger            extends     handle
type triggercondition   extends     handle
type triggeraction      extends     handle
type timer              extends     handle
type location           extends     handle
type region             extends     handle
type rect               extends     handle
type boolexpr           extends     handle
type sound              extends     handle
type conditionfunc      extends     boolexpr
type filterfunc         extends     boolexpr
type unitpool           extends     handle
type itempool           extends     handle
type race               extends     handle
type alliancetype       extends     handle
type racepreference     extends     handle
type gamestate          extends     handle
type igamestate         extends     gamestate
type fgamestate         extends     gamestate
type playerstate        extends     handle
type playerscore        extends     handle
type playergameresult   extends     handle
type unitstate          extends     handle
type aidifficulty       extends     handle

type eventid            extends     handle
type gameevent          extends     eventid
type playerevent        extends     eventid
type playerunitevent    extends     eventid
type unitevent          extends     eventid
type limitop            extends     eventid
type widgetevent        extends     eventid
type dialogevent        extends     eventid
type unittype           extends     handle

type gamespeed          extends     handle
type gamedifficulty     extends     handle
type gametype           extends     handle
type mapflag            extends     handle
type mapvisibility      extends     handle
type mapsetting         extends     handle
type mapdensity         extends     handle
type mapcontrol         extends     handle
type playerslotstate    extends     handle
type volumegroup        extends     handle
type camerafield        extends     handle
type camerasetup        extends     handle
type playercolor        extends     handle
type placement          extends     handle
type startlocprio       extends     handle
type raritycontrol      extends     handle
type blendmode          extends     handle
type texmapflags        extends     handle
type effect             extends     handle
type effecttype         extends     handle
type weathereffect      extends     handle
type terraindeformation extends     handle
type fogstate           extends     handle
type fogmodifier        extends     handle
type dialog             extends     handle
type button             extends     handle
type quest              extends     handle
type questitem          extends     handle
type defeatcondition    extends     handle
type timerdialog        extends     handle
type leaderboard        extends     handle
type multiboard         extends     handle
type multiboarditem     extends     handle
type trackable          extends     handle
type gamecache          extends     handle
type version            extends     handle
type itemtype           extends     handle
type texttag            extends     handle
type attacktype         extends     handle
type damagetype         extends     handle
type weapontype         extends     handle
type soundtype          extends     handle
type lightning          extends     handle
type pathingtype        extends     handle
type image              extends     handle
type ubersplat          extends     handle

constant native ConvertRace                 takes integer i returns race
constant native ConvertAllianceType         takes integer i returns alliancetype
constant native ConvertRacePref             takes integer i returns racepreference
constant native ConvertIGameState           takes integer i returns igamestate
constant native ConvertFGameState           takes integer i returns fgamestate
constant native ConvertPlayerState          takes integer i returns playerstate
constant native ConvertPlayerScore          takes integer i returns playerscore
constant native ConvertPlayerGameResult     takes integer i returns playergameresult
constant native ConvertUnitState            takes integer i returns unitstate
constant native ConvertAIDifficulty         takes integer i returns aidifficulty
constant native ConvertGameEvent            takes integer i returns gameevent
constant native ConvertPlayerEvent          takes integer i returns playerevent
constant native ConvertPlayerUnitEvent      takes integer i returns playerunitevent
constant native ConvertWidgetEvent          takes integer i returns widgetevent
constant native ConvertDialogEvent          takes integer i returns dialogevent
constant native ConvertUnitEvent            takes integer i returns unitevent
constant native ConvertLimitOp              takes integer i returns limitop
constant native ConvertUnitType             takes integer i returns unittype
constant native ConvertGameSpeed            takes integer i returns gamespeed
constant native ConvertPlacement            takes integer i returns placement
constant native ConvertStartLocPrio         takes integer i returns startlocprio
constant native ConvertGameDifficulty       takes integer i returns gamedifficulty
constant native ConvertGameType             takes integer i returns gametype
constant native ConvertMapFlag              takes integer i returns mapflag
constant native ConvertMapVisibility        takes integer i returns mapvisibility
constant native ConvertMapSetting           takes integer i returns mapsetting
constant native ConvertMapDensity           takes integer i returns mapdensity
constant native ConvertMapControl           takes integer i returns mapcontrol
constant native ConvertPlayerColor          takes integer i returns playercolor
constant native ConvertPlayerSlotState      takes integer i returns playerslotstate
constant native ConvertVolumeGroup          takes integer i returns volumegroup
constant native ConvertCameraField          takes integer i returns camerafield
constant native ConvertBlendMode            takes integer i returns blendmode
constant native ConvertRarityControl        takes integer i returns raritycontrol
constant native ConvertTexMapFlags          takes integer i returns texmapflags
constant native ConvertFogState             takes integer i returns fogstate
constant native ConvertEffectType           takes integer i returns effecttype
constant native ConvertVersion              takes integer i returns version
constant native ConvertItemType             takes integer i returns itemtype
constant native ConvertAttackType           takes integer i returns attacktype
constant native ConvertDamageType           takes integer i returns damagetype
constant native ConvertWeaponType           takes integer i returns weapontype
constant native ConvertSoundType            takes integer i returns soundtype
constant native ConvertPathingType          takes integer i returns pathingtype

constant native OrderId                     takes string  orderIdString     returns integer
constant native OrderId2String              takes integer orderId           returns string
constant native UnitId                      takes string  unitIdString      returns integer
constant native UnitId2String               takes integer unitId            returns string

// Not currently working correctly...
constant native AbilityId                   takes string  abilityIdString   returns integer
constant native AbilityId2String            takes integer abilityId         returns string

// Looks up the "name" field for any object (unit, item, ability)
constant native GetObjectName               takes integer objectId          returns string
 
Last edited:
Level 2
Joined
Nov 24, 2008
Messages
25
Instead of
Hero - Create Backtrack and give it to (Triggering unit)
(gives an item that uses itself giving You 0.01 sec invul)
it's better to just fix it using
Unit - Set life of (Triggering unit) to ((life of (Triggering unit)) + Damage Taken).
More like it's made in DotA.

Unit - Set life of (Triggering unit) to ((life of (Triggering unit)) + (Damage Taken x (Level of Backtrack for (Triggering unit)))
^ This way when Backtrack proceeds, You will be healed for 1/2/3/4 times of the damage You took.

Yeah, I know You guys know it :[.
 
Last edited:
Level 10
Joined
May 27, 2009
Messages
494
Baldoro you have a point :]

so if a unit is attacked, it would be healed up instead of evading it.

Eh what if the damage makes the unit dies? could it be healed up? especially when used in Kill systems.

and in some circumstances about the invulnerability, there are times that damage first before invulnerability takes place. But its within 2% :D

anyways, working in game
 
Top