- Joined
- Jun 26, 2020
- Messages
- 1,971
I create this trigger to acumulate items (I really don't want doing the powerup thing), I think it is ok but it just do until "remove item being manipulated" what am I doing bad? To understand I only have 10 types of items that I wanna stack saved in a variable called "Objetos_cargado":
-
Acumular mismos items
-

Events
-


Unit - A unit Acquires an item
-
-

Conditions
-


(Item-class of (Item being manipulated)) Equal to Charged
-
-

Actions
-


Custom script: local player p
-


Custom script: local integer i
-


Custom script: local integer B
-


Set Temp_Bool = False
-


For each (Integer Atemp_Int2) from 1 to 10, 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 Objeto_cargado[Atemp_Int2]
-
-





Then - Actions
-






Set Temp_Bool = True
-






Custom script: set B=udg_Atemp_Int2
-
-





Else - Actions
-
-
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




Temp_Bool Equal to False
-
-



Then - Actions
-




Skip remaining actions
-
-



Else - Actions
-
-


Custom script: set p=GetItemPlayer(GetManipulatedItem())
-


Custom script: set i=GetItemCharges(GetManipulatedItem())
-


Item - Remove (Item being manipulated)
-


Wait 0.01 seconds
-


Custom script: set udg_Atemp_Int=i
-


Custom script: set udg_Atemp_Int2=B
-


Custom script: set udg_Dueno=p
-


Set Temp_Unit = (Triggering unit)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Temp_Unit has an item of type Objeto_cargado[Atemp_Int2]) Igual a True
-
-



Then - Actions
-




Set Temp_Item[1] = (Item carried by Temp_Unit of type Objeto_cargado[Atemp_Int2])
-




Item - Set charges remaining in Temp_Item[1] to ((Charges remaining in Temp_Item[1]) + Atemp_Int)
-
-



Else - Actions
-




Hero - Create Objeto_cargado[Atemp_Int2] and give it to Temp_Unit
-




Item - Set charges remaining in (Last created item) to Atemp_Int
-




Item - Change ownership of (Last created item) to Dueno and Cambiar color
-
-
-


Custom script: set p=null
-
-



