• 🏆 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] Somekind Error

Status
Not open for further replies.
Level 7
Joined
Nov 19, 2007
Messages
253
Hi im new on jass i converted normal trigger to jass and fixed it to work and it works but when i press test map i get error that something isnt working and causing error (but trigger works perfectly) here it is
JASS:
function Trig_Avatar_aura_Func001C takes nothing returns boolean
    if ( not ( UnitHasBuffBJ(GetAttacker(), 'B001') == true ) ) then
        return false
    endif
    if ( not ( IsUnitIllusionBJ(GetAttacker()) == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Avatar_aura_Conditions takes nothing returns boolean
    if ( not Trig_Avatar_aura_Func001C() ) then
        return false
    endif
        return true
endfunction

function Trig_Avatar_aura_Func004Func003C takes nothing returns boolean
    if ( not ( GetRandomInt(1, 100) <= 30 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Avatar_aura_Func004C takes nothing returns boolean
    if ( not Trig_Avatar_aura_Func004Func003C() ) then
        return false
    endif
    return true
endfunction

function Trig_Avatar_aura_Actions takes nothing returns nothing
    local unit AaAttacker = GetAttacker()
    if ( Trig_Avatar_aura_Func004C() ) then
        call AddSpecialEffectTargetUnitBJ( "origin", AaAttacker, "Abilities\\Spells\\Human\\Avatar\\AvatarCaster.mdl" )
        call ModifyHeroStat( bj_HEROSTAT_STR, AaAttacker, bj_MODIFYMETHOD_ADD, 1 )
        call ModifyHeroStat( bj_HEROSTAT_AGI, AaAttacker, bj_MODIFYMETHOD_ADD, 1 )
        call ModifyHeroStat( bj_HEROSTAT_INT, AaAttacker, bj_MODIFYMETHOD_ADD, 1 )
        call TriggerSleepAction( 20.00 )
        call ModifyHeroStat( bj_HEROSTAT_STR, AaAttacker, bj_MODIFYMETHOD_SUB, 1 )
        call ModifyHeroStat( bj_HEROSTAT_AGI, AaAttacker, bj_MODIFYMETHOD_SUB, 1 )
        call ModifyHeroStat( bj_HEROSTAT_INT, AaAttacker, bj_MODIFYMETHOD_SUB, 1 )
    else
    endif
endfunction

//===========================================================================
function InitTrig_Avatar_Aura takes nothing returns nothing
    local trigger Avatar_Aura = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(Avatar_Aura, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition(Avatar_Aura, Condition( function Trig_Avatar_aura_Conditions ) )
    call TriggerAddAction(Avatar_Aura, function Trig_Avatar_aura_Actions )
    set Avatar_Aura = null
endfunction

and error says that
JASS:
function InitTrig_Avatar_Aura takes nothing returns nothing
this cause somekind error

And how do I remove special effect leak ?

P.S. Im using NewGen WE

EDIT: heres screenshot if you didnt understand what i said.
 

Attachments

  • error.JPG
    error.JPG
    87.5 KB · Views: 74
Last edited:
Level 7
Joined
Nov 19, 2007
Messages
253
I had trigger variable named AvatarAura i deleted it and its working now! thx for help
But theres another problem i cant see my map in wc3 when trying to create it
 
Status
Not open for further replies.
Top