sheep
New Member
- Reaction score
- 2
What the trigger do
In my RPG you have a hero and that hero have an equipment unit.
When the hero have a equitable item in his inventory, he clicks the item.
The item is now equiped, the heroes stats are changed, the icon symbolizing the inventory slot is switched out the icon of the new item.
Underneath there is a picture of my equipment unit. I have given every slot af number, the number can also be seen on the picture.
Every item have a code.
In the trigger "Item init" the item cloak is defined.
Set Cloak = 13100022
Black is the number of the slot where the item belongs
Red: how mutch strength the item gives
Green: how mutch agility the item gives
Blue: how mutch intelligens the item gives
The variable Equipment_stats is where i store all the item codes of the equipted items for all players. I made a picture of the variable, it is the attached file.
In this trigger I set all the spaces in equipment_stats to 00 str, 00 agi and 00 int. I also define my test item: "cloak"
The system is triggered by using my test item Cloak.
The item Cloak have an ability called Cloak.
So there is a Item, an ability and a variable called Cloak, it might be a bit confusing.
Now for the real problem.
The problem is that my trigger goes off when ever a spell is cast because I havent been abel to make a fitting condition.
Feel free to ask questions about my trigger, suggest improvements and help me solve the problem.
In my RPG you have a hero and that hero have an equipment unit.
When the hero have a equitable item in his inventory, he clicks the item.
The item is now equiped, the heroes stats are changed, the icon symbolizing the inventory slot is switched out the icon of the new item.
Underneath there is a picture of my equipment unit. I have given every slot af number, the number can also be seen on the picture.
Every item have a code.
In the trigger "Item init" the item cloak is defined.
Set Cloak = 13100022
Black is the number of the slot where the item belongs
Red: how mutch strength the item gives
Green: how mutch agility the item gives
Blue: how mutch intelligens the item gives
The variable Equipment_stats is where i store all the item codes of the equipted items for all players. I made a picture of the variable, it is the attached file.
In this trigger I set all the spaces in equipment_stats to 00 str, 00 agi and 00 int. I also define my test item: "cloak"
Trigger:
- Item init
- Events
- Time - Elapsed game time is 1.00 seconds
- Conditions
- Actions
- -------- No items --------
- For each (Integer A) from 1 to 10, do (Actions)
- Loop - Actions
- For each (Integer B) from 1 to 10, do (Actions)
- Loop - Actions
- Set Equipment_stats[((Integer B) + (10 x (Integer A)))] = (((Integer B) + ((Integer A) x 10)) x 1000000)
- Loop - Actions
- For each (Integer B) from 1 to 10, do (Actions)
- Loop - Actions
- -------- Cloak --------
- Set Cloak = 13100022
- Events
The system is triggered by using my test item Cloak.
The item Cloak have an ability called Cloak.
So there is a Item, an ability and a variable called Cloak, it might be a bit confusing.
Now for the real problem.
The problem is that my trigger goes off when ever a spell is cast because I havent been abel to make a fitting condition.
Trigger:
- Equiping items
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- Actions
- -------- Items --------
- If ((Ability being cast) Equal to Cloak ) then do (Set loadi = Cloak) else do (Do nothing)
- -------- Init --------
- Set Temp_ability = (Ability being cast)
- -------- Subtracting stats --------
- Hero - Modify Strength of (Casting unit): Subtract Equipment_stats[(Integer((Substring((String((((Integer((Substring((String(loadi)), 1, 2)))) - 10) + (10 x (Player number of (Triggering player)))))), 3, 4))))]
- Hero - Modify Agility of (Casting unit): Subtract Equipment_stats[(Integer((Substring((String((((Integer((Substring((String(loadi)), 1, 2)))) - 10) + (10 x (Player number of (Triggering player)))))), 5, 6))))]
- Hero - Modify Strength of (Casting unit): Subtract Equipment_stats[(Integer((Substring((String((((Integer((Substring((String(loadi)), 1, 2)))) - 10) + (10 x (Player number of (Triggering player)))))), 7, 8))))]
- -------- Saving stats --------
- Set Equipment_stats[(((Integer((Substring((String(loadi)), 1, 2)))) - 10) + (10 x (Player number of (Triggering player))))] = loadi
- -------- Adding stats --------
- Hero - Modify Strength of (Casting unit): Add (Integer((Substring((String(loadi)), 3, 4))))
- Hero - Modify Agility of (Casting unit): Add (Integer((Substring((String(loadi)), 5, 6))))
- Hero - Modify Intelligence of (Casting unit): Add (Integer((Substring((String(loadi)), 7, 8))))
- -------- Remove old spell --------
- If ((Integer((Substring((String(loadi)), 1, 2)))) Equal to 13) then do (Unit - Remove Equipment_abilitys[(3 + ((Player number of (Triggering player)) x 10))] from Equipment[(Player number of (Triggering player))]) else do (-------- Head --------)
- If ((Integer((Substring((String(loadi)), 1, 2)))) Equal to 12) then do (Unit - Remove Equipment_abilitys[(2 + ((Player number of (Triggering player)) x 10))] from Equipment[(Player number of (Triggering player))]) else do (-------- gloves --------)
- If ((Integer((Substring((String(loadi)), 1, 2)))) Equal to 11) then do (Unit - Remove Equipment_abilitys[(1 + ((Player number of (Triggering player)) x 10))] from Equipment[(Player number of (Triggering player))]) else do (-------- Neckless --------)
- -------- Inset new --------
- Unit - Add Temp_ability to Equipment[(Player number of (Triggering player))]
- Set Equipment_abilitys[(((Integer((Substring((String(loadi)), 1, 2)))) - 10) + (10 x (Player number of (Triggering player))))] = Temp_ability
- Events
Feel free to ask questions about my trigger, suggest improvements and help me solve the problem.