AlicanC
New Member
- Reaction score
- 2
I am working on an Item System. I want to limit items:
-Maximum 2 rings
-Maximum 1 boot
-Maximum 1 helmet etc.
My items names are like this "Ring of AlicanC (Level 1 Ring)", "Frozen Sword (Level 2 Weapon)"
So I make last 4 letter of my items (without ")") an item code like "Ring", "apon", "oots"; but this doesn't work.
I need help
-Maximum 2 rings
-Maximum 1 boot
-Maximum 1 helmet etc.
My items names are like this "Ring of AlicanC (Level 1 Ring)", "Frozen Sword (Level 2 Weapon)"
So I make last 4 letter of my items (without ")") an item code like "Ring", "apon", "oots"; but this doesn't work.
Code:
Check Items
Events
Unit - A unit Acquires an item
Unit - A unit Uses an item
Unit - A unit Loses an item
Unit - A unit Pawns an item (to shop)
Conditions
Actions
Set Last_Unit = (Triggering unit)
Set Last_Player = (Owner of Last_Unit)
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set IS_Last_ItemName = (Name of (Item carried by Last_Unit in slot (Integer A)))
Set IS_Last_ItemCode = (Substring(IS_Last_ItemName, ((Length of IS_Last_ItemName) - 6[B](I tried "-5" and "-4" too!)[/B]), ((Length of IS_Last_ItemName) - 1)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
IS_Last_ItemCode Equal to Ring
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
IS_Last_RingCount Equal to 2
Then - Actions
Hero - Drop the item from slot (Integer A) of Last_Unit
Game - Display to (All players) for 5.00 seconds the text: |cffff3300!Message|...
Else - Actions
Set IS_Last_RingCount = (IS_Last_RingCount + 1)
Else - Actions
Do nothing