• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] JASS Spell doesn't give bounty

Status
Not open for further replies.
Level 9
Joined
Sep 8, 2004
Messages
633
Howdy partners!
I'm using a JASS spell in my little brother's map, but there's a small problem!

I got the spell to work, set the variables to the desired values, no problem. Thing is, when the spell is used, the kills don't give bounty to the using player. I can modify simple JASS, but since I can only code GUI myself, I can't fix this problem. It uses a dummy caster, which needs to be owned by the casting unit's owner. Can anyone fix/create this for me? It concerns the following spell:
http://www.hiveworkshop.com/resources_new/spells/971/

JASS:
//===================================
//Spell: Cluster Bombs
//Author: paskovich
//
//If you want to import this spell,
//make sure you copy the dummy units
//from the object editor,
//and set the raw codes below!
//
//For damage values, copy and edit
//the 'Cluster Damage' ability.
//
//It uses the Handle Vars and 
//     REQUIRES vJASS!!
//
//Thanks to Shadow1500 for the
//parabola function!
//
//
//Don't forget to give a credit!
//===================================

//=============RAW CODES=============
//Make sure you set the proper raw codes!

constant function ClusterBombs_SpellId takes nothing returns integer
    return 'A00E' //The main ability's raw code
endfunction

constant function ClusterBombs_DummyId takes nothing returns integer
    return 'e001' //The generic dummy's raw code
endfunction

constant function ClusterBombs_AoEDamageAbility takes nothing returns integer
    return 'A01Y' //The AoE damage ability's raw code (it's called "Cluster Damage" in the object editor)
endfunction


//===========SPELL OPTIONS===========

constant function ClusterBombs_NumberOfBombs takes integer level returns integer
    return 2 * level //This defines the number of bombs falling from the sky.
endfunction

constant function ClusterBombs_NumberOfClusters takes nothing returns integer
    return 3 //The number of clusters that a bomb falls apart to.
endfunction

constant function ClusterBombs_AoE takes nothing returns real
    return 500.0 //The radius of the AoE. (Set this the same that you set in the object editor for the hero ability.)
endfunction

constant function ClusterBombs_Delay takes nothing returns real
    return 0.9 //The delay time between falling bombs.
endfunction

//=======================================
//============CLUSTER BOMBS==============
//=======================================
struct ClusterBombData
    unit c
    unit p
    real tx
    real ty
    real ang
    real dist
    real mdist
endstruct

function Trig_ClusterBomb_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == ClusterBombs_SpellId()
endfunction

function Timer_ClusterBombSplinter takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local ClusterBombData dat3 = ClusterBombData(GetHandleInt(t,"data3"))
    local unit s = dat3.p
    local real a = dat3.ang
    local real h = GetParabolaHeight(dat3.dist, dat3.mdist, 1)
    local real offset = ClusterBombs_AoE() / 28
    call SetUnitX(s, GetUnitX(s)+offset*Cos(a*bj_DEGTORAD))
    call SetUnitY(s, GetUnitY(s)+offset*Sin(a*bj_DEGTORAD))
    call SetUnitFlyHeight(s,h,0)
    set dat3.dist = dat3.dist + offset
    if dat3.dist >= dat3.mdist then
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl",GetUnitX(s),GetUnitY(s)))
        call KillUnit(s)
        call PauseTimer(t)
        call FlushHandleLocals(t)
        call DestroyTimer(t)
        call ClusterBombData.destroy(dat3)
    endif
    set t = null
    set s = null
endfunction

function Timer_ClusterBombFall takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local ClusterBombData dat2 = ClusterBombData(GetHandleInt(t,"data2"))
    local ClusterBombData dat3
    local unit b = null
    local real a = 0
    local timer tt = null
    local unit s = null
    local real offset = ClusterBombs_AoE() / 25
    if dat2.dist >= dat2.mdist then
        set b = dat2.p
        set a = dat2.ang
        call ShowUnit(b,true)
        call SetUnitX(b, GetUnitX(b) + offset * Cos(a*bj_DEGTORAD))
        call SetUnitY(b, GetUnitY(b) + offset * Sin(a*bj_DEGTORAD))
        call SetUnitFlyHeight(b, GetUnitFlyHeight(b) - 60, 0)
        if GetUnitFlyHeight(b) <= 40 then
            call PauseTimer(t)
            call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl",GetUnitX(b),GetUnitY(b)))
            set a = 0
            loop
                set a = a + 1
                exitwhen a > ClusterBombs_NumberOfClusters()
                set s = CreateUnit(GetOwningPlayer(b),ClusterBombs_DummyId(),GetUnitX(b),GetUnitY(b),0)
                call AddSpecialEffectTarget("abilities\\weapons\\DemolisherMissile\\DemolisherMissile.mdl",s,"origin")
                call UnitAddAbility(s, ClusterBombs_AoEDamageAbility())
                call SetUnitScale(s, 0.5, 0.5, 0.5)
                set tt = CreateTimer()
                set dat3 = ClusterBombData.create()
                set dat3.p = s
                set dat3.ang = GetRandomReal(1,360)
                set dat3.dist = 0
                set dat3.mdist = GetRandomReal(ClusterBombs_AoE()/8,ClusterBombs_AoE()/1.8)
                call SetHandleInt(tt,"data3",dat3)
                call TimerStart(tt, 0.04, true, function Timer_ClusterBombSplinter)
                set tt = null
            endloop
            call RemoveUnit(b)
            call FlushHandleLocals(t)
            call DestroyTimer(t)
            call ClusterBombData.destroy(dat2)
        endif
    else
        set dat2.dist = dat2.dist + 0.04
    endif
    set t = null
    set b = null
endfunction

function Timer_ClusterBombFlash takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local ClusterBombData dat = ClusterBombData(GetHandleInt(t,"data"))
    local ClusterBombData dat2
    local unit u = dat.c
    local unit p = dat.p
    local real a = dat.ang
    local real h = GetParabolaHeight(dat.dist, dat.mdist, 2)
    local timer tt = null
    local integer c = 0
    local real tx = 0
    local real ty = 0
    local real offset = 4 * ClusterBombs_AoE() / 57
    call SetUnitX(p, GetUnitX(p)+offset*Cos(a*bj_DEGTORAD))
    call SetUnitY(p, GetUnitY(p)+offset*Sin(a*bj_DEGTORAD))
    call SetUnitFlyHeight(p, h, 0)
    set dat.dist = dat.dist + offset
    if dat.dist >= dat.mdist then
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl",GetUnitX(p),GetUnitY(p)))
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Flare\\FlareTarget.mdl",GetUnitX(p),GetUnitY(p)))
        call KillUnit(p)
        loop
            set c = c + 1
            exitwhen c > ClusterBombs_NumberOfBombs(GetUnitAbilityLevel(u,ClusterBombs_SpellId()))
            set a = GetRandomReal(1,360)
            set h = GetRandomReal(ClusterBombs_AoE()/1.3,ClusterBombs_AoE()/0.66)
            set tx = dat.tx + h * Cos(a*bj_DEGTORAD)
            set ty = dat.ty + h * Sin(a*bj_DEGTORAD)
            set p = CreateUnit(GetOwningPlayer(u),ClusterBombs_DummyId(),tx,ty,a)
            call AddSpecialEffectTarget("Abilities\\Weapons\\Mortar\\MortarMissile.mdl", p, "origin")
            call SetUnitFlyHeight(p,1700,0)
            call ShowUnit(p,false)
            set tt = CreateTimer()
            set dat2 = ClusterBombData.create()
            set dat2.p = p
            set dat2.ang = a+180
            set dat2.dist = 0
            set dat2.mdist = c * ClusterBombs_Delay()
            call SetHandleInt(tt,"data2",dat2)
            call TimerStart(tt, 0.04, true, function Timer_ClusterBombFall)
            set tt = null
        endloop
        call PauseTimer(t)
        call FlushHandleLocals(t)
        call DestroyTimer(t)
        call ClusterBombData.destroy(dat)
    endif
    set t = null
    set u = null
    set p = null
endfunction

function Trig_ClusterBomb_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local location l = GetSpellTargetLoc()
    local real tx = GetLocationX(l)
    local real ty = GetLocationY(l)
    local timer t = CreateTimer()
    local unit p = CreateUnit(GetOwningPlayer(u),ClusterBombs_DummyId(),GetUnitX(u),GetUnitY(u),0)
    local ClusterBombData dat = ClusterBombData.create()
    call RemoveLocation(l)
    set l = null
    call SetUnitFlyHeight(u,20,0)
    call AddSpecialEffectTarget("Abilities\\Weapons\\BloodElfMissile\\BloodElfMissile.mdl",p,"origin")
    set dat.c = u
    set dat.p = p
    set dat.tx = tx
    set dat.ty = ty
    set dat.ang = AngleBetweenPointsXY(GetUnitX(u),GetUnitY(u),tx,ty)
    set dat.dist = 0
    set dat.mdist = DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),tx,ty)
    call SetHandleInt(t,"data",dat)
    call TimerStart(t, 0.04, true, function Timer_ClusterBombFlash)
    set u = null
    set t = null
    set p = null
endfunction

//===========================================================================
function InitTrig_ClusterBomb takes nothing returns nothing
    set gg_trg_ClusterBomb = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_ClusterBomb, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_ClusterBomb, Condition( function Trig_ClusterBomb_Conditions))
    call TriggerAddAction(gg_trg_ClusterBomb, function Trig_ClusterBomb_Actions)
    call RemoveUnit(CreateUnit(Player(15),ClusterBombs_DummyId(),0,0,0))
    call Preload("Abilities\\Weapons\\BloodElfMissile\\BloodElfMissile.mdl")
    call Preload("Abilities\\Weapons\\Mortar\\MortarMissile.mdl")
    call Preload("Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl")
    call Preload("Abilities\\Spells\\Human\\Flare\\FlareTarget.mdl")
    call Preload("abilities\\weapons\\DemolisherMissile\\DemolisherMissile.mdl")
    call Preload("Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl")
    call Preload("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl")
endfunction

The preloads are all set in the map script. JassNewGen and TESH are used. Thanks in advance!

~ Angelusz
 
Last edited by a moderator:
Level 9
Joined
Sep 8, 2004
Messages
633
Yes, the owning player is in game, as is the casting unit. Hence I don't understand what's going wrong. I copied the trigger exactly; as well as the abilities. Modified some values like damage and the variables, nothing else. Bounty is enabled in the map. Only this ability doesn't give bounty, nor aggro. (it seems as if the casting dummy unit doesn't belong to the owner of the hero)
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Okay, I confirm that it's a problem with the actual ability.

I added to the respawn creeps trigger a line that would display the name of the player who killed the unit. It displayed (null). I'll look more into the actual code to find a solution.

By the way, Angelusz, we have
JASS:
 tags for jass script. They work real nice, like this:
[code=jass]function YourFunction takes unit SomeUnit returns nothing
    // Do random actions...
    if SomeUnit==udg_MyUnit then // Look at the syntax highliting! :D
        call KillUnit(SomeUnit)
    endif
endfunction

EDIT: Ah I see. He uses a rather bizarre way of damaging the units. This spell, instead of damaging units within a certain zone of an explosion, adds the Goblin AoE Damage on Death ability to a dummy... which doesn't consider the owner of the dying suicidal unit.. Try it with this script instead. Adjust the damage values in the script now instead of the ability (I also removed an effect leak in there :D) :
JASS:
//===================================
//Spell: Cluster Bombs
//Author: paskovich
//
//If you want to import this spell,
//make sure you copy the dummy units
//from the object editor,
//and set the raw codes below!
//
//For damage values, modify these functions:
function ClusterBombs_FullDamageAmount takes nothing returns real
    return 50.0
endfunction
function ClusterBombs_FullDamageRadius takes nothing returns real
    return 100.0
endfunction
function ClusterBombs_PartialDamageAmount takes nothing returns real
    return 25.0
endfunction
function ClusterBombs_PartialDamageRadius takes nothing returns real
    return 50.0
endfunction

//
//It uses the Handle Vars and 
//     REQUIRES vJASS!!
//
//Thanks to Shadow1500 for the
//parabola function!
//
//
//Don't forget to give a credit!
//===================================

//=============RAW CODES=============
//Make sure you set the proper raw codes!

constant function ClusterBombs_SpellId takes nothing returns integer
    return 'A000' //The main ability's raw code
endfunction

constant function ClusterBombs_DummyId takes nothing returns integer
    return 'e000' //The generic dummy's raw code
endfunction

constant function ClusterBombs_AoEDamageAbility takes nothing returns integer
    return 'A001' //The AoE damage ability's raw code (it's called "Cluster Damage" in the object editor)
endfunction


//===========SPELL OPTIONS===========

constant function ClusterBombs_NumberOfBombs takes integer level returns integer
    return 1 + level //This defines the number of bombs falling from the sky.
endfunction

constant function ClusterBombs_NumberOfClusters takes nothing returns integer
    return 3 //The number of clusters that a bomb falls apart to.
endfunction

constant function ClusterBombs_AoE takes nothing returns real
    return 500.0 //The radius of the AoE. (Set this the same that you set in the object editor for the hero ability.)
endfunction

constant function ClusterBombs_Delay takes nothing returns real
    return 0.9 //The delay time between falling bombs.
endfunction

//=======================================
//============CLUSTER BOMBS==============
//=======================================
struct ClusterBombData
    unit c
    unit p
    effect e
    real tx
    real ty
    real ang
    real dist
    real mdist
endstruct

function Trig_ClusterBomb_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == ClusterBombs_SpellId()
endfunction

function Timer_ClusterBombSplinter takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local ClusterBombData dat3 = ClusterBombData(GetHandleInt(t,"data3"))
    local unit s = dat3.p
    local real a = dat3.ang
    local real h = GetParabolaHeight(dat3.dist, dat3.mdist, 1)
    local real offset = ClusterBombs_AoE() / 28
    call SetUnitX(s, GetUnitX(s)+offset*Cos(a*bj_DEGTORAD))
    call SetUnitY(s, GetUnitY(s)+offset*Sin(a*bj_DEGTORAD))
    call SetUnitFlyHeight(s,h,0)
    set dat3.dist = dat3.dist + offset
    if dat3.dist >= dat3.mdist then
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl",GetUnitX(s),GetUnitY(s)))
        call DestroyEffect(dat3.e)
        call KillUnit(s)
        call PauseTimer(t)
        call FlushHandleLocals(t)
        call DestroyTimer(t)
        call ClusterBombData.destroy(dat3)
    endif
    set t = null
    set s = null
endfunction
function TrueFilter takes nothing returns boolean
    return true
endfunction
function UnitDamageRadius takes unit whichUnit, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType, player p returns nothing
    local group g=CreateGroup()
    local unit u
    call GroupEnumUnitsInRange(g,x,y,radius,Filter(function TrueFilter))
    loop
        set u=FirstOfGroup(g)
        exitwhen u==null
        if IsUnitEnemy(u,p) then
            call UnitDamageTarget(whichUnit,u,amount,attack,ranged,attackType,damageType,weaponType)
        endif
        call GroupRemoveUnit(g,u)
    endloop
    call DestroyGroup(g)
    set g=null
endfunction
function Timer_ClusterBombFall takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local ClusterBombData dat2 = ClusterBombData(GetHandleInt(t,"data2"))
    local ClusterBombData dat3
    local unit b = null
    local real a = 0
    local timer tt = null
    local unit s = null
    local real offset = ClusterBombs_AoE() / 25
    if dat2.dist >= dat2.mdist then
        set b = dat2.p
        set a = dat2.ang
        call ShowUnit(b,true)
        call SetUnitX(b, GetUnitX(b) + offset * Cos(a*bj_DEGTORAD))
        call SetUnitY(b, GetUnitY(b) + offset * Sin(a*bj_DEGTORAD))
        call SetUnitFlyHeight(b, GetUnitFlyHeight(b) - 60, 0)
        if GetUnitFlyHeight(b) <= 40 then
            call PauseTimer(t)
            call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl",GetUnitX(b),GetUnitY(b)))
            set a = 0
            loop
                set a = a + 1
                exitwhen a > ClusterBombs_NumberOfClusters()
                set s = CreateUnit(GetOwningPlayer(b),ClusterBombs_DummyId(),GetUnitX(b),GetUnitY(b),0)
                call UnitDamageRadius(b,ClusterBombs_FullDamageRadius(),GetUnitX(b),GetUnitY(b),ClusterBombs_FullDamageAmount(),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS,GetOwningPlayer(b))
                call UnitDamageRadius(b,ClusterBombs_FullDamageRadius()+ClusterBombs_PartialDamageRadius(),GetUnitX(b),GetUnitY(b),ClusterBombs_PartialDamageAmount(),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS,GetOwningPlayer(b))
                set tt = CreateTimer()
                set dat3 = ClusterBombData.create()
                set dat3.e=AddSpecialEffectTarget("abilities\\weapons\\DemolisherMissile\\DemolisherMissile.mdl",s,"origin")
                set dat3.p = s
                set dat3.ang = GetRandomReal(1,360)
                set dat3.dist = 0
                set dat3.mdist = GetRandomReal(ClusterBombs_AoE()/8,ClusterBombs_AoE()/1.8)
                call SetHandleInt(tt,"data3",dat3)
                call TimerStart(tt, 0.04, true, function Timer_ClusterBombSplinter)
                set tt = null
            endloop
            call RemoveUnit(b)
            call FlushHandleLocals(t)
            call DestroyTimer(t)
            call ClusterBombData.destroy(dat2)
        endif
    else
        set dat2.dist = dat2.dist + 0.04
    endif
    set t = null
    set b = null
endfunction

function Timer_ClusterBombFlash takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local ClusterBombData dat = ClusterBombData(GetHandleInt(t,"data"))
    local ClusterBombData dat2
    local unit u = dat.c
    local unit p = dat.p
    local real a = dat.ang
    local real h = GetParabolaHeight(dat.dist, dat.mdist, 2)
    local timer tt = null
    local integer c = 0
    local real tx = 0
    local real ty = 0
    local real offset = 4 * ClusterBombs_AoE() / 57
    call SetUnitX(p, GetUnitX(p)+offset*Cos(a*bj_DEGTORAD))
    call SetUnitY(p, GetUnitY(p)+offset*Sin(a*bj_DEGTORAD))
    call SetUnitFlyHeight(p, h, 0)
    set dat.dist = dat.dist + offset
    if dat.dist >= dat.mdist then
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl",GetUnitX(p),GetUnitY(p)))
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Flare\\FlareTarget.mdl",GetUnitX(p),GetUnitY(p)))
        call KillUnit(p)
        loop
            set c = c + 1
            exitwhen c > ClusterBombs_NumberOfBombs(GetUnitAbilityLevel(u,ClusterBombs_SpellId()))
            set a = GetRandomReal(1,360)
            set h = GetRandomReal(ClusterBombs_AoE()/1.3,ClusterBombs_AoE()/0.66)
            set tx = dat.tx + h * Cos(a*bj_DEGTORAD)
            set ty = dat.ty + h * Sin(a*bj_DEGTORAD)
            set p = CreateUnit(GetOwningPlayer(u),ClusterBombs_DummyId(),tx,ty,a)
            call AddSpecialEffectTarget("Abilities\\Weapons\\Mortar\\MortarMissile.mdl", p, "origin")
            call SetUnitFlyHeight(p,1700,0)
            call ShowUnit(p,false)
            set tt = CreateTimer()
            set dat2 = ClusterBombData.create()
            set dat2.p = p
            set dat2.ang = a+180
            set dat2.dist = 0
            set dat2.mdist = c * ClusterBombs_Delay()
            call SetHandleInt(tt,"data2",dat2)
            call TimerStart(tt, 0.04, true, function Timer_ClusterBombFall)
            set tt = null
        endloop
        call PauseTimer(t)
        call FlushHandleLocals(t)
        call DestroyTimer(t)
        call ClusterBombData.destroy(dat)
    endif
    set t = null
    set u = null
    set p = null
endfunction

function Trig_ClusterBomb_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local location l = GetSpellTargetLoc()
    local real tx = GetLocationX(l)
    local real ty = GetLocationY(l)
    local timer t = CreateTimer()
    local unit p = CreateUnit(GetOwningPlayer(u),ClusterBombs_DummyId(),GetUnitX(u),GetUnitY(u),0)
    local ClusterBombData dat = ClusterBombData.create()
    call RemoveLocation(l)
    set l = null
    call SetUnitFlyHeight(u,20,0)
    call AddSpecialEffectTarget("Abilities\\Weapons\\BloodElfMissile\\BloodElfMissile.mdl",p,"origin")
    set dat.c = u
    set dat.p = p
    set dat.tx = tx
    set dat.ty = ty
    set dat.ang = AngleBetweenPointsXY(GetUnitX(u),GetUnitY(u),tx,ty)
    set dat.dist = 0
    set dat.mdist = DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),tx,ty)
    call SetHandleInt(t,"data",dat)
    call TimerStart(t, 0.04, true, function Timer_ClusterBombFlash)
    set u = null
    set t = null
    set p = null
endfunction

//===========================================================================
function InitTrig_ClusterBomb takes nothing returns nothing
    set gg_trg_ClusterBomb = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_ClusterBomb, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_ClusterBomb, Condition( function Trig_ClusterBomb_Conditions))
    call TriggerAddAction(gg_trg_ClusterBomb, function Trig_ClusterBomb_Actions)
    call RemoveUnit(CreateUnit(Player(15),ClusterBombs_DummyId(),0,0,0))
    call Preload("Abilities\\Weapons\\BloodElfMissile\\BloodElfMissile.mdl")
    call Preload("Abilities\\Weapons\\Mortar\\MortarMissile.mdl")
    call Preload("Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl")
    call Preload("Abilities\\Spells\\Human\\Flare\\FlareTarget.mdl")
    call Preload("abilities\\weapons\\DemolisherMissile\\DemolisherMissile.mdl")
    call Preload("Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl")
    call Preload("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl")
endfunction
 
Last edited:
Level 9
Joined
Sep 8, 2004
Messages
633
Ooo, you're the best Hindy <3 I'm going to try it out right now. +rep!
Thanks to you too, purplepoot, for the effort :D

Edit:
Uhm, when I copy that code, it doesn't record enters and tabs. So it's all in a big line. How do I copy your code? Can you put it in a map for me, please?
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
It's a problem with your browser. It happens for me too. Just try to copy it with Internet Explorer open, and it should work. If that still doesn't work, I'll paste it here:

BTW, I hate this spell for the length of it -.-
JASS:
//===================================
//Spell: Cluster Bombs
//Author: paskovich
//
//If you want to import this spell,
//make sure you copy the dummy units
//from the object editor,
//and set the raw codes below!
//
//For damage values, modify these functions:
function ClusterBombs_FullDamageAmount takes nothing returns real
    return 50.0
endfunction
function ClusterBombs_FullDamageRadius takes nothing returns real
    return 100.0
endfunction
function ClusterBombs_PartialDamageAmount takes nothing returns real
    return 25.0
endfunction
function ClusterBombs_PartialDamageRadius takes nothing returns real
    return 50.0
endfunction
//
//It uses the Handle Vars and
//     REQUIRES vJASS!!
//
//Thanks to Shadow1500 for the
//parabola function!
//
//
//Don't forget to give a credit!
//===================================
//=============RAW CODES=============
//Make sure you set the proper raw codes!
constant function ClusterBombs_SpellId takes nothing returns integer
    return 'A000' //The main ability's raw code
endfunction
constant function ClusterBombs_DummyId takes nothing returns integer
    return 'e000' //The generic dummy's raw code
endfunction
constant function ClusterBombs_AoEDamageAbility takes nothing returns integer
    return 'A001' //The AoE damage ability's raw code (it's called "Cluster Damage" in the object editor)
endfunction
//===========SPELL OPTIONS===========
constant function ClusterBombs_NumberOfBombs takes integer level returns integer
    return 1 + level //This defines the number of bombs falling from the sky.
endfunction
constant function ClusterBombs_NumberOfClusters takes nothing returns integer
    return 3 //The number of clusters that a bomb falls apart to.
endfunction
constant function ClusterBombs_AoE takes nothing returns real
    return 500.0 //The radius of the AoE. (Set this the same that you set in the object editor for the hero ability.)
endfunction
constant function ClusterBombs_Delay takes nothing returns real
    return 0.9 //The delay time between falling bombs.
endfunction
//=======================================
//============CLUSTER BOMBS==============
//=======================================
struct ClusterBombData
    unit c
    unit p
    effect e
    real tx
    real ty
    real ang
    real dist
    real mdist
endstruct
function Trig_ClusterBomb_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == ClusterBombs_SpellId()
endfunction
function Timer_ClusterBombSplinter takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local ClusterBombData dat3 = ClusterBombData(GetHandleInt(t,"data3"))
    local unit s = dat3.p
    local real a = dat3.ang
    local real h = GetParabolaHeight(dat3.dist, dat3.mdist, 1)
    local real offset = ClusterBombs_AoE() / 28
    call SetUnitX(s, GetUnitX(s)+offset*Cos(a*bj_DEGTORAD))
    call SetUnitY(s, GetUnitY(s)+offset*Sin(a*bj_DEGTORAD))
    call SetUnitFlyHeight(s,h,0)
    set dat3.dist = dat3.dist + offset
    if dat3.dist >= dat3.mdist then
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl",GetUnitX(s),GetUnitY(s)))
        call DestroyEffect(dat3.e)
        call KillUnit(s)
        call PauseTimer(t)
        call FlushHandleLocals(t)
        call DestroyTimer(t)
        call ClusterBombData.destroy(dat3)
    endif
    set t = null
    set s = null
endfunction
function TrueFilter takes nothing returns boolean
    return true
endfunction
function UnitDamageRadius takes unit whichUnit, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType, player p returns nothing
    local group g=CreateGroup()
    local unit u
    call GroupEnumUnitsInRange(g,x,y,radius,Filter(function TrueFilter))
    loop
        set u=FirstOfGroup(g)
        exitwhen u==null
        if IsUnitEnemy(u,p) then
            call UnitDamageTarget(whichUnit,u,amount,attack,ranged,attackType,damageType,weaponType)
        endif
        call GroupRemoveUnit(g,u)
    endloop
    call DestroyGroup(g)
    set g=null
endfunction
function Timer_ClusterBombFall takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local ClusterBombData dat2 = ClusterBombData(GetHandleInt(t,"data2"))
    local ClusterBombData dat3
    local unit b = null
    local real a = 0
    local timer tt = null
    local unit s = null
    local real offset = ClusterBombs_AoE() / 25
    if dat2.dist >= dat2.mdist then
        set b = dat2.p
        set a = dat2.ang
        call ShowUnit(b,true)
        call SetUnitX(b, GetUnitX(b) + offset * Cos(a*bj_DEGTORAD))
        call SetUnitY(b, GetUnitY(b) + offset * Sin(a*bj_DEGTORAD))
        call SetUnitFlyHeight(b, GetUnitFlyHeight(b) - 60, 0)
        if GetUnitFlyHeight(b) <= 40 then
            call PauseTimer(t)
            call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl",GetUnitX(b),GetUnitY(b)))
            set a = 0
            loop
                set a = a + 1
                exitwhen a > ClusterBombs_NumberOfClusters()
                set s = CreateUnit(GetOwningPlayer(b),ClusterBombs_DummyId(),GetUnitX(b),GetUnitY(b),0)
                call UnitDamageRadius(b,ClusterBombs_FullDamageRadius(),GetUnitX(b),GetUnitY(b),ClusterBombs_FullDamageAmount(),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS,GetOwningPlayer(b))
                call UnitDamageRadius(b,ClusterBombs_FullDamageRadius()+ClusterBombs_PartialDamageRadius(),GetUnitX(b),GetUnitY(b),ClusterBombs_PartialDamageAmount(),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS,GetOwningPlayer(b))
                set tt = CreateTimer()
                set dat3 = ClusterBombData.create()
                set dat3.e=AddSpecialEffectTarget("abilities\\weapons\\DemolisherMissile\\DemolisherMissile.mdl",s,"origin")
                set dat3.p = s
                set dat3.ang = GetRandomReal(1,360)
                set dat3.dist = 0
                set dat3.mdist = GetRandomReal(ClusterBombs_AoE()/8,ClusterBombs_AoE()/1.8)
                call SetHandleInt(tt,"data3",dat3)
                call TimerStart(tt, 0.04, true, function Timer_ClusterBombSplinter)
                set tt = null
            endloop
            call RemoveUnit(b)
            call FlushHandleLocals(t)
            call DestroyTimer(t)
            call ClusterBombData.destroy(dat2)
        endif
    else
        set dat2.dist = dat2.dist + 0.04
    endif
    set t = null
    set b = null
endfunction
function Timer_ClusterBombFlash takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local ClusterBombData dat = ClusterBombData(GetHandleInt(t,"data"))
    local ClusterBombData dat2
    local unit u = dat.c
    local unit p = dat.p
    local real a = dat.ang
    local real h = GetParabolaHeight(dat.dist, dat.mdist, 2)
    local timer tt = null
    local integer c = 0
    local real tx = 0
    local real ty = 0
    local real offset = 4 * ClusterBombs_AoE() / 57
    call SetUnitX(p, GetUnitX(p)+offset*Cos(a*bj_DEGTORAD))
    call SetUnitY(p, GetUnitY(p)+offset*Sin(a*bj_DEGTORAD))
    call SetUnitFlyHeight(p, h, 0)
    set dat.dist = dat.dist + offset
    if dat.dist >= dat.mdist then
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl",GetUnitX(p),GetUnitY(p)))
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Flare\\FlareTarget.mdl",GetUnitX(p),GetUnitY(p)))
        call KillUnit(p)
        loop
            set c = c + 1
            exitwhen c > ClusterBombs_NumberOfBombs(GetUnitAbilityLevel(u,ClusterBombs_SpellId()))
            set a = GetRandomReal(1,360)
            set h = GetRandomReal(ClusterBombs_AoE()/1.3,ClusterBombs_AoE()/0.66)
            set tx = dat.tx + h * Cos(a*bj_DEGTORAD)
            set ty = dat.ty + h * Sin(a*bj_DEGTORAD)
            set p = CreateUnit(GetOwningPlayer(u),ClusterBombs_DummyId(),tx,ty,a)
            call AddSpecialEffectTarget("Abilities\\Weapons\\Mortar\\MortarMissile.mdl", p, "origin")
            call SetUnitFlyHeight(p,1700,0)
            call ShowUnit(p,false)
            set tt = CreateTimer()
            set dat2 = ClusterBombData.create()
            set dat2.p = p
            set dat2.ang = a+180
            set dat2.dist = 0
            set dat2.mdist = c * ClusterBombs_Delay()
            call SetHandleInt(tt,"data2",dat2)
            call TimerStart(tt, 0.04, true, function Timer_ClusterBombFall)
            set tt = null
        endloop
        call PauseTimer(t)
        call FlushHandleLocals(t)
        call DestroyTimer(t)
        call ClusterBombData.destroy(dat)
    endif
    set t = null
    set u = null
    set p = null
endfunction
function Trig_ClusterBomb_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local location l = GetSpellTargetLoc()
    local real tx = GetLocationX(l)
    local real ty = GetLocationY(l)
    local timer t = CreateTimer()
    local unit p = CreateUnit(GetOwningPlayer(u),ClusterBombs_DummyId(),GetUnitX(u),GetUnitY(u),0)
    local ClusterBombData dat = ClusterBombData.create()
    call RemoveLocation(l)
    set l = null
    call SetUnitFlyHeight(u,20,0)
    call AddSpecialEffectTarget("Abilities\\Weapons\\BloodElfMissile\\BloodElfMissile.mdl",p,"origin")
    set dat.c = u
    set dat.p = p
    set dat.tx = tx
    set dat.ty = ty
    set dat.ang = AngleBetweenPointsXY(GetUnitX(u),GetUnitY(u),tx,ty)
    set dat.dist = 0
    set dat.mdist = DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),tx,ty)
    call SetHandleInt(t,"data",dat)
    call TimerStart(t, 0.04, true, function Timer_ClusterBombFlash)
    set u = null
    set t = null
    set p = null
endfunction
//===========================================================================
function InitTrig_ClusterBomb takes nothing returns nothing
    set gg_trg_ClusterBomb = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_ClusterBomb, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_ClusterBomb, Condition( function Trig_ClusterBomb_Conditions))
    call TriggerAddAction(gg_trg_ClusterBomb, function Trig_ClusterBomb_Actions)
    call RemoveUnit(CreateUnit(Player(15),ClusterBombs_DummyId(),0,0,0))
    call Preload("Abilities\\Weapons\\BloodElfMissile\\BloodElfMissile.mdl")
    call Preload("Abilities\\Weapons\\Mortar\\MortarMissile.mdl")
    call Preload("Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl")
    call Preload("Abilities\\Spells\\Human\\Flare\\FlareTarget.mdl")
    call Preload("abilities\\weapons\\DemolisherMissile\\DemolisherMissile.mdl")
    call Preload("Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl")
    call Preload("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl")
endfunction
 
Last edited by a moderator:
Level 9
Joined
Sep 8, 2004
Messages
633
Damn. Now the fragments don't deal damage anymore. Currently, a few bombs fall, depending on the level of the spell. Each bomb itself deals damage. The bombs split into three fragments though, which are supposed to do damage too, but won't anymore. Can you please find out why that doesn't work anymore? Perhaps you forgot to change a little part. Thanks again!
 
Level 9
Joined
Sep 8, 2004
Messages
633
Oww. Well, they're supposed to, I know that much. If the initial code didn't do that, perhaps it was forgotten by the creator. Is the ability "Cluster Damage" still used btw, I don't see it's ID anywhere in the code. Can anyone "add" the cluster damage?
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
[jass=Try this, but I didn't have a chance to compile it. However, it's probably fine]//===================================
//Spell: Cluster Bombs
//Author: paskovich
//
//If you want to import this spell,
//make sure you copy the dummy units
//from the object editor,
//and set the raw codes below!
//
//For damage values, modify these functions:
function ClusterBombs_FullDamageAmount takes nothing returns real
return 50.0
endfunction
function ClusterBombs_FullDamageRadius takes nothing returns real
return 100.0
endfunction
function ClusterBombs_PartialDamageAmount takes nothing returns real
return 25.0
endfunction
function ClusterBombs_PartialDamageRadius takes nothing returns real
return 50.0
endfunction
function ClusterBombs_ShardsFullDamageAmount takes nothing returns real
return 50.0
endfunction
function ClusterBombs_ShardsFullDamageRadius takes nothing returns real
return 100.0
endfunction
function ClusterBombs_ShardsPartialDamageAmount takes nothing returns real
return 25.0
endfunction
function ClusterBombs_ShardsPartialDamageRadius takes nothing returns real
return 50.0
endfunction
//
//It uses the Handle Vars and
// REQUIRES vJASS!!
//
//Thanks to Shadow1500 for the
//parabola function!
//
//
//Don't forget to give a credit!
//===================================
//=============RAW CODES=============
//Make sure you set the proper raw codes!
constant function ClusterBombs_SpellId takes nothing returns integer
return 'A000' //The main ability's raw code
endfunction
constant function ClusterBombs_DummyId takes nothing returns integer
return 'e000' //The generic dummy's raw code
endfunction
constant function ClusterBombs_AoEDamageAbility takes nothing returns integer
return 'A001' //The AoE damage ability's raw code (it's called "Cluster Damage" in the object editor)
endfunction
//===========SPELL OPTIONS===========
constant function ClusterBombs_NumberOfBombs takes integer level returns integer
return 1 + level //This defines the number of bombs falling from the sky.
endfunction
constant function ClusterBombs_NumberOfClusters takes nothing returns integer
return 3 //The number of clusters that a bomb falls apart to.
endfunction
constant function ClusterBombs_AoE takes nothing returns real
return 500.0 //The radius of the AoE. (Set this the same that you set in the object editor for the hero ability.)
endfunction
constant function ClusterBombs_Delay takes nothing returns real
return 0.9 //The delay time between falling bombs.
endfunction
//=======================================
//============CLUSTER BOMBS==============
//=======================================
struct ClusterBombData
unit c
unit p
effect e
real tx
real ty
real ang
real dist
real mdist
endstruct
function Trig_ClusterBomb_Conditions takes nothing returns boolean
return GetSpellAbilityId() == ClusterBombs_SpellId()
endfunction
function TrueFilter takes nothing returns boolean
return true
endfunction
function UnitDamageRadius takes unit whichUnit, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType, player p returns nothing
local group g=CreateGroup()
local unit u
call GroupEnumUnitsInRange(g,x,y,radius,Filter(function TrueFilter))
loop
set u=FirstOfGroup(g)
exitwhen u==null
if IsUnitEnemy(u,p) then
call UnitDamageTarget(whichUnit,u,amount,attack,ranged,attackType,damageType,weaponType)
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g=null
endfunction
function Timer_ClusterBombSplinter takes nothing returns nothing
local timer t = GetExpiredTimer()
local ClusterBombData dat3 = ClusterBombData(GetHandleInt(t,"data3"))
local unit s = dat3.p
local real a = dat3.ang
local real h = GetParabolaHeight(dat3.dist, dat3.mdist, 1)
local real offset = ClusterBombs_AoE() / 28
call SetUnitX(s, GetUnitX(s)+offset*Cos(a*bj_DEGTORAD))
call SetUnitY(s, GetUnitY(s)+offset*Sin(a*bj_DEGTORAD))
call SetUnitFlyHeight(s,h,0)
set dat3.dist = dat3.dist + offset
if dat3.dist >= dat3.mdist then
call UnitDamageRadius(s,ClusterBombs_ShardsFullDamageRadius(),GetUnitX(s),GetUnitY(s),ClusterBombs_ShardsFullDamageAmount(),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null,GetOwningPlayer(s))
call UnitDamageRadius(s,ClusterBombs_ShardsPartialDamageRadius()+ClusterBombs_ShardsFullDamageRadius(),GetUnitX(s),GetUnitY(s),ClusterBombs_ShardsPartialDamageAmount(),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null,GetOwningPlayer(s))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl",GetUnitX(s),GetUnitY(s)))
call DestroyEffect(dat3.e)
call KillUnit(s)
call PauseTimer(t)
call FlushHandleLocals(t)
call DestroyTimer(t)
call ClusterBombData.destroy(dat3)
endif
set t = null
set s = null
endfunction
function Timer_ClusterBombFall takes nothing returns nothing
local timer t = GetExpiredTimer()
local ClusterBombData dat2 = ClusterBombData(GetHandleInt(t,"data2"))
local ClusterBombData dat3
local unit b = null
local real a = 0
local timer tt = null
local unit s = null
local real offset = ClusterBombs_AoE() / 25
if dat2.dist >= dat2.mdist then
set b = dat2.p
set a = dat2.ang
call ShowUnit(b,true)
call SetUnitX(b, GetUnitX(b) + offset * Cos(a*bj_DEGTORAD))
call SetUnitY(b, GetUnitY(b) + offset * Sin(a*bj_DEGTORAD))
call SetUnitFlyHeight(b, GetUnitFlyHeight(b) - 60, 0)
if GetUnitFlyHeight(b) <= 40 then
call PauseTimer(t)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl",GetUnitX(b),GetUnitY(b)))
set a = 0
loop
set a = a + 1
exitwhen a > ClusterBombs_NumberOfClusters()
set s = CreateUnit(GetOwningPlayer(b),ClusterBombs_DummyId(),GetUnitX(b),GetUnitY(b),0)
call UnitDamageRadius(b,ClusterBombs_FullDamageRadius(),GetUnitX(b),GetUnitY(b),ClusterBombs_FullDamageAmount(),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS,GetOwningPlayer(b))
call UnitDamageRadius(b,ClusterBombs_FullDamageRadius()+ClusterBombs_PartialDamageRadius(),GetUnitX(b),GetUnitY(b),ClusterBombs_PartialDamageAmount(),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS,GetOwningPlayer(b))
set tt = CreateTimer()
set dat3 = ClusterBombData.create()
set dat3.e=AddSpecialEffectTarget("abilities\\weapons\\DemolisherMissile\\DemolisherMissile.mdl",s,"origin")
set dat3.p = s
set dat3.ang = GetRandomReal(1,360)
set dat3.dist = 0
set dat3.mdist = GetRandomReal(ClusterBombs_AoE()/8,ClusterBombs_AoE()/1.8)
call SetHandleInt(tt,"data3",dat3)
call TimerStart(tt, 0.04, true, function Timer_ClusterBombSplinter)
set tt = null
endloop
call RemoveUnit(b)
call FlushHandleLocals(t)
call DestroyTimer(t)
call ClusterBombData.destroy(dat2)
endif
else
set dat2.dist = dat2.dist + 0.04
endif
set t = null
set b = null
endfunction
function Timer_ClusterBombFlash takes nothing returns nothing
local timer t = GetExpiredTimer()
local ClusterBombData dat = ClusterBombData(GetHandleInt(t,"data"))
local ClusterBombData dat2
local unit u = dat.c
local unit p = dat.p
local real a = dat.ang
local real h = GetParabolaHeight(dat.dist, dat.mdist, 2)
local timer tt = null
local integer c = 0
local real tx = 0
local real ty = 0
local real offset = 4 * ClusterBombs_AoE() / 57
call SetUnitX(p, GetUnitX(p)+offset*Cos(a*bj_DEGTORAD))
call SetUnitY(p, GetUnitY(p)+offset*Sin(a*bj_DEGTORAD))
call SetUnitFlyHeight(p, h, 0)
set dat.dist = dat.dist + offset
if dat.dist >= dat.mdist then
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl",GetUnitX(p),GetUnitY(p)))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Flare\\FlareTarget.mdl",GetUnitX(p),GetUnitY(p)))
call KillUnit(p)
loop
set c = c + 1
exitwhen c > ClusterBombs_NumberOfBombs(GetUnitAbilityLevel(u,ClusterBombs_SpellId()))
set a = GetRandomReal(1,360)
set h = GetRandomReal(ClusterBombs_AoE()/1.3,ClusterBombs_AoE()/0.66)
set tx = dat.tx + h * Cos(a*bj_DEGTORAD)
set ty = dat.ty + h * Sin(a*bj_DEGTORAD)
set p = CreateUnit(GetOwningPlayer(u),ClusterBombs_DummyId(),tx,ty,a)
call AddSpecialEffectTarget("Abilities\\Weapons\\Mortar\\MortarMissile.mdl", p, "origin")
call SetUnitFlyHeight(p,1700,0)
call ShowUnit(p,false)
set tt = CreateTimer()
set dat2 = ClusterBombData.create()
set dat2.p = p
set dat2.ang = a+180
set dat2.dist = 0
set dat2.mdist = c * ClusterBombs_Delay()
call SetHandleInt(tt,"data2",dat2)
call TimerStart(tt, 0.04, true, function Timer_ClusterBombFall)
set tt = null
endloop
call PauseTimer(t)
call FlushHandleLocals(t)
call DestroyTimer(t)
call ClusterBombData.destroy(dat)
endif
set t = null
set u = null
set p = null
endfunction
function Trig_ClusterBomb_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location l = GetSpellTargetLoc()
local real tx = GetLocationX(l)
local real ty = GetLocationY(l)
local timer t = CreateTimer()
local unit p = CreateUnit(GetOwningPlayer(u),ClusterBombs_DummyId(),GetUnitX(u),GetUnitY(u),0)
local ClusterBombData dat = ClusterBombData.create()
call RemoveLocation(l)
set l = null
call SetUnitFlyHeight(u,20,0)
call AddSpecialEffectTarget("Abilities\\Weapons\\BloodElfMissile\\BloodElfMissile.mdl",p,"origin")
set dat.c = u
set dat.p = p
set dat.tx = tx
set dat.ty = ty
set dat.ang = AngleBetweenPointsXY(GetUnitX(u),GetUnitY(u),tx,ty)
set dat.dist = 0
set dat.mdist = DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),tx,ty)
call SetHandleInt(t,"data",dat)
call TimerStart(t, 0.04, true, function Timer_ClusterBombFlash)
set u = null
set t = null
set p = null
endfunction
//===========================================================================
function InitTrig_ClusterBomb takes nothing returns nothing
set gg_trg_ClusterBomb = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_ClusterBomb, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_ClusterBomb, Condition( function Trig_ClusterBomb_Conditions))
call TriggerAddAction(gg_trg_ClusterBomb, function Trig_ClusterBomb_Actions)
call RemoveUnit(CreateUnit(Player(15),ClusterBombs_DummyId(),0,0,0))
call Preload("Abilities\\Weapons\\BloodElfMissile\\BloodElfMissile.mdl")
call Preload("Abilities\\Weapons\\Mortar\\MortarMissile.mdl")
call Preload("Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl")
call Preload("Abilities\\Spells\\Human\\Flare\\FlareTarget.mdl")
call Preload("abilities\\weapons\\DemolisherMissile\\DemolisherMissile.mdl")
call Preload("Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl")
call Preload("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl")
endfunction[/code]
 
Status
Not open for further replies.
Top