- Joined
- Apr 23, 2010
- Messages
- 312
I was wondering if there was any way to detect when a dummy kills a unit for it's caster, how would I then go about doing triggers for the casting unit?
I realize i'm not the best at making clean, efficient triggers so don't tell me how I can improve the triggers below, that's not what I'm asking help for.
I realize i'm not the best at making clean, efficient triggers so don't tell me how I can improve the triggers below, that's not what I'm asking help for.
-
V Setup
-
Events
- Map initialization
- Conditions
-
Actions
- -------- --------------------------------------------------------------------------------------------- --------
- -------- Set this to how many kills you want before a bonus is given! --------
- Set V_KillLimit = 3
- -------- --------------------------------------------------------------------------------------------- --------
- -------- Add units below that you don't want to have a ranking! --------
- Set V_BlockedUnit[1] = Knight
- Set V_BlockedUnit[2] = Mortar Team
- -------- Set this number to the total amount of units you are blocking! --------
- Set V_AmountBlockedUnits = 2
- -------- --------------------------------------------------------------------------------------------- --------
- Set V_Abilities[1] = Bear Form
- Set V_Abilities[2] = Berserker Upgrade
- Set V_Abilities[3] = Burrow (Crypt Fiend)
- Set V_Abilities[4] = Corporeal Form
- Set V_Abilities[5] = Crow Form
- Set V_Abilities[6] = Destroyer Form
- Set V_Abilities[7] = Metamorphosis
- Set V_Abilities[8] = Phoenix Morphing (Egg Related)
- Set V_Abilities[9] = Stone Form
- Set V_Abilities[10] = Storm Crow Form
- Set V_Abilities[11] = Submerge (Myrmidon)
- Set V_Abilities[12] = Submerge (Royal Guard)
- Set V_Abilities[13] = Submerge (Snap Dragon)
- Set V_AbilitiesAmount = 13
- Hashtable - Create a hashtable
- Set V_Hashtable = (Last created hashtable)
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A structure) Not equal to True)) and do (Actions)
-
Loop - Actions
- Set V_Unit = (Picked unit)
-
For each (Integer A) from 1 to V_AmountBlockedUnits, do (Actions)
-
Loop - Actions
- If ((Unit-type of V_Unit) Equal to V_BlockedUnit[(Integer A)]) then do (Skip remaining actions) else do (Do nothing)
-
Loop - Actions
- Set V_HashUnit = (Key (Picked unit))
- Hashtable - Save 0 as 0 of V_HashUnit in V_Hashtable
- Unit - Add Rank (Dummy) to V_Unit
- Unit - Add V_Damage Bonus to V_Unit
- Unit - Add V_Armor Bonus to V_Unit
-
Loop - Actions
-
Events
-
V Created Units
-
Events
- Unit - A unit enters (Playable map area)
- Conditions
-
Actions
- Set V_HashUnit = (Key (Triggering unit))
- Set V_Unit = (Triggering unit)
-
For each (Integer A) from 1 to V_AmountBlockedUnits, do (Actions)
-
Loop - Actions
- If (((Unit-type of V_Unit) Equal to V_BlockedUnit[(Integer A)]) or ((V_Unit is A structure) Equal to True)) then do (Skip remaining actions) else do (Do nothing)
-
Loop - Actions
- Hashtable - Save 0 as 0 of V_HashUnit in V_Hashtable
- Unit - Add Rank (Dummy) to V_Unit
- Unit - Add V_Damage Bonus to V_Unit
- Unit - Add V_Armor Bonus to V_Unit
-
Events
-
V Start Ability
-
Events
- Unit - A unit Begins casting an ability
- Conditions
-
Actions
-
For each (Integer A) from 1 to V_AbilitiesAmount, do (Actions)
-
Loop - Actions
- If ((Ability being cast) Equal to V_Abilities[(Integer A)]) then do (Do nothing) else do (Skip remaining actions)
- Set V_AbilityUnit = (Triggering unit)
- Set V_RankLevel = (Level of Rank (Dummy) for V_AbilityUnit)
-
Loop - Actions
-
For each (Integer A) from 1 to V_AbilitiesAmount, do (Actions)
-
Events
-
V End Ability
-
Events
- Unit - A unit Finishes casting an ability
- Conditions
-
Actions
-
For each (Integer A) from 1 to V_AbilitiesAmount, do (Actions)
-
Loop - Actions
- If ((Ability being cast) Equal to V_Abilities[(Integer A)]) then do (Do nothing) else do (Skip remaining actions)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Rank (Dummy) for V_AbilityUnit) Less than 1
-
Then - Actions
- Unit - Add Rank (Dummy) to V_AbilityUnit
- Unit - Set level of Rank (Dummy) for V_AbilityUnit to V_RankLevel
- Unit - Add V_Damage Bonus to V_AbilityUnit
- Unit - Set level of V_Armor Bonus for V_AbilityUnit to V_RankLevel
- Unit - Add V_Armor Bonus to V_AbilityUnit
- Unit - Set level of V_Damage Bonus for V_AbilityUnit to V_RankLevel
- If (V_RankLevel Greater than or equal to 5) then do (Unit - Add V_Level 5 to V_AbilityUnit) else do (Do nothing)
- If (V_RankLevel Greater than or equal to 10) then do (Unit - Add V_Level 10 to V_AbilityUnit) else do (Do nothing)
- If (V_RankLevel Equal to 15) then do (Unit - Add V_Level 15 to V_AbilityUnit) else do (Do nothing)
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
For each (Integer A) from 1 to V_AbilitiesAmount, do (Actions)
-
Events
-
V Record
-
Events
- Unit - A unit Dies
- Conditions
-
Actions
- Set V_Unit = (Triggering unit)
- Unit - Remove V_Level 5 from V_Unit
- Unit - Remove V_Level 10 from V_Unit
- Unit - Remove V_Level 15 from V_Unit
- Set V_Killer = (Killing unit)
- Set V_HashUnit = (Key (Killing unit))
- Set V_RankKills = ((Load 0 of V_HashUnit from V_Hashtable) + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- V_RankKills Equal to V_KillLimit
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Level of Rank (Dummy) for V_Killer) Greater than 0) and ((Level of Rank (Dummy) for V_Killer) Less than 15)
-
Then - Actions
- Unit - Increase level of Rank (Dummy) for V_Killer
- Unit - Increase level of V_Armor Bonus for V_Killer
- Unit - Increase level of V_Damage Bonus for V_Killer
- Special Effect - Create a special effect attached to the origin of V_Killer using Abilities\Spells\Items\AIre\AIreTarget.mdl
- Special Effect - Destroy (Last created special effect)
- If ((Level of Rank (Dummy) for V_Killer) Equal to 5) then do (Unit - Add V_Level 5 to V_Killer) else do (Do nothing)
- If ((Level of Rank (Dummy) for V_Killer) Equal to 10) then do (Unit - Add V_Level 10 to V_Killer) else do (Do nothing)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Rank (Dummy) for V_Killer) Equal to 15
-
Then - Actions
- Unit - Remove V_Level 10 from V_Killer
- Unit - Add V_Level 15 to V_Killer
- Else - Actions
-
If - Conditions
- Set V_RankKills = ((Load 0 of V_HashUnit from V_Hashtable) - V_KillLimit)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
- Hashtable - Save V_RankKills as 0 of V_HashUnit in V_Hashtable
-
Events