HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Storm Bolt doesn't works for computer players

06-06-2006, 05:54 AM#1
GALLED
Hello everybody.

I'm make a spell called INEPTITUD; when the unit with the buff attacks, it recieves some damage and is stunned (well i'm create a unit and order storm bolt it), there is my code:

Collapse JASS:
function Trig_Ineptitud_Attack_Conditions takes nothing returns boolean
    if ( not ( UnitHasBuffBJ(GetAttacker(), 'B00O') == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Ineptitud_Attack_Actions takes nothing returns nothing
local real x = GetUnitX(GetAttacker())
local real y = GetUnitY(GetAttacker())
    call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetAttackedUnitBJ()), Location(x,y), bj_UNIT_FACING )
    call UnitAddAbilityBJ( 'A08A', GetLastCreatedUnit() )
    call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", GetAttacker() )
    call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
endfunction

//===========================================================================
function InitTrig_Ineptitud_Attack takes nothing returns nothing
    set gg_trg_Ineptitud_Attack = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Ineptitud_Attack, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( gg_trg_Ineptitud_Attack, Condition( function Trig_Ineptitud_Attack_Conditions ) )
    call TriggerAddAction( gg_trg_Ineptitud_Attack, function Trig_Ineptitud_Attack_Actions )
endfunction

When the unit with the buff attacks some unit controled by me, the spell works fine. But when the unit with the buff attacks some unit controled by the computed doesn't works... What happends???

Thanks in advance.
06-06-2006, 10:17 AM#2
StockBreak
Here you are, I made a map for you correcting some code leaks, it works well also against Computers. I hope it helps.
Attached Files
File type: w3xIneptitud.w3x (18.9 KB)
06-06-2006, 07:58 PM#3
GALLED
Oh man! Thanks. I would see when go home. :D
06-07-2006, 06:35 AM#4
GALLED
Thanks, works very good!

So here is my map:

http://www.wc3sear.ch/?p=Maps&ID=9085

it's a DOTA related map, see the Ilusionista hero.
06-07-2006, 09:25 PM#5
StockBreak
Nice map, there are a lot of nice heroes and abilities!
06-09-2006, 02:55 AM#6
GALLED
Je thanks, there are some abilities from www.wc3sear.ch and models, but i'm include their authors in the credits.