HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spell Faliure, Collision Missiles

05-04-2007, 08:56 AM#1
TGhost
I'm using Vexorians caster system to create a sort of fireball nova spell. The ability is supposed to create 6 missiles at the position of the caster, flying outwards in a spiral fashion till they reach maximum distance. It seems that the units are indeed created, but I can't see them. I'm using the spell map template, and noticed that the units that would have been hit did take damage, only that it was double the amount it should be?
To quckly sum it up the units take double damage and the missiles are invisible.
Collapse JASS:
function Trig_Burning_Flames_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A002'
endfunction

function Fireball_Impact takes nothing returns nothing
    local unit missile = GetTriggerCollisionMissile()
    local integer dmg = CollisionMissile_GetTag(missile)
    local unit target = GetTriggerUnit()
    local effect damageEffect
    if GetOwningPlayer(target) == GetOwningPlayer(missile) then
        set target = null
    endif
    call UnitDamageTarget(missile, target, I2R(dmg), false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, null)
    set damageEffect = AddSpecialEffectTarget("Abilities\\Spells\\Other\\BreathOfFire\\BreathOfFireDamage.mdl", target, "head")
    call PolledWait(0.5)
    call DestroyEffect(damageEffect)
    set damageEffect = null
    set target = null
    set missile = null 
endfunction

function Trig_Burning_Flames_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local real casterX = GetUnitX(caster)
    local real casterY = GetUnitY(caster)
    local integer dmg = (GetUnitAbilityLevel(caster, 'A002')*25)+50
    local real missileAngle = 0
    local integer i = 1
    local unit tempMissile
    loop
        set tempMissile = CollisionMissile_Create("Abilities\\Weapons\\RedDragonBreath\\RedDragonMissile.mdl", casterX, casterY, missileAngle, 450, 50, 1000, 50, true, 120, function Fireball_Impact)
        call CollisionMissile_SetTag(tempMissile, dmg)
        set missileAngle = missileAngle+60 
        set i = i+1
        exitwhen i==6
    endloop
    set caster = null
    set tempMissile = null
endfunction

//===========================================================================
function InitTrig_Burning_Flames takes nothing returns nothing
    set gg_trg_Burning_Flames = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Burning_Flames, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Burning_Flames, Condition( function Trig_Burning_Flames_Conditions ) )
    call TriggerAddAction( gg_trg_Burning_Flames, function Trig_Burning_Flames_Actions )
    call Preload("Abilities\\Spells\\Other\\BreathOfFire\\BreathOfFireDamage.mdl")
    call Preload("Abilities\\Weapons\\RedDragonBreath\\RedDragonMissile.mdl")
endfunction

Any help would be greatly appreciated!
05-04-2007, 09:08 AM#2
Toink
Wouldn't it be easier if you just used a shockwave spell that uses the fireball missile? Or if you don't want the ground to shake, a carrion swarm perhaps? And just calculate angles and order a caster to cast carrionswarm/shockwave to whatever location.
05-04-2007, 09:25 AM#3
TGhost
Well, if you can show me a way to give shockwaves/carrion swarm angle changes in flight let me know . The problem is I want the angle to increase as the missile flies, hence the use of collision missiles.
05-04-2007, 10:21 AM#4
diablo-dk
Did you remember to import the caster system dummy model? without that you can't attach special effects to them, meaning that collision missiles will be invisible.
05-04-2007, 10:56 AM#5
TGhost
It was already in the map, but I reimported it and now it's working... Maybe I forgot to restart the world editor the first time I imported it or something similiar, thanks alot, working now. Except for the double damage, still don't know why it's doing that?
05-04-2007, 01:04 PM#6
Vexorian
Always remember to save the map after importing any file, world editor likes to "forget" some imports if you don't do that.

120 is huge for a collision size, take the object editor and change the area of effect for blizzard to 120, test the targetting circle in game to see how big that actually is. So it would not be a surprise that you are hitting the same unit with 2 different missiles.

Also, Fireball_Impact is called when the collisionmissiles die (hit ground or air) so you have to handle that when target equals null, instead of using DamageUnit on null and that kind of stuff.

You should not have waits in the impact handler function, use a timer with the special effect attached to it in order to destroy that effect.