• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Item Wait MUI

Status
Not open for further replies.
Level 9
Joined
Dec 16, 2017
Messages
339
Hello guys, i am trying to make an active spell MUI for an item, and i am not sure if i use WAIT if it will still work for MUI or it will interfer with others, here is the trigger

  • DreadleatherJerkin
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dreadleather Jerkin (Item)
    • Actions
      • Set DJ_Caster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Unit - Add Dreadleather Jerkin (SpellBook) to DJ_Caster[(Player number of (Owner of (Triggering unit)))]
      • Player - Disable Dreadleather Jerkin (SpellBook) for (Owner of DJ_Caster[(Player number of (Owner of (Triggering unit)))])
      • Wait 3.00 seconds
      • Unit - Remove Dreadleather Jerkin (SpellBook) from DJ_Caster[(Player number of (Owner of (Triggering unit)))]
Also i am having a little issue with the items that i give a spell too, and also put a spellbook that has more than 4 items abilities, if i try to click the item to cast the spell, it opens the spellbook, how can i disable spellbook when an item get's picked so you can click directly the spell and not the spellbook?
 
Last edited:
Level 9
Joined
Dec 16, 2017
Messages
339
Yes, it's only one unit per player.

Also i am having a little issue with the items that i give a spell too, and also put a spellbook that has more than 4 items abilities, if i try to click the item to cast the spell, it opens the spellbook, how can i disable spellbook when an item get's picked so you can click directly the spell and not the spellbook?
 
Level 9
Joined
Dec 16, 2017
Messages
339
i am using the spellbook because i put more than 4 stats

Items let's you put a maximum of 4 diff stats, if i make items with more than 4 stats, i need a spellbook so i can store 9 stats. But if i have an active to that item, when i click it, it will enter in the spellbook that will be empty because of the stats
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
I'm not sure I understand you, but this is what I think you want: you want the unit holding item x to gain a spellbook, and also an active ability.

If that is the case - just trigger adding and removing the spell book from the unit when they acquire/drop the item, and have the active ability be the ability of the item.
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
This simple:

  • get spellbook
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
    • Actions
      • Unit - Add Spell Book to (Triggering unit)
  • lose spellbook
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Kelen's Dagger of Escape
    • Actions
      • Unit - Remove Spell Book from (Triggering unit)
(obviously change the item and spell to match yours... )

this should do it...
good luck!
 
Level 9
Joined
Dec 16, 2017
Messages
339
I can put directly the spellbook into the item from object editor
What i need is to disable the spellbook for the item that gets picked up, so when you click an active item, it doesn't open an empty spellbook but uses the spell that the item has
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
which is exactly why you should have the default ability of the item be the active one, and add the spellbook with triggers and not the object editor. I feel like we are going in circles...:grin:

Edit:

think of it like this - we want to make sure that when you click on the item it casts the active ability. an easy way to ensure that, is to have the only ability on that item be that one. you also should base this off of an item that has an active ability and switch it with the ability you want. that is why I used kelens dagger in the example.

we use the trigger to make it look like the spellbook is also part of the item, even though from the coding point of view there is no connection between them. the unit just happens to get the spellbook whenever holding the item, but the item is not internally linked to the spellbook. just to the original active spell. this way we can be completely sure that clicking on the item will use the active spell.

I hope this wall of text helped...
 
Last edited:
Level 9
Joined
Dec 16, 2017
Messages
339
which is exactly why you should have the default ability of the item be the active one, and add the spellbook with triggers and not the object editor. I feel like we are going in circles...:grin:

Edit:

think of it like this - we want to make sure that when you click on the item it casts the active ability. an easy way to ensure that, is to have the only ability on that item be that one. you also should base this off of an item that has an active ability and switch it with the ability you want. that is why I used kelens dagger in the example.

we use the trigger to make it look like the spellbook is also part of the item, even though from the coding point of view there is no connection between them. the unit just happens to get the spellbook whenever holding the item, but the item is not internally linked to the spellbook. just to the original active spell. this way we can be completely sure that clicking on the item will use the active spell.

I hope this wall of text helped...
Ok it is working the way i need and want, what i want to ask is, what happens when the 2 players have the same item, and one of them drops the item, will it remove the spellbook from the last player that aquired the item or the first one?
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
No, that shouldn't be a problem. Each of these triggers operates independently. If you use the triggers I posted it should be fine even if it is two units owned by the same player.

however, if you have a situation where one unit gets two copies of that item it can cause a problem - if the unit drops one item and keeps the other - it will lose the spellbook.

if that is something that can happen in your map, and you want to avoid that, add a condition to the "lose spellbook" trigger making sure the unit does not have an item of that type in one of it's inventory slots.
 
Status
Not open for further replies.
Top