- Joined
- Jan 14, 2005
- Messages
- 73
K my spell triggers broken, Its supposed to add a spell any time the hero buys an item, but it only adds the first skill bought
Also All the items are classified as misc but the comparison Is item-class Misc doesnt work? it makes it so the trigger doesnt do anything
Edit: The Display Text and Wait Function are simply for debuging. The Misc Check doesnt work (if its not off then nothing happens), and the hero will never get more then 1 skill
Edit2: I found out that for some reason after getting the first skill it doesnt go back to loop 1-1, it goes 1-2,2-1 then stops without actually adding the skill to the hero
Thx MortAr (
Also All the items are classified as misc but the comparison Is item-class Misc doesnt work? it makes it so the trigger doesnt do anything
-
Hero Spells
-
Events
-
Unit - A unit Acquires an item
-
-
Conditions
-
(Item-class of (Item being manipulated)) Equal to Miscellaneous
-
-
Actions
-
For each (Integer A) from 0 to 10, do (Actions)
-
Loop - Actions
-
Wait 1.00 seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Player_Skill_Slots_Used[(Player number of (Owner of (Hero manipulating item)))] Less than 7
-
Skill_Item[(Integer A)] Equal to (Item-type of (Item being manipulated))
-
(Level of Skills[(Integer A)] for (Hero manipulating item)) Less than 1
-
-
Then - Actions
-
Unit - Add Skills[(Integer A)] to (Hero manipulating item)
-
Set PlayerSkills[((((Player number of (Owner of (Hero manipulating item))) - 1) x 7) + Player_Skill_Slots_Used[(Player number of (Owner of (Hero manipulating item)))])] = Skills[(Integer A)]
-
Set Player_Skill_Slots_Used[(Player number of (Owner of (Hero manipulating item)))] = (Player_Skill_Slots_Used[(Player number of (Owner of (Hero manipulating item)))] + 1)
-
Item - Remove (Item being manipulated)
-
Game - Display to (All players) the text: (1-1, + (String((Integer A))))
-
-
Else - Actions
-
Game - Display to (All players) the text: (1-2, + (String((Integer A))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Skill_Item[(Integer A)] Equal to (Item-type of (Item being manipulated))
-
MaxSkill_Level[(Integer A)] Greater than (Level of Skills[(Integer A)] for (Hero manipulating item))
-
-
Then - Actions
-
Game - Display to (All players) the text: (2-1, + (String((Integer A))))
-
Item - Remove (Item being manipulated)
-
Unit - Increase level of Skills[(Integer A)] for (Hero manipulating item)
-
-
Else - Actions
-
Game - Display to (All players) the text: (2-2, + (String((Integer A))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Skill_Item[(Integer A)] Equal to (Item-type of (Item being manipulated))
-
(MaxSkill_Level[(Integer A)] Equal to (Level of Skills[(Integer A)] for (Hero manipulating item))) or (Player_Skill_Slots_Used[(Player number of (Owner of (Hero manipulating item)))] Equal to 7)
-
-
Then - Actions
-
Game - Display to (All players) the text: (3-1, + (String((Integer A))))
-
Item - Remove (Item being manipulated)
-
Player - Add 1 to (Owner of (Hero manipulating item)) Current lumber
-
-
Else - Actions
-
Game - Display to (All players) the text: (3-2, + (String((Integer A))))
-
Do nothing
-
-
-
-
-
-
-
-
-
-
-
Initialize Variables
-
Events
-
Time - Elapsed game time is 0.00 seconds
-
-
Conditions
-
Actions
-
-------- These are the skills, these should have 2 per skill --------
-
Set Skill_Item[0] = Critical Strike
-
Set Skills[0] = Critical Strike
-
Set Skill_Item[1] = Blizzard
-
Set Skills[1] = Blizzard
-
Set Skill_Item[2] = Bash
-
Set Skills[2] = Bash
-
Set Skill_Item[3] = Heal
-
Set Skills[3] = Heal
-
Set Autocast_Ability[3] = True
-
Set Skills[4] = Envenomed Strike
-
Set Skill_Item[4] = Envenomed Strike
-
Set Skills[5] = Thorns Aura (Neutral Hostile)
-
Set Skill_Item[5] = Thorns Aura
-
-
Edit: The Display Text and Wait Function are simply for debuging. The Misc Check doesnt work (if its not off then nothing happens), and the hero will never get more then 1 skill
Edit2: I found out that for some reason after getting the first skill it doesnt go back to loop 1-1, it goes 1-2,2-1 then stops without actually adding the skill to the hero
Thx MortAr (
Code:
to [trigger])
Edit3: Debugged untill i got a result, Now i know that for some reason after buying the skill item it starts adding +1 to player skills variable making it jump to 7 and then u cant buy skills anymore,still no idea why this happens :\ stupid awsome world editor
Last edited: