ZeroGravity

Level 6
Hi, like the title said, I want to add not flat number but +50% experience to the hero when picking up tome of experience but I can only use flat number only so yea, any idea?

Chaosium

Level 14
You should be able to do that with a trigger. Replace the Tome of experience condition with your item (make sure it doesn't give any experience by itself)

• Experience
• Events
• Unit - A unit Acquires an item
• Conditions
• (Item-type of (Item being manipulated)) Equal to Tome of Experience
• Actions
• Set Integer = ((100 x 1) + (((Hero level of (Triggering unit)) x 100) + 0))
• Hero - Add (Integer / 2) experience to (Triggering unit), Show level-up graphics
The "difficulty" is to calculate how much EXP the hero needs to reach the next level, that's what the "Set Integer" variable is calculating.

I've run a quick test in a map and it seems to work like that

Edit: attached the test map

Attachments

• TestExperience.w3x
17.5 KB · Views: 3

Chaosium

Level 14
That's great Also, I must note that whole math things depends on the gameplay constants for XP in your map. If you edit these, you'll need to ajust the formula.

ZeroGravity

Level 6
That's great Also, I must note that whole math things depends on the gameplay constants for XP in your map. If you edit these, you'll need to ajust the formula.
Understood, but I have one more question, not sure if I can ask it here or need to create a new thread.

This trigger does not work sometimes and I don't know why. Is there anything wrong with it?

• Golem Hurl Boulder Wall
• Events
• Unit - A unit Dies
• Conditions
• (Unit-type of (Dying unit)) Equal to (Golem) Hurl Boulder Dummy
• Actions
• Set VariableSet Point1 = (Position of (Dying unit))
• Set VariableSet Real1 = (Strength of PlayerHero[(Player number of (Owner of (Dying unit)))] (Include bonuses))
• Set VariableSet Real2 = (Agility of PlayerHero[(Player number of (Owner of (Dying unit)))] (Include bonuses))
• Unit - Create 1 Boulder Wall (Golem) for (Owner of (Dying unit)) at Point1 facing Default building facing degrees
• Set VariableSet Golem_HurlBoulderWall = (Last created unit)
• Unit - Set Max HP of Golem_HurlBoulderWall to ((1000 x (Level of (Golem) Hurl Boulder Wall for PlayerHero[(Player number of (Owner of (Dying unit)))])) + (Real1 x (10 x (Level of (Golem) Hurl Boulder Wall for PlayerHero[(Player number of (Owner of (Dying unit)))]))))
• Unit - Set life of Golem_HurlBoulderWall to 100.00%
• Unit - Set Armor of Golem_HurlBoulderWall to ((5.00 x (Real((Level of (Golem) Hurl Boulder Wall for PlayerHero[(Player number of (Owner of (Dying unit)))])))) + ((Real(Real2)) x (0.10 x (Real((Level of (Golem) Hurl Boulder Wall for PlayerHero[(Player number of (Owner of (Dying unit)))]))))))
• Unit - Add a 180.00 second Generic expiration timer to Golem_HurlBoulderWall
• Set VariableSet UnitGroup1 = (Units within 300.00 of Point1 matching (((Matching unit) belongs to an enemy of (Owner of (Dying unit)).) Equal to True).)
• Unit Group - Pick every unit in UnitGroup1 and do (Actions)
• Loop - Actions
• Unit - Cause (Dying unit) to damage (Picked unit), dealing ((200.00 x (Real((Level of (Golem) Hurl Boulder Wall for PlayerHero[(Player number of (Owner of (Dying unit)))])))) + ((Real(Real1)) x (2.00 x (Real((Level of (Golem) Hurl Boulder Wall for PlayerHero[(Player number of (Owner of (Dying unit)))])))))) damage of attack type Spells and damage type Normal
• Custom script: call RemoveLocation(udg_Point1)
• Custom script: call DestroyGroup(udg_UnitGroup1)
The problem is, it can do damage just fine but sometimes the rock wall doesn't spawn.

Chaosium

Level 14
Not sure really, can't really see anything wrong with the trigger in itself, maybe it's the boulder wall unit that has something wrong, perhaps collision? I don't know.

Try to spawn something else like a peasant to see whether the problem lies in the trigger or the unit

ZeroGravity

Level 6
Not sure really, can't really see anything wrong with the trigger in itself, maybe it's the boulder wall unit that has something wrong, perhaps collision? I don't know.

Try to spawn something else like a peasant to see whether the problem lies in the trigger or the unit
Oh I figured it out that I forgot to fix the boulder all right it's working now. Thanks for everything!

Uncle

Warcraft Moderator
Level 50
Oh I figured it out that I forgot to fix the boulder all right it's working now. Thanks for everything!
I'm not 100% sure but using (Dying unit) like that may cause a problem if the damage it's dealing kills the (Picked unit):
• Unit - Cause (Dying unit) to damage (Picked unit)
I use (Triggering unit) whenever possible as I know it works without issues.

Pyrogasm

Level 36
I'm not 100% sure but using (Dying unit) like that may cause a problem
Dying Unit: Working correctly

Replies
10
Views
345
Replies
2
Views
564
Replies
1
Views
625
Replies
6
Views
827
Replies
3
Views
477