Shield Wall (Ability to reduce DMG taken by 60%)

duyen

New Member
Reaction score
214
Mana shield is taken off when you're out of mana, so it's not really much of an option.
 

Leazy

You can change this now in User CP.
Reaction score
50
Oh, then I can't go with it =/

Is there some good way in jass to reduce DMG taken by 60%?
 

Kenny

Back for now.
Reaction score
202
In JASS, you can use the UNIT_IS_DAMAGED event, or whatever it is, then check for a buff (the buff will be from a self targeting roar ability) and if the unit has the buff then heal the unit for 60% of the damage taken or whatever you wanted. I havent got WE, so some one else may be able to do it, but it is certainly possible, and quite easy. If i do do it, it will be in vJASS.

EDIT:

Don't have the time to make one exactly as you specified, however, this works similarly. Its like backtrack from DotA, if you know what that is. Instead of lasting 12 seconds it last indefinately, however it only has a % chance to go off.

Some on may be able to come along and change it for you.

JASS:
scope ShieldWall initializer Init

globals
    private constant integer Abil_id = '----' // Raw code of the passive ability.
    private constant string Sfx = "Your\\effect\\here." // May want an effect to Play
    private constant string Point = "chest" // Probably the best place for an attachment point.
endglobals

private function Percent takes integer lvl returns real
    return 0.20*lvl    // Percentage of damaged healed. So 100 damage dealt would only be 80/60/40.
endfunction

private function Chance takes integer lvl returns integer
    return 10+(5*lvl) // Percent chance to absorb damage.
endfunction

private function Heal takes nothing returns boolean
    local unit cast = GetTriggerUnit()
    local real dam = GetEventDamage()
    local integer lvl = GetUnitAbilityLevel(cast,Abil_id)
   
    if (dam > 1) then
	if (GetRandomInt(1,100) <= Chance(lvl)) then
            call SetWidgetLife(cast,GetWidgetLife(cast)+(dam*Percent(lvl)))
	    call DestroyEffect(AddSpecialEffectTarget(Sfx,cast,Point))
        endif
    endif
    
    set cast = null
    
    return false
endfunction

private function Actions takes nothing returns nothing
    local unit cast = GetTriggerUnit()
    local trigger trig
    
    if GetUnitAbilityLevel(cast,Abil_id) == 1 then
	set trig = CreateTrigger()
	call TriggerRegisterUnitEvent(trig,cast,EVENT_UNIT_DAMAGED)
	call TriggerAddCondition(trig,Condition(function Heal))
    endif
    
    set cast = null
endfunction

private function Conditions takes nothing returns boolean
    return GetLearnedSkill() == Abil_id and IsUnitIllusion(GetTriggerUnit()) == false
endfunction

private function Init takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_HERO_SKILL)
    call TriggerAddCondition(trig,Condition(function Conditions))
    call TriggerAddAction(trig,function Actions)
endfunction

endscope


Basically put in the raw code for the passive skill where '----' is, and add a special effect if you want. Then change around Percent and Chance as you like.

Its not much but its a start :). It was done in note pad, but i still think it should work fine.
 

Leazy

You can change this now in User CP.
Reaction score
50
Nice kenny, thanks! :)

However, could you do it likes this:
E: A unit takes DMG
C: The unit taking DMG has shield wall buff (rawcode = B00L)
A: some way to reduce DMG taken by 60%, before the DMG is dealt if possible.

Only 1 lvl, should always work if the unit has the buff (B00L).
No effect attached needed.

Thats all the trigger need =)
 

Igor_Z

You can change this now in User CP.
Reaction score
61
I think the unit takes damage means it will reduce damage from everything like spells, magic attack, piercing, hero etc.. Is that what u want? Read how Zombie's ulti spell is made in dotA
 

Leazy

You can change this now in User CP.
Reaction score
50
That spell gives extra DMG, thats much more easy to do than lowering the DMG taken before it is taken. Thanks anyway though :)
 

Slapshot136

Divide et impera
Reaction score
471
Mana shield doesn't seam to work. If I change these fields:

Damage Absorbed (%) to 0.60
Mana Per Hit Point to 0.00

The mana shield buff disappears after one hit. =/

sry if this is a little late.. but.. isnt that supposed to be a really big number instead of 0?
 

Leazy

You can change this now in User CP.
Reaction score
50
Yeah, maybe. However the shield is still removed when 0 mana is reached, and the unit is a warrior (like the warriors in WoW), so it has 100 rage, it will get 0 mana very often.
 

eXirrah

New Member
Reaction score
51
That's the best I could do with mana shield:

Trigger:
  • Shiled activate
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(thunderclap))
    • Actions
      • Game - Display to (All players) the text: on
      • Unit - Order (Triggering unit) to Neutral Naga Sea Witch - Activate Mana Shield
      • Set bool = True
      • Wait 12.00 seconds
      • Set bool = False
      • Unit - Order (Triggering unit) to Neutral Naga Sea Witch - Deactivate Mana Shield


Trigger:
  • Shield turned off
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • bool Equal to True
          • (Issued order) Equal to (Order(manashieldoff))
    • Actions
      • Wait 0.00 seconds
      • Unit - Order (Triggering unit) to Neutral Naga Sea Witch - Activate Mana Shield


but as you can see the mana shield is deactivatable so it can be a bit annoing someone playing with it, but you can put the mana shield in some spell book that the unit has no access to but just to store the mana shield so you can't deactivate it, it could work. Try it out ...

EDIT:
It is always nice when you reduce damage via triggers except for the case when the unit has 100 hp and is hit by 100 dmg which must be reduced to 40 so the unit dies and you cannot add hp ....

EDIT2 :

I checked all the abilities for some that you might use and noticed that Spiked Carapace has Received Damage Factor which is set to 1.00 by default. You should try to set it to 0.4 and try if you receive 60% less dmg. I think that will work.
 

perkeyone

something clever
Reaction score
71
maybe try
when a unit is targeted
add a large chunk of hp
then after the damage add a percentage of the damage taken back to the unit
then remove the large chunk of hp
 

Leazy

You can change this now in User CP.
Reaction score
50
I think I go with this: When a unit casts the ability, it will get a dummy ability based on spiked carapse, and after the duration is over I will remove the dummy ability. Thanks for tipping me about spiked carapse :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top