• 🏆 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!

[Trigger] Upgrade(recipe) Help

Status
Not open for further replies.
Level 4
Joined
Nov 9, 2008
Messages
112
How to make if a unit upgrade an item (using recipe)

ex:broadsword to broadsword+1

ex:broadsword + ore = broadsword+1 (with xx% succes)

(if possible)
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Whenever the upgrading should happen:

Set Integer A = 1 to 6
Check if slot Integer A contains Ore
Check if slot Integer A contains Broadsword
If both true:
Set RANDOM = Random number beteen 1 and 100
If RANDOM is less then or equal to xx (Your percentage), then do:
Remove Ore, remove Broadsword, and add Broadsword+

I got no WE here, so I can't give it to you in correct triggers, but all these commands are there.
 
Level 5
Joined
Jan 3, 2008
Messages
164
As Avator wrote there, I made the trigger for you.
  • Upgrade Recipe
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Hero manipulating item) has an item of type Broadsword) Equal to True
              • ((Hero manipulating item) has an item of type Ore) Equal to True
        • Then - Actions
          • Set Random = (Random integer number between 1 and 100)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Random Less than or equal to 50
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) of type Broadsword)
              • Item - Remove (Item carried by (Hero manipulating item) of type Ore)
              • Hero - Create Broadsword+ and give it to (Hero manipulating item)
            • Else - Actions
              • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You have failed to create a new item!
        • Else - Actions
          • Do nothing
*Works for heroes only!
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
Check my tutorial (it's in my signature). It's what you are looking for, just ignore the whole profession check part.
It's main part is having a recipe that will turn it into a item with a X chance.
Just cut out all of the profession checks.

Unless you want to make it a profession with lvls that is.
 
Level 4
Joined
Nov 9, 2008
Messages
112
that's have 50% chance...

but how if..(bad english)

50% succes (ex: Broadsword+1)
35% do nothing [still Broadsword] (but the ore vanish)
10% the weapon back to origin(ex: Broadsword+3 --> Broadsword)&[ore vanish]
5% the weapon and ore are vanished
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Then make such same If/Then/Else triggers like the 50% chance If/Then/Else, and you enter

  • If - Conditions
    • Random Greater then 50
    • Random Less then or equal to 85
This gives 35% chance. Just add which actions you want to be performed with which chances and you're all set.
 
Status
Not open for further replies.
Top