• 🏆 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!

Barbed Armor - Item Help

Status
Not open for further replies.
Level 5
Joined
Nov 29, 2007
Messages
106
I'v made an item, but this not work:
Item that after use gives a Thorn Aura to yourself and every units attacking you takes 100% damage return. Lasts 8 seconds.
I did item with Thunder Clap ability (Dummy Ability)
Triggers:
  • Events
    • Unit - A unit using an item
  • Conditions
    • (Item-type of (Item being manipulated)) = Barbed Armor
  • Actions
    • Set BarbedUnit = (Hero manipulating item)
    • Time - Start BarbedTimer as a one shot‚ timer that will expire in 8.00 seconds
    • Unit - Add Barbed Armor to BarbedUnit
    • Trigger - Turn on Disactive <gen>
Disactive:
  • Events
    • Time - BarbedTimer expires
  • Actions
    • Unit - Remove Barbed Armor from BarbedUnit
 
Level 6
Joined
Dec 9, 2007
Messages
208
I think you should use an ability which doesn't have a casttime/castanimation. The original Barbed Armor doesn't have a cast animation and is rather instant to activate.

Uh and if you are in fact taking the one from HoN then the damage is only 80% :)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Well then, he's got another work to do . . .
To add the spell INTO the item to be able for the trigger to work and it's time-consuming
Why don't he just use that Event ?
Anyway, both way works the same I think

I think the problem is:

  • Unit - Add BarbedArmor to BarbedUnit
Use this:

  • Unit - Add BarbedArmor to (Hero manipulating item)
You must first put a Condition regarding the item so that is specifies it
 
Well then, he's got another work to do . . .
To add the spell INTO the item to be able for the trigger to work and it's time-consuming
Why don't he just use that Event ?
Anyway, both way works the same I think

I think the problem is:

  • Unit - Add BarbedArmor to BarbedUnit
Use this:

  • Unit - Add BarbedArmor to (Hero manipulating item)
You must first put a Condition regarding the item so that is specifies it

but he did this...

Set BarbedUnit = (Hero manipulating item)


anyway, WHAT IS NOT WORKING? its not giving the ability? or what?
 
I suspect that it's because you have your "Disactive" trigger (which should be "Deactivate") not initially enabled. You don't have to turn it on in-game. Anyway, I made it MUI, here:
JASS:
function Trig_Barbed_Armor_Conditions takes nothing returns boolean //The item id.
    return GetItemTypeId(GetManipulatedItem()) == 'I000'
endfunction

function Ability takes nothing returns integer //The Thorns Aura spell book.
    return 'A002'
endfunction

function Duration takes nothing returns real //The duration.
    return 8
endfunction

function RemoveAb takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local integer id = GetHandleId (t)
    local integer abilityid = Ability()
    local unit u = LoadUnitHandle (udg_B_Hash, id, StringHash("unit"))
    call UnitRemoveAbility (u, abilityid)
    call GroupRemoveUnit (udg_B_Group, u)
    call FlushChildHashtable (udg_B_Hash, id)
    call DestroyTimer (t)
    set t = null
    set u = null
endfunction

function Trig_Barbed_Armor_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local boolean b = IsUnitInGroup (u, udg_B_Group)
    local timer t
    local integer id
    local integer abilityid
    if b == false then
        set abilityid = Ability()
        call UnitAddAbility (u, abilityid)
        set t = CreateTimer()
        call GroupAddUnit (udg_B_Group, u)
        set id = GetHandleId (t)
        call SaveUnitHandle (udg_B_Hash, id, StringHash("unit"), u)
        call TimerStart (t, Duration(), false, function RemoveAb)
    endif
    set u = null
    set t = null
endfunction

//===========================================================================
function InitTrig_Barbed_Armor takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_USE_ITEM )
    call TriggerAddCondition(t, Condition( function Trig_Barbed_Armor_Conditions ) )
    call TriggerAddAction( t, function Trig_Barbed_Armor_Actions )
endfunction
 

Attachments

  • Barbed Armor.w3x
    18.5 KB · Views: 83
Status
Not open for further replies.
Top