WildTurkey
Previously known as giv_me_rep
- Reaction score
- 88
So I have a morph ability for a unit using base spell robo-goblin.
when spell is cast abilities are removed and replaced and set to original level of abilities.
Abilities stored as array ability variables HeroAbilityX[player number] and HeroAlternateAbilityX[player number]. To detect if a unit is morphing in or out of normal form theres an additional variable AltFormActive
I cant see why it isnt working and have looked online, found some JASS code but I couldnt get it to work, know the issue I have?
Current code is as follows:
when spell is cast abilities are removed and replaced and set to original level of abilities.
Abilities stored as array ability variables HeroAbilityX[player number] and HeroAlternateAbilityX[player number]. To detect if a unit is morphing in or out of normal form theres an additional variable AltFormActive
I cant see why it isnt working and have looked online, found some JASS code but I couldnt get it to work, know the issue I have?
Current code is as follows:
Code:
Shapeshift Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Shapeshift
Actions
Game - Display to (All players) the text: yes
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
AlternateFormActive[(Player number of (Owner of (Triggering unit)))] Equal to False
Then - Actions
Unit - Remove HeroAbility1[(Player number of (Owner of (Triggering unit)))] from (Triggering unit)
Unit - Remove HeroAbility2[(Player number of (Owner of (Triggering unit)))] from (Triggering unit)
Unit - Remove HeroAbility3[(Player number of (Owner of (Triggering unit)))] from (Triggering unit)
Unit - Add HeroAbility1_Alternate[(Player number of (Owner of (Triggering unit)))] to (Triggering unit)
Unit - Add HeroAbility2_Alternate[(Player number of (Owner of (Triggering unit)))] to (Triggering unit)
Unit - Add HeroAbility3_Alternate[(Player number of (Owner of (Triggering unit)))] to (Triggering unit)
Unit - Set level of HeroAbility1_Alternate[(Player number of (Owner of (Triggering unit)))] for (Triggering unit) to HeroAbilityLevel1[(Player number of (Owner of (Triggering unit)))]
Unit - Set level of HeroAbility2_Alternate[(Player number of (Owner of (Triggering unit)))] for (Triggering unit) to HeroAbilityLevel2[(Player number of (Owner of (Triggering unit)))]
Unit - Set level of HeroAbility3_Alternate[(Player number of (Owner of (Triggering unit)))] for (Triggering unit) to HeroAbilityLevel3[(Player number of (Owner of (Triggering unit)))]
Set AlternateFormActive[(Player number of (Owner of (Triggering unit)))] = True
Else - Actions
Unit - Remove HeroAbility1_Alternate[(Player number of (Owner of (Triggering unit)))] from (Triggering unit)
Unit - Remove HeroAbility2_Alternate[(Player number of (Owner of (Triggering unit)))] from (Triggering unit)
Unit - Remove HeroAbility3_Alternate[(Player number of (Owner of (Triggering unit)))] from (Triggering unit)
Unit - Add HeroAbility1[(Player number of (Owner of (Triggering unit)))] to (Triggering unit)
Unit - Add HeroAbility2[(Player number of (Owner of (Triggering unit)))] to (Triggering unit)
Unit - Add HeroAbility3[(Player number of (Owner of (Triggering unit)))] to (Triggering unit)
Unit - Set level of HeroAbility1[(Player number of (Owner of (Triggering unit)))] for (Triggering unit) to HeroAbilityLevel1[(Player number of (Owner of (Triggering unit)))]
Unit - Set level of HeroAbility2[(Player number of (Owner of (Triggering unit)))] for (Triggering unit) to HeroAbilityLevel2[(Player number of (Owner of (Triggering unit)))]
Unit - Set level of HeroAbility3[(Player number of (Owner of (Triggering unit)))] for (Triggering unit) to HeroAbilityLevel3[(Player number of (Owner of (Triggering unit)))]
Set AlternateFormActive[(Player number of (Owner of (Triggering unit)))] = False