HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

For every 10 kills do [Action]

09-04-2003, 10:14 AM#1
kl33r
Ok I have my triggers set up as :-

Events
Unit - A unit owned by Player 3 (Teal) Dies
Conditions
(Owner of (Killing unit)) Equal to Player 1 (Red)
Actions
Set KillsLV15[0] = (KillsLV15[0] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
++ If - Conditions
-- KillsLV15[0] Equal to 10
++ Then - Actions
-- Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) and do (Actions)
+ Loop - Actions
-- Hero - Modify Strength of (Picked unit): Add 2
-- Hero - Modify Agility of (Picked unit): Add 2
-- Hero - Modify Intelligence of (Picked unit): Add 2
-- Set KillsLV15[0] = 0
++ Else - Actions
Do nothing

I thought this should work... but for some reason it does not. I want for every 10 kills a player gets the trigger adds +2 to all stats of the player's hero. The initial value of the KillsLV15 variable is 0 Btw.

After adding +2 to all stats the variable KillsLV15 value is reset to 0, to allow the trigger to run again once the value hits 10
Any help?
09-04-2003, 10:23 AM#2
cideh
Every kill, set a killvariable to +1.

Then, after every kill, check if the killvariable equals to another integer variable * 10, if it is, then set the other integer variable to +1.

For example:

Trigger1
Event: A unit dies
Actions: Set Kills[Owner of (Killing unit)] = Kills[Owner of (Killing unit)] + 1
Trigger - Run (Trigger2) checking conditions

Trigger2
Condition: Kills[Owner of (Killing unit)] = (NextLevel[Owner of (Killing unit)] * 10)
Actions: Set NextLevel[Owner of (Killing unit)] = NextLevel[Owner of (Killing unit)] + 1
-- Unit Group - Pick every unit in (Units in (Playable map area) owned by Owner of (Killing unit)) and do (Actions)
+ Loop - Actions
-- Hero - Modify Strength of (Picked unit): Add 2
-- Hero - Modify Agility of (Picked unit): Add 2
-- Hero - Modify Intelligence of (Picked unit): Add 2
09-04-2003, 10:26 AM#3
kl33r
Thanks for the quick reply =)

I'm going to test it out now and modify it a bit
09-04-2003, 01:35 PM#4
kl33r
Well i tried your trigger, but it didn't work.. so i took it, modified a bit and mixed it with my previous trigger........ and it works! Thanks for your help
09-04-2003, 02:25 PM#5
cideh
Great :D