HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Hero Skill Refund

04-06-2008, 02:10 AM#1
Eyestrain92
I've been working on a custom hero type map, and I have it set so that you buy skills similar to hero craft. Problem is, I don't know how to refund gold once you've hit the max level of an ability. Anyone think they can help me out here?
04-06-2008, 03:36 AM#2
Pyrogasm
Well, you must add to a player's resources:
Trigger:
Player - Add 150 to Player 1 (Red) Current gold
If you're looking for a way to find out how much gold to refund and you're using items for the abilities, you can use weaaddar's GetItemCostById function.
04-06-2008, 05:35 AM#3
Eyestrain92
Augh. I should've been clearer. How do I detect what level a hero's skill is?
04-06-2008, 06:43 AM#4
Pyrogasm
Rather simply:
Trigger:
If (All conditions are true) then do (Then actions) else do (Else actions)
Collapse If - Conditions
(Level of YourAbility for (Triggering Unit)) greater than <Max Level>
Collapse Then - Actions
----- Whatever -----
Collapse Else - Actions
----- Whatever -----