• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

grenade launch issue

Status
Not open for further replies.
Level 10
Joined
Sep 29, 2006
Messages
447
Ok so i dont really think that this is a problem with the JASS but you never know so.

basically the idea of the spell is, a unit launches a grenade at a target and it explodes dealing damage to everything in the area

everything is working except for the projectile art. what i did was have one dummy unit cast acid bomb in another (for the art) and then the dummy unit would cast thunderclap for teh damage, and a special effect is created. evrything except for teh acid bomb part works and i dont know why.

here's my trigger:

A00k is acid bomb dummy spell and A00L is the dummy thunderclap
Code:
function Trig_Grenade_Launch_Copy_Conditions takes nothing returns boolean    
    if ( not ( GetSpellAbilityId() == 'A00J' ) ) then        
        return false    
        endif    
    return true
endfunction

function Trig_Grenade_Launch_Copy_Actions takes nothing returns nothing   
    local unit caster = GetTriggerUnit()    
    local unit TempUnit    
    local unit TempUnit2    
    local location TempPoint = GetUnitLoc(caster)    
    local location TempPoint2 = GetSpellTargetLoc()    
    call CreateNUnitsAtLoc( 1, 'h005', GetOwningPlayer(caster), TempPoint, bj_UNIT_FACING )    
    set TempUnit = GetLastCreatedUnit()    
    call UnitAddAbility( TempUnit, 'A00K' )    
    call UnitApplyTimedLife( TempUnit, 'BTLF', 6.00 )    
    call CreateNUnitsAtLoc( 1, 'h006', GetOwningPlayer(caster), TempPoint2, bj_UNIT_FACING )    
    set TempUnit2 = GetLastCreatedUnit()    
    call UnitAddAbility( TempUnit2, 'A00L' )    
    call SetUnitAbilityLevelSwapped( 'A00L', TempUnit2, GetUnitAbilityLevelSwapped('A00J', caster) )    
    call UnitApplyTimedLife( TempUnit2, 'BTLF', 6.00 )    call IssueTargetOrder( TempUnit, "acidbomb", TempUnit2 )    
    call TriggerSleepAction( ( DistanceBetweenPoints(TempPoint, TempPoint2) / 700.00 ) )    
    call IssueImmediateOrder( TempUnit2, "thunderclap" )    
    call AddSpecialEffectLoc( "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", TempPoint2 )    
    call DestroyEffect( GetLastCreatedEffectBJ() )    
    call RemoveLocation(TempPoint)    
    call RemoveLocation(TempPoint2)    
    set caster = null   
    set TempUnit = null    
    set TempUnit2 = null
endfunction

//===========================================================================
function InitTrig_Grenade_Launch_Copy takes nothing returns nothing    
    set gg_trg_Grenade_Launch_Copy = CreateTrigger(  )    
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Grenade_Launch_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )    
    call TriggerAddCondition( gg_trg_Grenade_Launch_Copy, Condition( function Trig_Grenade_Launch_Copy_Conditions ) )    
    call TriggerAddAction( gg_trg_Grenade_Launch_Copy, function Trig_Grenade_Launch_Copy_Actions )
endfunction

as a side note:

there are two dummies being used h005 and h006. h006 is not invulnerabe and does not have locust, otherwise i wouldnt be able to cast acid bomb on it, so that is NOT the problem.

EDIT: the code tag messed up ill fix it hold on please

EDIT: okay all fixed, can anyone help?
 
Level 3
Joined
Jun 16, 2008
Messages
28
Two recomendations:

one this belongs in triggers and scripts not the world editor help zone

two this seems to complicated for what you are trying to do why not just modify flamestrike or something?
 
Status
Not open for further replies.
Top