22-01-2009, 11:16 PM
pvp would be harder then npc v p, but pretty much the same concept.
With npc v p, first bring up a screen for the player where they can choose skills to use. When they pick one disable the skills and send it to the server, which will depending on the skill lower npc hp etc etc. Send packets back with the lowered hp, and also decide the npc's attack, and send it over/calculate the damage. When the client gets the npc attack packet, reenable the attack buttons, and it starts over again. Just do some checks to see if one dies and end the confrontation.
With npc v p, first bring up a screen for the player where they can choose skills to use. When they pick one disable the skills and send it to the server, which will depending on the skill lower npc hp etc etc. Send packets back with the lowered hp, and also decide the npc's attack, and send it over/calculate the damage. When the client gets the npc attack packet, reenable the attack buttons, and it starts over again. Just do some checks to see if one dies and end the confrontation.