- Reaction score
- 888
> Why?
Deleted the globals. Didn't want to rename all the variables in the code.
Deleted the globals. Didn't want to rename all the variables in the code.
If this is all that is in your spell you can upgrade it to MUI easy.Code:Pillar of Lightning Events Unit - A unit Starts the effect of an ability Conditions (Ability being cast) Equal to Pillar of Lightning Actions Set TempPoint = ((Target point of ability being cast) offset by (0.00, 0.00)) Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl Special Effect - Destroy (Last created special effect) For each (Integer A) from 1 to 10, do (Actions) Loop - Actions Unit - Create 1 Effect Unit for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees Unit - Order (Last created unit) to Stop Animation - Play (Last created unit)'s stand animation Set Wisps[(Integer A)] = (Last created unit) Animation - Change Wisps[(Integer A)] flying height to (50.00 x ((Real((Integer A))) - 1.00)) at 500.00 Wait 0.10 seconds For each (Integer A) from 1 to LightningIntervals, do (Actions) Loop - Actions For each (Integer B) from 1 to NumberofTargets, do (Actions) Loop - Actions Custom script: if (bj_forLoopBIndex == 1 or GetRandomInt(1,100) <= udg_ChanceforBolt) then Unit - Create 1 Effect Unit for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees Set Caster = (Last created unit) Unit - Hide Caster Unit - Add a 3.00 second Generic expiration timer to Caster Animation - Change Caster flying height to (Random real number between 100.00 and 450.00) at 4000.00 Set TempGroup = (Units within BoltRange of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) Set Target = (Random unit from TempGroup) Unit - Order Caster to Orc Far Seer - Chain Lightning Target Custom script: call DestroyGroup(udg_TempGroup) Custom script: endif Wait (Random real number between 1.00 and 3.00) seconds For each (Integer A) from 1 to 10, do (Actions) Loop - Actions Animation - Change Wisps[(Integer A)] flying height to 0.00 at 300.00 Wait 2.50 seconds For each (Integer A) from 1 to 10, do (Actions) Loop - Actions Unit - Remove Wisps[(Integer A)] from the game Custom script: call RemoveLocation(udg_TempPoint)
exitwhen looping > end
exitwhen looping > 10
exitwhen looping > 10
set end = LightningIntervals
call CreateNUnitsAtLoc( 1, 039;e000039;, GetOwningPlayer(GetTriggerUnit()), TempPoint, bj_UNIT_FACING )
call IssueImmediateOrder( GetLastCreatedUnit(), "stop" )
call SetUnitAnimation( GetLastCreatedUnit(), "stand" )
set Wisps[looping] = GetLastCreatedUnit()
function AddSpecialEffectLocBJ takes location where, string modelName returns effect
set bj_lastCreatedEffect = AddSpecialEffectLoc(modelName, where)
return bj_lastCreatedEffect
endfunction
native AddSpecialEffectLoc takes string modelName, location where returns effect
local grup g=CreateGroup()
call GroupEnumUnitsInRangeOfLocMatching(all arguments here...)
call RemoveUnit(CreateUnit(bla bla))
//Constant functions, you may edit these//
constant function POL_rawcode takes nothing returns integer
return 039;A000039; //The rawcode of the spell//
//POL means Pillar_Of_Lightning//
endfunction
constant function POL_ThunderClap takes nothing returns string
return "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl"
endfunction
constant function LightningIntervals takes nothing returns integer
return 50
endfunction
constant function NumberofTargets takes nothing returns integer
return 3
endfunction
constant function ChanceforBolt takes nothing returns integer
return 20
endfunction
constant function BoltRange takes nothing returns real
return 600.
endfunction
//Do NOT edit past this point unless you know what you are doing//
function Pillar_Of_Lightning_UnitEnemy takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Pillar_of_Lightning_Conditions takes nothing returns boolean
return GetSpellAbilityId() == POL_rawcode()
endfunction
function Trig_Pillar_of_Lightning_Actions takes nothing returns nothing
local unit array Wisps
local location TempPoint
local unit Caster
local unit Target
local group TempGroup
local integer i = 0
local integer i2 = 0
set TempPoint = GetSpellTargetLoc()
call DestroyEffect(AddSpecialEffectLoc(POL_ThunderClap(), TempPoint ))
set i = 1
loop
exitwhen i > 10
set Wisps<i> = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()) , 039;e000039;, TempPoint, bj_UNIT_FACING )
call IssueImmediateOrder( Wisps<i>, "stop" )
call SetUnitAnimation( Wisps<i>, "stand" )
call ResetUnitAnimation( Wisps<i> )
call SetUnitFlyHeight( Wisps<i>, ( 50.00 * ( I2R(i) - 1 ) ), 500.00 )
set i = i + 1
endloop
call TriggerSleepAction( 0.10 )
set i = 1
loop
exitwhen i > LightningIntervals()
set i2 = 1
loop
exitwhen i2 > NumberofTargets()
if (i2 == 1 or GetRandomInt(1,100) <= ChanceforBolt()) then
set Caster = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()) , 039;e000039;, TempPoint, bj_UNIT_FACING )
call ShowUnitHide( Caster )
call UnitApplyTimedLife(Caster, 039;BTLF039;, 3.00 )
call SetUnitFlyHeight( Caster, GetRandomReal(100.00, 450.00), 4000.00 )
set TempGroup = CreateGroup()
call GroupEnumUnitsInRangeOfLoc(TempGroup, TempPoint, BoltRange(), Condition(function Pillar_Of_Lightning_UnitEnemy))
set Target = GroupPickRandomUnit(TempGroup)
call IssueTargetOrder( Caster, "chainlightning", Target )
call DestroyGroup(TempGroup)
set TempGroup = null
set Caster = null
set Target = null
endif
set i2 = i2 + 1
endloop
call TriggerSleepAction( GetRandomReal(1.00, 3.00) )
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 10
call SetUnitFlyHeight( Wisps<i>, 0.00, 300.00 )
set i = i + 1
endloop
call TriggerSleepAction( 2.50 )
set i = 1
loop
exitwhen i > 10
call RemoveUnit( Wisps<i> )
set Wisps<i> = null
set i = i + 1
endloop
call RemoveLocation(TempPoint)
set TempPoint = null
endfunction
//===========================================================================
function InitTrig_Pillar_of_Lightning takes nothing returns nothing
set gg_trg_Pillar_of_Lightning = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Pillar_of_Lightning, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(gg_trg_Pillar_of_Lightning,Condition(function Trig_Pillar_of_Lightning_Conditions))
call TriggerAddAction( gg_trg_Pillar_of_Lightning, function Trig_Pillar_of_Lightning_Actions )
endfunction</i></i></i></i></i></i></i></i>