HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Weird spell interaction.

11-09-2006, 02:56 AM#1
Moss
I have this ability called Humiliate which does damage to a unit based on how much more Intelligence they have then the targeted hero. I have an item called the Ankh of Retaliation which is supposed to have a 10% chance to do 100 damage to any unit that hurts the wearer. Both these things seem to work fine on their own, but for some reason I can't figure out, when Humliate is cast on a unit with an Ankh the caster is "Retaliated" against repeatedly until they are dead. And it happen 100% of the time. Here are the triggers.

Trigger:
Humiliate Action
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Humiliate
Collapse Actions
Set u = (Triggering unit)
Set u2 = (Target unit of ability being cast)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Target unit of ability being cast) is A Hero) Equal to True
Collapse Then - Actions
Set r = ((2.00 + (2.00 x (Real((Level of (Ability being cast) for u))))) x ((Real((Intelligence of u (Include bonuses)))) - (Real((Intelligence of u2 (Include bonuses))))))
Collapse Else - Actions
Set r = ((1.50 + (0.50 x (Real((Level of (Ability being cast) for u))))) x (Real((Intelligence of u (Include bonuses)))))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
r Greater than 0.00
Collapse Then - Actions
Unit - Cause u to damage (Target unit of ability being cast), dealing r damage of attack type Spells and damage type Normal
Else - Actions

Trigger:
Ankh of Retaliation Damage
Events
Collapse Conditions
((Triggering unit) has an item of type Ankh of Retaliation) Equal to True
(Random integer number between 1 and 10) Greater than 9
Collapse Actions
Set p = (Position of (Triggering unit))
Custom script: call CasterSetCastSourceLoc( udg_p )
Custom script: call CasterCastAbility(GetOwningPlayer(GetTriggerUnit()), 'ACf3', "fingerofdeath", GetEventDamageSource(), false)
Custom script: call RemoveLocation(udg_p)

In case you are wondering, the Ankh trigger has events added when a unit Acquires an Ankh of Retaliation. Like so.
Trigger:
Trigger - Add to Ankh of Retaliation Damage <gen> the event (Unit - (Triggering unit) Takes damage)
11-09-2006, 04:15 AM#2
Av3n
Dunno Really but did you use the same base spell for both of them if so thats your problem.

-Av3n
11-09-2006, 04:27 AM#3
Vexorian
I don't really know what's going on, but for things dealing with damage events, I always add plenty of things to conditions:

For example:

- Damage must be greater than or equal to 1
- Damage must be done by an enemy of (Triggering Unit)
11-09-2006, 07:10 AM#4
Moss
One is fingerofpain the other is soulburn. Oh, Humiliate also silence the target, if that has anything to do with it.

Thanks Vex. I'll add some conditions and see what happens.
11-09-2006, 03:57 PM#5
oNdizZ
I'd guess you are using soulburn as a base for the Humiliate spell since you use it's silence effect. It should work by doing what vex said since the soulburn will fire the unit takes damage event even though you have probably set the damage to 0. (Unit Takes Damage fires on any damage, whatever it may be :/)
11-12-2006, 04:09 PM#6
Moss
It seems like adding those conditions worked! Or else it was just a freak occurrence. Other weird things happened that game like upgrades not working and stores getting attack and move buttons.

I did have Soul Burn set to 0 damage but the Humiliate trigger makes the casting unit do damage to the target unit anyway. That would trigger the Retaliation too right? That could explain for getting retaliated twice, which would have equaled 200 damage, but not repeatedly to death.