Hello everyone, I ripped and edited this code from PICCETA, but the only reason I edited it is because it didnt work right when I first put it in, so the editing is ok I guess but I want it to rely on the Stats of the hero and I haven't gotten an idea on how to have it hit the hero, if someone can help me fix this code to work perfectly (for all enemys made) I would be very grateful. Also for those stuck for storylines, I'm good at making storylines come to life.
Common Events Name: Battle
Trigger: Parallel Process
Trigger Switch: Battle
Variable Oper: [HeroATK] Set, Hero Attack
Variable Oper: [HeroDEF] Set, Hero Attack
Variable Oper: [HeroEVD] Set, Hero Attack
Variable Oper: [HeroMAG] Set, Hero Attack
Variable Oper: [HeroX] Set, Hero Attack
Variable Oper: [HeroY] Set, Hero Attack
Variable Oper: [EnemyX] Set, Hero Attack
Variable Oper: [EnemyY] Set, Hero Attack
Variable Oper: [EnemyATK] Set, [Blank]
Variable Oper: [EnemyDEF] Set, [Blank]
Variable Oper: [EnemyMAG] Set, [Blank]
Branch if Hero Up Facing
Branch if Var [HeroX] is [EnemyX] Equal
Variable Oper: [Temp] Set, Var [HeroY]
Wait 0.1 Sec
Variable Oper: [Temp] - , Var [EnemyY] Value
Branch if Var [Temp] is 2 Less
Variable Oper [Temp] Set, Var [HeroX] Value
Wait 0.1 Sec
Variable Oper: [EnemyY] - , Var [Temp] Value
Branch if Var [Temp] is 2 less
Flash Sprite: <Enemy>, 0.5 Sec
Variable Oper: [Enemy1hp] - , 2
Message Display Options: Transp, Bottom, Fixed, Processes Continue
Message: Enemy HP:[ \v[Enemy1hp] ]
Move Event: <Enemy> Lock Facing, Move Away from Hero, Unlock Facing\
Branch if Var [enemy1hp] is 0 less
Switch Operation: [enemy1die] ON
Message: Battle Won
<b>code needed: <EXP> Gained </b>
:End
Wait: Until Key Pressed
:End
:End
:End
:End
Branch if Hero Down Facing
Branch if Var [HeroX] is [EnemyX] Equal
Variable Oper: [Temp] Set, Var [HeroY]
Wait 0.1 Sec
Variable Oper: [Temp] - , Var [EnemyY] Value
Branch if Var [Temp] is 2 Less
Variable Oper [Temp] Set, Var [HeroX] Value
Wait 0.1 Sec
Variable Oper: [EnemyY] - , Var [Temp] Value
Branch if Var [Temp] is 2 less
Flash Sprite: <Enemy>, 0.5 Sec
Variable Oper: [Enemy1hp] - , 2
Message Display Options: Transp, Bottom, Fixed, Processes Continue
Message: Enemy HP:[ \v[Enemy1hp] ]
Move Event: <Enemy> Lock Facing, Move Away from Hero, Unlock Facing\
Branch if Var [enemy1hp] is 0 less
Switch Operation: [enemy1die] ON
Message: Battle Won
<b>code needed: <EXP> Gained </b>
:End
Wait: Until Key Pressed
:End
:End
:End
:End
Branch if Hero Right Facing
Branch if Var [HeroY] is [EnemyY] Equal
Variable Oper: [Temp] Set, Var [HeroX]
Wait 0.1 Sec
Variable Oper: [Temp] - , Var [EnemyX] Value
Branch if Var [Temp] is 2 Less
Variable Oper [Temp] Set, Var [HeroY] Value
Wait 0.1 Sec
Variable Oper: [EnemyX] - , Var [Temp] Value
Branch if Var [Temp] is 2 less
Flash Sprite: <Enemy>, 0.5 Sec
Variable Oper: [Enemy1hp] - , 2
Message Display Options: Transp, Bottom, Fixed, Processes Continue
Message: Enemy HP:[ \v[Enemy1hp] ]
Move Event: <Enemy> Lock Facing, Move Away from Hero, Unlock Facing\
Branch if Var [enemy1hp] is 0 less
Switch Operation: [enemy1die] ON
Message: Battle Won
<b>code needed: <EXP> Gained </b>
:End
Wait: Until Key Pressed
:End
:End
:End
:End
Branch if Hero Left Facing
Branch if Var [HeroY] is [EnemyY] Equal
Variable Oper: [Temp] Set, Var [HeroX]
Wait 0.1 Sec
Variable Oper: [Temp] - , Var [EnemyX] Value
Branch if Var [Temp] is 2 Less
Variable Oper [Temp] Set, Var [HeroY] Value
Wait 0.1 Sec
Variable Oper: [EnemyX] - , Var [Temp] Value
Branch if Var [Temp] is 2 less
Flash Sprite: <Enemy>, 0.5 Sec
Variable Oper: [Enemy1hp] - , 2
Message Display Options: Transp, Bottom, Fixed, Processes Continue
Message: Enemy HP:[ \v[Enemy1hp] ]
Move Event: <Enemy> Lock Facing, Move Away from Hero, Unlock Facing\
Branch if Var [enemy1hp] is 0 less
Switch Operation: [enemy1die] ON
Message: Battle Won
<b>code needed: <EXP> Gained </b>
:End
Wait: Until Key Pressed
:End
:End
:End
:End
-------------------------
Enemy Char: <name>
Trigger: Touched By Hero
Event layer: Same as Hero
Branch if Switch [enemy1die] is ON
Switch Operation: [Battle] OFF
Erase Event
:Else Handler
Variable Oper: [enemy1hp] Set, Rnd[<depends on enemy>]
Variable Oper: [EnemyATK] Set, Rnd[<depends on enemy>]
Variable Oper: [EnemyDEF] Set, Rnd[<depends on enemy>]
Variable Oper: [EnemyMAG] Set, Rnd[<depends on enemy>]
Switch Operation: [Battle] ON
<b>I think I need more coding here but not sure</b>
:End
Please any help will be appreticed.