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

Swords and Scepters v. 2.44

  • Like
Reactions: FeikVizeege
Swords and Scepters (SaS for short) is an AoS map with only one large lane and stronger creep waves. Players need to focus on pushing instead of farming or hero-killing. SaS is specialized on variety of selections for class and skill.


-----------------------------
This map included a lot of issues such as models, icons, and codes that are all resourced in The Hive Workshop. The map creator will definitely credit the resource owners later in the next versions.
-----------------------------


:: General Information ::

- 29 types of custom Classes (different models used for the opposite team).
- 8 choices of selectable skill for each class.
- 2 choices of selectable ultimate skill.
- 6 types of upgradable creep can be added to the wave.
- 8 types of upgradable item.

:: Features ::

- Skill Crafting; this system combines the element of a Hero-Craft map into an AoS. None of skills can be learned through gaining levels. Use your gold to purchase them from the Skillmasters (you can find them at the Circle of Power in your base). Although the skills for each class have their own unique concept depend on which class you are playing. Since your hero has 7 unused spaces for skill icons, you can have the maximum of 6 types of normal skill and 1 ultimate skill. Arrange your class out depending on what's going on in the game. Make your own build of hero.

- 1 BIG LANE; this system prevents players from keep disappearing from the lane and go forest-farming or gang-backdooring the enemies, losing what AoS style map used to have at the beginning, Pushing. Swords and Scepters has this feature to protect what an AoS map should be like.

- Tower Capturing; following a 1 Big Lane ideal, this Tower Capturing system is added to make the pusing goes on. Whenever a tower has been destroyed, it will be recreated instantly, but for the enemy instead.

- Armor Types; seeing that melee heroes would easily find troubles farming their first levels in the game since SaS has only one lane which contains all ranged heroes and casters who own the battlefield when comes to range-harassing, Swords and Scepters provides the armor system that grants melee heroes the ability to take great amount of lower damage from attacks, making them able to survive during their early flows.

- Skill Point system; skills, ultimates, and equipments require Skill Points. This point can be obtained when your hero gains a level, or when an enemy hero has been killed. This system force the players to decide what/when to learn which skill, or which items. And since heroes need to fall back to base to learn their skills, this further forces the player to plan their strategy on when to hold the defense line, and when to retreat.

- Item Forging; Swords and Scepters does not have many choices of item, but only the basic equipments that focus the best on thier functions; Sword, Shield, Boots, Gloves, Necklace, Pendant, Health Stone, and Mana Stone. All of these equipments can be forged to the maximum of 8 levels.

- Powerful Army; creep wave in this map is way huge compares to the other AoS maps. This makes upgrading creeps seemed to be greatly considerable choice for pushing improvement of your team. Also each kind of creep the players can add to the army help supporting the players themselves in many ways.


Thank you for playing.


Keywords:
swords and scepters, swords, scepters, aos, fantasy, hero craft
Contents

Swords and Scepters v. 2.44 (Map)

Reviews
VGsatomi: Approved. I like how you did the hero/ability picking. Wide variety of abilities for each hero. Should lessen the amount of time between waves in my opinion.

Moderator

M

Moderator

VGsatomi: Approved. I like how you did the hero/ability picking. Wide variety of abilities for each hero. Should lessen the amount of time between waves in my opinion.
 
Level 2
Joined
Mar 29, 2006
Messages
7
Hi
i played the map solo and i have the next notes or questions:

First, is it meant that i level up at base?
Second, you should work a little on heroes and abilities (e.x Axarr the great Firelord which revive him has a lot of mana considering that this hero main attribute is Strength not to mention that it's have a long cooldown) thats an example.
Third, The Towers should have lower attack annd some more armor.(thats what i say you don't have to follow it).

Otherwise the game looks fine.
 
Level 3
Joined
Sep 2, 2006
Messages
17
Thank you for suggestion.

Some heroes' skills need to be balanced and thank you for your feedback on Reincarnation. I will follow it as well since the Berserker's other ultimate (Mortal Strike) is a lot better compare to Reincarnation.

btw what do u mean by " level up at base? "
if u r talking about learning skill at base, yes. becoz this map is 5-5 AoS with only 1 lane so leaving the battleground and go back to base would'nt be a big problem becoz your teammates gain more experience when someone leaves the battle :)

It's up to u to decide who and when to go back. turn by turn.
 
Level 2
Joined
May 24, 2006
Messages
18
I played this solo as well, and I found two things you might want to make weaker.

The summoner and the level 8 items from the Blacksmith. I got my summoner's abilities to level 5. They were all of the summoning ones, along with summoning mastery. He never died. I played a paladin, which I thought was balanced, but the items from the blacksmith made him quite overpowered, as they would with any hero.

Other then that, great map! It would be fun online, definitley.
 
Level 3
Joined
Sep 2, 2006
Messages
17
Thx for more feedback :)

Yes the level 8 item is quite great all of them, but u have to consider that its hard to forge them to the 8th level when u play it online 5-5.

becoz your exp will be shared among 5 ppl and u won't get as much gold and as much lumber since its harder to level up.

Summoner is very well good class on one-on-one or playing solo since he can farm a lot of creep and can hunt down towers easily.
And u might have to know this; Summoner's summons will instantly die if the summoner gets killed. :)
So its very hard to play summoner when the other side has some WW killer like assassin or ninja, or sniper that can harass the summoner out the whole game.

Paladin with Pulverize and level 8 Gloves would be outstanding. BUT since he is melee makes him harder to farm gold at early game would make him that much imba.

Try playing this online ^^ it will gaurantee my words

Thx for suggestion. May be I will think about nerfing Summoner and Paladin a little, though.
 
Level 7
Joined
Sep 6, 2007
Messages
120
Well, you want, you got it :p Hi!

Played the map, and i have seen quite some problems.

1) All the texts are not centered. To center them, you should create floating texts at point with offset. For example x:-100 y:85. This way the texts will be centered.
2) Second, and quite big problem, is the lag. You have too many units in your map. The game is lagging a bit, and what will happen, when you train more units from the barracs? You should come up with an original solvation of the problem.
3) In the barracs, the units aren't described properly. It just says it adds Knight (for example) to the wave. But what if i don't want the knight? What if i want the sorceres? Then i look, and the sorceres says the same. You should write what stats she has, or what abilities (like heal or slow) she has got.
4) When i capture 1 of the 2 towers in the center, the spawned creeps go forward, forgeting about the second enemy tower. Please fix that. They should attack the second tower, if it belongs to the enemy.

But overall, nice job! You should realy take a look at #2 and #3. Good luck ;]
 
Level 3
Joined
Sep 2, 2006
Messages
17
Thx Somaz for suggestions :)

that helps on #1 with the text.

and yeah #4 can be fixed easily by just moving towers to be closer ( or something like that ).

#3 yep u right. i have to fix that

#2.... hmm lemme c how do i do this?
 
Level 7
Joined
Sep 6, 2007
Messages
120
#2, i have absolutely no idea, exept for reducing their count at least at start.

#4 Just create a trigger, that looks if the second tower belongs to the enemy, when your creeps spawn. Then it orders to attack it first, and then go to the next point.
 
Level 4
Joined
Sep 27, 2007
Messages
85
well your saying that the item forge wahtever thing level 8. is easy to get when your playing solo. but its harder to get when doing 5v5. not everyone will always play 5v5. so maybe you can do some sorta system so that at the start it checks the amount of players. then it adjusts the cost of the forgin thing
i guess you could just recreate the item but put it at different prices. enless theres a trigger to change the gold. i havent played yet but it looks good

GJ :thumbs_up:
 
Level 11
Joined
Aug 11, 2009
Messages
594
tried to solo play it and i enjoyed the map, just some things i thought about

- Reduce the advantage of capping a tower, once I had capped 2 towers the waves could go alone and cap the rest in just a few minutes, since when capping a tower the enemy team loses 3 adds, while the capping team gains 3, thats a 6 add difference jst by one tower, with 2 towers thats a 12 adds different. You might want to change that to make it more balanced :)

- With so many creeps in each wave, its hard as a melee not to get aggro, i would suggest to reduce the damage from ranged creeps as they are harder to get away from than melee.

- Towers should have greater survivability in general. Also I didn't check, but if the towers behind the first one doesn't get stronger, then they should, because the waves increase in numbers and Heroes grow stronger as time goes by, the towers in the back will just fall to quickly if they are not stronger than the front towers.

Thats about it, havn't checked any Hero balancing since its hard to do alone :p but I enjoyed the map and hope you continue to balance it out, I would really like to try this in multiplayer :)
 
Level 3
Joined
Sep 2, 2006
Messages
17
@Peacehagen
Thank you for testing! : )

I guess it's hard to change the number of adds in each wave since that would affect the exp gains of heroes, but I could try making those peasants/peons weaker instead. Still, this is an interesting suggestion. And also your suggest on reducing damage of range units, too.

About the back tower should be stronger; well this too is quite hard to balance because making the towers stronger means when the opponent capture them, they will be the stronger ground for them too, and that would make it harder for the defending team to capture back. I need to find some other method to deal this this somehow, but I can see your point.

Thank you :)
 
Level 11
Joined
Aug 11, 2009
Messages
594
It's true, one way to deal with the towers would be this, if they were stronger in the back:

- Capturing a tower in the back would create a weaker tower for the capturing team.
- Recapturing your tower in the back would create the stronger version again.

However, when I think about it, it would be too easy to defend then, and really hard to capture the last towers :p since you have longer to your base when attacking and the defenders are already in their base.

Damn, it will be hard for you to balance this hehe :D

But if you weaken the peasants it should balance it out a bit I think :) when playing multiplayer it probably is a bit more balanced aswell. You should try and recruit a testing team of at least 6 people so you can try 3v3 and balance the map on their testing. Make a post in the forum or something :)
 
Level 3
Joined
Sep 2, 2006
Messages
17
lol I also have tried that method and it went just like you said. The defending team captured the tower back in just 1-2 minute, and cpuld push back to the enemy base and capture their back tower, then the opponent capture it back. That turned into a loop and made that a 1 hour game, which I don't want that.

and well I've been balancing this map with my team for 10 late versions (we play 3v3 or 4v4 sometimes) but I surely still want to hear suggestions from people in this site.
 
Level 11
Joined
Aug 11, 2009
Messages
594
Ok :) then I can see this concept is hard to balance :p

I hope I could help you a little atleast, and I will try this map again to see if I can find something else :) good luck with the map :)
 
Level 10
Joined
Aug 21, 2010
Messages
316
Why do you use red and green slot?
You should output the player 1 and player 7, because you generally do not need to define which player is controlled by computers.If you do not know how to do it,just say, I will gladly help you.
 
Last edited:
Level 3
Joined
Sep 2, 2006
Messages
17
@zv27
to be honest, no I don't know how to do it lol but for now there are many triggers that pointing Player1 and Player7, so changing this whole thing will cause me a lot of troubles refixing the triggers.

So I will think about it, and it would be great to know how to do this if you please : ) Thank you very much!
 
Level 11
Joined
Aug 11, 2009
Messages
594
copsychus comment gave me an idea atleast about the towers hehe :p if you want you can make it so that after the same tower has been captured/recaptured too many times, it will be destroyed completely. That's one way to make an even game not last too long :) just a thought
 
Level 6
Joined
Jul 22, 2009
Messages
214
For the tower I think it's could be a good idea to make a reconstruction delay when they are captured. I explain me, when you destroy an enemy tower, it's could take like 30sec-1min (the delay could increase for back tower) before having an operational tower. During this phase the other team can destroy the non-operational tower and start to rebuild their tower.
 
Level 5
Joined
Apr 10, 2010
Messages
224
It's very fun but it lacks something....something important...
Edit:It needs cliffs.What is a war without cliffs. Cliffs where you plan to ambush enemies. Cliffs where you shoot arrows and gunpowder. Cliffs where you cast your nuke skills that obliterates the enemy forces.
It also needs something else... lemme think
 
Level 3
Joined
Sep 2, 2006
Messages
17
Whoa... the reconstructing tower is a mindblowing idea for me. I will try testing this if it goes well. Thank you!

and @MR.Tricky the cliff is also nice. I will see if I can arrange the terrain a bit to create cliffs in the middle part of the map (or even nearby castle so the defending team can go cast some skill on the cliff for advantage). But I guess I have to make these cliffs not so hard for the enemies to reach or that would be imbalance. Thanks : )
 
Level 6
Joined
Jul 22, 2009
Messages
214
Whoa... the reconstructing tower is a mindblowing idea for me. I will try testing this if it goes well. Thank you!

I've just tested it and I think it's a going idea to share it to you. Ok what I made is very very simple but it's work. Remember to set the requirement, the gold/lumber cost of the upgrade building to 0.
 

Attachments

  • ThekebecerTowerRebuildSystem.w3x
    13.8 KB · Views: 74
Level 1
Joined
Dec 7, 2008
Messages
823
lol I also have tried that method and it went just like you said. The defending team captured the tower back in just 1-2 minute, and cpuld push back to the enemy base and capture their back tower, then the opponent capture it back. That turned into a loop and made that a 1 hour game, which I don't want that.
The problem was just strategy. Use a melee hero choosing auras benefiting your troops. then the map can be ended in under 15 minutes. If you want it to be a short map then it is definitely that for a single player. (played in single player only) but i would say that it isn't very interesting in single player without enemy heroes.
 
Level 10
Joined
Aug 21, 2010
Messages
316
@zv27
to be honest, no I don't know how to do it lol but for now there are many triggers that pointing Player1 and Player7, so changing this whole thing will cause me a lot of troubles refixing the triggers.

So I will think about it, and it would be great to know how to do this if you please : ) Thank you very much!

If I understood well, you said that you will have problems if you take away a player 1 and player 7. This is not true.These days I am very good will, so if you want I'll show you how to do it.

If you need any assistance in connection with the AOS system of play, contact me here at the hive.
 
Last edited:
Level 3
Joined
Sep 2, 2006
Messages
17
I do want the how to remove player slot and still having them take part in their color in-game playing, so please tell me whenever you feel comfortable. It could be here in this reply or by messaging me : ) Thanks a lot!
 
Level 3
Joined
Sep 2, 2006
Messages
17
GUI would be appreciate. My knowledge of JASS using is not very advanced lol...

and yes my map is not protected. I just don't feel like protecting my map because there aren't many mapmakers from where I play WCIII (in my country's server) ppl there just play DotA and never give sheezt for other maps. :(

@thekebecer
will do : )
 
Level 6
Joined
Jul 22, 2009
Messages
214
I've found two other thing you can fix.
1) The Crafter repair can target friendly unit(not only building)
2) Some icon don't have a proper disabled version, you have green icon. If you don't know how to fix than jsut ask.
 
Level 10
Joined
Aug 21, 2010
Messages
316
GUI would be appreciate. My knowledge of JASS using is not very advanced lol...

and yes my map is not protected. I just don't feel like protecting my map because there aren't many mapmakers from where I play WCIII (in my country's server) ppl there just play DotA and never give sheezt for other maps. :(

@thekebecer
will do : )
Create a new map with size 96x96 for testing, set the starting location of all players except the player 1 and 7
Go to Scenario=Player Properties and set Player 1 and Player 7 to NONE
then go to Forces and disable Allied,Allied Victory and Share Vision
Have fun.


[TRIGGER=Setup Players]
Trigger 1 GUI Version Example 1
Events
Map initialization
Conditions
Actions
Set rct_NightElf_Hero_Spawn = (Region(-3808.00, 3264.00, -3328.00, 3712.00))
Set rct_Undead_Hero_Spawn = (Region(3136.00, -4096.00, 3616.00, -3648.00))
Set Player_NightElf[0] = Player 1 (Red)
Set Player_NightElf[1] = Player 2 (Blue)
Set Player_NightElf[2] = Player 3 (Teal)
Set Player_NightElf[3] = Player 4 (Purple)
Set Player_NightElf[4] = Player 5 (Yellow)
Set Player_NightElf[5] = Player 6 (Orange)
Set Player_Undead[0] = Player 7 (Green)
Set Player_Undead[1] = Player 8 (Pink)
Set Player_Undead[2] = Player 9 (Gray)
Set Player_Undead[3] = Player 10 (Light Blue)
Set Player_Undead[4] = Player 11 (Dark Green)
Set Player_Undead[5] = Player 12 (Brown)
Set Player_Neutral_Hostile = Neutral Hostile
Set Player_Neutral_Victim = Neutral Victim
Set Player_Neutral_Extra = Neutral Extra
Set Player_Neutral_Passive = Neutral Passive
Set Player_Host = Player_NightElf[1]
Set txt[(Player number of Player_NightElf[0])] = |c00ff0303
Set txt[(Player number of Player_NightElf[1])] = |c000042ff
Set txt[(Player number of Player_NightElf[2])] = |c001ce6b9
Set txt[(Player number of Player_NightElf[3])] = |c00540081
Set txt[(Player number of Player_NightElf[4])] = c00fffc01
Set txt[(Player number of Player_NightElf[5])] = |c00ff8000
Set txt[(Player number of Player_Undead[0])] = |c0020c000
Set txt[(Player number of Player_Undead[1])] = |c00e55bb0
Set txt[(Player number of Player_Undead[2])] = |c00959697
Set txt[(Player number of Player_Undead[3])] = |c007ebff1
Set txt[(Player number of Player_Undead[4])] = |c00106246
Set txt[(Player number of Player_Undead[5])] = |c004e2a04
Player - Change color of Player_NightElf[0] to Red, Changing color of existing units
Player - Change color of Player_NightElf[1] to Blue, Changing color of existing units
Player - Change color of Player_NightElf[2] to Teal, Changing color of existing units
Player - Change color of Player_NightElf[3] to Purple, Changing color of existing units
Player - Change color of Player_NightElf[4] to Yellow, Changing color of existing units
Player - Change color of Player_NightElf[5] to Orange, Changing color of existing units
Player - Change color of Player_Undead[0] to Green, Changing color of existing units
Player - Change color of Player_Undead[1] to Pink, Changing color of existing units
Player - Change color of Player_Undead[2] to Gray, Changing color of existing units
Player - Change color of Player_Undead[3] to Light Blue, Changing color of existing units
Player - Change color of Player_Undead[4] to Dark Green, Changing color of existing units
Player - Change color of Player_Undead[5] to Brown, Changing color of existing units
For each (Integer A) from 0 to 5, do (Actions)
Loop - Actions
Player - For Player_NightElf[0], turn Alliance (non-aggression) On toward Player_NightElf[(Integer A)]
Player - For Player_NightElf[1], turn Alliance (non-aggression) On toward Player_NightElf[(Integer A)]
Player - For Player_NightElf[2], turn Alliance (non-aggression) On toward Player_NightElf[(Integer A)]
Player - For Player_NightElf[3], turn Alliance (non-aggression) On toward Player_NightElf[(Integer A)]
Player - For Player_NightElf[4], turn Alliance (non-aggression) On toward Player_NightElf[(Integer A)]
Player - For Player_NightElf[5], turn Alliance (non-aggression) On toward Player_NightElf[(Integer A)]
Player - Make Player_NightElf[0] treat Player_NightElf[(Integer A)] as an Ally with shared vision
Player - Make Player_NightElf[1] treat Player_NightElf[(Integer A)] as an Ally with shared vision
Player - Make Player_NightElf[2] treat Player_NightElf[(Integer A)] as an Ally with shared vision
Player - Make Player_NightElf[3] treat Player_NightElf[(Integer A)] as an Ally with shared vision
Player - Make Player_NightElf[4] treat Player_NightElf[(Integer A)] as an Ally with shared vision
Player - Make Player_NightElf[5] treat Player_NightElf[(Integer A)] as an Ally with shared vision
Player - For Player_Undead[0], turn Alliance (non-aggression) On toward Player_Undead[(Integer A)]
Player - For Player_Undead[1], turn Alliance (non-aggression) On toward Player_Undead[(Integer A)]
Player - For Player_Undead[2], turn Alliance (non-aggression) On toward Player_Undead[(Integer A)]
Player - For Player_Undead[3], turn Alliance (non-aggression) On toward Player_Undead[(Integer A)]
Player - For Player_Undead[4], turn Alliance (non-aggression) On toward Player_Undead[(Integer A)]
Player - For Player_Undead[5], turn Alliance (non-aggression) On toward Player_Undead[(Integer A)]
Player - Make Player_Undead[0] treat Player_Undead[(Integer A)] as an Ally with shared vision
Player - Make Player_Undead[1] treat Player_Undead[(Integer A)] as an Ally with shared vision
Player - Make Player_Undead[2] treat Player_Undead[(Integer A)] as an Ally with shared vision
Player - Make Player_Undead[3] treat Player_Undead[(Integer A)] as an Ally with shared vision
Player - Make Player_Undead[4] treat Player_Undead[(Integer A)] as an Ally with shared vision
Player - Make Player_Undead[5] treat Player_Undead[(Integer A)] as an Ally with shared vision
Player - Set name of Player_NightElf[0] to Force 1
Player - Set name of Player_Undead[0] to Force 2
Unit - Create 1 Circle of Power for Player_NightElf[1] at (Point(-4544.00, 4544.00)) facing 270.00 degrees
Set Circle_Of_Power_P1_Blue = (Last created unit)
Unit - Create 1 Circle of Power for Player_NightElf[2] at (Point(-4416.00, 4544.00)) facing 270.00 degrees
Set Circle_Of_Power_P2_Teal = (Last created unit)
Unit - Create 1 Circle of Power for Player_NightElf[3] at (Point(-4288.00, 4544.00)) facing 270.00 degrees
Set Circle_Of_Power_P3_Purple = (Last created unit)
Unit - Create 1 Circle of Power for Player_NightElf[4] at (Point(-4160.00, 4544.00)) facing 270.00 degrees
Set Circle_Of_Power_P4_Yellow = (Last created unit)
Unit - Create 1 Circle of Power for Player_NightElf[5] at (Point(-4032.00, 4544.00)) facing 270.00 degrees
Set Circle_Of_Power_P5_Orange = (Last created unit)
Unit - Create 1 Circle of Power for Player_Undead[1] at (Point(4032.00, -5120.00)) facing 270.00 degrees
Set Circle_Of_Power_P7_Pink = (Last created unit)
Unit - Create 1 Circle of Power for Player_Undead[2] at (Point(4160.00, -5120.00)) facing 270.00 degrees
Set Circle_Of_Power_P8_Gray = (Last created unit)
Unit - Create 1 Circle of Power for Player_Undead[3] at (Point(4288.00, -5120.00)) facing 270.00 degrees
Set Circle_Of_Power_P9_Light_Blue = (Last created unit)
Unit - Create 1 Circle of Power for Player_Undead[4] at (Point(4416.00, -5120.00)) facing 270.00 degrees
Set Circle_Of_Power_P10_Dark_Green = (Last created unit)
Unit - Create 1 Circle of Power for Player_Undead[5] at (Point(4544.00, -5120.00)) facing 270.00 degrees
Set Circle_Of_Power_P11_Brown = (Last created unit)
Unit - Create 1 Tavern for Player_Neutral_Passive at (Point(-4288.00, 4288.00)) facing 0.00 degrees
Set GUI_Unit_Tavern_NightElf = (Last created unit)
Unit - Change color of GUI_Unit_Tavern_NightElf to Red
Unit - Create 1 Tavern for Player_Neutral_Passive at (Point(4288.00, -4864.00)) facing 0.00 degrees
Set GUI_Unit_Tavern_Undead = (Last created unit)
Unit - Change color of GUI_Unit_Tavern_Undead to Green
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player_NightElf[(Integer A)] slot status) Equal to Is playing
Then - Actions
Player Group - Add Player_NightElf[(Integer A)] to NightElf_Force
Else - Actions
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player_Undead[(Integer A)] slot status) Equal to Is playing
Then - Actions
Player Group - Add Player_Undead[(Integer A)] to Undead_Force
Else - Actions
Set GUI_Force_NightElf_Counter = (Number of players in NightElf_Force)
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player_NightElf[(Integer A)] slot status) Equal to Is playing
Then - Actions
Player - Set Player_NightElf[(Integer A)] Current gold to (3998 / GUI_Force_NightElf_Counter)
Player - Set Player_NightElf[(Integer A)] Current lumber to 0
Player - Set Player_NightElf[(Integer A)] Food cap to 8
Else - Actions
Player - Set name of Player_NightElf[(Integer A)] to ([email protected] + (String((Integer A))))
Set GUI_Force_Undead_Counter = (Number of players in Undead_Force)
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player_Undead[(Integer A)] slot status) Equal to Is playing
Then - Actions
Player - Set Player_Undead[(Integer A)] Current gold to (3998 / GUI_Force_Undead_Counter)
Player - Set Player_Undead[(Integer A)] Current lumber to 0
Player - Set Player_Undead[(Integer A)] Food cap to 8
Else - Actions
Player - Set name of Player_Undead[(Integer A)] to ([email protected] + (String((5 + (Integer A)))))
Set First_NightElf_Hero = 1
Set GUI_Max_Hero_Num[1] = Keeper of the Grove
Set GUI_Max_Hero_Num[2] = Priestess of the Moon
Set GUI_Max_Hero_Num[3] = Demon Hunter
Set GUI_Max_Hero_Num[4] = Warden
Set Last_NightElf_Hero = 4
Set First_Undead_Hero = 5
Set GUI_Max_Hero_Num[5] = Death Knight
Set GUI_Max_Hero_Num[6] = Lich
Set GUI_Max_Hero_Num[7] = Dreadlord
Set GUI_Max_Hero_Num[8] = Crypt Lord
Set Last_Undead_Hero = 8
For each (Integer A) from First_NightElf_Hero to Last_NightElf_Hero, do (Actions)
Loop - Actions
Neutral Building - Add GUI_Max_Hero_Num[(Integer A)] to GUI_Unit_Tavern_NightElf with 0 in stock and a max stock of 1
For each (Integer A) from First_Undead_Hero to Last_Undead_Hero, do (Actions)
Loop - Actions
Neutral Building - Add GUI_Max_Hero_Num[(Integer A)] to GUI_Unit_Tavern_Undead with 0 in stock and a max stock of 1
[/TRIGGER]


[TRIGGER=Hero Spawn]
Trigger 2 GUI Version Example 1
Events
Unit - A unit enters (Region(-4864.00, 3872.00, -3744.00, 4736.00))
Unit - A unit enters (Region(3712.00, -5280.00, 4832.00, -4416.00))
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
Set check_is_picked[(Point-value of (Triggering unit))] = True
Set which_unit[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Set check_is_used[(Point-value of (Triggering unit))] = True
Trigger - Run Trigger 3 GUI Version Example 1 <gen> (ignoring conditions)
Player - Set (Owner of (Triggering unit)) Food cap to 6
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) is in NightElf_Force) Equal to True
Then - Actions
Set LocCenter = (Center of rct_NightElf_Hero_Spawn)
Set LocRandom = (Random point in rct_NightElf_Hero_Spawn)
Else - Actions
Set LocCenter = (Center of rct_Undead_Hero_Spawn)
Set LocRandom = (Random point in rct_Undead_Hero_Spawn)
Set check_is_revived[(Point-value of (Triggering unit))] = True
Camera - Pan camera for (Owner of (Triggering unit)) to LocCenter over 0.00 seconds
Selection - Clear selection for (Owner of (Triggering unit))
Selection - Add (Triggering unit) to selection for (Owner of (Triggering unit))
Set death_time[(Player number of (Owner of (Triggering unit)))] = 0
Set death_counter[(Player number of (Owner of (Triggering unit)))] = (death_counter[(Player number of (Owner of (Triggering unit)))] + 1)
For each (Integer A) from First_NightElf_Hero to Last_NightElf_Hero, do (Actions)
Loop - Actions
Player - Limit training of GUI_Max_Hero_Num[(Integer A)] to 0 for (Owner of (Triggering unit))
For each (Integer A) from First_Undead_Hero to Last_Undead_Hero, do (Actions)
Loop - Actions
Player - Limit training of GUI_Max_Hero_Num[(Integer A)] to 0 for (Owner of (Triggering unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
check_is_repicked[(Player number of (Owner of (Triggering unit)))] Equal to True
Then - Actions
Game - Display to (All enemies of (Owner of (Triggering unit))) for 10.00 seconds the text: (An enemy has repicked into + ((Name of (Triggering unit)) + .))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
check_is_randomed[(Player number of (Owner of (Triggering unit)))] Equal to True
Then - Actions
Game - Display to (All enemies of (Owner of (Triggering unit))) for 10.00 seconds the text: (An enemy has randomed + ((Name of (Triggering unit)) + .))
Else - Actions
Game - Display to (All enemies of (Owner of (Triggering unit))) for 10.00 seconds the text: (An enemy has chosen + ((Name of (Triggering unit)) + .))
Unit - Move (Triggering unit) instantly to LocCenter
Unit - Move (Triggering unit) instantly to LocRandom
Custom script: call RemoveLocation(udg_LocCenter)
Custom script: call RemoveLocation(udg_LocRandom)
[/TRIGGER]


  • Trigger 3 GUI Version Example 1
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Player - Limit training of (Unit-type of (Triggering unit)) to 0 for Player_NightElf[(Integer A)]
          • Player - Limit training of (Unit-type of (Triggering unit)) to 0 for Player_Undead[(Integer A)]
      • Set check_is_used[(Point-value of (Triggering unit))] = True




JASS:
function FillGlobalVariable takes nothing returns nothing
        local integer x
        set x=0
        loop
	     exitwhen (x>16)
	     set udg_death_time[x]=0
	     set x=x+1
        endloop
        set x=0
	loop
		exitwhen(x>8)
		set udg_check_is_used[x]=false
		set udg_check_is_revived[x]=false
		set udg_check_is_picked[x]=false
		set x=x+1
	endloop
        set x=0
	loop
		exitwhen(x>15)
		set udg_check_is_repicked[x]=false
		set udg_check_is_randomed[x]=false
		set udg_death_counter[x]=0
                set udg_which_unit[x]=null
		set x=x+1
	endloop
endfunction

function RegHashTable takes nothing returns hashtable                                           
        if udg_HTable==null then                                                                  
              call InitHashtable()                                                             
              set udg_HTable=InitHashtable()                                                        
        endif                                                                                
        return udg_HTable                                                                            
endfunction

function RegisterPlayersInRedForce takes player whichPlayer returns boolean
        return(whichPlayer==udg_Player_NightElf[0])or(whichPlayer==udg_Player_NightElf[1])or(whichPlayer==udg_Player_NightElf[2])or(whichPlayer==udg_Player_NightElf[3])or(whichPlayer==udg_Player_NightElf[4])or(whichPlayer==udg_Player_NightElf[5])
endfunction

function RegisterPlayersInGreenForce takes player whichPlayer returns boolean
        return(whichPlayer==udg_Player_Undead[0])or(whichPlayer==udg_Player_Undead[1])or(whichPlayer==udg_Player_Undead[2])or(whichPlayer==udg_Player_Undead[3])or(whichPlayer==udg_Player_Undead[4])or(whichPlayer==udg_Player_Undead[5])
endfunction

function RegisterPlayersIfActive takes player whichPlayer returns boolean
        return(GetPlayerSlotState(whichPlayer)==ConvertPlayerSlotState(1))//and GetPlayerController(whichPlayer)==ConvertMapControl(0)
endfunction

function RegisterOfActivePlayers takes nothing returns nothing
	if RegisterPlayersIfActive(GetEnumPlayer())then
	     set bj_forceCountPlayers=bj_forceCountPlayers+1
	endif
endfunction

function RegisterTheNumberOfActivePlayers takes force whichForce returns integer
	set bj_forceCountPlayers=0
	call ForForce(whichForce,function RegisterOfActivePlayers)
	return bj_forceCountPlayers
endfunction

function RegisterPlayers takes nothing returns nothing
        local integer x
        local integer ForceRedCounter
	local integer ForceGreenCounter
        set udg_Player_NightElf[0]=Player(0)
        set udg_Player_NightElf[1]=Player(1)
        set udg_Player_NightElf[2]=Player(2)
        set udg_Player_NightElf[3]=Player(3)
        set udg_Player_NightElf[4]=Player(4)
        set udg_Player_NightElf[5]=Player(5)
        set udg_Player_Undead[0]=Player(6)
        set udg_Player_Undead[1]=Player(7)
        set udg_Player_Undead[2]=Player(8)
        set udg_Player_Undead[3]=Player(9)
        set udg_Player_Undead[4]=Player(10)
        set udg_Player_Undead[5]=Player(11)
        set udg_Player_Neutral_Hostile=Player(12)
        set udg_Player_Neutral_Victim=Player(13)
        set udg_Player_Neutral_Extra=Player(14)
        set udg_Player_Neutral_Passive=Player(15)
        set udg_txt[GetPlayerId(udg_Player_NightElf[0])]="|c00ff0303"
	set udg_txt[GetPlayerId(udg_Player_NightElf[1])]="|c000042ff"
	set udg_txt[GetPlayerId(udg_Player_NightElf[2])]="|c001ce6b9"
        set udg_txt[GetPlayerId(udg_Player_NightElf[3])]="|c00540081"
	set udg_txt[GetPlayerId(udg_Player_NightElf[4])]="|c00fffc01"
	set udg_txt[GetPlayerId(udg_Player_NightElf[5])]="|c00ff8000"
	set udg_txt[GetPlayerId(udg_Player_Undead[0])]="|c0020c000"
	set udg_txt[GetPlayerId(udg_Player_Undead[1])]="|c00e55bb0"
	set udg_txt[GetPlayerId(udg_Player_Undead[2])]="|c00959697"
	set udg_txt[GetPlayerId(udg_Player_Undead[3])]="|c007ebff1"
	set udg_txt[GetPlayerId(udg_Player_Undead[4])]="|c00106246"
	set udg_txt[GetPlayerId(udg_Player_Undead[5])]="|c004e2a04"
        call SetPlayerColor(udg_Player_NightElf[0],ConvertPlayerColor(0))
	call SetPlayerColor(udg_Player_NightElf[1],ConvertPlayerColor(1))
	call SetPlayerColor(udg_Player_NightElf[2],ConvertPlayerColor(2))
        call SetPlayerColor(udg_Player_NightElf[3],ConvertPlayerColor(3))
	call SetPlayerColor(udg_Player_NightElf[4],ConvertPlayerColor(4))
	call SetPlayerColor(udg_Player_NightElf[5],ConvertPlayerColor(5))
	call SetPlayerColor(udg_Player_Undead[0],ConvertPlayerColor(6))
	call SetPlayerColor(udg_Player_Undead[1],ConvertPlayerColor(7))
	call SetPlayerColor(udg_Player_Undead[2],ConvertPlayerColor(8))
	call SetPlayerColor(udg_Player_Undead[3],ConvertPlayerColor(9))
	call SetPlayerColor(udg_Player_Undead[4],ConvertPlayerColor(10))
	call SetPlayerColor(udg_Player_Undead[5],ConvertPlayerColor(11))
        set x=0
        loop
             exitwhen x>5
             call SetPlayerAlliance(udg_Player_NightElf[0],udg_Player_NightElf[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_NightElf[1],udg_Player_NightElf[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_NightElf[2],udg_Player_NightElf[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_NightElf[3],udg_Player_NightElf[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_NightElf[4],udg_Player_NightElf[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_NightElf[5],udg_Player_NightElf[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_Undead[0],udg_Player_Undead[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_Undead[1],udg_Player_Undead[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_Undead[2],udg_Player_Undead[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_Undead[3],udg_Player_Undead[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_Undead[4],udg_Player_Undead[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_Undead[5],udg_Player_Undead[x],ConvertAllianceType(0),true)
             call SetPlayerAlliance(udg_Player_NightElf[0],udg_Player_NightElf[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_NightElf[1],udg_Player_NightElf[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_NightElf[2],udg_Player_NightElf[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_NightElf[3],udg_Player_NightElf[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_NightElf[4],udg_Player_NightElf[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_NightElf[5],udg_Player_NightElf[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_Undead[0],udg_Player_Undead[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_Undead[1],udg_Player_Undead[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_Undead[2],udg_Player_Undead[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_Undead[3],udg_Player_Undead[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_Undead[4],udg_Player_Undead[x],ConvertAllianceType(5),true)
             call SetPlayerAlliance(udg_Player_Undead[5],udg_Player_Undead[x],ConvertAllianceType(5),true)
             set x=x+1
        endloop
        set x=1
        loop
            exitwhen x>5
               if RegisterPlayersIfActive(udg_Player_NightElf[x])then
                     call ForceAddPlayer(udg_NightElf_Force,udg_Player_NightElf[x])
               endif
               if RegisterPlayersIfActive(udg_Player_Undead[x])then
                     call ForceAddPlayer(udg_Undead_Force,udg_Player_Undead[x])
               endif
               set x=x+1
        endloop
             
        call SetPlayerTeam(udg_Player_NightElf[0],0)
	call SetPlayerTeam(udg_Player_NightElf[1],0)
	call SetPlayerTeam(udg_Player_NightElf[2],0)
	call SetPlayerTeam(udg_Player_NightElf[3],0)
	call SetPlayerTeam(udg_Player_NightElf[4],0)
	call SetPlayerTeam(udg_Player_NightElf[5],0)
	call SetPlayerTeam(udg_Player_Undead[0],1)
	call SetPlayerTeam(udg_Player_Undead[1],1)
	call SetPlayerTeam(udg_Player_Undead[2],1)
	call SetPlayerTeam(udg_Player_Undead[3],1)
	call SetPlayerTeam(udg_Player_Undead[4],1)
	call SetPlayerTeam(udg_Player_Undead[5],1)
	call SetPlayerName(udg_Player_NightElf[0],"Force 1")
	call SetPlayerName(udg_Player_Undead[0],"Force 2")   
        set ForceRedCounter=RegisterTheNumberOfActivePlayers(udg_NightElf_Force) 
        set ForceGreenCounter=RegisterTheNumberOfActivePlayers(udg_Undead_Force)
        set x=1
        loop
             exitwhen x>5
             if RegisterPlayersIfActive(udg_Player_NightElf[x])then
	           call SetPlayerState(udg_Player_NightElf[x],ConvertPlayerState(1),(4000/ForceRedCounter))
	           call SetPlayerState(udg_Player_NightElf[x],ConvertPlayerState(2),0)
	           call SetPlayerState(udg_Player_NightElf[x],ConvertPlayerState(4),10)
	     endif
	     if RegisterPlayersIfActive(udg_Player_Undead[x])then
	           call SetPlayerState(udg_Player_Undead[x],ConvertPlayerState(1),(4000/ForceGreenCounter))
	           call SetPlayerState(udg_Player_Undead[x],ConvertPlayerState(2),0)
	           call SetPlayerState(udg_Player_Undead[x],ConvertPlayerState(4),10)
	     endif
             if not RegisterPlayersIfActive(udg_Player_NightElf[x])then
                   call SetPlayerName(udg_Player_NightElf[x],"[email protected] "+I2S(x))    
             endif
             if not RegisterPlayersIfActive(udg_Player_Undead[x])then
	           call SetPlayerName(udg_Player_Undead[x],"[email protected] "+I2S(5+x))
             endif
             call SetPlayerHandicapXP(udg_Player_NightElf[x],1)
             call SetPlayerHandicapXP(udg_Player_Undead[x],1)
             set x=x+1
        endloop 
	set x=0
        loop
            call SetPlayerState(udg_Player_NightElf[x],ConvertPlayerState(7),1)
            call SetPlayerState(udg_Player_Undead[x],ConvertPlayerState(7),1)
            set x=x+1
            exitwhen x>5
        endloop   
endfunction

function RescriptCreateRect takes nothing returns nothing
       set udg_rct_Marketplace_NightElf=Rect(-4864.,3872.,-3744.,4736.)
       set udg_rct_Marketplace_Undead=Rect(3712.,-5280.,4832.,-4416.)
       set udg_rct_NightElf_Hero_Spawn=Rect(-3808.,3264.,-3328.,3712.)
       set udg_rct_Undead_Hero_Spawn=Rect(3136.,-4096.,3616.,-3648.)
endfunction

function SetupUnit takes nothing returns nothing
        local player p
        local unit lf0
        local unit lf7
        set p=Player(1)
        set udg_Circle_Of_Power_P1_Blue=CreateUnit(p,'ncop',-4544.,4544.,270.)
        set p=Player(2)
        set udg_Circle_Of_Power_P2_Teal=CreateUnit(p,'ncop',-4416.,4544.,270.)
        set p=Player(3)
        set udg_Circle_Of_Power_P3_Purple=CreateUnit(p,'ncop',-4288.,4544.,270.)
        set p=Player(4)
        set udg_Circle_Of_Power_P4_Yellow=CreateUnit(p,'ncop',-4160.,4544.,270.)
        set p=Player(5)
        set udg_Circle_Of_Power_P5_Orange=CreateUnit(p,'ncop',-4032.,4544.,270.)
        set p=Player(15)
        set lf0=CreateUnit(p,'ntav',-4288.,4288.,270.)
        call SetUnitColor(lf0,ConvertPlayerColor(0))
        call SaveAgentHandle(RegHashTable(),0,StringHash("Red Tavern"),lf0)
        set lf7=CreateUnit(p,'n000',4288.,-4864.,270.)
        call SetUnitColor(lf7,ConvertPlayerColor(6))
        call SaveAgentHandle(RegHashTable(),0,StringHash("Green Tavern"),lf7)
        set p=Player(7)
        set udg_Circle_Of_Power_P7_Pink=CreateUnit(p,'ncop',4032.,-5120.,270.)
        set p=Player(8)
        set udg_Circle_Of_Power_P8_Gray=CreateUnit(p,'ncop',4160.,-5120.,270.)
        set p=Player(9)
        set udg_Circle_Of_Power_P9_Light_Blue=CreateUnit(p,'ncop',4288.,-5120.,270.)
        set p=Player(10)
        set udg_Circle_Of_Power_P10_Dark_Green=CreateUnit(p,'ncop',4416.,-5120.,270.)
        set p=Player(11)
        set udg_Circle_Of_Power_P11_Brown=CreateUnit(p,'ncop',4544.,-5120.,270.)
endfunction

function LimitSelectionForPlayer takes integer whichInteger,player whichPlayer returns nothing
	call SetPlayerTechMaxAllowed(whichPlayer,whichInteger,0)
	set udg_check_is_used[GetUnitPointValueByType(whichInteger)]=true
endfunction

function LimitSelectionForAllPlayer takes integer i returns nothing
	call LimitSelectionForPlayer(i,udg_Player_NightElf[1])
	call LimitSelectionForPlayer(i,udg_Player_NightElf[2])
	call LimitSelectionForPlayer(i,udg_Player_NightElf[3])
	call LimitSelectionForPlayer(i,udg_Player_NightElf[4])
	call LimitSelectionForPlayer(i,udg_Player_NightElf[5])
	call LimitSelectionForPlayer(i,udg_Player_Undead[1])
	call LimitSelectionForPlayer(i,udg_Player_Undead[2])
	call LimitSelectionForPlayer(i,udg_Player_Undead[3])
	call LimitSelectionForPlayer(i,udg_Player_Undead[4])
	call LimitSelectionForPlayer(i,udg_Player_Undead[5])
endfunction

function RescriptHeroData takes nothing returns nothing
        set udg_First_NightElf_Hero=1
        set udg_Max_Hero_Num[1]='Ekee'
        set udg_Max_Hero_Num[2]='Emoo'
        set udg_Max_Hero_Num[3]='Edem'
        set udg_Max_Hero_Num[4]='Ewar'
        set udg_Last_NightElf_Hero=4
        set udg_First_Undead_Hero=8
        set udg_Max_Hero_Num[8]='Udea'
        set udg_Max_Hero_Num[9]='Ulic'
        set udg_Max_Hero_Num[10]='Udre'
        set udg_Max_Hero_Num[11]='Ucrl'
        set udg_Last_Undead_Hero=11
endfunction

function AddUnitToMarket takes integer i returns unit
	if i<=4 then
	       return LoadUnitHandle(RegHashTable(),0,StringHash("Red Tavern"))
        elseif i<=12 then
               return LoadUnitHandle(RegHashTable(),0,StringHash("Green Tavern"))
	endif
	       return null
endfunction

function RescriptAddHeroesToMarketplace takes nothing returns nothing
        local integer x=udg_First_NightElf_Hero
        loop
             exitwhen x>udg_Last_NightElf_Hero
             call AddUnitToStock(AddUnitToMarket(x),udg_Max_Hero_Num[x],0,1)
             set x=x+1
        endloop
        set x=udg_First_Undead_Hero
        loop
             exitwhen x>udg_Last_Undead_Hero
             call AddUnitToStock(AddUnitToMarket(x),udg_Max_Hero_Num[x],0,1)
             set x=x+1
        endloop
endfunction

function MoveUnitInstantlyToCoordinates takes unit u,real x,real y returns boolean
        local rect rct=GetWorldBounds()
        local real lf1=GetRectMinX(rct)
        local boolean check=true
        if(x<lf1)then
              set x=lf1
              set check=false
        else
              set lf1=GetRectMaxX(rct)
        if(x>lf1)then
              set check=false
              set x=lf1
        endif
        endif
              set lf1=GetRectMinY(rct)
        if(y<lf1)then
              set y=lf1
              set check=false
        else
              set lf1=GetRectMaxY(rct)
        if(y>lf1)then
              set y=lf1
              set check=false
        endif
        endif
              call SetUnitX(u,x)
              call SetUnitY(u,y)
              set rct=null
              return check
endfunction

function SetUnitLoc takes unit u,location l returns boolean
        return MoveUnitInstantlyToCoordinates(u,GetLocationX(l),GetLocationY(l))
endfunction

function InitTrig_Trigger_1_JASS_Version_Example_1 takes nothing returns nothing
        call FillGlobalVariable()
        call RescriptCreateRect()
        call RegisterPlayers()
        call SetupUnit()
        call RescriptHeroData()
        call RescriptAddHeroesToMarketplace()
        call TimerStart(udg_endless_time,99999.,false,null)
        call SetFloatGameState(ConvertFGameState(2),6.)
endfunction


JASS:
function HeroSpawnOrRevivedCond takes nothing returns boolean
        return not IsUnitType(GetTriggerUnit(),ConvertUnitType(0))==false and not udg_check_is_picked[GetUnitPointValue(GetTriggerUnit())] and not IsUnitType(GetTriggerUnit(),ConvertUnitType(10)) and not IsUnitIllusion(GetTriggerUnit())
endfunction

function HeroSpawnOrRevivedMain takes nothing returns nothing
        local unit u=GetTriggerUnit()
	local integer x
	local integer y
        local real lX
	local real lY
        local location l
        local rect r=udg_rct_NightElf_Hero_Spawn
        local rect R=udg_rct_Undead_Hero_Spawn
        set udg_check_is_picked[GetUnitPointValue(u)]=true
        set udg_which_unit[GetPlayerId(GetOwningPlayer(u))]=u
        set udg_check_is_used[GetUnitPointValue(u)]=true
        call LimitSelectionForAllPlayer(GetUnitTypeId(u))
        call SetPlayerState(GetOwningPlayer(u),ConvertPlayerState(4),6)
        if RegisterPlayersInRedForce(GetOwningPlayer(u))then
	     set lX=GetRectCenterX(r)
	     set lY=GetRectCenterY(r)
             set l=Location(GetRandomReal(GetRectMinX(r),GetRectMaxX(r)),GetRandomReal(GetRectMinY(r),GetRectMaxY(r)))
	else
	     set lX=GetRectCenterX(udg_rct_Undead_Hero_Spawn)
	     set lY=GetRectCenterY(udg_rct_Undead_Hero_Spawn)
             set l=Location(GetRandomReal(GetRectMinX(R),GetRectMaxX(R)),GetRandomReal(GetRectMinY(R),GetRectMaxY(R)))
	endif
        set udg_check_is_revived[GetUnitPointValue(u)]=true
	call ClearSelection()
        if GetLocalPlayer()==GetOwningPlayer(u)then
             call PanCameraToTimed(lX,lY,0)
	     call SelectUnit(u,true)
        endif
        set udg_death_time[GetPlayerId(GetOwningPlayer(u))]=0
	set udg_death_counter[GetPlayerId(GetOwningPlayer(u))]=udg_death_counter[GetPlayerId(GetOwningPlayer(u))]+1
        if GetTriggerEventId()==ConvertPlayerUnitEvent(46)then
	     call MoveUnitInstantlyToCoordinates(u,lX,lY)
             call SetUnitLoc(u,l)
	else
	     call MoveUnitInstantlyToCoordinates(u,lX,lY)
             call SetUnitLoc(u,l)
	endif
        if(udg_check_is_repicked[GetPlayerId(GetOwningPlayer(u))])then
	      call DisplayTimedTextToForce(GetPlayersEnemies(GetOwningPlayer(u)),10.,("An enemy has repicked into "+(GetUnitName(u)+".")))
	elseif (udg_check_is_randomed[GetPlayerId(GetOwningPlayer(u))])then
	      call DisplayTimedTextToForce(GetPlayersEnemies(GetOwningPlayer(u)),10.,("An enemy has randomed "+(GetUnitName(u)+".")))
	else
	      call DisplayTimedTextToForce(GetPlayersEnemies(GetOwningPlayer(u)),10.,("An enemy has chosen "+(GetUnitName(u)+".")))
	endif
        set x=udg_First_NightElf_Hero
	set y=udg_Last_NightElf_Hero
	loop
	     exitwhen x>y
	     call SetPlayerTechMaxAllowed(GetOwningPlayer(u),udg_Max_Hero_Num[x],0)
	     set x=x+1
	endloop
        set x=udg_First_Undead_Hero
	set y=udg_Last_Undead_Hero
	loop
	     exitwhen x>y
	     call SetPlayerTechMaxAllowed(GetOwningPlayer(u),udg_Max_Hero_Num[x],0)
	     set x=x+1
	endloop
        call RemoveLocation(l)
        set u=null
endfunction

function InitTrig_Trigger_2_JASS_Version_Example_1 takes nothing returns nothing
        local trigger ltt=CreateTrigger()
        local region R1             
        local region R2
        local boolexpr bx=Filter(function HeroSpawnOrRevivedCond)
        local integer i=0
        loop
             call TriggerRegisterPlayerUnitEvent(ltt,Player(i),ConvertPlayerUnitEvent(46),null)
             set i=i+1
             exitwhen i==16
        endloop
        set R1=CreateRegion()
        call RegionAddRect(R1,udg_rct_Marketplace_NightElf)
        call TriggerRegisterEnterRegion(ltt,R1,bx)
        set  R2=CreateRegion() 
        call RegionAddRect(R2,udg_rct_Marketplace_Undead)
        call TriggerRegisterEnterRegion(ltt,R2,bx)
        call TriggerAddAction(ltt,function HeroSpawnOrRevivedMain)
        call DestroyBoolExpr(bx) 
        set ltt=null
endfunction

 
Last edited:
Level 3
Joined
Sep 2, 2006
Messages
17
@thekebecer
1) will fix :) thx
2) I know how to deal with green icon. could u tell me which one of them still showing green one if possible? if not that is fine though. : ) thx again!

@zv27
Tried it and worked just fine. You are awesome. Thank you for such great help!
 
Level 6
Joined
Jul 22, 2009
Messages
214
When playing with a friend we've found a weird bug. When a team win all unit a freeze, but if a player is dead and he revive he can control his hero and attack people.(can cast spell)
 
Level 2
Joined
Sep 29, 2010
Messages
32
me too found a bug .,. for bard , if a melee hero attack it , it cant use any range attack after the melee hero melee it ......

for padding that melee hero , there is a error rarely happen that if it die , it cant be revive and some other bugs i keep it to myself for now after you fix , then i say more
 
Last edited:
Level 4
Joined
Nov 11, 2009
Messages
92
I have been playing this map a lot recently, and its really fun! I only have a couple things to say: put something in quests for info for nubs, make it so that leaver heroes are removed and their gold is given, not just shared control (it is hard to use two heroes at once), and i once bought a ballista but it never spawned. but i really like the map so hopefully you are still working on it, i would like to see that third tavern filled! oh and also maybe change map name from sas so that people know what they are joining
 
Top