| 12-20-2004, 08:06 PM | #1 |
Ok...I need some help...Ive got this ability called Gold Sheild...Its basicly a mana shield but instead of subtracting mana for every damage delt it subtracts gold...I want it so that for every 5 damage delt, it takes away one gold...And i really have no idea of how to trigger this seeing as how im a terrainer/object editor kinda guy...These are what my triggers look like so far...and i bet their horribly wrong...Any help will be greatly appreciated and i will give rep. Thanks in advance ~Vilkacis Heres the triggers. Gold Sheild Events Unit - A unit Begins casting an ability Conditions (Ability being cast) Equal to Gold Shield Actions Set SheildedUnit = (Casting unit) Gold Damage Events Unit - A unit Is attacked Conditions (Attacked unit) Equal to SheildedUnit Actions For each (Integer A) from 1 to 999, do (Actions) Loop - Actions Player - Add -1 to (Owner of SheildedUnit) Current gold Gold Sheild Off Events Unit - A unit Finishes casting an ability Conditions (Ability being cast) Equal to Gold Shield Actions Set SheildedUnit = No unit |
| 12-20-2004, 08:45 PM | #2 |
Well...This was moved....Can anyone help me? |
| 12-20-2004, 09:39 PM | #3 |
Sigh, I just posted a long but incomplete explanation on how I would do it using a mana shield that absorbed all damage. I will try to get on later today and fill you in on it, but hopefully by then someone will have posted a better solution that mine. EDIT: My sigh was because my post that was incomplete got deleted when I tried to submit - got a server too busy message. Just thought I would clear that up. |
| 12-20-2004, 11:38 PM | #4 |
You got everything correct up to the actions of "Gold Damage". I'm currently stumped on the details. aaero hinted to the right path, a mana shield that abosrbs all damage and removes no mana. But to get the damage dealt to the shielded unit... that's the trick. It could be done if you remove all mana regeneration and compare lost mana, then replace the mana back to where it was. Hmm, I'll think on it and hopefully beat aaero to the punch. |
| 12-21-2004, 12:13 AM | #5 |
OK, the only solution I can think of has one gaping problem - it will keep the unit alive sometimes when it shouldn't. Basically, any time the unit is dealt damage, all that damage will be absorbed as long as they have 5 or more gold. Other than that, it would work perfectly. If this would be acceptable to you, put a message out here on the forum. If no, that's OK...someone will think of something better. Probably AntJab, maybe someone else, possibly even me! |
| 12-21-2004, 12:19 AM | #6 |
Whatever plan aaero has up his/her sleeve I say take it. You can always make a trigger that turns off Gold Shield when a player gets below a certain amount of gold. (I.E. In order to cast and maintian the shield a player must have at least 25 gold.) |
| 12-21-2004, 03:19 AM | #7 |
Heres what i would do: Event: A unit is targeted by a spell (Jass and WEU only) Condition: Target of ability being cast has specific buff Gold Shield Action: If: Owner of target of ability being cast total gold >= (Max mana - current mana)/ 5 then: Subract (Max mana - current mana)/5 gold Else: Order that unit to Order(Turn off Naga Seawitch-Mana Shield) Deal (Max mana - current mana) damage to that unit (WEU and Jass only) ------------------------------------------------------------------------------------ Event: A unit is attacked Condition: Attacked unit has specific buff Gold Shield Action: If: Owner of target of ability being cast total gold >= (Max mana - current mana)/ 5 then: Subract (Max mana - current mana)/5 gold Else: Order that unit to Order(Turn off Naga Seawitch-Mana Shield) Deal (Max mana - current mana) damage to that unit (WEU and Jass only) ------------------------------------------------------------------------------ Object Editor: Make sure gold shield has a damage ratio of 1:1 Set gold shields turn off Id to Mana Shield ----------------------------------------------------------------------- Other: Maybe adding a Not enough gold messege would look cool I would recommend adding a no mana regen buff to the unit when checking otherwise it might be off by about 15 gold if the unit has fast regen. |
| 12-21-2004, 06:06 AM | #8 |
Am i missing somethign here, i cant see contigency in your trigger for when a unit is damaged with less than full mana.... If a unit is at 210/500 mana and takes 10 damage your triggers removes 60 gold.... if he doesnt have 60 gold it deals him 300 damage..... Or am i missing somethign obvious here? |
| 12-21-2004, 07:34 AM | #9 |
Well, I started another nice long explanation and about halfway through I realized it wouldn't work. The basic issue is that if you use a mana shield that absorbs all damage, then you have no way of knowing how much damage would have been dealt. If you don't do this, you run the risk of having your unit die while the gold shield is on, since you can only determine how much damage was dealt after the unit has already been damaged. If this wasn't a problem, I can post a solution for you where the unit would die if they tried to use gold shield when their HP was low enough that they could die in one hit. No matter how you look at it, though, this is a fairly complicated process. To detect how much damage will be dealt to a non-preplaced unit is kind of advanced - I found out how to do it in this thread. Basically, what I'm trying to say is this ability won't be easy. Harsh's trigger won't really work because though he's trying to use mana as his basis, at least I think so, but he still doesn't have a way of knowing how much damage was dealt. I think he's assuming they had maximum mana when they were hit by a spell or ability and using that to make their calculations. |
| 12-21-2004, 05:11 PM | #10 |
You can use the system where you compare the unit's hp with a rapid periodic event. The problem that would occur if the unit took lethal damage in a single blow could be avoided by giving the hero, when he activates gold shield, a hp bonus if his hp are too low. That bonus would be then substracted when the shield is turned off (since all damage dealt to the hero in the meantime is supposed to be annuled, there is no danger of the deactivation of gold shield killing the hero). You should also add additional checks into the periodic event that would reduce the hp bonus if the hero restored his hp while he had the shield on; that way, you would assure that he can heal to full hp while shielded. The periodic check should be also manually run when the shield deactivates, to remedy any damage dealt in the small time that passed between the last time the periodic trigger run and the deactivation event happened. This is still an approximation; if multiple damage/heal events occur in the time between two periodic checks, they will be considered as one event. If there are many powerfull damage events, they may kill the hero even with all the precautions we took. Same goes for very strong heal events, they could not be taken to full advantage if the hero had the hp bonus (which would be removed the next time the periodic trigger run, because it would see the hero's hp is no longer critical, but by then, it would already be too late for the heal spell to fill the resulting hp gap) A combination of damage and heal events would neutralize each other, resulting in less life gain, but also less gold charged. Chances for such anomalies can be minimized by having a good safety margin; if the hero's minimum hp is larger than the combined damage of two or three most powerfull insta-damage spells/attacks, and the periodic trigger runs every 0.01 seconds, then it is virtually impossible for the gold shield to malfunction. |
| 12-21-2004, 05:13 PM | #11 |
Damn...I thought i could just fix this shit with a few integers and variables....Sorry...I dint know things like this were so advanced, i can do most trigger spells but this one...this one was just way hard....I guess ill just scracth the idea and come up with some kinda new ulti, Thank you all, reps given. ~Vilkacis |
| 12-21-2004, 07:34 PM | #12 |
After looking at the thread that aaero linked to, I think I may have come up with a solution. Correct me if I'm wrong though. Code:
Event-
A unit is attacked
Conditions-
Attacked unit has specific buff Mana Shield (or whatever its called)
Actions-
Set StartMana= Mana of (attacked unit)
Trigger- Add to GoldShield <gen> the event (Unit - (Attacked unit) Takes damage)
--GoldShield--
Event-
Conditions-
Actions-
Set ManaDifference= (Mana of (triggering unit) - (StartMana))
(Whatever the action for setting a player's gold is) Gold of Player - (ManaDifference/5)
Set mana of (triggering unit)= StartManaAgain, correct me if I'm wrong, and I'm not entirely sure this will work cause I don't have WE open in front of me. Also, this is just a basic structure of the triggers, so you'll need to add conditions and such if this actually does work, which I somewhat doubt. Knowing me, I'm probably missing something. EDIT: Almost forgot, you need a mana shield with a 1:1 ratio. |
| 12-21-2004, 08:41 PM | #13 |
Looks pretty solid. One thing tho, there doesnt apear to be a contignecy for changes in the units mana. Casting spells while the mana shield is active will result in you getting charged more gold next time you are attacked. If you end up with mana than you started with while the shield is up (say, a potion of mana) it will also have some trouble. |
| 12-21-2004, 09:53 PM | #14 |
Yeah I know but its just the basic structure. You would also need to put in If, Then, Else actions in there also to check to make sure that they have enough gold or mana and whatnot. I just hope that it will work the way I think it will work. |
| 12-22-2004, 06:53 PM | #15 |
The annoying thing is that you can use mana for other spells, so tracking mana loss is not the best way to do this. It would be easier to track hp loss. Also, you keep adding the same events over and over again to that trigger. |
