i need help with 2 problems my map is an hero arena.
the first one is a triger that prevent allies attack allies.
the second is to detect living units in team 1 to make duel end.
look my idea but dont work i nedd help to fix it or try another way to do it.
the end of duel Events Time - Every 5.00 seconds of game time Conditions bDuel Equal to True Actions For each (Integer A) from 1 to 5, do (If ((Number of living (Unit-type of Heroes[(Integer A)]) units owned by (Owner of Heroes[(Integer A)])) Equal to 0) then do (Trigger - Run End Duel team2 <gen> (checking conditions)) else do (Do nothing)) For each (Integer A) from 6 to 10, do (If ((Number of living (Unit-type of Heroes[(Integer A)]) units owned by (Owner of Heroes[(Integer A)])) Equal to 0) then do (Trigger - Run End Duel team 1 <gen> (checking conditions)) else do (Do nothing))
1) Just make a dummy with a polymorph based ability that costs 0 mana that can target enemies and allies. also give the dummy -1 hp regen and 1(2) hp.
Events: Unit is attacked Conditions: -------- Actions: If: owner of attacking unit is an allie of owner of attacked unit Then: Create 1 polymorph dummy at position of attacking unit Order last created unit to human sorceress - polymorph attacking unit Else: Do Nothing
PS: Make sure u base the spell off the sorc polymorph and not the neutral hostile, else it doesnt work
2)
For each (Integer A) from 1 to 5, do (If ((Number of living (Unit-type of Heroes[(Integer A)]) units owned by (Owner of Heroes[(Integer A)])) Equal to 0) then do (Trigger - Run End Duel team2 <gen> (checking conditions)) else do (Do nothing)) For each (Integer A) from 6 to 10, do (If ((Number of living (Unit-type of Heroes[(Integer A)]) units owned by (Owner of Heroes[(Integer A)])) Equal to 0) then do (Trigger - Run End Duel team 1 <gen> (checking conditions)) else do (Do nothing))
.... No ..... U dont need 2 do it that complicated Events: Unit dies Contitions: -------- Actions: If: and conditions: Dying unit = owned by player 1 integer comparison - number of units owned by player 1 in Rect (a rect that covers the arena) = o Then: *end the duel* Else: Do Nothing
Then: Unit dies. If unit is in a playergroup1 (playergruop type variable) (in map ini set all players form a team in that variable) if number of units in playergroup is 0 then......
hey man you can explain it with more details ?? i tried this but dont worked
the end of duel Events Unit - A unit Dies Conditions bDuel Equal to True ((Triggering unit) is A Hero) Equal to True Actions If ((Owner of (Dying unit)) Equal to (Random player from Team1)) then do (Unit Group - Add (Dying unit) to Team1deadheroes) else do (Do nothing) If ((Owner of (Dying unit)) Equal to (Random player from Team2)) then do (Unit Group - Add (Dying unit) to Team2deadheroes) else do (Do nothing) If ((Number of units in Team1deadheroes) Equal to (Number of units in Team1Heroes)) then do (Trigger - run End Duel team2 <gen>) else do (Do nothing) If ((Number of units in Team2deadheroes) Equal to (Number of units in Team2Heroes)) then do (Trigger - run End Duel team 1 <gen>) else do (Do nothing)
Why do u add players to a playergroup in that trigger when they die??? U should add players to the player group in another trigger in map initilization.
Whats this for bullcr*p => If ((Number of units in Team1deadheroes) Equal to (Number of units in Team1Heroes))
The number in 'team1deadheroes' is ALWAYS equal to the number of 'team1deadheroes'
I dont get what u r trying. Just do precisely as what I told u 2 or 3 post back