• 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.

[JASS] I fail again at gui - jass conversion

Status
Not open for further replies.
Level 28
Joined
Mar 25, 2008
Messages
2,955
JASS:
function Trig_Judgement_Func048001 takes nothing returns boolean
    return ( GetUnitTypeId(GetSpellAbilityUnit()) == 'o01O' )
endfunction

function Trig_Judgement_Func048002 takes nothing returns boolean
    return ( GetSpellAbilityId() == 'A01S' )
endfunction

function Trig_Judgement_Conditions takes nothing returns boolean
    if ( not GetBooleanAnd( Trig_Judgement_Func048001(), Trig_Judgement_Func048002() ) ) then
        return false
    endif
    return true
endfunction

function Trig_Judgement_Func016A takes nothing returns nothing
    call SetUnitScalePercent( GetEnumUnit(), 250.00, 250.00, 250.00 )
endfunction

function Trig_Judgement_Func024A takes nothing returns nothing
endfunction

function Trig_Judgement_Func029002 takes nothing returns nothing
    call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( 150000.00 / I2R(CountUnitsInGroup(GetLastCreatedGroup())) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction

function Trig_Judgement_Func038A takes nothing returns nothing
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Judgement_Actions takes nothing returns nothing
    local real x
    local location divine_cross_caster_punkt
    local location divine_cross_aura_posi
    local location div_cross_ball_pkt_create
    local location array divine_cross_ball_punkt
    local effect divine_cross_rev_effect
    local unit dummy_aura
    local unit array judgement_blitz_anfang
    local lightning array judgement_blitz_zu_ball
    local lightning array judgement_blitz_kaputt
    local rect divine_cross_region
    local integer C    
    set divine_cross_caster_punkt = GetUnitLoc(GetTriggerUnit())
    // start
    call AddSpecialEffectLocBJ( divine_cross_caster_punkt, "Abilities\\Spells\\Human\\ReviveHuman\\ReviveHuman.mdl" )
    set divine_cross_rev_effect = GetLastCreatedEffectBJ()
    call TriggerSleepAction( 0.70 )
    // create aura
    call CreateNUnitsAtLoc( 1, 'o01P', GetOwningPlayer(GetTriggerUnit()), divine_cross_caster_punkt, bj_UNIT_FACING )
    set dummy_aura = GetLastCreatedUnit()
    set divine_cross_aura_posi = GetUnitLoc(dummy_aura)
    call SetUnitTimeScalePercent( dummy_aura, 25.00 )
    call SetUnitScalePercent( dummy_aura, 1000.00, 1000.00, 1000.00 )
    call TriggerSleepAction( 1.20 )
    // create sfx
    set C = 1
    loop
        exitwhen C > 8
        set x = ( x + 45.00 )
        set div_cross_ball_pkt_create = PolarProjectionBJ(divine_cross_caster_punkt, 500.00, ( x + 45.00 ))
        call CreateNUnitsAtLoc( 1, 'o01Q', GetOwningPlayer(GetTriggerUnit()), div_cross_ball_pkt_create, bj_UNIT_FACING )
        set judgement_blitz_anfanC] = GetLastCreatedUnit()
        set divine_cross_ball_punkt[C] = GetUnitLoc(judgement_blitz_anfang[C])
        set C = C + 1
    endloop
    call CreateNUnitsAtLoc( 1, 'o01Q', GetOwningPlayer(GetTriggerUnit()), divine_cross_caster_punkt, bj_UNIT_FACING )
    set udg_divine_cross_ball_groesser = GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetTriggerUnit()), 'o01Q')
    call ForGroupBJ( udg_divine_cross_ball_groesser, function Trig_Judgement_Func016A )
    // create lightning
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 7
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        call AddLightningLoc( "SPLK", divine_cross_ball_punkt[GetForLoopIndexA()], divine_cross_ball_punkt[( GetForLoopIndexA() + 1 )] )
        set judgement_blitz_zu_ball[GetForLoopIndexA()] = GetLastCreatedLightningBJ()
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call AddLightningLoc( "SPLK", divine_cross_ball_punkt[8], divine_cross_ball_punkt[1] )
    set judgement_blitz_zu_ball[9] = GetLastCreatedLightningBJ()
    set bj_forLoopBIndex = 1
    set bj_forLoopBIndexEnd = 8
    loop
        exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
        call AddLightningLoc( "SPLK", divine_cross_ball_punkt[GetForLoopIndexB()], divine_cross_aura_posi )
        set judgement_blitz_kaputt[GetForLoopIndexB()] = GetLastCreatedLightningBJ()
        set bj_forLoopBIndex = bj_forLoopBIndex + 1
    endloop
    call TriggerSleepAction( 0.50 )
    // create explosion
    call ForGroupBJ( udg_divine_cross_ball_groesser, function Trig_Judgement_Func024A )
    set C = 1
    loop
        exitwhen C > 8
        call AddSpecialEffectLocBJ( divine_cross_ball_punkt[C], "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
        set C = C + 1
    endloop
    // deal damage
    set divine_cross_region = RectFromCenterSizeBJ(divine_cross_caster_punkt, 1600.00, 1600.00)
    set udg_divine_cross_creeps = GetUnitsInRectOfPlayer(divine_cross_region, Player(11))
    call ForGroupBJ( udg_divine_cross_creeps, function Trig_Judgement_Func029002 )
    call RemoveRect(divine_cross_region)
    // clear
    call TriggerSleepAction( 0.01 )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 7
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        call DestroyLightningBJ( judgement_blitz_zu_ball[GetForLoopIndexA()] )
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call DestroyLightningBJ( judgement_blitz_zu_ball[9] )
    set bj_forLoopBIndex = 1
    set bj_forLoopBIndexEnd = 8
    loop
        exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
        call DestroyLightningBJ( judgement_blitz_kaputt[GetForLoopIndexB()] )
        set bj_forLoopBIndex = bj_forLoopBIndex + 1
    endloop
    call TriggerSleepAction( 0.20 )
    call ForGroupBJ( udg_divine_cross_ball_groesser, function Trig_Judgement_Func038A )
    call GroupClear( GetLastCreatedGroup() )
    call RemoveUnit( dummy_aura )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    set x = 0.00
    call RemoveLocation(divine_cross_caster_punkt)
    call RemoveLocation(divine_cross_aura_posi)
    call RemoveLocation(div_cross_ball_pkt_create)
    call DestroyGroup(udg_divine_cross_ball_groesser)
    call DestroyGroup(udg_divine_cross_creeps)
endfunction

//===========================================================================
function InitTrig_Judgement takes nothing returns nothing
    set gg_trg_Judgement = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Judgement, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Judgement, Condition( function Trig_Judgement_Conditions ) )
    call TriggerAddAction( gg_trg_Judgement, function Trig_Judgement_Actions )
endfunction
as i start the game, nothing happens but a fatal error.. any helpers? :D
 
Last edited:
Level 8
Joined
Mar 23, 2007
Messages
302
JASS:
    set udg_C = 1
    loop
        exitwhen C > 8
        set x = ( x + 45.00 )
        set div_cross_ball_pkt_create = PolarProjectionBJ(divine_cross_caster_punkt, 500.00, ( x + 45.00 ))
        call CreateNUnitsAtLoc( 1, 'o01Q', GetOwningPlayer(GetTriggerUnit()), div_cross_ball_pkt_create, bj_UNIT_FACING )
        set judgement_blitz_anfanC] = GetLastCreatedUnit()
        set divine_cross_ball_punkt[C] = GetUnitLoc(judgement_blitz_anfang[C])
        set C = C + 1
    endloop
Im not sure , u realy want it to set a GLOBAL C and then use a LOCAL C?
additionaly u have never set a C vaule... C is still nothing and waiting for
a vaule (null)
try to replace this
JASS:
    local integer C
with this
JASS:
    local integer C = 0

btw, way to much BJs... mb comment a bit what the spell is supposed to do?
 
Level 8
Joined
Mar 23, 2007
Messages
302
Nice Ideas ^^
but after time they are very similar to each other.. like always total mass effect.
However keep up the good work, good look on it but improve the codes
or it could cause errors and lags.
Try to remove BJs whenever u can.
Replace the CreatNUnits sh"t with CreateUnit.

greets equal
and dont forget to nullyfi at end !!! ^^
 
Level 8
Joined
Mar 23, 2007
Messages
302
I cant help u more with this
"code" >.> if u give me some time and exactly informations
i can clone this spell in great and clean JASS.
try to disable this trigger, MB it doesnt deppent on it.
 
Status
Not open for further replies.
Top