HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Lightning Ward

03-08-2004, 10:21 PM#1
pappi.chullo
-.- I know, another question from pappi, but its for a good cause :D

Anyway, the ability makes a ward that casts forked lightning 5 times, then it dies. I dont know what the triggers should be for the ability.

The ability costs 1 mana and has 1 second cool down.
The ward (unit) has 5 mana maximum.

Question: Make it so that when the ward's mana reaches 0, it dies.
03-08-2004, 10:50 PM#2
Maxxthepenguin
Make an initially disabled trigger that checks the if the mana is zero every .2 seconds. If so, remove the ward from the game. When the ward is summoned, turn the trigger on. When the trigger activates it turns itself off.
03-08-2004, 11:08 PM#3
ThyFlame
Quote:
Originally Posted by pappi.chullo
-.- I know, another question from pappi, but its for a good cause :D

Anyway, the ability makes a ward that casts forked lightning 5 times, then it dies. I dont know what the triggers should be for the ability.

The ability costs 1 mana and has 1 second cool down.
The ward (unit) has 5 mana maximum.

Question: Make it so that when the ward's mana reaches 0, it dies.


This is a sloppy way to do it...

Make a region as large as the spell's range is. When the ability is activated, you create the ward, center the region on the ward, store the ward into a variable, have the ward cast the spell [unit - order ability targeting unit], on an enemy unit in the region, wait 1 second, get a new random unit from the region, and repeat.

(Using a loop from 1-5)
03-08-2004, 11:45 PM#4
pappi.chullo
Sorry for all the trouble, but I realised that the Lightning sentry was different. What it really did was attack 10 times then go away. I figured to use mana as the amount of attacks left. So the wards have 10 mana. Now the problem is that I don't know how to make it so that wen the ward has 0 mana, it dies. I tried to use the "Unit - Mana" event, but it requires a specific unit, not a unit-type. Please help me if anyone can, I would really like to make this game as good as possible :)

As for the trigger I am using for the mana stuff, here it is, for those who are interested.

Lightning Sentry
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacking unit)) Equal to Lightning Sentry (Level 1)
Actions
Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 1.00)
03-09-2004, 01:44 AM#5
pappi.chullo
Anyone care to help? >.<
03-09-2004, 03:00 AM#6
Oinkerwinkle
There may be a way to do this without Jass, but I don't know it.


Just put this in a trigger called SentryEnters and change hfoo to your unit's four-letter code.

Code:
function KillSentry_Actions takes nothing returns nothing
    call KillUnit( GetTriggerUnit() )
endfunction

function Trig_SentryEnters_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == '[b]hfoo[/b]' ) ) then
        return false
    endif
    return true
endfunction

function Trig_SentryEnters_Actions takes nothing returns nothing
    local trigger trg_KillSentry = CreateTrigger(  )
    call TriggerRegisterUnitManaEvent( trg_KillSentry, GetTriggerUnit(), EQUAL, 0.00 )
    call TriggerAddAction( trg_KillSentry, function KillSentry_Actions )
endfunction

//===========================================================================
function InitTrig_SentryEnters takes nothing returns nothing
    set gg_trg_SentryEnters = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_SentryEnters, GetEntireMapRect() )
    call TriggerAddCondition( gg_trg_SentryEnters, Condition( function Trig_SentryEnters_Conditions ) )
    call TriggerAddAction( gg_trg_SentryEnters, function Trig_SentryEnters_Actions )
endfunction

To summarize... When a ____ enters the map, it sets up a new trigger: When the entering unit's mana is 0, kill it. This allows you do use a specific unit event on a unit that is not preplaced.
03-09-2004, 04:12 AM#7
pappi.chullo
:( Damn, I tried the trigger you gave me, but I saw no difference at all. The ward still was there after it had lost it's mana :(
03-09-2004, 04:20 AM#8
pappi.chullo
So sorry for double-posting or spamming, but I just would like to say that I had completed the ability using a different meathod. But thanks for trying :D