- Joined
- Nov 21, 2016
- Messages
- 30
So i have that dynamic shop system but i can't get it to work as intended first i have a DB of the products and the materials
then i have i trigger to set some values
then finally the recipes actual trigger
and yes i'm creating that hash first
but sometimes the final item won't come or the recipe isn't removed
-
ItenVarset
-
Events
- Time - Elapsed game time is 0.10 seconds
- Conditions
-
Actions
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Agility Relic
- Set AttackSpeed[ItemArray] = 36
- Set ItemValue[ItemArray] = 5
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Agility Stone
- Set AttackSpeed[ItemArray] = 15
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Clarity Shard
- Set ManaRegen[ItemArray] = 150
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Clarity Stone
- Set ManaRegen[ItemArray] = 195
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Health Crystal
- Set Health[ItemArray] = 230
- Set ItemValue[ItemArray] = 3
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Health Relic
- Set Health[ItemArray] = 380
- Set ItemValue[ItemArray] = 5
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Health Shard
- Set Health[ItemArray] = 85
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Mana Crystal
- Set Mana[ItemArray] = 150
- Set ItemValue[ItemArray] = 3
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Mana Shard
- Set Mana[ItemArray] = 85
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Mana Stone
- Set Mana[ItemArray] = 105
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Power Crystal
- Set Damage[ItemArray] = 16
- Set ItemValue[ItemArray] = 3
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Power Relic
- Set Damage[ItemArray] = 27
- Set ItemValue[ItemArray] = 5
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Power Shard
- Set Damage[ItemArray] = 6
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Vitality Shard
- Set LifeRegen[ItemArray] = 2
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- -------- -------------------------------------------------------------------- --------
- Set ItemArray = (ItemArray + 1)
- Set ItemType[ItemArray] = Vitality Stone
- Set LifeRegen[ItemArray] = 4
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = 25
- -------- ------------------------------------Basics End's Here-------------------------------- --------
- Set ItemType[ItemArray] = Throwing Axe
- Set ItemRecipe[ItemArray] = Throwing Axe (Recipe)
- Set ItemValue[ItemArray] = 1
- Set ItemCost[ItemArray] = 0
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Blood Pendant
- Set ItemRecipe[ItemArray] = Blood Pendant (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Glacial Gem
- Set ItemRecipe[ItemArray] = Glacial Gem (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Sage Circlet
- Set ItemRecipe[ItemArray] = Sage Circlet (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Fel Blade
- Set ItemRecipe[ItemArray] = Fel Blade (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Silver Buckler
- Set ItemRecipe[ItemArray] = Silver Buckler (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Enduring Helm
- Set ItemRecipe[ItemArray] = Enduring Helm (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 1
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Reaper's Scythe
- Set ItemRecipe[ItemArray] = Reaper's Scythe (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Elder Stone
- Set ItemRecipe[ItemArray] = Elder Stone (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Healing Rod
- Set ItemRecipe[ItemArray] = Healing Rod (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Empowered Bracer
- Set ItemRecipe[ItemArray] = Empowered Bracer (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Cleric Chalice
- Set ItemRecipe[ItemArray] = Cleric Chalice (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Dampening Cloak
- Set ItemRecipe[ItemArray] = Dampening Cloak (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Captain's Crest
- Set ItemRecipe[ItemArray] = Captain's Crest (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 2
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Crystalline Shiv
- Set ItemRecipe[ItemArray] = Crystalline Shiv (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 3
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Windrush
- Set ItemRecipe[ItemArray] = Windrush (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 3
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Archmage's Ring
- Set ItemRecipe[ItemArray] = Archmage's Ring (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 3
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Seer's Eye
- Set ItemRecipe[ItemArray] = Seer's Eye (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 3
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Arcane Emblem
- Set ItemRecipe[ItemArray] = Arcane Emblem (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 3
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
- Set ItemType[ItemArray] = Ranger's Vest
- Set ItemRecipe[ItemArray] = Ranger's Vest (Recipe)
- Set ItemCost[ItemArray] = 0
- Set ItemValue[ItemArray] = 3
- Set ItemId[ItemArray] = ItemArray
- Set ItemArray = (ItemArray + 1)
- -------- -------------------------------------------------------------------- --------
-
Events
-
VarSet
-
Events
- Unit - A unit Sells an item (from shop)
- Conditions
-
Actions
-
For each (Integer A) from 1 to 100, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- ItemType[(Integer A)] Equal to (Item-type of (Sold Item))
- ItemRecipe[(Integer A)] Equal to (Item-type of (Sold Item))
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-class of (Sold Item)) Equal to Permanent
-
Then - Actions
- Item - Set the custom value of (Sold Item) to ItemId[(Integer A)]
-
Else - Actions
- Item - Set the custom value of (Sold Item) to ItemId[(Integer A)]
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 100, do (Actions)
-
Events
-
ShopNovo
-
Events
- Unit - A unit Acquires an item
-
Conditions
- (Item-class of (Item being manipulated)) Equal to Campaign
-
Actions
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
-
For each (Integer B) from 1 to 6, do (Actions)
-
Loop - Actions
-
For each (Integer d) from 1 to 6, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item-class of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Permanent
- (Item-class of (Item carried by (Triggering unit) in slot (Integer B))) Equal to Permanent
- (Item-class of (Item carried by (Triggering unit) in slot d)) Equal to Permanent
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Integer A) Not equal to (Integer B)
- (Integer A) Not equal to d
- d Not equal to (Integer B)
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (ItemValue[(Custom value of (Item carried by (Triggering unit) in slot (Integer B)))] + (ItemValue[(Custom value of (Item carried by (Triggering unit) in slot d))] + ItemValue[(Custom value of (Item carried by (Triggering unit) in slot (Integer A)))])) Equal to ItemValue[(Custom value of (Item being manipulated))]
-
Then - Actions
- Hashtable - Save ItemValue[(Custom value of (Item carried by (Triggering unit) in slot (Integer A)))] as 1 of (Key (Item carried by (Triggering unit) in slot (Integer A))) in ShopHash
- Hashtable - Save ItemValue[(Custom value of (Item carried by (Triggering unit) in slot (Integer B)))] as 2 of (Key (Item carried by (Triggering unit) in slot (Integer B))) in ShopHash
- Hashtable - Save ItemValue[(Custom value of (Item carried by (Triggering unit) in slot d))] as 3 of (Key (Item carried by (Triggering unit) in slot d)) in ShopHash
- Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
- Item - Remove (Item carried by (Triggering unit) in slot (Integer B))
- Item - Remove (Item carried by (Triggering unit) in slot d)
- Hero - Create ItemType[(Custom value of (Item being manipulated))] and give it to (Triggering unit)
- Item - Remove (Item being manipulated)
- Skip remaining actions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer d) from 1 to 6, do (Actions)
-
Loop - Actions
-
For each (Integer B) from 1 to 6, do (Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 6, do (Actions)
-
Events
but sometimes the final item won't come or the recipe isn't removed