This is as much as I have atm:
First of all, the system:
JASS:
function ACS_AddAbilityCost takes integer abilityCode, real manaCost returns nothing
local integer i = 0
loop
exitwhen(LoadReal(udg_ACS_Hashtable, abilityCode, i) == 0)
set i = i + 1
endloop
call SaveReal(udg_ACS_Hashtable, abilityCode, i, manaCost)
endfunction
function InitTrig_ACS_Initialization takes nothing returns nothing
local integer i
set gg_trg_ACS_Initialization = CreateTrigger()
set udg_ACS_Hashtable = InitHashtableBJ()
set i = 'AHtc' //Ability code of Thunder clap.
call ACS_AddAbilityCost(i, 90) //level 1
call ACS_AddAbilityCost(i, 120) //level 2
call ACS_AddAbilityCost(i, 150) //level 3
endfunction
The first function is very simple and just adds one real to an array that can be accessed by an ability-type-integer.
The second function runs on initialization (hardcoded WC3 stuff) and adds 3 integers for ability 'AHtc' which represents the Thunder Clap of our beloved Mountain King.
It starts with level one and sets the cost to 90.
Level 2 has a 120 cost and level 3 has a 150 cost.
All levels after that have a 0 cost but you can be a smart man an know that you have to add more of the same lines... after all, there are no abilities that make more levels during the game.
Now lets go to the effect:
-
ACS Effect
-

Events
-


Unit - A unit Starts the effect of an ability
-

Conditions
-

Actions
-


Custom script: set udg_TempInteger = GetSpellAbilityId()
-


Set TempInteger2 = ((Level of (Ability being cast) for (Triggering unit)) - 1)
-


Set TempReal = (Load TempInteger2 of TempInteger from ACS_Hashtable)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




((Triggering unit) has an item of type Red Drake Egg) Equal to True
-



Then - Actions
-




Set TempReal = (TempReal / 2.00)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Life of (Triggering unit)) Greater than TempReal
-





Then - Actions
-






Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - TempReal)
-





Else - Actions
-






Unit - Order (Triggering unit) to Stop
-




Skip remaining actions
-



Else - Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Mana of (Triggering unit)) Greater than TempReal
-



Then - Actions
-




Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - TempReal)
-



Else - Actions
-




Unit - Order (Triggering unit) to Stop
This trigger removes the mana of a unit by the amount that is registered in the other trigger.
If the unit has the item Red Drake Egg (yea in my example it is a drake egg

) then the cost is reduced and is token from the life instead.
(The amount / 2 is just an example of how you should deal with the amount and how to change it. You shouldnt change the amount in "set life of triggering unit ..." so you can keep it simple.)
You must set all ability costs to 0 and put up some nice stuff in the descriptions.
Something like: "|cff66ffffMana cost: 90|r|n|n"
The |n|n are two so called "newlines" and are just to make it look nice.
The |cff66ffff ... |r is a color code and a return code. This code adds a color to the text between them.
The color used is 66ffff which is a hex-color code that represents a nice light blue. (Change it to whatever you want.)
This has to be done for every level in every ability.
Because WC3 has not very good tooltips, you cannot make it have a better tooltip than this without doubling your abilities. I also want better ones in WC4 if it ever comes.
Please dont forget to add the global variables when you implement it into your maps. Thank you.