• 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.

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>
 
Level 5
Joined
May 27, 2007
Messages
126
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!!
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
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)
 
Level 12
Joined
Aug 22, 2008
Messages
911
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.
Top