Adding/RemovingSpellsfromSkillPointsMenu(need help)
HeroUnitID:
H01G:Hant
There's a hero that has spells with RawCodes:
A07E:ANmo ( Normal Spell ) <-- AoE Spell Thunderstorm
A04E:A0s2 ( Normal Spell ) <-- AoE Spell2 Similar to shockwave
A024:A0cl or A024:A0cI ( Normal Spell ) Hard to see. <--- The old Ulti / Chain lightning alike
RawCodes For New Spells:
A023:ANmo ( Old Spell Turned into Ulti ) Thunderstorm
A02B:ANsi ( Normal spell ) <-- Silence/Slow
A070:AUfn ( Normal Spell ) <--similar to frost nova
I need a trigger where Player(6) types a chat message ''-RevertForm''
and remove the New spells from the HeroSkillsMenuSelection and add the Other spells into the HeroSkillsMenuSelection.
All of those spells are levelable up to 4. Would this work? What am I missing?
Spell only works once because there won't be a trigger to reverse it.
HeroUnitID:
H01G:Hant
There's a hero that has spells with RawCodes:
A07E:ANmo ( Normal Spell ) <-- AoE Spell Thunderstorm
A04E:A0s2 ( Normal Spell ) <-- AoE Spell2 Similar to shockwave
A024:A0cl or A024:A0cI ( Normal Spell ) Hard to see. <--- The old Ulti / Chain lightning alike
RawCodes For New Spells:
A023:ANmo ( Old Spell Turned into Ulti ) Thunderstorm
A02B:ANsi ( Normal spell ) <-- Silence/Slow
A070:AUfn ( Normal Spell ) <--similar to frost nova
I need a trigger where Player(6) types a chat message ''-RevertForm''
and remove the New spells from the HeroSkillsMenuSelection and add the Other spells into the HeroSkillsMenuSelection.
All of those spells are levelable up to 4. Would this work? What am I missing?
Spell only works once because there won't be a trigger to reverse it.
JASS:
function RevertForm takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer lvl1 = GetUnitAbilityLevel(u,'A023')
local integer lvl2 = GetUnitAbilityLevel(u,'A02B')
local integer lvl3 = GetUnitAbilityLevel(u,'A070')
call UnitRemoveAbility(u,'A023')
call UnitRemoveAbility(u,'A02B')
call UnitRemoveAbility(u,'A070')
call UnitAddAbility(u,'A07E')
call UnitAddAbility(u,'A04E')
call UnitAddAbility(u,'A024')
call SetUnitAbilityLevel(u,'A024',lvl1)
call SetUnitAbilityLevel(u,'A07E',lvl2)
call SetUnitAbilityLevel(u,'A04E',lvl3)
set u = null
call DestroyTrigger(GetTriggeringTrigger())
endfunction
function InitTrig_RevertForm takes nothing returns nothing
local trigger RF = CreateTrigger()
call TriggerRegisterPlayerChatEvent(RF,Player(6),''-RevertForm'',true)
call TriggerAddAction(RF, function RevertForm)
set RF = null
endfunction
Last edited: