- Joined
- Apr 16, 2011
- Messages
- 158
Well that magic should be "Lightning Strike" I (zeus Dota) am trying to do her only for code, I have the following problems:
1-I get to create a the light put is so fast that nor of the to see.
2-to light it should come from top but does she come from the right side, as I know?I didn't remove the light to see the effect
what do I need?
that the effect has a time to be visualized and that the light comes from top.
suggestions?
1-I get to create a the light put is so fast that nor of the to see.
2-to light it should come from top but does she come from the right side, as I know?I didn't remove the light to see the effect
what do I need?
that the effect has a time to be visualized and that the light comes from top.
suggestions?
JASS:
library LightningStrike requires SpellEffectEvent
private function TargetDamage takes integer i returns real
return 100. + 75.*i
endfunction
struct LightningStrike extends array
// The Id of the ability
private static constant integer ABIL_CODE = 'A002'
// The code of dummy
private static constant integer DUMMY = 'n001'
// The Id of the ability of dummy
private static constant integer ABIL_CODE_DUMMY = 'A003'
// The Id of the fly ability
private static constant integer ABIL_FLY = 'Amrf'
// The type of created light
private static constant string LIGHT_EFFECT = "CLPB"
// The Height of fly dummy
private static constant real HEIGHT = 1000
private static method onCast takes nothing returns nothing
local player p = GetTriggerPlayer()
local unit t = GetSpellTargetUnit()
local unit u = GetTriggerUnit()
local real ux = GetUnitX(t)
local real uy = GetUnitY(t)
local unit d = CreateUnit(p, DUMMY, ux, uy, 0)
local real dx = GetUnitX(d)
local real dy = GetUnitY(d)
local integer i = GetUnitAbilityLevel(u, ABIL_CODE)
local lightning l = AddLightningEx(LIGHT_EFFECT,true,ux,dy,32,uy,dy,32)
call UnitAddAbility(d, ABIL_FLY)
call SetUnitFlyHeight(d, HEIGHT, 0)
call UnitDamageTarget(u,t,TargetDamage(i),false,false,null,null,null)
call UnitApplyTimedLife(d, 'BTLF', 1)
call DestroyLightning(l)
set p = null
set t = null
set u = null
set d = null
set l = null
endmethod
private static method onInit takes nothing returns nothing
call RegisterSpellEffectEvent(ABIL_CODE, function thistype.onCast)
endmethod
endstruct
endlibrary