hello ,
what I am trying to do is having items that are upgradable when you keep buying them,
Initially,
I tried creating 10 items for 1 item with 10 upgrades and 10 abilities for each of them.
Then remove the [item]lv1 you just brought if your inventory have [that same item]lvX where x is greater than 1 and less than 9.
That is done by dropping that [item]lvX and create a new item of [that same item]lv X+1 and removing last dropped item
However, even with that, I was struggling with the triggers, plus it means I would have to do the same thing to all other items in the future, so I need an easier way of doing this...
From what I've found, this can be done by
Making them charged items and
Then setting the level of corresponding ability in that item equal to the number of charges.
So now the trigger is
Combining the same type of item into 1 with the sum of the charges of the 2 combining items.
Then make the level of ability of that combined item equal to the number of charges
The problem is I don't know how to do that as I have very little experience in playing with items and associating trigger functions,
however, I found this thread about the same thing, but it was outdated and one of the answerer removed the link to the map containing his trigger so all the variables he used are unknown to me:
Item Ability-Level Up
Here's the trigger by Dameon in the above link:
Now even without the variables in it, the trigger itself is pretty confusing to me =.=
Any help would be appreciated :thup:
what I am trying to do is having items that are upgradable when you keep buying them,
Initially,
I tried creating 10 items for 1 item with 10 upgrades and 10 abilities for each of them.
Then remove the [item]lv1 you just brought if your inventory have [that same item]lvX where x is greater than 1 and less than 9.
That is done by dropping that [item]lvX and create a new item of [that same item]lv X+1 and removing last dropped item
However, even with that, I was struggling with the triggers, plus it means I would have to do the same thing to all other items in the future, so I need an easier way of doing this...
From what I've found, this can be done by
Making them charged items and
Then setting the level of corresponding ability in that item equal to the number of charges.
So now the trigger is
Combining the same type of item into 1 with the sum of the charges of the 2 combining items.
Then make the level of ability of that combined item equal to the number of charges
The problem is I don't know how to do that as I have very little experience in playing with items and associating trigger functions,
however, I found this thread about the same thing, but it was outdated and one of the answerer removed the link to the map containing his trigger so all the variables he used are unknown to me:
Item Ability-Level Up
Here's the trigger by Dameon in the above link:
Code:
[B]UI MI[/B]
Events
Map initialization
Conditions
Actions
-------- Items Varible --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Set ItemT_UI[1] = Item 1
Set ItemT_UI[2] = Item 2
Else - Actions
-------- Abilitys Varible --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Set Ability_UI[1] = Item 1
Set Ability_UI[2] = Item 2
Else - Actions
Code:
[B]Item Upgradeing[/B]
Events
Unit - A unit Acquires an item
Conditions
Actions
For each (Integer Slot) from 1 to 6, do (Actions)
Loop - Actions
For each (Integer Interger_UI_IC) from 1 to 2, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to ItemT_UI[Interger_UI_IC]
(Charges remaining in (Item carried by (Hero manipulating item) in slot Slot)) Less than 5
(Item-type of (Item carried by (Hero manipulating item) in slot Slot)) Equal to (Item-type of (Item being manipulated))
(Item carried by (Hero manipulating item) in slot Slot) Not equal to (Item being manipulated)
Then - Actions
Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot Slot) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot Slot)) + (Charges remaining in (Item being manipulated)))
Item - Remove (Item being manipulated)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by (Hero manipulating item) in slot Slot)) Equal to ItemT_UI[Interger_UI_IC]
(Charges remaining in (Item carried by (Hero manipulating item) in slot Slot)) Greater than 5
Then - Actions
Set Point_Temp = (Position of (Hero manipulating item))
Item - Create ItemT_UI[Interger_UI_IC] at Point_Temp
Custom script: call RemoveLocation (udg_Point_Temp)
Item - Set charges remaining in (Last created item) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot Slot)) - 5)
Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot Slot) to 5
Hero - Give (Last created item) to (Hero manipulating item)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by (Hero manipulating item) in slot Slot)) Equal to ItemT_UI[Interger_UI_IC]
Then - Actions
Unit - Set level of Ability_UI[Interger_UI_IC] for (Hero manipulating item) to (Charges remaining in (Item carried by (Hero manipulating item) in slot Slot))
Else - Actions
Code:
[B]Item Charge Set[/B]
Events
Unit - A unit Uses an item
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Item 1
Then - Actions
Item - Set charges remaining in (Item being manipulated) to ((Charges remaining in (Item being manipulated)) + 1)
Else - Actions
Now even without the variables in it, the trigger itself is pretty confusing to me =.=
Any help would be appreciated :thup: