Yamuraiha
Member
- Reaction score
- 1
I wanna make an new shock wave ability of which the missile sweep away enemies and push them back.
function Trig_getsuga_Conditions takes nothing returns boolean
return (GetSpellAbilityId()=='A0VH') or (GetSpellAbilityId()=='A0VA')
endfunction
function Trig_getsuga_Actions takes nothing returns nothing
(activated when spell cast)
set ichigo_w=GetSpellAbilityUnit()
set tp1=GetUnitLoc(ichigo_w)
set tp2=GetSpellTargetLoc()
set rangle1=AngleBetweenPoints(tp1,tp2)
set getsugahit=CreateGroup()
set ablev[2]=GetUnitAbilityLevelSwapped(GetSpellAbilityId(),ichigo_w)
set tp3=PolarProjectionBJ(tp1,30,rangle1)
call RemoveLocation(tp1)
call CreateNUnitsAtLoc(1,'h04X',GetOwningPlayer(ichigo_w),tp3,rangle1)
call RemoveLocation(tp2)
call RemoveLocation(tp3)
set getsudummy=GetLastCreatedUnit()
call UnitApplyTimedLifeBJ(1.00,'BTLF',getsudummy)
call EnableTrigger(trg_getsugap)
call TriggerSleepAction(0.55)
call DisableTrigger(trg_getsugap)
call DestroyGroup(getsugahit)
set ichigo_w=null
set getsudummy=null
endfunction
(condition for unit group hit)
function getsugap_enemy takes nothing returns boolean
return IsUnitAliveBJ(GetFilterUnit()) and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(ichigo_w)) and (IsUnitInGroup(GetFilterUnit(),getsugahit)==false)
endfunction
function getsugap_dam takes nothing returns nothing
call GroupAddUnitSimple(GetEnumUnit(),getsugahit)
call UnitDamageTargetBJ(ichigo_w,GetEnumUnit(),dx,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC)
endfunction
(event for this is timer-periodec 0.02 seconds)
function Trig_getsugap_Actions takes nothing returns nothing
set fint2=GetHeroStr(ichigo_w,true)
set dx=I2R(ablev[2]*(100+fint2))/2.
set tp1=GetUnitLoc(getsudummy)
set tp2=PolarProjectionBJ(tp1, 14, rangle1)
call SetUnitPositionLoc(getsudummy,tp2)
set tg=GetUnitsInRangeOfLocMatching(140,tp2,Condition(function getsugap_enemy))
call ForGroupBJ(tg,function getsugap_dam)
call DestroyGroup(tg)
call RemoveLocation(tp1)
call RemoveLocation(tp2)
endfunction
Almost all the lines I used in the Jass have a GUI equivalent, that is why I thought u could look at what they seem to say and then take a guess at what that translates into.I don't know JASS, I think I should study about JASS first and resume editting my map someday huh
call CreateNUnitsAtLoc(1,'h04X',GetOwningPlayer(ichigo_w),tp3,rangle1)
ichigo_w is a unit variable, meant to hold the casting unit.
rangle1 is a real, intended to be the angle at which spell cast.
set ablev[2]: set integer variable = level of ability(ability being cast) for triggering unit
set tp3: set point tp3= point with offset, point tp1 offset by 30 towards angle rangle1
You are of course free to rename the variables as you see fit, these names are just the ones I happened to be using in one of my maps.