creating item with 2 of same items

Im_On_56k

Hm...
Reaction score
116
You know in dota with the "recipies" and how you can combine items and stuff.

I know how to do that but how would I make it upgrade when you have two of the same items. Iv tried it and it upgrades when you have one of the item.

This might help you understand my question.
--------------------------------------------------------------------------------------------------------
Event- Unit Aquires an item

Condition - Item carried by (triggering unit) of type (Claws of attack +12)
Condition - Item carried by (triggering unit) of type (Claws of attack +12)

Action- Item Remove (carried by triggering unit) of type (claws of attack +12)
Action- Item Remove (carried by triggering unit) of type (claws of attack +12)
Action- Create (claws of attack +25) and give it to (triggering unit)
--------------------------------------------------------------------------------------------------------
Once i get one claws of attack it makes the item.
 
I had this exact same problem with the tradeskills in my RPG. Here's the solution I came up with, in general:

Events: Unit Acquires an item
Conditions: Item carried by (Triggering unit) of type (Claws of attack +12)
Actions: Remove item of type (Claws of attack +12)
If/then/else, multiple conditions:
If: Item carried by (Triggering unit) of type (Claws of attack +12)
Then: Remove item of type (Claws of attack +12)
Create item for (Triggering unit) of type (Claws of attack +25)
Else: Create item for (Triggering unit) of type (Claws of attack +12)

This will remove one Claws of attack +12, and then check again whether or not the triggering unit has one left. If the unit has another, it finishes the creation; otherwise, it returns the original Claws.
 
As a side-note to the reason yours is not working is because you have 2 of the same exact condition, meaning it's just like having one. So basically it checks if the hero has an item Claws, then checks agai, it ignores if it has 2 of the same item.
 
wont that jus remove the item when you buy it?

Because it removes the item if you have it and than it runs the next if than else
 
You want to change one of the conditions to "acquired item is <your claws>" and it should work.
 
Look here

Right this is soooo simple i dont know how you cant come up with it.
Im not being big headed or nothing but im a trigger expert.
I can make any trigger possible know to man.
This is what you need to solve your problem...

This function will require 2 Triggers. Trigger number 1 :



Events
Unit - A unit Acquires an item

Actions
If ((Item-type of (Item being manipulated)) Equal to Claws of Attack +12) then do (Item - Set the custom value of (Item carried by (Triggering unit) of type Claws of Attack +12) to ((Custom value of (Item carried by (Triggering unit) of type Claws of Attack +12)) + 1)) else do (Do nothing)
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has an item of type Claws of Attack +12) Equal to True
(Custom value of (Item carried by (Triggering unit) of type Claws of Attack +12)) Equal to 2
Then - Actions
Item - Remove (Item carried by (Triggering unit) of type Claws of Attack +12)
Item - Remove (Item carried by (Triggering unit) of type Claws of Attack +12)
Item - Create Circlet of Nobility at (Position of (Triggering unit))
Hero - Give (Last created item) to (Triggering unit)
Else - Actions


And trigger Number 2 :

Conditions
(Item-type of (Item being manipulated)) Equal to Claws of Attack +12

Actions
Item - Set the custom value of (Item being manipulated) to 0
If (((Triggering unit) has an item of type Claws of Attack +12) Equal to True) then do (Item - Set the custom value of (Item carried by (Triggering unit) of type Claws of Attack +12) to ((Custom value of (Item carried by (Triggering unit) of type Claws of Attack +12)) - 1)) else do (Do nothing)

That should do it ... If you dident undertand any of that whatsoever plz contact me at [email protected]

If you need any help with any triggers at any time just come to me and i will give you them with help and advice on whatever you need.

Thx bye
 
Sorry forgot about something

Were it says on the above text .
Creat a circle of nobility..... change it to whatever item you want the unit to have after it has 2 of the claws.

sorry about that

Bye
 
Interesting...


What you think of this one?

Code:
ItemCombo
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Claws of Attack +6
    Actions
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Claws of Attack +6
                    Then - Actions
                        For each (Integer B) from ((Integer A) + 1) to 6, do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Item-type of (Item carried by (Triggering unit) in slot (Integer B))) Equal to Claws of Attack +6
                                    Then - Actions
                                        Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                                        Item - Remove (Item carried by (Triggering unit) in slot (Integer B))
                                        Hero - Create Claws of Attack +12 and give it to (Triggering unit)
                                        Skip remaining actions
                                    Else - Actions
                    Else - Actions
 
There was a huge debate on this on wc3campaigns.

The winner was Vexorian, who knows how to make 'item groups' just like 'unit groups' and player groups.

The demo is called "Pool class demo".

The catch is, its all jass, and its deep. The map comes with functions and everything.

The reason I don't point people to it, is because its as deep as the 'Save Code' function, and instead of hearing 'Eureaka! Awesome!" I just get 1000 questions.

http://www.wc3campaigns.com/showthread.php?t=46190&highlight=pool+class+demo
 
aceheart i tried urs since i didnt want to make 2 triggers for every item upgrade.

It didn't work.

It upgraded the item when i bought one of them.
And its supose to upgrade when you have 2 of it.
 
Code:
Events
Unit-  A Aquires an item

Conditions
Item type of (item being manipulated)) Equal to Metal Helmet

Actions
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-Type of (Item carried  by (Triggering unit) in slot (Integer A)) equal to metal helmet
Then - Actions
For each (Integer B) from 1 to 6 do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else to (Else Actions)
If - Conditions
(Item-type of (Item carried by (Triggering Unit) in slot (Integer B)) Equal to Metal Helmet
Then - Actions
Item - Remove (Item carried by (Triggering Unit) in slot (Integer A)
Item - Remove (Item carried by (Triggering Unit) in slot (Integer B)
Hero - Create Hood of Destruction and give it to (Triggering Unit)
Game - Display to (Owner of Triggering Unit), at offset (0.00,0.00) the text (You have upgraded an item into |cffFF8000 + ((Name of (Last created item)) + |r))
Skip Remaining Actions
Else - Actions
Else - Actions
 
Ace Hearts -

ItemCombo
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Claws of Attack +6
Actions
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Claws of Attack +6
Then - Actions
For each (Integer B) from ((Integer A) + 1) to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by (Triggering unit) in slot (Integer B))) Equal to Claws of Attack +6
Then - Actions
Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
Item - Remove (Item carried by (Triggering unit) in slot (Integer B))
Hero - Create Claws of Attack +12 and give it to (Triggering unit)
Skip remaining actions
Else - Actions
Else - Actions

Im_On_56k's

Events
Unit- A Aquires an item

Conditions
Item type of (item being manipulated)) Equal to Metal Helmet

Actions
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-Type of (Item carried by (Triggering unit) in slot (Integer A)) equal to metal helmet
Then - Actions
For each (Integer B) from 1 to 6 do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else to (Else Actions)
If - Conditions
(Item-type of (Item carried by (Triggering Unit) in slot (Integer B)) Equal to Metal Helmet
Then - Actions
Item - Remove (Item carried by (Triggering Unit) in slot (Integer A)
Item - Remove (Item carried by (Triggering Unit) in slot (Integer B)
Hero - Create Hood of Destruction and give it to (Triggering Unit)
Game - Display to (Owner of Triggering Unit), at offset (0.00,0.00) the text (You have upgraded an item into |cffFF8000 + ((Name of (Last created item)) + |r))
Skip Remaining Actions
Else - Actions
Else - Actions


Now if look closely there is one small but very vital difference

Aceheart's
For each (Integer B) from ((Integer A) + 1) to 6, do (Actions)

Im_On_56k's
For each (Integer B) from 1 to 6 do (Actions)


That +1 is all the difference you need that stops the trigger from working like you wanted.
 
Guys dont even try.
Just use Vexorian's item class pool functions.
Vexorian is the master of JASS. this is 1 of them things were you need to reley on JASS and there functions because Blizzard hasent made every aspect of JASS. just listen to SD_Ryoko and use Vexorian's work. im a trigger and jass pro myself but i dont stand anywere compared to Vexorian and here work.

So dont attemp to debate cause you need JASS for things like these.
 
i had something like this in my inu yasha map with jewel shards

3 jewel shards = 1 jewel chip
2 jewl chips = 1 jewel piece
2 jewel pieces = 1 jewel fragment
2 jewel fragments = 1 jewel segment
6 jewel segments = 1 jewel of the 4 souls

i just made an integer variable called count

event
unit aquires an item
condition
item being manipulated equal to jewel shard
action
set count equal to 0
for every integer A 1 to 6 do
if item carried by hero manipulating item in slot integer A equal to jewel shard
then set count equal to count + 1
else do nothing
if count equal to 3
then for every integer a 1 to 6 do
if item carried by hero manipulating item in slot integer A equal to jewel shard
then remove item carried by hero manipulating item in slot A
else do nothing
if count equal to 3
then create jewel chip for hero manipulating item
else do nothing

i did this in ROC so i couldnt do the (multiple actions) if/then/else or for loops
 
i must be missing something if you guys think it can only be done in jass code, i did this back in the day using ROC. didnt even have TFT triggers and i could do it. also, those people at wc3campaigns must be stupid if thats the best they could come up with
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I love the Trending Content!
  • The Helper The Helper:
    New News Forum World News
  • The Helper The Helper:
    How often does the Trending Content box refresh?
  • The Helper The Helper:
    Also, in the last template there was a seperation between sticky threads and regular threads in the forum
  • Ghan Ghan:
    Not sure. It's probably part of a cron job.
  • The Helper The Helper:
    Hey Ghan, whatever cron job its part of its not running its been the same for days. If it does not work can we remove it?
  • The Helper The Helper:
    LOL! A tweak job!
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)

The Helper Discord

Staff online

  • Ghan
    Administrator - Servers are fun

Members online

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top