ID:166072
 
I made a combat system where, there are some basic attacks and blocks. The problem is I have no clue how to design them so mobs can block and attack against players. I want to make it so combat starts when you click the mob. The basic combat commands are:
Sweep
Punch(left/right)
Roundhouse
Parry High(Blocks Punches, Roundhouse)
Parry Low (blocks sweep)

I need to know how to make it so mobs will have a good chance of blocking then attacking the player.
Use rand() to determine wether or not they get hit.
In response to Dice1989
i know, but like me try to break it down easier

You click the sweep button okay, and it will send a input message to you like this

You begin a low motion sweep......

Now The player or mob has 3 seconds to click parry low so that it blocks that attack

IE

If they parried on time
You parry [M]'s Sweep.
and if they dont hit it rigt
[M]'s sweep hits you for [1,000] damage.

I just need to no a Mob system that lets them chance to block and how to make them to attack.
In response to Rikishi
^bump
In response to Rikishi
This is untested and since I'm about to go to school, not enough time. use this only as an example
mob/var/sweeping=0
mob/var/parrylow=0
mob/verb/Sweep(mob/M in get_step(usr,usr.dir)) //Does a sweeping attack to a mob your facing and is one step away.
if(usr.sweeping)return //if the user is already sweeping then return
view(6)<<"[usr.name]: Sweeping" //Tells everyone in the users view six spaces away that the user is sweeping.
usr.sweeping=1 //changed the sweeping variable to one
sleep(30) // sleeps for 3 seconds
if(M.parrylow) // if the person you are trying to sweep is parrying.
view(6)<<"[M.name]: blocks [usr.name]'s sweep!" //tells everyone in the users view six spaces away that M blocks your attack.
M.parrylow=0 // changes M's parrylow variable to 0
usr.sweeping=0 //changes the user's sweeping variable to 0
else // if M.parrylow=0
usr.sweeping=0 // the user's sweeping variable is changed to one
del(M) // and M gets deleted =P.

mob/verb/Parry_Low() // Parry Low verb
if(usr.parrylow)return //if the usr is already parrying low, then return.
view(6)<<"[usr.name]: Low Parry"
usr.parrylow=1 //changes user's parrylow to 1
sleep(30) // sleeps for 3 seconds
if(usr.parrylow) // if the user's parrylow var is still true
usr.parrylow=0 //change it to 0
In response to Enfini-Desu
that works..but i still need a way to make combat start for NPC like a click button that makes them not able to move or anything.
In response to Rikishi
^