Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Blah
Events:

Unit - A unit starts effect of an ability
Actions:

Custom script: local unit udg_AECaster = GetTriggerUnit()

Set AECaster_2 = AECaster

Unit - Order AECaster to do blah

Trigger - Turn on Blah2

[...]
Blah2
Events:

Time - Every bleh seconds
Actions:

Custom script: local unit udg_AECaster = udg_AECaster_2

[...]
Custom script: local location udg_temppoint = GetUnitLoc(GetPickedUnit())
Imported material, beyond a dummy model, is strictly forbidden.
Just a question... is it allowed to have "two" spells? I mean, the first one places it, the second one triggers is, like Lanayas traps in DotA??
If your asking if your allowed to use more than one trigger for your spell, some GUI spells you have to, so I'd assume you can
No, I want to have something like that:
Spell 1: Place traps.
Spell 2: Trigger traps.
For sure thats just an example, since I would have a great idea then![]()



endif
if IsUnitInGroup(targ, udg_BeeSwarmed) and (not IsUnitType(targ, UNIT_TYPE_DEAD)) then
call SetUnitPosition(u, x2, y2)
call BJDebugMsg(R2S((BeeSwarmBaseDPS(lvl)*BeeSwarmInterval())+dmg)) //this was the msg I added
call UnitDamageTarget(cast, targ, (BeeSwarmBaseDPS(lvl)*BeeSwarmInterval())+dmg, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
[...]
Actually its rather simple to make it MUI.
Instead of using whatever AoE target spell, use Tornado.
That is one.
The second thing is to make the armour/health regeneration thing MUI. That is also rather simple. Instead of giving a fixed unit (I assumed you made a variable which is assigned to the butterfly thing), pick all units in playable map area matching Matching Unit is Alive and Unit-Type of Matching Unit equals to (Your dummy special effect thingy). After that, set the unit to a temporary unit variable (Temp_Unit or something)Then just do whatever other thing it is you did for your current spell except change the variable unit to Temp_Unit or whatever. You could get some examples from my spell pack in siggy![]()
Doom_Sheep, unit groups are actually checking every handle unit on the whole map and checks if it matches your conditions. When picking units in playable map area, sure you have to use unit group variables since it would otherwise leak a unit group, but thats all. (or use set bj_wantDestroyGroup = true). There would be a difference on destructables however, since there are mostly over a thousand of them at the same time.
oh, and im pissed off at the world editor at the moment becouse it wont do what i tell it to do
Spell Copy

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Touch of Nature

Actions


Set UnitVarAlly = (Target unit of ability being cast)


Countdown Timer - Start TimerAlly as a One-shot timer that will expire in 10.00 seconds


Unit - Add Armor Bonus to UnitVarAlly


Unit - Set level of Armor Bonus for UnitVarAlly to (Level of Touch of Nature for (Triggering unit))


Unit - Add Damage Bonus to UnitVarAlly


Unit - Set level of Damage Bonus for UnitVarAlly to (Level of Touch of Nature for (Triggering unit))


Unit - Set life of UnitVarAlly to ((Real((Integer((Life of UnitVarAlly))))) + (90.00 x (Real((Level of Touch of Nature for (Target unit of ability being cast))))))


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Integer((Percentage life of UnitVarAlly))) Less than or equal to 33



Then - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Random integer number between 1 and 100) Less than or equal to 33





Then - Actions






Unit - Set life of UnitVarAlly to 100.00%






Special Effect - Create a special effect attached to the origin of UnitVarAlly using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl






Special Effect - Destroy (Last created special effect)





Else - Actions



Else - Actions
If - Conditions

(Integer((Percentage life of UnitVarAlly))) Less than or equal to 33

Then - Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Random integer number between 1 and 100) Less than or equal to 33



Then - Actions




Unit - Set life of UnitVarAlly to 100.00%




Special Effect - Create a special effect attached to the origin of UnitVarAlly using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl




Special Effect - Destroy (Last created special effect)



Else - Actions

Else - Actions
Unit - Set life of UnitVarAlly to ((Real((Integer((Life of UnitVarAlly))))) + (90.00 x (Real((Level of Touch of Nature for (Target unit of ability being cast))))))
If - Conditions
(Integer((Percentage life of UnitVarAlly))) Less than or equal to 33
- ya' know, or harder 
scope BeeSwarm initializer Init
//=========================Bee Swarm by BlackShogun==========================//
//=================================Setup=====================================//
//spell rawcode
private constant function BeeSwarmRawCode takes nothing returns integer
return 'A000'
endfunction
//dummy unit rawcode
private constant function BeeSwarmModel takes nothing returns integer
return 'h000'
endfunction
//dummy unit model
private constant function BeeSwarmSFX takes nothing returns string
return "Abilities\\Weapons\\CryptFiendMissile\\CryptFiendMissile.mdl"
endfunction
//base damage per second
private function BeeSwarmBaseDPS takes integer lvl returns real
return 5.0*lvl
endfunction
//increase in damage per second for every second the target is moving
private function BeeSwarmIncDPS takes integer lvl returns real
return 0.5*lvl
endfunction
//decrease in damage per second for every second the target is moving
private constant function BeeSwarmDecDPS takes nothing returns real
return 0.5
endfunction
//duration of spell
private constant function BeeSwarmDur takes nothing returns real
return 20.0
endfunction
//the movement and effects interval
private constant function BeeSwarmInterval takes nothing returns real
return 0.03
endfunction
//distance moved by projectile each interval
private constant function BeeSwarmDist takes nothing returns real
return 15.0
endfunction
//===============================EndSetup====================================//
//==================NOTE: DO NOT EDIT ANYTHING BEYOND HERE===================//
struct BeeSwarm_Data
unit cast
unit targ
unit u
real x
real y
real dmg
real time
effect sfx
endstruct
globals
private timer t = CreateTimer()
private BeeSwarm_Data array ar
private integer total = 0
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == BeeSwarmRawCode()
endfunction
private function Effects takes nothing returns nothing
local BeeSwarm_Data dat
local integer i=0
local real x1=GetUnitX(dat.u)
local real y1=GetUnitY(dat.u)
local real x2=GetUnitX(dat.targ)
local real y2=GetUnitY(dat.targ)
local real a=Atan2(y2-y1, x2-x1)
local real mx=BeeSwarmDist()*Cos(a)
local real my=BeeSwarmDist()*Sin(a)
local integer lvl=GetUnitAbilityLevel(dat.cast, BeeSwarmRawCode())
loop
exitwhen i>=total
set dat=ar[i]
if not IsUnitInRange(dat.u, dat.targ, 50) then
call SetUnitX(dat.u, x1+mx)
call SetUnitY(dat.u, y1+my)
call SetUnitFacing(dat.u, 57.29583*a)
endif
if IsUnitInRange(dat.u, dat.targ, 50) and (not IsUnitType(dat.targ, UNIT_TYPE_DEAD)) then
call SetUnitX(dat.u, x2)
call SetUnitY(dat.u, y2)
call UnitDamageTarget(dat.cast, dat.targ, (BeeSwarmBaseDPS(lvl)*BeeSwarmInterval())+dat.dmg, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
if dat.x!=null then
if IsUnitInRangeXY(dat.targ, dat.x, dat.y, 5) then
set dat.dmg=dat.dmg-(BeeSwarmDecDPS()*BeeSwarmInterval())
else
set dat.dmg=dat.dmg+(BeeSwarmIncDPS(lvl)*BeeSwarmInterval())
endif
endif
set dat.x=x2
set dat.y=y2
endif
if (BeeSwarmBaseDPS(lvl)+dat.dmg<=0) or (dat.time>=BeeSwarmDur()) or (IsUnitInRange(dat.u, dat.targ, 50) and IsUnitType(dat.targ, UNIT_TYPE_DEAD)) then
call DestroyEffect(dat.sfx)
call RemoveUnit(dat.u)
set ar[i]=ar[total-1]
set total=total-1
call dat.destroy()
endif
set dat.time=dat.time+(1*BeeSwarmInterval())
set i=i+1
endloop
if total==0 then
call PauseTimer(t)
endif
endfunction
private function Actions takes nothing returns BeeSwarm_Data
local BeeSwarm_Data dat=BeeSwarm_Data.create()
local player p
local real a
set dat.cast=GetTriggerUnit()
set p = GetOwningPlayer(dat.cast)
set dat.targ=GetSpellTargetUnit()
set a=57.29583*Atan2(GetUnitY(dat.targ)-GetUnitY(dat.cast), GetUnitX(dat.targ)-GetUnitX(dat.cast))
set dat.u=CreateUnit(p, BeeSwarmModel(), GetUnitX(dat.cast), GetUnitY(dat.cast), a)
set dat.sfx=AddSpecialEffectTarget(BeeSwarmSFX(), dat.u, "chest")
set dat.dmg=0
set dat.time=0
set p=null
if total==0 then
call TimerStart(t, BeeSwarmInterval(), true, function Effects)
endif
set total=total+1
set ar[total-1]=dat
return dat
endfunction
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(T, function Actions)
call TriggerAddCondition(T, Condition(function Conditions))
endfunction
endscope
