wc3edit.net

United Warcraft 3 map hacking!
It is currently April 20th, 2024, 2:02 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: April 28th, 2007, 8:30 pm 
Offline
Member

Joined: February 27th, 2007, 11:17 pm
Posts: 50
Code:
function Trig_NUKE_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetSummonedUnit()) == 'e007' ) ) then
        return false
    endif
    return true
endfunction


function GetNukeGameCache takes nothing returns gamecache
    return gg_trg_Nuke
    return null
endfunction

function StoreNukeGameCache takes nothing returns trigger
    return bj_lastCreatedGameCache
    return null
endfunction

function TimedSFX_Child takes nothing returns nothing
    local effect tempeffect
    set tempeffect = bj_lastCreatedEffect

    call PolledWait(14.00)
    call DestroyEffect(tempeffect)

    set tempeffect = null
endfunction

function TimedSFX takes location Loc, string Effect, real duration returns nothing
    local trigger TimedSFXTrigger = CreateTrigger()
    call AddSpecialEffectLocBJ( Loc, Effect )
    call TriggerAddAction(TimedSFXTrigger,function TimedSFX_Child)
    call TriggerExecute(TimedSFXTrigger)
    call DestroyTrigger(TimedSFXTrigger)

    set TimedSFXTrigger = null
endfunction

function TimedBlight takes nothing returns nothing
    local location Center
    set Center = Location(GetStoredReal(GetNukeGameCache(), "Nuke", "LocationX" ), GetStoredReal(GetNukeGameCache(), "Nuke", "LocationY" ))
    call PolledWait(16.00)
    call SetBlightLoc( Player(PLAYER_NEUTRAL_AGGRESSIVE), Center, 512.00, false )
    call RemoveLocation(Center)
    set Center = null
endfunction

function NukeDamage takes nothing returns nothing
     call UnitDamageTargetBJ( GetSummonedUnit(),GetEnumUnit(), 200.00, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_FIRE )
endfunction

function RandomPointInRange takes location Center, real Radius returns location
    return PolarProjectionBJ(Center, GetRandomReal(128.00, Radius), GetRandomDirectionDeg())
endfunction
function Trig_NUKE_Actions takes nothing returns nothing
    local integer k
    local location uloc
    set uloc = (GetUnitLoc(GetSummonedUnit()))
    local trigger TempTrigger = CreateTrigger()
    local player owner
    set owner = GetOwningPlayer(GetSummonedUnit())

    call StoreReal( GetNukeGameCache(), "Nuke", "LocationX", GetLocationX(uloc) )
    call StoreReal( GetNukeGameCache(), "Nuke", "LocationY", GetLocationY(uloc) )

    call PolledWait( 4.00 )
    call SetUnitTimeScalePercent( GetSummonedUnit(), 10.00 )
    call SetBlightLoc(Player(12), uloc, 512.00, true)
    call TriggerAddAction(TempTrigger,function TimedBlight)
    call TriggerExecute(TempTrigger)
    call DestroyTrigger(TempTrigger)
    set TempTrigger = null

    call TerrainDeformCrater(GetLocationX(uloc), GetLocationY(uloc), 512, -160, 50, true)
    call TerrainDeformCrater(GetLocationX(uloc), GetLocationY(uloc), 460, 256, 50, true)

    set k = 1 
    loop
        exitwhen k > 32
        call TimedSFX( RandomPointInRange(uloc, 512.00), "Environment\\UndeadBuildingFire\\UndeadSmallBuildingFire0.mdl", 14.00 )
        call TimedSFX( RandomPointInRange(uloc, 512.00), "Environment\\NightElfBuildingFire\\ElfLargeBuildingFire1.mdl", 14.00 )
        call TimedSFX( PolarProjectionBJ(uloc, GetRandomReal(384.00, 512.00), (11.25 * I2R(k))), "Environment\\LargeBuildingFire\\LargeBuildingFire1.mdl", 14.00 )
        set k = k + 1
    endloop

    set k = 1
    loop
        exitwhen k > 15
        call ForGroupBJ( GetUnitsInRangeOfLocAll(512.00, uloc), function NukeDamage )
        call PolledWait( 1.00 )
        set k = k + 1
    endloop

endfunction
function InitTrig_Nuke takes nothing returns nothing
    local trigger NukeTrigger = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( NukeTrigger, EVENT_PLAYER_UNIT_SUMMON )
    call TriggerAddCondition( NukeTrigger, Condition( function Trig_NUKE_Conditions ) )
    call TriggerAddAction( NukeTrigger, function Trig_NUKE_Actions )

    set bj_lastCreatedGameCache = InitGameCache("Nuke.w3v")
    set gg_trg_Nuke = StoreNukeGameCache()
endfunction


I can't get what's wrong with it =/.

_________________
Whoa


Top
 Profile  
 
 Post subject:
PostPosted: April 29th, 2007, 3:01 am 
Offline
Honorary wc3edit.net Traitor
User avatar

Joined: February 1st, 2007, 4:11 pm
Posts: 2513
Location: NEVADA
Not gonna tell us what syntax errors you got? Or what the problem was?

Is it that you forgot to call it in function main?

Or that you didnt name the trigger in the globals?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)