• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] How to edit a spell's datas with items

Status
Not open for further replies.
Level 2
Joined
Mar 28, 2008
Messages
6
Heya!

There are these summoning spells... i want to make an item, that increase the amount of the units that a spell summons.
So if I choose the Summon Bear spell, and the hero got this item then he will summon 2 bear and not 1. How can i make it?
In the map there can be more heroes which uses this spell, but i want to only that heroe's spell increase which owns the item.
There should be a limit, so the hero cant carry more than 2 of this item. So he max can summon 3 units.
Any tips?

Thanks :thumbs_up:
 
Level 9
Joined
Oct 17, 2007
Messages
547
make that spell has serveral levels, e.i. lv 1 give 1 summon, lv 2 give 2 summons.

Whenever the unit pick up that item, increase the lv of the skill by 1, and whenever the item is dropped, decrease skill lv by 1 or set it to 1.

remember to make the tool tips for both levels identical
 
Level 2
Joined
Mar 28, 2008
Messages
6
Yep but there is already more levels of this spell... It would work if i put the level skip requires to 99 so the hero only can go to higher lvl if he got the item, but i want him to able to choose the levels because lvl 2 and 3 give more stronger units...
I made another spell, that is the same just summons 2 and not 1 monster, and if the hero got the item then i remove the original spell and give the new one to him... Its worked, but there is an exploit: so if he summons, there is a 30 sec cooldown, but if he picks up the item then he can again summon, then he drops it and he can summon again, how can i fix this bug? Its not important to take the cooldown to that place where it was, its also good if the cooldown starts again from the start.
?
 
Level 7
Joined
Dec 8, 2005
Messages
319
well you could pull out the tinkers upgrade ability... just simply make an upgrade of that ability and let warcraft do the work and make it undroppable... and they would have to destory the item to open that slot... that would solve that problem... but you might have to make another trigger to reset the heros ability back to the original when the item is dropped.
 
Level 35
Joined
Jul 22, 2004
Messages
1,001
you probably need a trigger that says something along the lines of this:

Event: Unit aquires an item
Condition: Unit aquiring item = your hero type
Item being manipulated = your item

Actions: If/Then/Else
If level of your ability = 1
Then increase level of your ability to 2
Else
*repeat the if/then/else above like 2 more times for level = 2 and
for level = 3. if the level = 3, make the hero drop the item*

sorry if this doesn't help much lol.
 
Level 9
Joined
May 27, 2006
Messages
498
The easiest way is to do it by creating a dummy spell + trigger :|

1. You create a summoning spell that summons 1 unit you want it to create. In tooltip you write, that number of units depends on how much items you aqcuire.

2. You create a book-based item (like book of strength, book of agility, etc...) that will increase your skill when picked up.

3. Finally, you must make the triggers. There are 2 needed for this to work. First, a trigger that detects if the book you've created is acquired. Now, go to variable editor and create an integer variable and name it like UnitSummoned. Tick the 'array' box at the bottom of the window. In actions put: Set UnitSummoned[(Player number of (Owner of (Triggering unit))] = (UnitSummoned[(Player number of (Owner of (Triggering unit))] + 1). Thats all for the first one.
The seconds trigger. In events use "Creates a summoned unit'. Conditions: (Unit-type of (Summoned unit)) Equal to (Your_Summoned_Unit-Type) [in unit-type comparison]. Now actions. Here you have to remove the summoned unit and spawn n units of the same type as the just removed one, where n equals to UnitSummoned variable.

All in all, the triggers should look like this:
First, add these actions...
  • Actions:
    • For each (Integer A) from 1 to 10 [number of players in your game] do (Actions):
      • Set UnitSummoned[(Integer A)] = 1
...To your map initialization trigger.

  • Blah1
    • Events:
      • Unit - A unit acquires an item
    • Conditions:
      • (Item-type of (Item being manipulated)) Equal to (Your_Book_Item)
    • Actions:
      • Set UnitSummoned[(Player number of (Owner of (Triggering unit))] = ( UnitSummoned[(Player number of (Owner of (Triggering unit))] + 1 )
  • Blah2
    • Events:
      • Unit - A unit creates a summoned unit
    • Conditions:
      • (Unit-type of (Summoned unit)) Equal to (Your_Summoned_Unit-type)
    • Actions:
      • Set TempPoint = (Position of (Summoned unit)) // TempPoint is a point variable
      • Unit - Remove (Summoned unit) from the game
      • For each (Integer A) from 1 to UnitSummoned[(Player number of (Owner of (Triggering unit))] do (Actions):
        • Unit - Create 1 units of type (Unit-type of (Summoned unit)) at TempPoint facing (Default building degrees)
        • Unit - Add [time your summoned unit's are alive] second Generic timer to (Last Created unit)
      • Custom script: call RemoveLocation(udg_TempPoint)
 
Status
Not open for further replies.
Top