• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spell Convert

Status
Not open for further replies.
Hey, guys!
I've made this spell before and I converted it to custom text but I don't find it's main GUI trigger map. Is there any way to convert it to GUI again?
JASS:
function Trig_EluneBolt_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A603' ) ) then
        return false
    endif
    return true
endfunction

function Trig_EluneBolt_Func013Func001C takes nothing returns boolean
    if ( not ( IsUnitDeadBJ(udg_Unit01) == true ) ) then
        return false
    endif
    if ( not ( IsUnitDeadBJ(udg_Unit02) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_EluneBolt_Actions takes nothing returns nothing
    set udg_Targ_Unit = GetSpellTargetUnit()
    set udg_Temp_Unit = GetTriggerUnit()
    set udg_Temp_Point = GetUnitLoc(GetTriggerUnit())
    set udg_Targ_Point = GetUnitLoc(GetSpellTargetUnit())
    call AddSpecialEffectLocBJ( udg_Temp_Point, "Abilities\\Spells\\Orc\\SpiritLink\\SpiritLinkZapTarget.mdl" )
    set udg_Effect01 = GetLastCreatedEffectBJ()
    call AddSpecialEffectLocBJ( udg_Temp_Point, "Abilities\\Spells\\Orc\\SpiritLink\\SpiritLinkZapTarget.mdl" )
    set udg_Effect02 = GetLastCreatedEffectBJ()
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 5
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        call CreateNUnitsAtLoc( 1, 'h603', Player(0), udg_Temp_Point, bj_UNIT_FACING )
        set udg_Unit01 = GetLastCreatedUnit()
        call CreateNUnitsAtLoc( 1, 'h603', Player(0), udg_Targ_Point, bj_UNIT_FACING )
        call KillUnit( udg_Unit01 )
        set udg_Unit02 = GetLastCreatedUnit()
        call KillUnit( udg_Unit02 )
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call AddLightningLoc( "CLPB", udg_Temp_Point, udg_Targ_Point )
    set udg_Lightning = GetLastCreatedLightningBJ()
    call TriggerSleepAction( 0.05 )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 5
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_EluneBolt_Func013Func001C() ) then
            set bj_forLoopAIndex = 1
            set bj_forLoopAIndexEnd = 30
            loop
                exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
                call PlaySoundAtPointBJ( gg_snd_LightningBolt1, 100, udg_Targ_Point, 0 )
                call AddSpecialEffectLocBJ( udg_Targ_Point, "Doodads\\Cinematic\\Lightningbolt\\Lightningbolt.mdl" )
                call UnitDamageTargetBJ( GetTriggerUnit(), GetSpellTargetUnit(), ( 1000000000.00 * GetUnitLifePercent(udg_Targ_Unit) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
                set bj_forLoopAIndex = bj_forLoopAIndex + 1
            endloop
            set bj_forLoopAIndex = 1
            set bj_forLoopAIndexEnd = 16
            loop
                exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
                call AddSpecialEffectLocBJ( udg_Targ_Point, "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
                call DestroyEffectBJ( GetLastCreatedEffectBJ() )
                call DestroyEffectBJ( udg_Effect01 )
                call DestroyEffectBJ( udg_Effect02 )
                set bj_forLoopAIndex = bj_forLoopAIndex + 1
            endloop
            call AddSpecialEffectLocBJ( udg_Targ_Point, "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" )
            call DestroyLightningBJ( udg_Lightning )
        else
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_EluneBolt takes nothing returns nothing
    set gg_trg_EluneBolt = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_EluneBolt, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_EluneBolt, Condition( function Trig_EluneBolt_Conditions ) )
    call TriggerAddAction( gg_trg_EluneBolt, function Trig_EluneBolt_Actions )
endfunction
 
Level 12
Joined
Dec 11, 2014
Messages
665
Ill give it a shot once I'm back at my pc, ill edit this post if i manage something

  • Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set Targ_Unit = (Target unit of ability being cast)
      • Set Temp_Unit = (Triggering unit)
      • Set Temp_Point = (Position of (Triggering unit))
      • Set Targ_Point = (Position of (Target unit of ability being cast))
      • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Orc\SpiritLink\SpiritLinkZapTarget.mdl
      • Set Effect01 = (Last created special effect)
      • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Orc\SpiritLink\SpiritLinkZapTarget.mdl
      • Set Effect02 = (Last created special effect)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing degrees
          • Set Unit01 = (Last created unit)
          • Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing degrees
          • Unit - Kill Unit01
          • Set Unit02 = (Last created unit)
          • Unit - Kill Unit02
      • Lightning - Create a Chain Lightning - Primary lightning effect from source Temp_Point to target Targ_Point
      • Set Lightning = (Last created lightning effect)
      • Wait 0.05 seconds
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit01 is alive) Equal to True
                  • (Unit02 is alive) Equal to True
            • Then - Actions
              • For each (Integer A) from 1 to 30, do (Actions)
                • Loop - Actions
                  • Sound - Play (Last played sound) at 100.00% volume, located at Temp_Point with Z offset 0.00
                  • Special Effect - Create a special effect at Targ_Point using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
                  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (1000000.00 x (Percentage life of Targ_Unit)) damage of attack type Normal and damage type Magic
              • For each (Integer A) from 1 to 16, do (Actions)
                • Loop - Actions
                  • Special Effect - Create a special effect at Targ_Point using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Destroy Effect01
                  • Special Effect - Destroy Effect02
              • Special Effect - Create a special effect at Targ_Point using Abilities\Spells\Other\Doom\DoomDeath.mdl
              • Lightning - Destroy Lightning
            • Else - Actions
Here you go. There are still some things that you have to edit like the condition where it checks which ability it is.
Sidenote: the trigger is a mess, there are a lot of things wrong with it.
 

Attachments

  • Spell.w3x
    7.6 KB · Views: 32
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
Indeed, there are several flaws in it. Effects are leaking, multiple loops using the very same global variable (Integer A), checking if units are alive, but they get killed at creation time - always returning false, lightning effect never gets destroyed because of the if-statement problem.
 
Here you go. There are still some things that you have to edit like the condition where it checks which ability it is.
Thanks, man! :)
Sidenote: the trigger is a mess, there are a lot of things wrong with it.
Indeed, there are several flaws in it. Effects are leaking, multiple loops using the very same global variable (Integer A), checking if units are alive, but they get killed at creation time - always returning false, lightning effect never gets destroyed because of the if-statement problem.
Yeah, I know and I want to fix them, that's why I asked if there is any way to return the trigger.
 
Last edited:
Status
Not open for further replies.
Top