| 07-19-2008, 09:31 AM | #1 |
... gives a solid reduction to spell damage? I know there's stuff like Elune's Grace but is that's in percentages... is there something that gives a solid lowering in damage from spells? |
| 07-19-2008, 07:05 PM | #2 |
Closest that I can think of is the Spell Shield that banshees have. It absorbs X amount of spell damage. |
| 07-20-2008, 12:58 AM | #3 |
Sure, do that if you want to reapply the buff any and everytime the unit takes damage. |
| 07-20-2008, 02:35 AM | #4 |
Damn it... oh wells, +rep for helping... |
| 07-23-2008, 08:41 AM | #5 |
It really wouldn't be that hard, though a bit inefficient and robust: JASS:library SpellReduction initializer Init globals private integer DUMMY_ID = 'h000' private integer REDUCTION_ABILITY_ID = 'A005' private trigger ApplyTrig = null private unit Dummy = null endglobals private function True takes nothing returns boolean return true endfunction private function Apply takes nothing returns boolean local unit U = GetTriggerUnit() call SetUnitX(Dummy, GetUnitX(U)) call SetUnitY(Dummy, GetUnitY(U)) call IssueTargetOrder(Dummy, "spellshield", U) if GetTriggerEventId() != EVENT_UNIT_DAMAGED then call TriggerRegisterUnitEvent(ApplyTrig, U, EVENT_UNIT_DAMAGED) endif set U = null return false endfunction private function Enum takes nothing returns nothing local unit U = GetTriggerUnit() call SetUnitX(Dummy, GetUnitX(U)) call SetUnitY(Dummy, GetUnitY(U)) call IssueTargetOrder(Dummy, "spellshield", U) call TriggerRegisterUnitEvent(ApplyTrig, U, EVENT_UNIT_DAMAGED) set U = null endfunction private function Init takes nothing returns nothing local group G = CreateGroup() local region R = CreateRegion() call RegionAddRect(R, bj_mapInitialPlayableArea) set ApplyTrig = CreateTrigger() call TriggerRegisterEnterRegion(ApplyTrig, R, Condition(function True)) call TriggerAddCondition(ApplyTrig, Condition(function Apply)) set Dummy = CreateUnit(Player(14), DUMMY_ID, 0.00, 0.00, 0.00) call UnitAddAbility(Dummy, REDUCTION_ABILITY_ID) call UnitRemoveAbility(Dummy, 'Amov') call GroupEnumUnitsInRect(G, bj_mapInitialPlayableArea, Condition(function True)) call ForGroup(G, function Enum) call RemoveRegion(R) call DestroyGroup(G) set R = null endfunction endlibrary |
| 07-23-2008, 03:07 PM | #6 |
As a workaround I'd suggest doing the following: -Catch the unit gets damaged event, and incase the unit is protected prevent 100% of the damage(using hardened skin and a 0. timer) -Deal the Damage you want to be dealt to the unit yourself For this method, though, you need some kind of damage detection. If you aren't alreayd using one I suggest you use the one from moyack since it still allows for orb abilities and stuff. Sorry, don't know of a better way to do this. |
| 07-23-2008, 04:48 PM | #7 |
You can always use spell shield, if you set it's life to 300 for example it will absorb 300 damage and then dispel itself. Having damage detection system solves 80% of this type of problems btw. |
| 07-23-2008, 11:00 PM | #8 |
Yeah but a damage detection system wasn't made for, say, a single spell or unit. If he's just doing this for a single unit, why would he want to download an entire damage detection system? And Spell Shield was already suggested I believe, and the shield will dispel, not offering a solid reduction consistantly like he wanted. |
| 07-23-2008, 11:35 PM | #9 |
This probably won't be the only thing he'll need a damage-system for in his map(I doubt that for 90% of the maps), and even if it was, it would still pay off. Because e.g. casting spell shield every time the unit would take damage, imagine that in a 0.04 dmg loop or something.. and then imagine like 5 units having that shield.. |
| 07-24-2008, 11:27 AM | #10 |
I think I might need to change my signature back... I can't use any "magical" Jass because I use Mac OS X. |
| 07-25-2008, 05:48 PM | #11 |
I'd personally suggest a really long duration Spell Shield, that would be recast whenever the unit takes damage/becomes the target of a spell/just before the duration ends/gets dispelled. |
| 07-25-2008, 05:52 PM | #12 |
That's been suggest 100 times, and apparently it would be slow as hell on spells that did damage every .04 seconds or whatever. |
| 07-27-2008, 06:50 AM | #13 |
Right after I posted that code, Tide, I left for vacation. In the car I realized that you can't use vJASS code and then I smacked my head with a book XD Go me for remembering. |
