HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger: Super funny ULTIMATE goblin spell !!

02-09-2003, 10:38 AM#1
Darky28
Hi Folks

I've created a very cool Ultimate spell for my Goblin Hero. Its "Super Suicide" which revives the goblin after the explosion.

Look at it and write your feedbacks here :-)

http://www.wc3sear.ch/kaboom.zip


Code:
//===========================================================================
// Trigger:         Super Suicide
// Script Author:   Darky26
// Info:            This Trigger lets the Goblin Explode
// Additional info: goblin brother separated by cookie !
//===========================================================================

function Trig_Suicide_Conditions takes nothing returns boolean
    return (( GetUnitTypeId(GetOrderedUnit()) == 'EC21' ) and ( GetIssuedOrderIdBJ() == String2OrderIdBJ("thunderclap") ))
endfunction

function Trig_Suicide_Filter takes nothing returns boolean
    return ( GetFilterUnit() != GetOrderedUnit() )
endfunction

function Trig_Suicide_Damage takes nothing returns nothing
    call AddSpecialEffectLocBJ( GetUnitLoc(GetEnumUnit()), "Abilities\\Weapons\\Mortar\\MortarMissile.mdl" )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    call SetUnitLifeBJ( GetEnumUnit(), GetUnitStateSwap(UNIT_STATE_LIFE, GetEnumUnit()) - 150) 
endfunction

function Trig_Suicide_Actions takes nothing returns nothing
    local real mana = GetUnitStateSwap(UNIT_STATE_MANA, GetOrderedUnit())
    local real life = GetUnitStateSwap(UNIT_STATE_LIFE, GetOrderedUnit())
    local effect resurrection
    call CreateFogModifierRadiusLocBJ( true, Player(0), FOG_OF_WAR_VISIBLE, GetUnitLoc(GetOrderedUnit()), 400.00 )
    call CreateNUnitsAtLoc( 1, 'eC24', Player(0), GetUnitLoc(GetOrderedUnit()), bj_UNIT_FACING )
    call KillUnit( GetLastCreatedUnit() )
    call KillUnit( GetOrderedUnit() )
    call ForGroup( GetUnitsInRangeOfLocMatching(400.00, GetUnitLoc(GetOrderedUnit()), Condition(function Trig_Suicide_Filter)), function Trig_Suicide_Damage )
    
    call TriggerSleepAction( 0.8 )
    call AddSpecialEffectLocBJ( GetUnitLoc(GetOrderedUnit()), "Abilities\\Spells\\Orc\\Reincarnation\\ReincarnationTarget.mdl" )
    set resurrection = GetLastCreatedEffectBJ()
    
    call TriggerSleepAction( 5.00 )
    call DestroyEffectBJ( resurrection )
    call ReviveHeroLoc( GetOrderedUnit(), GetUnitLoc(GetOrderedUnit()), false )
    call SetUnitLifeBJ( GetOrderedUnit(), life )
    call SetUnitManaBJ( GetTriggerUnit(), mana-250 )
    call DestroyFogModifier( GetLastCreatedFogModifier() )
endfunction

//===========================================================================
function InitTrig_Suicide takes nothing returns nothing
    set gg_trg_Suicide = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Suicide, Player(0), EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( gg_trg_Suicide, Condition( function Trig_Suicide_Conditions ) )
    call TriggerAddAction( gg_trg_Suicide, function Trig_Suicide_Actions )
endfunction
02-09-2003, 12:09 PM#2
Tapek
Heh, sounds pretty cool and goblin-like.
02-09-2003, 09:31 PM#3
c0nnick
woa! That spell is phat! GJ
02-09-2003, 09:37 PM#4
Knight of Ni
Uuuuuuh, sound cool, I just love goblings blowing things (including themselves) up. However it might need some balancing in order not to make it overpowered (think comparing to reincarnation)
02-09-2003, 10:18 PM#5
dataangel
You could get rid of a few of your actions by just giving him an ankh of reincarnation as soon as the suicide order is given, seeing as you made him a hero. Of course, if he's in a map that uses items then you'd have to store an item, delete it, give the ankh, and give him back the original once he's revived... so maybe more work depending ;)
02-10-2003, 05:33 AM#6
Guest
what if inventory is full? just leave it
02-10-2003, 06:01 AM#7
Darky28
Quote:
Originally posted by dataangel
You could get rid of a few of your actions by just giving him an ankh of reincarnation as soon as the suicide order is given, seeing as you made him a hero. Of course, if he's in a map that uses items then you'd have to store an item, delete it, give the ankh, and give him back the original once he's revived... so maybe more work depending ;)


As relentless already said... you cannt make it use an ankh... if he has 6 items in his slot i need to get one out put an ankh and l8er restore the removed item.. thats not clever to do. Like this it works way better