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

[General] Item Trigger

Status
Not open for further replies.
1-Let's say I want a trigger where a unit picks a specific item, when he does he learns an ability, when he drops the item he loses that ability.

2-How do I make it so that it rains on a specific region

3-How do I disable cheats such as: ''Iseedeadpeople'' in my map?

willing to give reputation and credits to anyone who helps.
 
Level 11
Joined
May 8, 2009
Messages
275
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Your Item
  • Actions
    • Unit - Add Your ability to (Triggering unit)
  • Events
    • Unit - A unit Loses an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Your Item
  • Actions
    • Unit - Remove Your Ability from (Triggering unit)
2. Right-Click on a region's name, then select "Edit Region Properties", check the "Weather Effects" box and select whatever effect you need.

3. You could create a small region at a corner of your map surrounded by boundary (make sure it's always invisible to every player). Then create a trigger like this:
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
    • (Point is visible to Player 1 (Red)) Equal to True
  • Actions
    • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Black mask across (Playable map area)
*The "Point" variable has to be set at the map initialization as the center of the Region. Be careful to disable this trigger during cinematics.
 
Level 2
Joined
Jan 4, 2012
Messages
5
Assume that a unit acquired specified ability and then he uses metamorhosis ability or of such kind, then how to make so that specified ability wont dissapear?
-I got problems when unit dies, the unit loses ability after reviving
-when transforms
-when acquires the same type of item a second time, so two identical items in inventory
 
Last edited:
Level 19
Joined
Aug 8, 2007
Messages
2,765
Assume that unit takes two identical items and it merges into new one. What to do plz help

Please make a new thread next time. Also, there should be absolutely no change to the trigger, assuming ur removing both items than adding the result.
 
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Your Item
  • Actions
    • Unit - Add Your ability to (Triggering unit)
  • Events
    • Unit - A unit Loses an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Your Item
  • Actions
    • Unit - Remove Your Ability from (Triggering unit)
A small note: Transformation skills such as metamorphesis and I think also maybe the Hero death removes the addition ability.
I think the only way to counter it will be
  • Events
    • Time - Every 1 seconds of the game
  • Conditions
    • Actions
      • set unitgroup = units with the item type
    • pick every unit in unitgroup
      • if unit has not have the ability
        • Unit - Add Your ability to (Picked unit)
  • call DestroyGroup(udg_unitgroup)
  • set unitgroup = units with the ability
    • pick every unit in unitgroup
      • if unit has not have the item
        • Unit - Remove Your ability from (Picked unit)
  • call DestroyGroup(udg_unitgroup)
 
Let's say when you do lots of coding and research, you'll learn something new.
I found that script over at Internet Google Search.

All I can say is, experience taught me everything I need.

This is very difficult
  • Spell Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Copy Sharingan
    • Actions
      • Set A = (Player number of (Owner of (Triggering unit)))
      • Set B = (Player number of (Owner of (Target unit of ability being cast)))
      • Set p = (Position of (Triggering unit))
      • Set p2 = (Position of (Target unit of ability being cast))
      • Sound - Play SpellStealMissile <gen> at 100.00% volume, attached to (Target unit of ability being cast)
      • Set Integer = (Level of (Ability being cast) for (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to (Triggering unit)
        • Then - Actions
          • Set lastusedability[B] = Chidory 1
          • Set lastusedability_string[B] = Chidory
        • Else - Actions
      • Special Effect - Create a special effect at p using Abilities\Spells\Human\SpellSteal\SpellStealMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at p2 using Abilities\Spells\Human\SpellSteal\SpellStealMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Floating Text - Create floating text that reads lastusedability_string[B] at p with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
      • Floating Text - Create floating text that reads lastusedability_string[B] at p2 with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
      • Unit - Remove stolenability[A] from (Triggering unit)
      • Set stolenability[A] = lastusedability[B]
      • Unit - Add lastusedability[B] to (Triggering unit)
      • Custom script: call UnitMakeAbilityPermanent(Triggering_unit, udg_stolenability[udg_A])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Ability being cast) for (Triggering unit)) Equal to 3
        • Then - Actions
          • Unit - Set level of lastusedability[B] for (Triggering unit) to 3
          • Unit - Set level of lastusedability[B] for (Triggering unit) to 4
        • Else - Actions
          • Unit - Set level of lastusedability[B] for (Triggering unit) to (Level of (Ability being cast) for (Triggering unit))
      • Custom script: call RemoveLocation (udg_p)
      • Custom script: call RemoveLocation (udg_p2)
Did I do it wrong?
 
How I wish you can differentiate between GUI and JASS.
It's call UnitMakeAbilityPermanent(whichUnit, whichAbilityRawCode)

can you explain it further? "which unit" should be placed with what?

You ignored my question twise and tried to act all mighty about knowing how to use this, you failed in writing this down so it took me 10 minutes to search all over the google to realize how to use it (there was only 1 post which mentioned it so it was really hard even after it was found since they didn't tell much either) Well, that's a good thing I managed to find it, but you sir, don't deserve any reputation for that attitude.
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
And I thought naming the parameter using the standard naming procedure might help you to understand it.
whichUnit by logic, refers to what unit you ask ?

You would expect the whichUnit is the unit that your neighbor is using... ?

Also, blame you for not using the powerful option given to all users on THW and it's called Search, learn how to use it before post another similar thread that has the same solution.

Here's the list of the similar solution you would found (keyword: UnitMakeAbilityPermanent);
http://www.hiveworkshop.com/forums/requests-341/melee-range-system-224660/
http://www.hiveworkshop.com/forums/...nge-melee-ranged-after-equipping-item-223337/
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/spellbook-spell-doesnt-work-222655/
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/slow-target-unit-need-opinions-220425/
http://www.hiveworkshop.com/forums/triggers-scripts-269/expected-name-218886/
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/metamorphosis-attachments-215925/

And the list continues...

And I'm sorry, the correct function is: call UnitMakeAbilityPermanent(whichUnit, true, whichAbilityId)
I missed that boolean parameter in the middle, that would make that ability becomes permanent.
If it's set to false, it would cancel the effect (making the ability non-permanent).
 
And I'm sorry, the correct function is: call UnitMakeAbilityPermanent(whichUnit, true, whichAbilityId)
I missed that boolean parameter in the middle, that would make that ability becomes permanent.
If it's set to false, it would cancel the effect (making the ability non-permanent).
I know it was incorrect, because after 1 hour of searching I finnaly hooked out from google that your phrase needed that fix, which gave me the solution. I was sure you done it to prove I don't know "basic jass" but if you didn't then, Thanks.
 
Status
Not open for further replies.
Top