mob
verb
Attack(mob/M as mob in oview(1))
var/damage = rand(usr.strength-M.defense)
if(damage <= 0)
usr << "[M] easily dodges your attack!"
M << "You easily dodge [usr]'s attack."
else
M.hp -= damage
view() << "[usr] attacks [M] for [damage] Damage!"
M:DeathCheck()
mob
proc
DeathCheck()
if(src.hp <= 0)
view() << "[src] dies!"
src.hp = 10
if(monster == 1)
del(src)
else
src.Move(locate(1,1,1))
ID:146983
![]() Nov 20 2004, 2:29 pm
|
|
Below is my attack verb and deathcheck proc, they work fine, i can attack monsters, but one problem, how do i make the monsters attack me back? Please help. Thanks.
|
![]() Nov 20 2004, 2:35 pm
|
|
Dude, I don't think you are going to get an answer, this is the third time you've posted this, and the other two didn't get answers. So, this is the THIRD post on the SAME topic, all within what..24 hours? 12 hours? less?
|
Just look for a demo or library in the search. You could have found it if Kunark still had RPG tutorial but he just took it off the hub.
|
You have to create an A.I. loop. Basically, you just have to create something of a looping procedure that tells the monsters to walk towards players, and attack them. This is the second simplest kind of monster A.I. in my opinion.
I'm not the best at this kind of thing, but I'l give this a stab. mob/npc This should do it. And by the way, I'm certain other people may have brought this up, but it is rude to make multiple posts if your question dies. If nobody answers, wait a day and try again. DO NOT, however, make multiple posts on different forums on the same topic. You really annoy people when you do stuff like this. Plus, try making your title a bit more descriptive. "Please help" doesn't say a lot. I'd have titled it something along the lines of "Enemy AI help.". Just a heads up for next time. |
Lenox wrote:
Dude, I don't think you are going to get an answer, this is the third time you've posted this, and the other two didn't get answers. So, this is the THIRD post on the SAME topic, all within what..24 hours? 12 hours? less? I agree with Lenox, you shouldn't post the same thing 3 times in the same day. If you question doesn't get answered within a short period of time that doesn't mean you need to repost your question again. Anyways, this post should be in newbie central. |
YMIHere wrote:
Zaltron wrote: *checks newbie central* You're right, but that makes 4 times <_<. I'm annoyed though; I wrote up a really long and in-depth mini-tutorial for this, but then, I accidently pressed Ctrl+B(Back) instead of Ctrl+V(Paste) <_< |