| 01-30-2005, 03:41 AM | #1 |
Okay, having a little bit of problem getting this Ultimate to work. It's called Bloody Effigy, and here's basically what happens: The spell targets an enemy unit. When the spell is cast, a voodoo-doll esque creature appears. It can't move or attack, but it has 1000 health and heavy armor. The target of the spell has it's health tied to the Effigy, so whenever the Effigy is attacked, the targeted unit takes 50% of the damage. Basically, you cast it on the enemy, the Effigy pops up right next to the caster, and you can wail away on it instead of the enemy unit. Even if the enemy unit makes a break for it, it can still be damaged. The Effigy counts as an ally, so enemy units will attack it as well. The problem is, I can't figure out how to make attack against the Effigy damage the enemy unit. Is there any way the trigger can record the amount of damage the Effigy suffers and then subtract 50% of it from the target of the spell? |
| 01-30-2005, 08:15 AM | #2 |
This is a somewhat difficult issue...it's always difficult to detect exactly how much damage is dealt to a non-preplaced unit. One idea is that you could store the health of the effigy in an integer variable, and then perform periodic checks (maybe every .25 seconds) of the health of the doll vs. the stored value. The trigger would look something like this. Code:
Events -
Every .25 seconds of game time
Conditions -
Actions -
If (Life of [color=orange]unitEffigy[/color] < [color=orange]intEffigyLife[/color])
Then do Actions -
Unit - Order [color=orange]untEffigy[/color] to Damage [color=orange]untEffigyTarget[/color] for (Life of [color=orange]unitEffigy[/color] - [color=orange]intEffigyLife[/color]) / 2
Set intEffigyLife = Life of UnitEffigyunitEffigy = The Effigy Unit intEffigyLife = The life of the Effigy the last time the trigger ran untEffigyTarget = The Target of the Ability You would turn on this trigger when the ability was cast, and turn it off when the effigy died. Doing it this way isn't a great path if you want to make it multi-instanceable, I honestly would just suggest using JASS if you want to do that. There are a lot of people here that can help you out with that (myself included) but this way is much easier if you prefer GUI :). |
| 01-30-2005, 11:50 AM | #3 |
what you should do is give the Effigy a modified version of spiked carapace with a "0.01" damage return and "50%" damage reduction. also instead of having it already running, have it intially disabled and have another trigger that goes E unit finishes casting an ability C ability being cast equal to Effigy A trigger turn on such and such trigger |
| 01-30-2005, 12:08 PM | #4 |
u can add a spell "shared life" beetwen the statue and the target |
| 01-31-2005, 01:22 AM | #5 |
aaero's suggestion seems to make the most sense to me. I haven't got a clue how JASS works, so I'm pretty much stuck using in-game triggers. Checking the Effigy's health and subtracting the target's health accordingly is something that wouldn't have occured to me, but I can see that it would probably be a lot easier than setting up something to record how much damage the Effigy takes. Thanks for the help, everyone. |
| 01-31-2005, 04:03 PM | #6 |
Guest | there is a trigger that stores the units damage if u do set damagetransfer = (damage delt by unit(not sure what it is but there is definatly a trigger that sesit) set damagetransfer = damagetransfer / 2 event ever 0.10 seconds condition abilityon = true action order damgingunit to attack targetedunit with damagetransfer over 0 seconds |
| 01-31-2005, 07:00 PM | #7 |
APM - You are right, there is a event that stores how much damage was taken, but that event works for preplaced units. You can get around that through clever triggering, but it's a lot of hassle and not really necessary in this case. |
| 02-01-2005, 05:44 AM | #8 |
why dont you just add a event using a variable? Trigger - Add Event. That way you can use the Unit takes damage with a variable.. or just do it in the condition.. Unit Taking Damage = Effigy caster Equal to True But you could try to use a modified Spirit link.. here is a example i use in my map it a Fireskin based spell that acts as a shield to absorb damage: Code:
Fireskin Cast
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Fireskin 1
Actions
Game - Display to (All players) the text: Fireskin on!
Set Fireskin_damage_amount = ((Level of Fireskin 1 for (Casting unit)) x 125)
Set Fireskin_caster = (Casting unit)
Set Fireskin_enabled = True
Set Fireskin_damage_received = 0
Trigger - Add to Fireskin on <gen> the event (Unit - Fireskin_caster Takes damage)Now note the last action, i add a event with takes damage using a variable. then i have the following trigger: Code:
Fireskin on
Events
Conditions
Fireskin_enabled Equal to True
Actions
Set Fireskin_damage_received = (Integer((Damage taken)))
Advanced - Create at Attach Point - Origin of Fireskin_caster the Abilities\Spells\Items\AIim\AIimTarget.mdl effect lasting 1.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Fireskin_damage_amount - Fireskin_damage_received) Greater than 0
Then - Actions
Set Fireskin_damage_amount = (Fireskin_damage_amount - Fireskin_damage_received)
Unit - Set life of Fireskin_caster to ((Life of Fireskin_caster) + (Damage taken))
Else - Actionsand the rest of the levels.. but here it takes the event that is added when the spel is cast, yo dou have to check if it is enabled, but perhaps i can delete the event when the spell is done.. anyway this is how you do that.. |
| 02-01-2005, 07:14 AM | #9 |
Wiebbe - I didn't suggest that method because I feel like it's kind of complicated. It can seem simple once you've done it a few times, but I feel like the concept of adding events to a trigger is a pretty advanced one. That is a more precise method though, and I would probably even suggest it if Yak felt up to it. |
| 02-01-2005, 08:38 AM | #10 |
aaero that may be so, but what he is planning is quite a difficult thing to do.. using a periodic event for checking for damage is a very crappy way to check for damage.. It takes a ton of resoures, and prob will be buggy.. This works like it is supposed to, and maybe it will help him in triggering a bit. |
| 02-01-2005, 03:42 PM | #11 |
While I agree that the method you suggested is more effective and even much faster, it's not true that the method I suggested will be buggy or exceptionally processor-instensive. Even running the damage event every .1 seconds won't cause any slow down on even the slowest PCs on battle.net. Basically, I'll concede that your method is better in every way except simplicity, but I'm not saying that the method I suggested won't work =). Another reason I suggested this method was because I had a good idea on how to make it multi-instanceable (assuming there are something like "while" loops in JASS) where I feel like that might be more difficult using your solution. |
| 02-02-2005, 11:33 PM | #12 |
Guest | Some one has probily allready sed this but carnt u use Spirit Link and give it to ur voodoo-doll and order that unit to cast it on the targeted unit, u wud have to set the number of untis to 1 though. but i am sure that when it casts it, it shudonly target the targeted unit and its self other then that it aint possible wellit is but u wud have to use jass and i dont no any thing about jass. |
| 02-03-2005, 09:59 PM | #13 |
My earlier attempts were with Spirit Link, but the met with failure, as the Effigy would take damage whenever the target was attacked and vise versa. However, with aaero's method, I have gotten the skill to work flawlessly. Now the target of the Bloody Effigy spell takes damage exactly how I want it to. This method is also going to be a big help with another spell I'm making that works in a similar way (wherein the Hero taking damage has the damage transfered to a powerful Summouned Monster the ability creates.) Thanks to aaero, and everyone else who replyed with suggestions. Expect to see this skill popping up in a map I've been putting together (80% done). |
| 02-04-2005, 04:51 PM | #14 |
No problem and I'm glad you got it working! Good luck with your map. |
