HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

triggered spell question

08-04-2006, 09:22 PM#1
refl3ction
i have a spell that uses triggers to damage a unit when sed unit attacks, a curse you could call it... the skill is based of the ability 'soul burn' but ive removed damage so the only reason for the spell is to deliver the buff, but heres my trigger

Trigger:
Empathy
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
((Attacking unit) has buff Empathy ) Equal to True
Collapse Actions
Unit - Cause (Attacked unit) to damage (Attacking unit), dealing ((Damage taken) x 3.00) damage of attack type Spells and damage type Magic

this doesnt work but i also want to know:
how do i include the level of the ability in the damage returned to the attacking unit

thanks for the help
08-04-2006, 10:24 PM#2
SFilip
Damage taken <- this only works for Takes Damage event.
in other words having your unit do 3x damage using trigger would be pretty hard...however you might find the demolish ability useful here

as for the second question - i never figured out is there really a way to check the level of a buff...or at least the unit that casted it.
08-04-2006, 10:32 PM#3
Naakaloh
The damage has not been dealt yet, you'll want to use the unit takes damage event; it's a unit specific event so you'll need to create a trigger when units are attacked or create a trigger for each unit on the map.

For determining the level, I think you'll want to store level of the buff in an integer variable, something like this I think.

Trigger:
Actions:
Custom Script: local integer level = 0
Custom Script: set level = GetUnitAbilityLevel(GetDamageSource(), [BuffID])
Custom Script: call UnitDamageTarget(GetTriggerUnit(), GetDamageSource(), GetEventDamage() * 3 * level, false, true, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL, null )
08-04-2006, 10:40 PM#4
refl3ction
is there neway specify this without using custom texts?
naakaloh is there nething i need to add in the () parenthesis?
08-04-2006, 10:51 PM#5
Naakaloh
No, I think I filled all the parameters correctly.

There really isn't any way using the normal map editor to create triggers and add events, actions, and conditions without using JASS.

You can minimize the use of Custom Script, but there isn't really any way to completely get rid of it. Of course, I would suggest instead that you learn JASS and do everything with custom script.
08-04-2006, 11:59 PM#6
refl3ction
i used all thre custom scripts and copied them excactly
and when i saved the game it said that the last two scripts required a name

and also:
Trigger:
Custom Script: set level = GetUnitAbilityLevel(GetDamageSource(), [BuffID])

where it says [BuffID] do i leave that or do i put the ID of the Buff?
08-05-2006, 12:11 AM#7
Alevice
The later
08-05-2006, 12:11 AM#8
SFilip
the id.
i tried with GetUnitAbilityLevel back when i was making an aura and it always returned 1...are you sure that works?
oh and btw you can add events without the use of custom script (jass), there is a trigger - add event action. however the problem here is that takes damage responds to absolutely any damage which includes spells...
if you know the attack speed of the unit you can perhaps use unit is attacked, set the current hp of the attacked unit in a variable and then wait <unit's attack speed>. after that you do variable - current hp and you should get the damage the attacker done.
yet i still think you should check out demolish...
08-05-2006, 12:17 AM#9
refl3ction
Trigger:
Empathy
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
((Attacking unit) has buff Empathy ) Equal to True
Collapse Actions
Custom script: local integer level = 0
Custom script: GetUnitAbilityLevel(GetDamageSource(), [B000])
Custom script: call UnitDamageTarget(GetTriggerUnit(), GetDamageSource(), GetEventDamage() * 3 * level, false, true, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL, null )

that is my recent trigger (wich is deactivated from compile errors) and
[B000] is the id of my buff (its custom)
08-05-2006, 12:20 AM#10
Naakaloh
Oh, if it always returns 1, then it must not work. I assumed it did, so it must act as more of a marker. If you can't get it to work with Demolish, like SFilip suggested, then you can probably only do it with JASS.

Quote:
Originally Posted by SFilip
you can add events without the use of custom script (jass),
Heh, I don't really know what's available with GUI; it's been a really long time since I've done anything with it.

Edit: The value for the buff should be in single quotes not brackets, my mistake for misleading you, I assumed you knew. ('B000')
Also, the Unit is attacked event is not going to work, you'll need to use Unit takes damage.
08-05-2006, 12:24 AM#11
SFilip
Custom script: GetUnitAbilityLevel(GetDamageSource(), [B000])
should be
Custom script: GetUnitAbilityLevel(GetDamageSource(), 'B000')
but you're still using the wrong event...it will never work this way.
as i said you must use takes damage event...and this event must be speicific so you have to add it from some other trigger (most likely using a pick every unit in region...).
08-05-2006, 05:28 AM#12
refl3ction
so how would the triggers go to get the Unit takes Damage
08-10-2006, 11:37 PM#13
refl3ction
seriously, i cannot find the event: Unit Takes Damage
some1 want to help

ugh nvm i found it....