• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Item that makes attacking impossible!

Status
Not open for further replies.
Level 5
Joined
May 27, 2007
Messages
126
Dear Hiveworkshop'ers!

The problem is the following:

I want a unit to not be able to attack anyone when the unit has acquired a certain wielding item. However, the attack function must only be disabled when the unit wears that/those specific item(s).

I tried my best, I couldn't find a way to do it!

I hope someone can help me with it, preferable in GUI, but JASS is oke, if you tell me clear on how to implement it and what I need for it

Yours sincerely,

Syntic
 
You could do this:
  • Init Trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item being manipulated) Equal to "Your Item"
    • Actions
      • Set Unit_With_Item = (Hero manipulating item)
      • Trigger - Turn on No Attack Trigger <gen>
  • No Attack Trigger
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Ordered unit) Equal to Unit_With_Item
      • (Issued order) Equal to (Order(attack))
    • Actions
      • Unit - Order Unit_With_Item to Stop
  • End Trigger
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item being manipulated) Equal to "Your Item"
    • Actions
      • Trigger - Turn off No Attack Trigger <gen>
 
You could do this:

  • Init Trigger
    • Events
    • Unit - A unit Acquires an item
    • Conditions
    • (Item being manipulated) Equal to "Your Item"
    • Actions
    • Set Unit_With_Item = (Hero manipulating item)
    • Trigger - Turn on No Attack Trigger <gen>
  • No Attack Trigger
  • Events
  • Unit - A unit Is issued an order targeting an object
  • Conditions
  • (Ordered unit) Equal to Unit_With_Item
  • (Issued order) Equal to (Order(attack))
  • Actions
  • Unit - Order Unit_With_Item to Stop
End Trigger

Events

  • Unit - A unit Loses an item
    • Conditions
    • (Item being manipulated) Equal to "Your Item"
    • Actions
    • Trigger - Turn off No Attack Trigger <gen>

thanks! I will check if it works :)

Or you can make an item with negative attack damage bonus and disable attacking abilities for hero when he'll aquire that item.

thats the problem! I dont know how to disable attacking ability on the hero when wearing an item!

P.S. the trigger didnt work! I could still attack the target after I worned the item!!
 
Make trigger like this:

  • Aquire
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to YourItem
    • Actions
      • -------- For this system you will need point variable, a dummy caster and spell based on silence --------
      • -------- Dummy will cast silence modified to prevent all attacks --------
      • -------- Note: Silence has option to prevent attacks --------
      • -------- Note: Be carefull when setting targets for your silence --------
      • Set TempPoint = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call IssueTargetOrder( GetLastCreatedUnitBJ(), "silence", GetTriggerUnit() )
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
  • Loose
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to YourItem
    • Actions
      • -------- Here we just need to remove silence buff from unit --------
      • Unit - Remove YourSilenceBuff buff from (Triggering unit)
 
Can't you disable and enable attacks via researches or via triggers?
Or push it all into one trigger:
  • Item Disable Attack
    • Events
      • Unit - a unit is attacked
    • Conditions
      • ((Attacking Unit)has Item) equal to True
    • Actions
      • Unit - Order (Attacking Unit) to Stop
You get my point? Just use that basis.
 
Status
Not open for further replies.
Back
Top