- Joined
- Nov 13, 2006
- Messages
- 1,814
i posted here coz since i made it for fun (not really for spell section since for that this need timer for more accurated timeing)
i posted here coz i am curios to suggestion about ability, also maybe somebody else made trigger abilities what is similiar than original (chain lightning, forked lightning, etc) so its a bit lets talk about immitating the base skills
i attached the test map (its really just test map where i test the effects and what i think), there it is with dwarven hero/muradin skill
how u make frontal aoe spells? with make a region with offset between target and caster and pick everybody on that region?
i posted here coz i am curios to suggestion about ability, also maybe somebody else made trigger abilities what is similiar than original (chain lightning, forked lightning, etc) so its a bit lets talk about immitating the base skills
i attached the test map (its really just test map where i test the effects and what i think), there it is with dwarven hero/muradin skill
how u make frontal aoe spells? with make a region with offset between target and caster and pick everybody on that region?
JASS:
function Impale_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00C'
endfunction
function Trig_Impale_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit ut = GetSpellTargetUnit()
local unit pu
local unit array ua
local real array spd
local effect array f
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real xt = GetUnitX(ut)
local real yt = GetUnitY(ut)
local real xd = x + 150 * Cos(Atan2(yt - y, xt - x))
local real yd = y + 150 * Sin(Atan2(yt - y, xt - x))
local real xc = (xt - xd)
local real yc = (yt - yd)
local real xe
local real ye
local real ang = 180.0/3.14159 * Atan2(yt - y, xt - x)
local real dist = SquareRoot(xc * xc + yc * yc)
local real dmg = GetHeroLevel(u) * 10 + GetUnitAbilityLevel(u, 'A00C')*10
local player p = GetTriggerPlayer()
local integer i = 150
local integer d
local string s = "Abilities\\Spells\\Undead\\Impale\\ImpaleMissTarget.mdl"
local string s1 = "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl"
local string s2 = "Abilities\\Spells\\Undead\\Impale\\ImpaleHitTarget.mdl"
local string s3 = "Abilities\\Spells\\Human\\Thunderclap\\ThunderclapTarget.mdl"
local group g = bj_lastCreatedGroup
if dist > 150 then
loop
exitwhen (i-85>dist)
set x = GetUnitX(u)
set y = GetUnitY(u)
set xt = GetUnitX(ut)
set yt = GetUnitY(ut)
set ang=Atan2(yt - y, xt - x)
set xd = x + i * Cos(ang)
set yd = y + i * Sin(ang)
set xe = x + (i - 50) * Cos(ang)
set ye = y + (i - 50) * Sin(ang)
call DestroyEffect (AddSpecialEffect (s, xd,yd))
call DestroyEffect (AddSpecialEffect (s1, xe,ye))
set i = i + 85
call TriggerSleepAction(.1)
endloop
endif
call DestroyEffect (AddSpecialEffect (s, xt,yt))
call DestroyEffect (AddSpecialEffect (s1, xt,yt))
set xd = xt + 50 * Cos(ang)
set yd = yt + 50 * Sin(ang)
set xe = xt - 50 * Cos(ang)
set ye = yt - 50 * Sin(ang)
set bj_lastCreatedTerrainDeformation = TerrainDeformWave(xd, yd, (xe-xd)/100, (ye-yd)/100, 100, 200, 200, -100, 0, 1)
call GroupEnumUnitsInRange(g,xt,yt,250.00,null)
set i = 0
loop
set pu = FirstOfGroup(g)
exitwhen (pu==null)
if (IsUnitEnemy(pu, p) and (GetWidgetLife(pu) > 0)) then
set xe = GetUnitX(pu)
set ye = GetUnitY(pu)
call DestroyEffect (AddSpecialEffect (s2, xe,ye))
call UnitDamageTarget(u, pu, dmg, true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
set ua[i] = pu
if GetWidgetLife(pu) > 0 then
set f[i] = AddSpecialEffectTarget(s3, pu, "overhead")
call SetUnitInvulnerable( pu, true )
call PauseUnit( pu, true )
endif
set i = i + 1
call UnitAddAbility( pu, 'Amrf')
call UnitRemoveAbility( pu, 'Amrf' )
call SetUnitFlyHeight( pu, 500.00, 750.00 )
endif
call GroupRemoveUnit(g, pu)
endloop
call TriggerSleepAction(.3)
set d = i
set i = 0
loop
exitwhen i > d
call SetUnitFlyHeight( ua[i], 0.00, 750.00 )
set i = i + 1
endloop
call TriggerSleepAction(1)
set i = 0
loop
exitwhen i > d
if GetWidgetLife(ua[i]) > 0 then
call PauseUnit( ua[i], false )
call SetUnitInvulnerable( ua[i], false )
call DestroyEffect(f[i])
set f[i]=null
endif
set ua[i]=null
set i = i + 1
endloop
set g = null
set u = null
set ut = null
set pu = null
set p = null
set s = null
set s1 = null
set s2 = null
set s3 = null
endfunction
//===========================================================================
function InitTrig_Impale_1 takes nothing returns nothing
set gg_trg_Impale_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Impale_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Impale_1, Condition( function Impale_Conditions ) )
call TriggerAddAction( gg_trg_Impale_1, function Trig_Impale_Actions )
endfunction
Attachments
Last edited: