WolfieeifloW
WEHZ Helper
- Reaction score
- 372
Spellbook And Switching Auras
This may be a little complicated..
I want a hero to have two auras, but only one able to be active at a time.
From my other thread I've learned I should probably use a spellbook to accomplish this.
I have two abilities based off Thunderclap, and then the actual two auras, making 4 spells in total (5 with the spellbook).
So my hero only has the first aura as one of his abilities.
The rest is triggers.
When he learns the aura (We'll use Command and Endurance) Command, I have a trigger like this (Haven't had time to convert this one to JASS yet)
So, it gives the spellbook to the hero, sets the levels of the aura to 1, and disables the other aura.
Now, my JASS trigger, is the one that actually makes the abilities switch (Or is supposed to):
There's all the blanked out parts because I saw somewhere remove/add abilities doesn't work very well? If it does, let me know please!
But anyways, when any unit casts one of the Thunderclap dummies, it's supposed to disable the Thunderclap dummy for Command aura, then disable the actual Command Aura inside the spellbook. Then enable the Thunderclap dummy for Endurance, and enable to actual Endurance aura inside the spellbook, and set the level of both Endurance things to the level of the Command things.
So, anyone know what's wrong?
I am willing to send the map to anyone who will help me fix this!
This may be a little complicated..
I want a hero to have two auras, but only one able to be active at a time.
From my other thread I've learned I should probably use a spellbook to accomplish this.
I have two abilities based off Thunderclap, and then the actual two auras, making 4 spells in total (5 with the spellbook).
So my hero only has the first aura as one of his abilities.
The rest is triggers.
When he learns the aura (We'll use Command and Endurance) Command, I have a trigger like this (Haven't had time to convert this one to JASS yet)
Code:
FULearn
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Frost Presence (D)
Actions
Unit - Add Unholy Presence (D) to (Learning Hero)
Player - Disable Unholy Presence (D) for (Owner of (Learning Hero))
Player - Disable Unholy Presence for (Owner of (Learning Hero))
Unit - Add Spell Book to (Learning Hero)
Unit - Set level of Frost Presence for (Learning Hero) to 1
Player - Disable Spell Book for (Owner of (Learning Hero))
Now, my JASS trigger, is the one that actually makes the abilities switch (Or is supposed to):
JASS:
function F2U takes nothing returns nothing
local integer l
local unit t = GetTriggerUnit()
local integer f = 039;A000039;
local integer u = 039;A001039;
local integer fd = 039;A003039;
local integer ud = 039;A002039;
set l = GetUnitAbilityLevel(t, fd)
//call UnitRemoveAbility(t, fd)
call SetPlayerAbilityAvailable(GetOwningPlayer(t), fd, false)
call SetPlayerAbilityAvailable(GetOwningPlayer(t), f, false)
//call SetUnitAbilityLevel(t, f, 0)
//call UnitAddAbility(t, ud)
call SetPlayerAbilityAvailable(GetOwningPlayer(t), ud, true)
call SetPlayerAbilityAvailable(GetOwningPlayer(t), u, true)
call SetUnitAbilityLevel(t, ud, l)
call SetUnitAbilityLevel(t, u, l)
endfunction
function Conditions takes nothing returns boolean
if GetSpellAbilityId() == 039;A003039; then
call F2U()
//elseif GetSpellAbilityId() == 'A002' then
//call U2F()
endif
return false
endfunction
function Presence takes nothing returns nothing
local integer index = 0
local trigger t = CreateTrigger()
loop
call TriggerRegisterPlayerUnitEvent(t, Player(index), EVENT_PLAYER_UNIT_SPELL_CAST, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(t, Condition(function Conditions))
endfunction
There's all the blanked out parts because I saw somewhere remove/add abilities doesn't work very well? If it does, let me know please!
But anyways, when any unit casts one of the Thunderclap dummies, it's supposed to disable the Thunderclap dummy for Command aura, then disable the actual Command Aura inside the spellbook. Then enable the Thunderclap dummy for Endurance, and enable to actual Endurance aura inside the spellbook, and set the level of both Endurance things to the level of the Command things.
So, anyone know what's wrong?
I am willing to send the map to anyone who will help me fix this!