- Joined
- May 3, 2008
- Messages
- 3,154
-
Arrow Split 1
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Arrow Split (Red Ranger)
-
-
Actions
-
Set SA_castpt = (Position of (Triggering unit))
-
Set SA_tmppt = (Target point of ability being cast)
-
Set SA_real = (Angle from SA_castpt to SA_tmppt)
-
Set SA_tarpt = (SA_castpt offset by 100.00 towards SA_real degrees)
-
Unit - Create 1 Dummy 1 (Arrow Split) for (Owner of (Triggering unit)) at SA_tarpt facing SA_tmppt
-
Unit - Order (Last created unit) to Move To SA_tmppt
-
Set SA_real = ((Distance between SA_castpt and SA_tmppt) / 522.00)
-
Unit - Add a SA_real second Generic expiration timer to (Last created unit)
-
Custom script: call RemoveLocation(udg_SA_castpt)
-
Custom script: call RemoveLocation(udg_SA_tarpt)
-
Custom script: call RemoveLocation(udg_SA_tmppt)
-
-
-
Arrow Split 2
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Dummy 1 (Arrow Split)
-
-
Actions
-
Set SA_tmppt3 = (Position of (Triggering unit))
-
For each (Integer Arrow_Split) from 1 to 12, do (Actions)
-
Loop - Actions
-
Set SA_tmppt2 = (SA_tmppt3 offset by 300.00 towards (SA_real + 30.00) degrees)
-
Unit - Create 1 Dummy 2 (Arrow Split) for (Owner of (Triggering unit)) at SA_tmppt3 facing SA_tmppt2
-
Unit - Add a 0.30 second Generic expiration timer to (Last created unit)
-
Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave SA_tmppt2
-
Set SA_real = (SA_real + 30.00)
-
Custom script: call RemoveLocation(udg_SA_tmppt2)
-
-
-
Custom script: call RemoveLocation(udg_SA_tmppt3)
-
Set SA_real = 0.00
-
-
JASS:
function Arrow_Split_Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A62X'
endfunction
function Arrow_Split_Actions takes nothing returns nothing
local unit caster=GetTriggerUnit()
local real x1=GetUnitX(caster)
local real y1=GetUnitY(caster)
local real x2=GetSpellTargetX()
local real y2=GetSpellTargetY()
local real sd=(GetUnitFacing(caster) + 100)
local real td
local unit lastcreated=CreateUnit(GetOwningPlayer(caster),'n61Q',x1,y1,sd)
call IssuePointOrder(lastcreated,"move",x2,y2)
set td=SquareRoot((y2-y1)*(y2-y1)+(x2-x1)*(x2-x1))/522.
call UnitApplyTimedLife(lastcreated,'BTLF',td)
set caster=null
set lastcreated=null
endfunction
function Arrow_Death_Conditions takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit())=='n61Q'
endfunction
function Arrow_Death_Actions takes nothing returns nothing
local unit dead=GetTriggerUnit()
local unit lastCreated=null
local real x1=GetUnitX(dead)
local real y1=GetUnitY(dead)
local integer Arrow_Split=1
local real SA_real=0
local real missilefacing=bj_RADTODEG*Atan2(y1,x1)
local real newX
local real newY
loop
exitwhen Arrow_Split>12
set newX=x1+300*Cos(SA_real+.523599)
set newY=y1+300*Sin(SA_real+.523599)
set lastCreated=CreateUnit(GetOwningPlayer(dead),'n61R',x1,y1,missilefacing)
call UnitApplyTimedLife(lastCreated,'BTLF',.30)
call IssuePointOrder(lastCreated,"shockwave",newX,newY)
set SA_real=SA_real+.523599
set Arrow_Split=Arrow_Split+1
endloop
set dead=null
set lastCreated=null
endfunction
//===========================================================================
constant function CSAS takes nothing returns boolean
return true
endfunction
function InitTrig_Arrow_Split takes nothing returns nothing
local trigger T=CreateTrigger()
local trigger T2=CreateTrigger()
local integer TI=0
local filterfunc FF=Filter(function CSAS)
loop
exitwhen (TI>=bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T,Player(TI),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
call TriggerRegisterPlayerUnitEvent(T2,Player(TI),EVENT_PLAYER_UNIT_DEATH,null)
set TI=TI+1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Arrow_Split_Actions)
call TriggerAddCondition(T,Condition(function Arrow_Split_Conditions))
call TriggerAddAction(T2,function Arrow_Death_Actions)
call TriggerAddCondition(T2,Condition(function Arrow_Death_Conditions))
set FF=null
set T=null
set T2=null
endfunction
-
Flashlight
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Flashlight (Prophet)
-
-
Actions
-
Set dummy_pt = (Position of (Triggering unit))
-
Set tar_u = (Target unit of ability being cast)
-
Set tar_pt = (Position of tar_u)
-
Set dist = 522.00
-
Set exp_r = 0.20
-
Set lvl = (Level of Flashlight (Prophet) for (Triggering unit))
-
Unit - Create 1 Dummy 1 (Flashlight) for (Owner of (Triggering unit)) at dummy_pt facing tar_pt
-
Set dum_u = (Last created unit)
-
Unit - Order dum_u to Orc Far Seer - Chain Lightning tar_u
-
Unit - Add a exp_r second Generic expiration timer to dum_u
-
Unit - Create 1 Dummy 1 (Flashlight) for (Owner of (Triggering unit)) at tar_pt facing tar_pt
-
Unit - Add a exp_r second Generic expiration timer to dum_u
-
Set dum_u = (Last created unit)
-
Unit - Order dum_u to Human Mountain King - Storm Bolt tar_u
-
For each (Integer FlashLight) from 1 to 10, do (Actions)
-
Loop - Actions
-
Set tar_pt2 = (tar_pt offset by dist towards ang degrees)
-
Unit - Create 1 Dummy 2 (Flashlight) for (Owner of (Triggering unit)) at tar_pt facing tar_pt2
-
Set dum_u = (Last created unit)
-
Unit - Add a (exp_r + 1.30) second Generic expiration timer to dum_u
-
Unit - Order dum_u to Move To tar_pt2
-
Unit - Create 1 Dummy 3 (Flashlight) for (Owner of (Triggering unit)) at tar_pt2 facing tar_pt
-
Set dum_u = (Last created unit)
-
Unit - Set level of Chain Lightning (Multiple Target) (Dummy Ability) for dum_u to lvl
-
Unit - Add a (exp_r + 1.30) second Generic expiration timer to dum_u
-
Unit - Order dum_u to Orc Far Seer - Chain Lightning tar_u
-
Set ang = (ang + 36.00)
-
Custom script: call RemoveLocation(udg_tar_pt2)
-
-
-
Set ang = 0.00
-
Custom script: call RemoveLocation(udg_dummy_pt)
-
Custom script: call RemoveLocation(udg_tar_pt)
-
-
JASS:
function Flashlight_Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A62P'
endfunction
function Flashlight_Actions takes nothing returns nothing
local unit caster=GetTriggerUnit()
local unit lastcreated
local location target=GetSpellTargetLoc()
local real angle
local real distance = 522.00
local real life_duration = 0.20
local real x1=GetUnitX(caster)
local real y1=GetUnitY(caster)
local real x2=GetLocationX(target)
local real y2=GetLocationY(target)
local integer level
local integer FL = 1
set udg_dummy_pt = GetUnitLoc(caster)
set udg_tar_u = GetSpellTargetUnit()
set udg_tar_pt = GetUnitLoc(udg_tar_u)
set level = GetUnitAbilityLevel(caster,'A61T')
set lastcreated=CreateUnit(GetOwningPlayer(caster),'n61I',x1,y1,x2, y2)
call IssueTargetOrder(lastcreated, "chainlightning", udg_tar_u)
call UnitApplyTimedLife(lastcreated,'BTLF',life_duration)
call UnitApplyTimedLife(lastcreated,'BTLF',life_duration)
call IssueTargetOrder( lastcreated, "thunderbolt", udg_tar_u )
set lastcreated=null
loop
exitwhen FL > 10
set udg_tar_pt2 = PolarProjectionBJ(udg_tar_pt, distance, angle)
set lastcreated=CreateUnit(GetOwningPlayer(caster),'n61I',x1,y1,x2,y2)
call UnitApplyTimedLife(lastcreated,'BTLF',life_duration + 1.30)
call IssuePointOrderLoc (lastcreated, "move", x2,y2)
set lastcreated=CreateUnit(GetOwningPlayer(caster),'n61I',x1,y1,x2,y2)
call SetUnitAbilityLevel (lastcreated, 'A61V', level)
call UnitApplyTimedLife(lastcreated,'BTLF',life_duration + 1.30)
call IssueTargetOrder( lastcreated, "thunderbolt", udg_tar_u )
set angle = ( angle + 36.00 )
call RemoveLocation(udg_tar_pt2)
set FL = FL + 1
set lastcreated=null
endloop
set angle = 0.00
call RemoveLocation(udg_dummy_pt)
call RemoveLocation(udg_tar_pt)
endfunction
//===========================================================================
constant function GSF takes nothing returns boolean
return true
endfunction
function InitTrig_Flashlight takes nothing returns nothing
local trigger T=CreateTrigger()
local integer TI=0
local filterfunc FF=Filter(function GSF)
loop
exitwhen (TI>=bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T,Player(TI),EVENT_PLAYER_UNIT_SPELL_EFFECT,FF)
set TI=TI+1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Flashlight_Actions)
call TriggerAddCondition(T,Condition(function Flashlight_Conditions))
set FF=null
set T=null
endfunction
-
Set Attacking Damage
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
Actions
-
Unit Group - Add (Attacking unit) to Electric_Attack
-
-
-
Set Non Attacking Damage
-
Events
-
Unit - A unit Starts the effect of an ability
-
Unit - A unit Begins channeling an ability
-
Unit - A unit Begins casting an ability
-
-
Conditions
-
Actions
-
Unit Group - Remove (Triggering unit) from Electric_Attack
-
-
-
Electric Chain Add 1
-
Events
-
Unit - A unit enters (Entire map)
-
-
Conditions
-
Actions
-
Trigger - Add to Electric Chain Hit <gen> the event (Unit - (Triggering unit) Takes damage)
-
-
-
Electric Chain Add 2
-
Events
-
Time - Elapsed game time is 1.00 seconds
-
-
Conditions
-
Actions
-
Set Group[1] = (Units in (Playable map area))
-
Unit Group - Pick every unit in Group[1] and do (Actions)
-
Loop - Actions
-
Trigger - Add to Electric Chain Hit <gen> the event (Unit - (Picked unit) Takes damage)
-
-
-
Custom script: call DestroyGroup (udg_Group[1])
-
-
-
Electric Chain Hit
-
Events
-
Conditions
-
(Unit-type of (Damage source)) Equal to Prophet
-
(Level of Electric Chain (Prophet) for (Damage source)) Greater than or equal to 1
-
((Damage source) is in Electric_Attack) Equal to True
-
-
Actions
-
Set Electric_Punch_Hits[(Custom value of (Damage source))] = (Electric_Punch_Hits[(Custom value of (Damage source))] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Electric_Punch_Hits[(Custom value of (Damage source))] Equal to (10 - (Level of Electric Chain (Prophet) for (Damage source)))
-
-
Then - Actions
-
Special Effect - Create a special effect attached to the (weapon + left) of (Damage source) using Abilities\Spells\Orc\LightningShield\LightningShieldTarget.mdl
-
Set Electric_Punch_Effect[(Custom value of (Damage source))] = (Last created special effect)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Electric_Punch_Hits[(Custom value of (Damage source))] Equal to (11 - (Level of Electric Chain (Prophet) for (Damage source)))
-
-
Then - Actions
-
Set Capacitor_Point[1] = (Position of (Damage source))
-
Unit - Create 1 Dummy (Electric Strike) for (Owner of (Damage source)) at Capacitor_Point[1] facing Default building facing degrees
-
Unit - Add Electric Strike (Dummy Ability) to (Last created unit)
-
Unit - Set level of Electric Strike (Dummy Ability) for (Last created unit) to (Level of Electric Chain (Prophet) for (Damage source))
-
Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Triggering unit)
-
Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
-
Special Effect - Destroy Electric_Punch_Effect[(Custom value of (Damage source))]
-
Custom script: call RemoveLocation (udg_Capacitor_Point[1])
-
Set Electric_Punch_Hits[(Custom value of (Damage source))] = 0
-
-
Else - Actions
-
-
-
-
-
JASS:
function Electric_Chain_Attacked_Actions takes nothing returns nothing
call GroupAddUnit(udg_Electric_Attack, GetAttacker())
endfunction
function Electric_Chain_None_Attacking_Damage_Actions takes nothing returns nothing
call GroupRemoveUnit(udg_Electric_Attack, GetTriggerUnit())
endfunction
function Electric_Chain_Add_1_Actions takes nothing returns nothing
call TriggerRegisterUnitEvent(T5, GetTriggerUnit(), EVENT_UNIT_DAMAGED )
endfunction
function Trig_Electric_Chain_Add_2_Actions_2 takes nothing returns nothing
call TriggerRegisterUnitEvent(T5, GetEnumUnit(), EVENT_UNIT_DAMAGED )
endfunction
function Electric_Chain_Add_2_Actions takes nothing returns nothing
set udg_Group[1] = GetUnitsInRectAll(GetPlayableMapRect())
call ForGroupBJ( udg_Group[1], function Electric_Chain_Add_2_Actions_2 )
call DestroyGroup (udg_Group[1])
endfunction
function Electric_Chain_Hit_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEventDamageSource()) == 'H602' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A61Y', GetEventDamageSource()) >= 1 ) ) then
return false
endif
if ( not ( IsUnitInGroup(GetEventDamageSource(), udg_Electric_Attack) == true ) ) then
return false
endif
return true
endfunction
function Trig_Electric_Chain_Hit_Func002Func002C takes nothing returns boolean
if ( not ( udg_Electric_Punch_Hits[GetUnitUserData(GetEventDamageSource())] == ( 11 - GetUnitAbilityLevelSwapped('A61Y', GetEventDamageSource()) ) ) ) then
return false
endif
return true
endfunction
function Trig_Electric_Chain_Hit_Func002C takes nothing returns boolean
if ( not ( udg_Electric_Punch_Hits[GetUnitUserData(GetEventDamageSource())] == ( 10 - GetUnitAbilityLevelSwapped('A61Y', GetEventDamageSource()) ) ) ) then
return false
endif
return true
endfunction
function Electric_Chain_Hit_Actions takes nothing returns nothing
set udg_Electric_Punch_Hits[GetUnitUserData(GetEventDamageSource())] = ( udg_Electric_Punch_Hits[GetUnitUserData(GetEventDamageSource())] + 1 )
if ( Trig_Electric_Chain_Hit_Func002C() ) then
call AddSpecialEffectTargetUnitBJ( ( "weapon" + "left" ), GetEventDamageSource(), "Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdl" )
set udg_Electric_Punch_Effect[GetUnitUserData(GetEventDamageSource())] = GetLastCreatedEffectBJ()
else
if ( Trig_Electric_Chain_Hit_Func002Func002C() ) then
set udg_Capacitor_Point[1] = GetUnitLoc(GetEventDamageSource())
call CreateNUnitsAtLoc( 1, 'h60W', GetOwningPlayer(GetEventDamageSource()), udg_Capacitor_Point[1], bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A61X', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A61X', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A61Y', GetEventDamageSource()) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "chainlightning", GetTriggerUnit() )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
call DestroyEffectBJ( udg_Electric_Punch_Effect[GetUnitUserData(GetEventDamageSource())] )
call RemoveLocation (udg_Capacitor_Point[1])
set udg_Electric_Punch_Hits[GetUnitUserData(GetEventDamageSource())] = 0
else
endif
endif
endfunction
//===========================================================================
constant function GSEC takes nothing returns boolean
return true
endfunction
function InitTrig_Electric_Chain takes nothing returns nothing
local trigger T=CreateTrigger()
local trigger T2=CreateTrigger()
local trigger T3=CreateTrigger()
local trigger T4=CreateTrigger()
local trigger T5=CreateTrigger()
local integer TI=0
local filterfunc FF=Filter(function GSEC)
loop
exitwhen (TI>=bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T,Player(TI),EVENT_PLAYER_UNIT_ATTACKED,null)
call TriggerRegisterPlayerUnitEvent(T2,Player(TI), EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
call TriggerRegisterPlayerUnitEvent(T2,Player(TI), EVENT_PLAYER_UNIT_SPELL_CHANNEL,null)
call TriggerRegisterPlayerUnitEvent(T2,Player(TI), EVENT_PLAYER_UNIT_SPELL_CAST,null)
call TriggerRegisterEnterRegion(T3,Player(TI), GetWorldBounds() )
call TriggerRegisterTimerEvent(T4,Player(TI),1.00 )
set TI=TI+1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Electric_Chain_Attacked_Actions)
call TriggerAddAction(T2,function Electric_Chain_None_Attacking_Damage_Actions)
call TriggerAddAction(T3,function Electric_Chain_Add_1_Actions)
call TriggerAddAction(T4,function Electric_Chain_Add_2_Actions)
call TriggerAddAction(T5, function Electric_Chain_Hit_Actions )
call TriggerAddCondition(T5, Condition( function Electric_Chain_Hit_Conditions ) )
set FF=null
set T=null
set T2=null
set T3=null
set T4=null
set T5=null
endfunction
I try to convert this spells to JASS for better efficiency.
Upon casting, this spells would create 1 arrow infront of the caster (offset 100) and then move forward to the targeted location. Upon reaching the target location, it would split into 12 arrows.
Well, I am not quite familiar with real x/y. Any resolution with it?
Last edited: