• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

50% reduction Magic Shield Item

Status
Not open for further replies.
Level 16
Joined
Aug 20, 2009
Messages
1,552
hello, can anybody help me creating this item?
i wanted it to reduce all magical damage by 50%, for 15 seconds,when used...

i tried using banshee's spell immunity and anti-magic potion, but i couldn't really understand how to use the "Magic damage reduction" Function on it,

if possible, please post me the map! xD thx.

I will really appreciate your help, +REP for those really trying to help me :D
 
Last edited:
Level 15
Joined
Jul 9, 2008
Messages
1,552
ok ill see what i can do

EDIT:
well the item ability spell reduction gives the reduction you need but it cant be used to add the buff for x seconds so i made a trigger that gives the caster the ability then removes it after 15 seconds

The trigger is GUI MUI. the trigger uses a wait but is still MUI because it is using Triggering unit
 

Attachments

  • Razor21's Magic shield item.w3x
    13.1 KB · Views: 55
Level 16
Joined
Aug 20, 2009
Messages
1,552
thx but, could it be done in Object editor?, i am going to use this in a arena kind of a map, what if the hero dies in the middle of the buff, will it remains after he revives?, i have some spells which gives instant revive, if you use this trigger, the "50%" spell reduction will stays active even if the unit revives.

and what if someone dispells his buff? (i got a lot of dispelling buff stuff),

well, thx anyways, +REP xD
 
Level 16
Joined
Aug 20, 2009
Messages
1,552
Uhh...it can be buggy at that,and i don't think you could remove ability when the unit is dead, Plus, i already give spell damage reduction on every hero. it can stack, but not that great, i rather prefer someone could Tell me something about the Anti-magic potion ability, whether they could make some "Spell Damage Reduction" instead of "Magic Immunity" From that, coz i see that you could change its value, but whicever value i change, it always gave me spell immunity.
 
Ok, here:
JASS:
function Trig_M1_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function ElseRemoval takes nothing returns nothing
    local trigger t = GetTriggeringTrigger()
    local integer id = GetHandleId (t)
    local unit u = LoadUnitHandle (udg_M_Hash, id, StringHash("unit"))
    call UnitRemoveAbility (u, 'A001')
    call FlushChildHashtable (udg_M_Hash, id)
    call DestroyTrigger (t)
    set u = null
endfunction

function Removal takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local integer id = GetHandleId (t)
    local unit u = LoadUnitHandle (udg_M_Hash, id, StringHash("unit"))
    local trigger tr
    if GetWidgetLife (u) > 0.415 then
        call UnitRemoveAbility (u, 'A001')
    else
        set tr = CreateTrigger()
        call SaveUnitHandle (udg_M_Hash, GetHandleId (tr), StringHash("unit"), u)
        call TriggerRegisterUnitLifeEvent (tr, u, GREATER_THAN, 0.415)
        call TriggerAddAction (tr, function ElseRemoval)
    endif
    call FlushChildHashtable (udg_M_Hash, id)
    call DestroyTimer (t)
    set u = null
    set t = null
endfunction

function Trig_M1_Actions takes nothing returns nothing
    local unit u = GetSpellTargetUnit()
    local real d = GetUnitAbilityLevel (u, 'A000') * 5
    local timer t = CreateTimer()
    local integer id = GetHandleId (t)
    call SaveUnitHandle (udg_M_Hash, id, StringHash("unit"), u)
    call TimerStart (t, d, false, function Removal)
    call UnitAddAbility (u, 'A001')
    set u = null
    set t = null
endfunction

//===========================================================================
function InitTrig_M1 takes nothing returns nothing
    set gg_trg_M1 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_M1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_M1, Condition( function Trig_M1_Conditions ) )
    call TriggerAddAction( gg_trg_M1, function Trig_M1_Actions )
endfunction

Attack a Far Seer, to see how much damage he normally deals to you, cast the ability on yourself and check how much damage they deal now.
If a hero dies, when the duration ends, the trigger detects whenever the hero comes back to life, to remove the ability right after. Works on normal units too, of course. It is MUI.
 

Attachments

  • Magic Shield.w3x
    18.6 KB · Views: 44
Level 16
Joined
Aug 20, 2009
Messages
1,552
JASS...i am not good with it,i wonder if i could implement this on my map, gonna use it in item,

well, does it works perfectly fine with units which have metamorph ability? (when he morph, dies, etc)

and units which already have the Magic Resistance skill?

what if i cast this shield twice, what could happen? does it still remove properly? thx

anyways, Thx ! xD you always help me out, +REP
 
Last edited:
Level 16
Joined
Aug 20, 2009
Messages
1,552
so, which buff should i change to add / remove buff?, will the resistance removed if i use purge or mirror image? (Buff Removing Abilities)

and i just need to change the ability into item ability, and put the ability raw code into the JASS right?

\\\\\\\
anyone,is it possible to change the magic reduction percentage in "Anti Magic Potion" into 50% or something?s
 
Last edited:
Level 11
Joined
Sep 12, 2008
Messages
657
HELP!! D: It gave me many Errors D:
Expected a name, and many stuff like that.


well.. might be because you didnt copy the variables in test map.
without variables, no hashtable, no unit, etc is found. so you cant do nothing.
basicly, go to test map, take all variables, (in trigger editor press ctrl + b)
and copy everything, then paste it to your map.
 
Level 16
Joined
Aug 20, 2009
Messages
1,552
well, aside from variable, there is many more errors,

anyways, i expected something that blizz made already xD

but it seems that it needs triggering to be made...

and, local and many variable is creating havoc..D:
weird..but i got trouble importing on my map.

you can use Spell Damage Reduction its an item ability, set to default at 33%

but you can set it to 50, and you could add it, then remove it after the ability is over

well, that, i want it with buff, if buff is removed, then remove the 50% reduction,
and i want it when unit dies, it doesn't retain the effect or something, ussually, triggers with waits have errors in that part, and doesn't remove the ability from a dead hero.
 
Last edited:
it probably wont lag as much as you think...,
event (every 1 second), pick all units in (magicreducegroup),
if picked unit has x buf, do nothing, else, remove magic reduc, and remove picked unit from group (magicreducegroup)

that shouldnt be to bad at all.. aslong as you dont set it to low of a periodic (1 should be fine in almost any situation for this spell, but if you want u can go to .25, depending on, how many units you expect to be in this spells aoe (10,100, 500))
 
Status
Not open for further replies.
Top