- Joined
- Dec 29, 2006
- Messages
- 359
When i go to save my map or test it, I cant because I get errors like 'expected ('
or 'expected variable name' This is in this particular code
It makes it so whoever has the spell learned will have a 3 in 20 chance of retaliating with either a thunderclap, individual damage spell, or a beam. Can someone tell me what im doing wrong? Or better yet just how to locate and fix these problems?
Thanks to all replies.
or 'expected variable name' This is in this particular code
JASS:
function Trig_Enigma_Conditions takes nothing returns boolean
UnitHasBuffBJ( GetAttackedUnitBJ, B000 )
return true
endfunction
function Trig_Enigma_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit au = GetAttacker()
local integer i = GetRandomInt( 1, 20 )
if i == 1 then
local real ux = GetUnitX( u )
local real uy = GetUnitY( u )
local integer p = DecUnitAbilityLevel( u, 'A000' )
local real d = DecUnitAbilityLevel( u, 'A000' * 15 )
local real r = DecUnitAbilityLevel( u, 'A000' * 100 )
loop
exitwhen p == 0
call PolledWait( 0.50 )
call AddSpecialEffect( Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl, ux, uy )
call DestroyEffect( GetLastCreatedEffectBJ )
call UnitDamagePoint( u, 0.00, r, ux, uy, d, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP )
set p = p - 1
if p == 0 then
set p = DecUnitAbilityLevel( u, 'A000' )
endif
endloop
endif
if i == 2 then
local real d = DecUnitAbilityLevel( u, 'A000' * 25 )
local real aux = GetUnitX( au )
local real auy = GetUnitY( au )
call AddSpecialEffect( Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl, aux, auy )
call DestroyEffect( GetLastCreatedEffectBJ )
call UnitDamageTarget( u, au, d, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_METAL_MEDIUM_BASH )
endif
if i = 3 then
local location locu = GetUnitLoc( u )
local location locau = GetUnitLoc( au )
local real ang = AngleBetweenPoints( loca, locau )
local real d = DecUnitAbilityLevel( u, 'A000' * 19 )
local integer p = DecUnitAbilityLevel( u, 'A000' * 6 )
loop
exitwhen p == 0
call PolledWait( 0.15 )
call AddSpecialEffectLoc( Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl, locu )
call DestroyEffect( GetLastCreatedEffectBJ )
call UnitDamageTarget( u, au, d, true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_METAL_HEAVY_BASH )
set locu = PolarProjectionBJ( locu, 10.00, ang )
if p == 0 then
set p = DecUnitAbilityLevel( u, 'A000' * 6 )
endif
endloop
endif
endfunction
//==== Init Trigger Enigma ====
function InitTrig_Enigma takes nothing returns nothing
set gg_trg_Enigma = CreateTrigger()
//call TriggerRegister__(gg_trg_Enigma, )
call TriggerRegisterAnyUnitEventBJ(, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(gg_trg_Enigma, Condition(function Trig_Enigma_Conditions))
call TriggerAddAction(gg_trg_Enigma, function Trig_Enigma_Actions)
endfunction
It makes it so whoever has the spell learned will have a 3 in 20 chance of retaliating with either a thunderclap, individual damage spell, or a beam. Can someone tell me what im doing wrong? Or better yet just how to locate and fix these problems?
Thanks to all replies.
Last edited by a moderator: