- Joined
- Jun 15, 2018
- Messages
- 195
Hi, I want to create a "Book of Learning" whereby the Hero who holds this item will get 50% more experience. Let's start with the fact that it is not easy. You can't just use it:
So you will have to manually increase the amount of experience for the hero with this item. Knowing the mechanics of the game experience is essential. I will describe it below:
Let's start with the fact that always experience is shared between Heroes that belongs to owner of killing unit or his allies.
This mechanic works if there is no Hero within 1200 range of dying unit:
1. The experience is awarded globally without loss due to the distance you are away.
2. Experience is shared between all heroes currently on the map
The exception to such mechanics is the situation in which there is a hero within 1200 range:
1. The experience is shared only to Heroes which are in 1200 range from dying unit.
There is experience bonus for killing due to Tech (Tier of Hall):
If Player have only one Hero (including dead heroes and heroes being trained), he'll receive extra experience points if he's either on tier 2 or tier 3.
Tier 1 - 100%
Tier 2 - 115%
Tier 3 - 130%
If Player starts training another Hero or he has more than one already (including dead heroes) he will get normal experience bonus ratio.
High level = less experience from creeping:
It is known that if your hero is level 5, he no longer gains experience for killing creeps.
But you also get less experience every time your hero gains a level:
Summoned units gives 50% experience.
Now you should know how much experience you get for killing a particular unit or hero:
When it comes to the mechanics of gaining experience, that's all. If it is not legible read the article I used to make this note: Hero Experience In Warcraft 3: How It Works
Now let's focus on stages of triggers:
First we need to collect data needed to calculate the value of the experience granted:
Here is pattern: (Pure Experience)/(Amount of Heroes)x(Tech Tier Bonus)x(Book of Learing Value)x(Creeps Reduction (if need))
Pure Experience:
We need two arrays of integers UnitsExperience and HeroesExperience. Then we need to set them due to level:
UnitsExperience[1] = 25
UnitsExperience[2] = 40
...
UnitsExperience[10] = 340
HeroesExperience[1] = 100
HeroesExperience[2] = 120
...
HeroesExperience[10] = 800
Amount of Heroes:
I have a little problem with this one. In this variable I need to store ammount of Heroes owned by player who killed unit or his allies. We have two cases:
1. No Heroes in 1200 range from dying unit
2. There is/are Hero/Heroes in this range
Due to this we set Ammount of Heroes to:
1. Units in Playable Map Area of type Hero, owned by Player (Owner of Killing Unit) or Ally of him.
2. Units within 1200 range of Position of Dying Unit of type Hero, owned by Player (Owner of Killing Unit) or Ally of him.
Tech Tier Bonus:
I found a way to count this one. I will put triggers later.
Book of Learining Value:
On the start we can set it to 1 to simplify tests or calculations.
Creeps Reduction:
Also easy to make.
So far I made it for Heroes in 1200 Range. But I have problem with picking all Heroes in map in the same trigger using picked units. :/
-
Hero - Make Player 1 (Red) Heroes gain 100.00% experience from future kills
So you will have to manually increase the amount of experience for the hero with this item. Knowing the mechanics of the game experience is essential. I will describe it below:
Let's start with the fact that always experience is shared between Heroes that belongs to owner of killing unit or his allies.
This mechanic works if there is no Hero within 1200 range of dying unit:
1. The experience is awarded globally without loss due to the distance you are away.
2. Experience is shared between all heroes currently on the map
The exception to such mechanics is the situation in which there is a hero within 1200 range:
1. The experience is shared only to Heroes which are in 1200 range from dying unit.
There is experience bonus for killing due to Tech (Tier of Hall):
If Player have only one Hero (including dead heroes and heroes being trained), he'll receive extra experience points if he's either on tier 2 or tier 3.
Tier 1 - 100%
Tier 2 - 115%
Tier 3 - 130%
If Player starts training another Hero or he has more than one already (including dead heroes) he will get normal experience bonus ratio.
High level = less experience from creeping:
It is known that if your hero is level 5, he no longer gains experience for killing creeps.
But you also get less experience every time your hero gains a level:
Summoned units gives 50% experience.
Now you should know how much experience you get for killing a particular unit or hero:
When it comes to the mechanics of gaining experience, that's all. If it is not legible read the article I used to make this note: Hero Experience In Warcraft 3: How It Works
Now let's focus on stages of triggers:
First we need to collect data needed to calculate the value of the experience granted:
Here is pattern: (Pure Experience)/(Amount of Heroes)x(Tech Tier Bonus)x(Book of Learing Value)x(Creeps Reduction (if need))
Pure Experience:
We need two arrays of integers UnitsExperience and HeroesExperience. Then we need to set them due to level:
UnitsExperience[1] = 25
UnitsExperience[2] = 40
...
UnitsExperience[10] = 340
HeroesExperience[1] = 100
HeroesExperience[2] = 120
...
HeroesExperience[10] = 800
Amount of Heroes:
I have a little problem with this one. In this variable I need to store ammount of Heroes owned by player who killed unit or his allies. We have two cases:
1. No Heroes in 1200 range from dying unit
2. There is/are Hero/Heroes in this range
Due to this we set Ammount of Heroes to:
1. Units in Playable Map Area of type Hero, owned by Player (Owner of Killing Unit) or Ally of him.
2. Units within 1200 range of Position of Dying Unit of type Hero, owned by Player (Owner of Killing Unit) or Ally of him.
Tech Tier Bonus:
I found a way to count this one. I will put triggers later.
Book of Learining Value:
On the start we can set it to 1 to simplify tests or calculations.
Creeps Reduction:
Also easy to make.
-
Setup Experience
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- Setup TechBonusMultipler --------
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
-
Set VariableSet TechBonusMultipler[(Integer A)] = 1.00
-
-
-
-------- Setup CreepsMultipler --------
-
Set VariableSet CreepsMultipler[1] = 0.80
-
Set VariableSet CreepsMultipler[2] = 0.70
-
Set VariableSet CreepsMultipler[3] = 0.60
-
Set VariableSet CreepsMultipler[4] = 0.50
-
For each (Integer A) from 5 to 20, do (Actions)
-
Loop - Actions
-
Set VariableSet CreepsMultipler[(Integer A)] = 0.00
-
-
-
-------- Setup UnitsExperience --------
-
Set VariableSet TempScalar = 5
-
Set VariableSet Scalar = 15
-
For each (Integer A) from 1 to 20, do (Actions)
-
Loop - Actions
-
Set VariableSet TempScalar = (TempScalar + 5)
-
Set VariableSet Scalar = (Scalar + TempScalar)
-
Set VariableSet UnitsExperience[(Integer A)] = Scalar
-
-
-
-------- Setup HeroExperience --------
-
Set VariableSet TempScalar = -20
-
Set VariableSet Scalar = 100
-
For each (Integer A) from 1 to 4, do (Actions)
-
Loop - Actions
-
Set VariableSet TempScalar = (TempScalar + 20)
-
Set VariableSet Scalar = (Scalar + TempScalar)
-
Set VariableSet HeroesExperience[(Integer A)] = Scalar
-
-
-
Set VariableSet Scalar = 200
-
For each (Integer A) from 5 to 20, do (Actions)
-
Loop - Actions
-
Set VariableSet HeroesExperience[(Integer A)] = (Scalar + 100)
-
-
-
-
-
Train Hero
-
Events
-
Unit - A unit Is issued an order with no target
-
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Issued order) Equal to (Order(Paladin))
-
(Issued order) Equal to (Order(Archmage))
-
(Issued order) Equal to (Order(Mountain King))
-
(Issued order) Equal to (Order(Blood Mage))
-
(Issued order) Equal to (Order(Blademaster))
-
(Issued order) Equal to (Order(Far Seer))
-
(Issued order) Equal to (Order(Tauren Chieftain))
-
(Issued order) Equal to (Order(Shadow Hunter))
-
(Issued order) Equal to (Order(Death Knight))
-
(Issued order) Equal to (Order(Lich))
-
(Issued order) Equal to (Order(Dreadlord))
-
(Issued order) Equal to (Order(Crypt Lord))
-
(Issued order) Equal to (Order(Keeper of the Grove))
-
(Issued order) Equal to (Order(Priestess of the Moon))
-
(Issued order) Equal to (Order(Demon Hunter))
-
(Issued order) Equal to (Order(Warden))
-
(Issued order) Equal to (Order(Alchemist))
-
(Issued order) Equal to (Order(Sea Witch))
-
(Issued order) Equal to (Order(Tinker))
-
(Issued order) Equal to (Order(Beastmaster))
-
(Issued order) Equal to (Order(Brewmaster))
-
(Issued order) Equal to (Order(Dark Ranger))
-
(Issued order) Equal to (Order(Firelord))
-
(Issued order) Equal to (Order(Pit Lord))
-
-
-
-
Actions
-
-------- When Player Begins Training a Hero --------
-
-------- Increases Heroes Amount for him (0, 1, 2, 3) --------
-
Set VariableSet HeroesAmount[(Player number of (Owner of (Triggering unit)))] = (HeroesAmount[(Player number of (Owner of (Triggering unit)))] + 1)
-
-------- When Player has more than 1 Hero --------
-
-------- TechBonusMultipler = 1 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HeroesAmount[(Player number of (Owner of (Triggering unit)))] Greater than 1
-
-
Then - Actions
-
Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.00
-
-
Else - Actions
-
-
-
-
Cancel Hero
-
Events
-
Unit - A unit Cancels training a unit
-
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Altar of Kings
-
(Unit-type of (Triggering unit)) Equal to Altar of Storms
-
(Unit-type of (Triggering unit)) Equal to Altar of Darkness
-
(Unit-type of (Triggering unit)) Equal to Altar of Elders
-
-
-
-
Actions
-
-------- When Player Cancels Training a Hero --------
-
-------- Decreases Heroes Amount for him (0, 1, 2, 3) --------
-
Set VariableSet HeroesAmount[(Player number of (Owner of (Triggering unit)))] = (HeroesAmount[(Player number of (Owner of (Triggering unit)))] - 1)
-
-------- For each checks if Player has at most 1 Hero --------
-
-------- TechBonusMultipler = 1 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HeroesAmount[(Player number of (Owner of (Triggering unit)))] Less than or equal to 1
-
-
Then - Actions
-
Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.00
-
-
Else - Actions
-
-
-------- TechBonusMultipler = 1.15 when Player has T2 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HeroesAmount[(Player number of (Owner of (Triggering unit)))] Less than or equal to 1
-
Or - Any (Conditions) are true
-
Conditions
-
(Number of living Keep units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Stronghold units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Halls of the Dead units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Tree of Ages units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
-
-
-
Then - Actions
-
Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.15
-
-
Else - Actions
-
-
-------- TechBonusMultipler = 1.3 when Player has T3 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HeroesAmount[(Player number of (Owner of (Triggering unit)))] Less than or equal to 1
-
Or - Any (Conditions) are true
-
Conditions
-
(Number of living Castle units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Fortress units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Black Citadel units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Tree of Eternity units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
-
-
-
Then - Actions
-
Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.30
-
-
Else - Actions
-
-
-
-
Tech Bonus
-
Events
-
Unit - A unit Finishes construction
-
Unit - A unit Finishes an upgrade
-
Unit - A unit Dies
-
-
Conditions
-
HeroesAmount[(Player number of (Owner of (Triggering unit)))] Less than or equal to 1
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Keep
-
(Unit-type of (Triggering unit)) Equal to Castle
-
(Unit-type of (Triggering unit)) Equal to Stronghold
-
(Unit-type of (Triggering unit)) Equal to Fortress
-
(Unit-type of (Triggering unit)) Equal to Halls of the Dead
-
(Unit-type of (Triggering unit)) Equal to Black Citadel
-
(Unit-type of (Triggering unit)) Equal to Tree of Ages
-
(Unit-type of (Triggering unit)) Equal to Tree of Eternity
-
-
-
-
Actions
-
-------- When Player Finishes tech or lose it --------
-
-------- Changes TechBonusMultipler dependently --------
-
Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.00
-
-------- TechBonusMultipler = 1.15 when Player has T2 and 1 Hero --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Number of living Keep units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Stronghold units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Halls of the Dead units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Tree of Ages units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
-
-
-
Then - Actions
-
Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.15
-
-
Else - Actions
-
-
-------- TechBonusMultipler = 1.3 when Player has T3 and 1 Hero --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Number of living Castle units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Fortress units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Black Citadel units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
(Number of living Tree of Eternity units owned by (Owner of (Triggering unit))) Greater than or equal to 1
-
-
-
-
Then - Actions
-
Set VariableSet TechBonusMultipler[(Player number of (Owner of (Triggering unit)))] = 1.30
-
-
Else - Actions
-
-
-
-
Book of Learning
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
Actions
-
-------- Picks Heroes that belongs to owner of killing unit or his allies in 1200 area --------
-
-------- --------
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 1200.00 of (Position of (Dying unit)).) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Owner of (Killing unit)) is an ally of (Owner of (Picked unit)).) Equal to True
-
((Owner of (Dying unit)) is an enemy of (Owner of (Picked unit)).) Equal to True
-
((Picked unit) is A Hero) Equal to True
-
-
Then - Actions
-
-------- --------
-
-------- FullHeroes = Count units is this group --------
-
-------- We will use this value to verify if there are 0 Heroes in 1200 range --------
-
-------- In this case we need to: FullHeroes = Cout each Hero in entire map that belongs to owner of killing unit or his allies --------
-
-------- This value will be used to count sharing experience --------
-
Unit Group - Add (Picked unit) to TempUnitGroup
-
Set VariableSet FullHeroes = (Number of units in TempUnitGroup)
-
-------- --------
-
-------- Here we have each Hero in 1200 range or in whloe Map --------
-
-------- Now we want to save only those with the item - Book of Learining --------
-
-------- For later giving the Experience --------
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) has an item of type |cffffcc00Book of Learning|r) Equal to True
-
-
Then - Actions
-
-------- Now we check if dying unit is Hero/Creep/Summon/Unit --------
-
-------- Killing Hero: --------
-
-------- Uses HeroesExperience values to count ExperienceGained --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Dying unit) is A Hero) Equal to True
-
(Owner of (Dying unit)) Not equal to Neutral Hostile
-
-
Then - Actions
-
Set VariableSet ExperienceGained = (Integer((((Real(HeroesExperience[(Hero level of (Dying unit))])) / (Real(FullHeroes))) x (1.00 x TechBonusMultipler[(Player number of (Owner of (Picked unit)))]))))
-
-
Else - Actions
-
-
-------- --------
-
-------- Summon: --------
-
-------- Uses UnitsExperience values and 50% multipler to count ExperienceGained --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Dying unit) is Summoned) Equal to True
-
(Owner of (Dying unit)) Not equal to Neutral Hostile
-
-
Then - Actions
-
Set VariableSet ExperienceGained = (Integer((((Real((UnitsExperience[(Level of (Dying unit))] / 2))) / (Real(FullHeroes))) x (1.00 x TechBonusMultipler[(Player number of (Owner of (Picked unit)))]))))
-
-
Else - Actions
-
-
-------- --------
-
-------- Unit: --------
-
-------- Uses UnitsExperience values to count ExperienceGained --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Dying unit) is Summoned) Equal to False
-
(Owner of (Dying unit)) Not equal to Neutral Hostile
-
-
Then - Actions
-
Set VariableSet ExperienceGained = (Integer((((Real(UnitsExperience[(Level of (Dying unit))])) / (Real(FullHeroes))) x (1.00 x TechBonusMultipler[(Player number of (Owner of (Picked unit)))]))))
-
-
Else - Actions
-
-
-------- --------
-
-------- Creep: --------
-
-------- Uses UnitsExperience values to count ExperienceGained --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Dying unit)) Equal to Neutral Hostile
-
-
Then - Actions
-
Set VariableSet ExperienceGained = (Integer((((Real(UnitsExperience[(Level of (Dying unit))])) / (Real(FullHeroes))) x ((CreepsMultipler[(Level of (Picked unit))] x 1.00) x TechBonusMultipler[(Player number of (Owner of (Picked unit)))]))))
-
-
Else - Actions
-
-
-------- --------
-
-------- Creep Summon: --------
-
-------- Uses UnitsExperience values to count ExperienceGained --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Dying unit)) Equal to Neutral Hostile
-
((Dying unit) is Summoned) Equal to True
-
-
Then - Actions
-
Set VariableSet ExperienceGained = (Integer((((Real(UnitsExperience[(Level of (Dying unit))])) / (Real(FullHeroes))) x ((CreepsMultipler[(Level of (Picked unit))] x (1.00 x 0.50)) x TechBonusMultipler[(Player number of (Owner of (Picked unit)))]))))
-
-
Else - Actions
-
-
-------- --------
-
Hero - Add ExperienceGained experience to (Picked unit), Hide level-up graphics
-
Unit Group - Remove all units from TempUnitGroup.
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
-
-
Attachments
Last edited: