• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Item Abilities: magic damage reduce

Status
Not open for further replies.
Level 9
Joined
Apr 3, 2008
Messages
700
I wanna to make a magic damage reduce abilities of items to stack. For example, if hero carries 2 items: one give 15% mdr, and other 20% mdr, hero should take totally 1*0.85*0.8=68% damage (=32% mdr). I used an ability of rune bracers, mdr didn't stack. It reduces magic damage only by 20% instead of 32%. Any way to solve this problem? Other abilities? Triggers?
 
Level 9
Joined
Aug 1, 2008
Messages
453
u could make it so when u get 2 of that item it upgrades then if u get another of the 1st rank one it upgrades again and so on.

EX) Item 1 + item 1 = item 2

Item 2 + Item 1 = Item 3

and u could go on and on and on
 
Level 9
Joined
Apr 3, 2008
Messages
700
It will be too much combinations =)
I think it'll be than 100 items in my ORPG. So if i'll have 10 items with mdr (and i'll have them, at least), i'll have to create 90 extra items (as all items have different mdr value).
Ofc, i can make an mdr skill with 50-100 skill levels and set integer variables for damage reduction (smth like unit aquires item, if(item type of (item being manipulated)==A000 or ***=A001 or ***)), then set udg_integer=udg_integer+28, and then set level of mdr skill to udg_integer. But this way is big too... and skills with many skill levels increases map loading time greatly,
 
Level 5
Joined
May 23, 2008
Messages
148
2 items MDR will not stack.
However, innat armor type MDR and 1 unit MDR ability and 1 item MDR ability do stack.

Check out DotA Mechanics subforum to see which item/unit MDR ability will work when you get many of them.
 
Level 8
Joined
Oct 28, 2007
Messages
435
No, it is NOT impossible. You will need to do it with triggers. There are several other ways to do it. My way require only one tempory integer, but require that none of your items that grants bonus magic resissistance has any usable ability and will require that you set their charges to your amount of magic resistance that it grants:

Firstly: (SAVE your map)
Second: Remove all magic damage reduction bonusses from items. Create a new ability Magic Ressistance with 100 levels, each level granting magic resistance equal to that level. Like level 1 : 1% Level 2: 2%... Level 100: 100%
Third: Change all your item types to (artifact). You can use any item type and change their charges to the amount of magic resistance they should give
Fourth: Add a integer variable : Temp_Integer
Lastly: Create a trigger doing the following:


JASS:
function Trig_Item_Conditions takes nothing returns boolean
return GetItemType(GetManipulatedItem())==ITEM_TYPE_ARTIFACT 
endfunction



function Trig_Item_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer i=0
local integer m=0

loop
exitwhen i==6
set i=i+1
if GetItemType(UnitItemInSlotBJ(u, i))==ITEM_TYPE_ARTIFACT  then
set m=m+GetItemCharges(UnitItemInSlotBJ(u, i))
endif
endloop

loop 
exitwhen GetUnitAbilityLevel(u,'A000')==0
call UnitRemoveAbility(u,'A000')
endloop

if m>0 then


if m> 100 then
set m=100
endif

call UnitAddAbility(u,'A000')
call SetUnitAbilityLevel(u,'A000',m)

endif

set u=null
set i=0
set m=0

endfunction

//===========================================================================
function InitTrig_Item takes nothing returns nothing
    set gg_trg_Item = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Item, function Trig_Item_Actions )
    call TriggerAddCondition(gg_trg_Item, Condition(function  Trig_Item_Conditions))
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Item, EVENT_PLAYER_UNIT_PICKUP_ITEM )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Item, EVENT_PLAYER_UNIT_DROP_ITEM )
    // We do the following to prevent first time lag, just replace the unit with any unit in your map
call UnitAddAbility(bj_lastCreatedUnit,'A000')
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A000',100)
call UnitRemoveAbility(bj_lastCreatedUnit,'A000')
endfunction

It should work...
 
Last edited:
Status
Not open for further replies.
Top