- Joined
- May 16, 2012
- Messages
- 640
Hi Hivers. Today i tried to implement [vJASS] - Missile by BPower in my map, but first i tried to create a little test code to see if it would work the way i thought it would, but the arcing of the missile is not working, and i dont know why. Some insight?
As you can see in the picture, the missile do not arc. How to make it work?
JASS:
scope MTest initializer Init
private struct Fireball extends array
private static method onCollide takes Missile missile, unit hit returns boolean
if UnitAlive(hit) and hit == missile.target then
return UnitDamageTarget(missile.source, hit, missile.damage, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DIVINE, null)
endif
return false
endmethod
implement MissileStruct
endstruct
private function Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local Missile missile = Missile.createXYZ(x, y, 50., GetUnitX(target), GetUnitY(target), 50.)
set missile.source = caster
set missile.target = target
set missile.owner = GetOwningPlayer(caster)
set missile.speed = 30
set missile.arc = 15*bj_DEGTORAD
set missile.damage = 100
set missile.model = "Abilities\\Weapons\\FireBallMissile\\FireBallMissile.mdl"
set missile.collision = 32.
call Fireball.launch(missile)// Launches for struct Fireball.
endfunction
private function Conditions takes nothing returns boolean
if (GetSpellAbilityId() == 'A002') then
call Actions()
endif
return false
endfunction
//===========================================================================
private function Init takes nothing returns nothing
set gg_trg_MTest = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_MTest, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_MTest, Condition(function Conditions))
endfunction
endscope
As you can see in the picture, the missile do not arc. How to make it work?