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!
Hi, im new to moding wc3 and need some help. How can i make a spell consume an item each time i use the spell? Need to be able to cast a magic spell that consume like a "scroll" or "magic rune".
Sorry for my bad english!
Generally... like this. If I understand you correctly though.
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Animate Dead
(Charges remaining in (Item carried by (Triggering unit) of type Tome of Experience)) Greater than 0
Actions
Item - Set charges remaining in (Item carried by (Triggering unit) of type Tome of Experience) to ((Charges remaining in (Item carried by (Triggering unit) of type Tome of Experience)) - 1)
Generally... like this. If I understand you correctly though.
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Animate Dead
(Charges remaining in (Item carried by (Triggering unit) of type Tome of Experience)) Greater than 0
Actions
Item - Set charges remaining in (Item carried by (Triggering unit) of type Tome of Experience) to ((Charges remaining in (Item carried by (Triggering unit) of type Tome of Experience)) - 1)
In other words, everytime you cast Animate Dead, the charges of Tomes of Experience will be reduced by 1. So, it doesn't require the item to be casted.
Generally... like this. If I understand you correctly though.
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Animate Dead
(Charges remaining in (Item carried by (Triggering unit) of type Tome of Experience)) Greater than 0
Actions
Item - Set charges remaining in (Item carried by (Triggering unit) of type Tome of Experience) to ((Charges remaining in (Item carried by (Triggering unit) of type Tome of Experience)) - 1)
If you reduce the charges remaining from 1 to 0, the item would be made infinite and just hang in the inventory with no charges. The hero probably needs to be unable to cast the spell without the item as well, so here is an example of 2 triggers that do the job cleanly - using Healing Salves:
Ability Cancel No Item
Events
Unit - A unit Begins channeling an ability
Conditions
(Ability being cast) Equal to Animate Dead
(Charges remaining in (Item carried by (Triggering unit) of type Healing Salve)) Less than 1
Actions
Unit - Order (Triggering unit) to Stop
Game - Display to (Player group((Owner of (Triggering unit)))) the text: You do not have a Healing Salve, toolface!
First trigger checks if you have the item, and stops you before you cast if you don't, displaying a message to the player. Don't worry, the spell doesn't have to have cast time or be a channel spell. 'Begins channeling' (in most cases) refers to as soon as the unit meets the conditions to cast the spell it was ordered to.
Ability Cast Item Consume
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Animate Dead
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Charges remaining in (Item carried by (Triggering unit) of type Healing Salve)) Equal to 1
Then - Actions
Item - Remove (Item carried by (Triggering unit) of type Healing Salve)
Else - Actions
Item - Set charges remaining in (Item carried by (Triggering unit) of type Healing Salve) to ((Charges remaining in (Item carried by (Triggering unit) of type Healing Salve)) - 1)
Second trigger takes away a charge after the ability is started. If the item has 1 charge, it will be removed. If it has more, it will be reduced by 1.
If you reduce the charges remaining from 1 to 0, the item would be made infinite and just hang in the inventory with no charges. The hero probably needs to be unable to cast the spell without the item as well, so here is an example of 2 triggers that do the job cleanly - using Healing Salves:
Ability Cancel No Item
Events
Unit - A unit Begins channeling an ability
Conditions
(Ability being cast) Equal to Animate Dead
(Charges remaining in (Item carried by (Triggering unit) of type Healing Salve)) Less than 1
Actions
Unit - Order (Triggering unit) to Stop
Game - Display to (Player group((Owner of (Triggering unit)))) the text: You do not have a Healing Salve, toolface!
First trigger checks if you have the item, and stops you before you cast if you don't, displaying a message to the player. Don't worry, the spell doesn't have to have cast time or be a channel spell. 'Begins channeling' (in most cases) refers to as soon as the unit meets the conditions to cast the spell it was ordered to.
Ability Cast Item Consume
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Animate Dead
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Charges remaining in (Item carried by (Triggering unit) of type Healing Salve)) Equal to 1
Then - Actions
Item - Remove (Item carried by (Triggering unit) of type Healing Salve)
Else - Actions
Item - Set charges remaining in (Item carried by (Triggering unit) of type Healing Salve) to ((Charges remaining in (Item carried by (Triggering unit) of type Healing Salve)) - 1)
Second trigger takes away a charge after the ability is started. If the item has 1 charge, it will be removed. If it has more, it will be reduced by 1.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.