• 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 disables spells

Status
Not open for further replies.
Level 10
Joined
Sep 29, 2006
Messages
447
Is there a way to make it so that when a hero picks up an item it cannot cast any spells. I would prefer to do this without using soul burn, as it can be dispelled and that would be a big no no.

Lines of JASS code are welcomed if that's where the solution lies.
 
Level 10
Joined
Jan 28, 2009
Messages
442
  • Stop Casting
  • Events
    • A unit begins casting an ability
  • Conditions
    • Or - Multiple conditions
      • (Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to NoCastItem
      • (Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to NoCastItem
      • (Item-type of (Item carried by (Triggering unit) in slot 3)) Equal to NoCastItem
      • (Item-type of (Item carried by (Triggering unit) in slot 4)) Equal to NoCastItem
      • (Item-type of (Item carried by (Triggering unit) in slot 5)) Equal to NoCastItem
      • (Item-type of (Item carried by (Triggering unit) in slot 6)) Equal to NoCastItem
  • Actions
    • Unit - Order Triggering unit to Stop
 
Make the ability require a research. When the game starts set every players research level for that research to 1. When a hero acquires an item set the research level for the ability you wanna disable to 0. That might work but im not sure.

this looks a good way to do this.... but it will show a requirement once the upgrade is set to 0 and it would not look like really silenced.. but I think your idea is the best simplest way to do this...
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Another option is to check when the item is picked up, then save all ability levels to integers, remove the abilities and add the same abilities, but dummy versions to the unit. Then restore the ability levels. Create grayed-out icons for the dummy spells. Should be simple with any decent image processing software.
 
Level 10
Joined
Jan 28, 2009
Messages
442
Make the ability require a research. When the game starts set every players research level for that research to 1. When a hero acquires an item set the research level for the ability you wanna disable to 0. That might work but im not sure.

Hmm.. I thought that was impossible. I thought it was impossible to remove an upgrade level, i.e. setting the current research level to a lower integer than it allready is...?

Another option is to check when the item is picked up, then save all ability levels to integers, remove the abilities and add the same abilities, but dummy versions to the unit. Then restore the ability levels. Create grayed-out icons for the dummy spells. Should be simple with any decent image processing software.

That's a good sollution, yes.
 
Level 7
Joined
Jul 18, 2009
Messages
272
You can also give the Item a modified Engineering-Upgrade-Ability that exchanges the Hero-Abilities for Dummy-Ones. Doesn't need a single trigger and you can change the abilities any way you want, make them uncastable, change the icons, etc.
Only downside is that you can't use Engineering-Upgrade for anything else anymore, but if you don't use it anyway, this should work for you.

PS: If a non-hero-unit takes up an item with an Engineering-Upgrade-Ability, the game crashes. Just to warn you. If you have non-hero-items with an inventory, you still need a trigger.
 
Status
Not open for further replies.
Top