Ice_water
Dragon Quest
- 11/1/07
- 1,457
- 182
Mình đã chỉnh được range ability , hero , và tarven (khoảng cách mua hero) nhưng hem bít sao để cho cái circle of power thành player như nào cả
.
Mình vào trong skill thì chỉ có 3 lv , làm sao để có lv 4 vậy
Thx đã đọc
.Mình vào trong skill thì chỉ có 3 lv , làm sao để có lv 4 vậy

Trong trigger trên mình hem bít làm sao để add lệnh "Set" .Hero Taverns
By SD_Ryoko
Introduction
Preparing your Heros
Creating a Tavern Unit
Placing the Tavern on the Map
Alter Gameplay Constants
Creating the Triggers
This tutorial also has a free demo map.
Download Here
Introduction
This tutorial will explain how to make a tavern where you can purchase your starting heroes. These taverns are common on the newer DOTA maps and some of the hero siege maps. When you have a lot of heroes, a tavern is nice because it takes much less room on your map than a hero arena does. We will cover creating the tavern, the heroes, and the triggers to make it all come together.
Were going to use the techtree and custom gameplay constants to restrict heroes to 1. This way, you don't have to use food, gold or lumber anymore! This allows you to use resources for other things, making a better map.
See also: Hero Arenas
A hero tavern uses icons to sell heroes.
Preparing your heros
The first step is prepare you heroes for the tavern. We also need to change the costs, techtree requirements, and button position of each hero for the tavern icon. The tavern will sort the heroes automatically, but when a hero is sold they will all shift to a new location. That's quite annoying, and we can prevent that by setting the units icon position. Taverns can hold up to twelve heros.
Button positions determine the icon locations of a hero.
Now you need to change your heroes to be compatable at the tavern. Remember that players start with zero resources, so unless your giving the players resources, the hero should cost nothing. To prevent players from owning more than one hero, we will modify the techtree requirements. Below is a list of fields you need to change, and a brief explenation of each.
* You'll notice some of these are default settings. But that is not true on all hero units.
Art - Button Position (X) X position of the hero icon.
Art - Button Position (Y) Y position of the hero icon.
Stats - Gold Cost How much gold your hero will cost.
Stats - Lumber Cost How much lumber your hero will cost.
Stats - Food Cost Hero food cost. Probobly 0 for your map.
Stats - Stock Maximum Change to 1.
Stats - Stock Start Delay Were going to use 15 seconds.
Techtree - Requirements Any Alter.
Techtree - Requirements - Tier 2 Any Tier 2 hall, Any Alter.
Techtree - Requirements - Tier 3 Any Tier 3 hall, Any Alter.
Creating the Tavern
Now we'll need a tavern to sell our heroes. I am going to start with the Tavern unit, which already sells heroes and it's a good template. The tavern is found in the object editor, under neutral passive buildings. Right click it and create a new custom unit.
First, lets change the abilities of the tavern. I am going to remove 'Revive Hero Instantly' because I do not want my tavern to revive heroes. The taverns abilities should read:
Abilities - Normal: Select Unit, Invulnerable (Neutral)
Next we add all of the heroes we want the tavern to sell. The field inside the tavern we want to change is Techtree - Units Sold. Double click it to change it, and add in all of your heroes. Again, the tavern can sell a maximum of twelve heroes.
Placing the Tavern on the Map
Your tavern is ready, so now we can place it on the map. The tavern should be in a remote area, farther away from gameplay than your other units. You will also need a region to place the heroes inside when a player picks them.
You will need a player unit somewhere near the tavern, so that a player can purchase units from it. Most commonly used unit is the circle of power. Place a custom circle of power for each player that can buy heroes from the tavern. I like to make my circles of power very small, so they are not obviously seen. You can change the Art - Scaling Value to .10 and hide them behind the back of the building.
Place the player units near the tavern. I prefere to hide mine.
Alter Gameplay Constants
Next we need to alter the gameplay constants to restrict heroes to 1 per player.
Click Advanced, Gameplay Constants.
Check the box at the top that says 'Use Custom Gameplay Constants'.
Find 'Techtree - Dependancy Equivalents - Alter'. Here, add your custom circle of power we are using next to the taverns. You now have a legitamate alter on the map, using the circle of power. This will allow you to purchase a hero.
Find 'Techtree - Dependancy Equivalents - Hero'. This controls which units count when restricting heroes. Clear all heroes already on the list. Now one by one, add your custom heroes here. This prevents your players from purchasing more than one hero!
Click 'OK' when finished.
Creating the Triggers
The first trigger you will need is a trigger to give every player some starting resources. Most importantly, this trigger ADDS ALL HEROES to an array variable. This is used to generate random hero picks. Our trigger will run when the map starts.
Total_Heroes is how many heroes you have. I have 8 heroes.
Random_Count is how many randoms are left. Should be EQUAL to your Total_Heroes.
Hero_Array contains ALL your custom heroes.
Random_Data is used for choosing a random, uniqe hero. This should ALSO be equal to your number of heroes.
Map Initialization
Events
Map initialization
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player - Set (Picked player) Current gold to 750
Player - Set (Picked player) Current lumber to 100
Camera - Pan camera for (Picked player) to (Position of Tavern 0000 ) over 0.00 seconds
Player - Set (Picked player) Food cap to 6
Set Total_Heroes = 8
Set Random_Count = 8
Set Hero_Array[1] = Alchemist
Set Hero_Array[2] = Naga Sea Witch
Set Hero_Array[3] = Tinker
Set Hero_Array[4] = Beastmaster
Set Hero_Array[5] = Dark Ranger
Set Hero_Array[6] = Firelord
Set Hero_Array[7] = Pandaren Brewmaster
Set Hero_Array[8] = Pit Lord
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
Set Random_Data[(Integer A)] = (Integer A)
Thx đã đọc
( cho ví dụ xài trigger để làm knock back cho dễ hiểu ) :hug: