Turning off Auto-Attack

Posted by Johny on Tue 22 Feb 2005 11:51 PM — 12 posts, 39,473 views.

USA #0
Would you believe it? It's the dumbass coder again.
This time I came right out with it, how do I turn off auto attack and make people type attack to do it?
USA #1
Now now, there's no reason to call yourself that. We all started off somewhere.

This is a big change, are you sure you can handle it? Personally, I can't go into the exact ways to do it... But you'll have to find calls to multi_hit, remove those, then create an attack function that calls multi_hit, and so on.
USA #2
Make sure you distinguish between mobs and players, because you will most likely want the mobs to fight back else they'd be somewhat puny mobs. :P
USA #3
Ok I found one of those things Zeno had spoken about:

if ( IS_AWAKE(ch) && ch->in_room == victim->in_room )
retcode = multi_hit( ch, victim, TYPE_UNDEFINED );

And I think I'd change the type undefined to TYPE_ATTACK or something of that sort
USA #4
Or maybe I'd make it

if ( IS_AWAKE(ch) && ch->in_room == victim->in_room )
retcode = attack( ch, victim, TYPE_UNDEFINED );

Then insert

#COMMAND
Name attack~
Code do_multi_hit
Position 7
Level 0
Log 0
End

into the command menu, but I also need a focus option... How would I do that?
USA #5
May also want to make a new entry into the "pulse" section of update.c, that way mobs will also "type" attack, perhaps have it attacks faster with higher dex/level or something.. up to you.
#6
Old thread but the only one I could find that came close to what I want to do. Would like to be able to run into a room, smack someone upside the head then run like the dickens leading them to an ambush.

So just sounding out the steps I need to take. Helps me think when I see it and other people comment, I view it from a different angle.

Removing the auto-attack
remove flee or change to allow regular movement

what do you think?

USA #7
You would need to allow people to leave combat without incurring the flee cost, I suppose. Perhaps you could add a special attack that works like a normal attack but does not actually engage combat. Of course, the person being attacked probably would want to fight back if given the chance. Perhaps the special attack could be an attempt to hit-and-run-that-way, where the attack always occurs and the running only works if a speed check succeeds or something like that. If the speed check fails, combat is engaged as normal.
#8
See that's the thing, I want don't auto combat, nor do I want to have to type a command to move. Would just like to do, kill so and so and then go east to dodge his attack.

Now, for a semi-specific question. Earlier in this thread it mentioned changing the calls to multi-hit. Now will disabling the multi-hit also remove the ability to hit more than once per "attack".

Was thinking of removing just the flee cost for PvP to keep it from being used against mobs.
USA #9
If you don't want auto-attack, then you just need to remove that part from the code: don't have the other person start fighting. In fact, you probably don't want the fight structures at all if you want people to have to enter their attacks manually. Of course, you'll have to figure out what to do with NPCs since you probably do want the fight structures for them...

I don't know what you mean by not wanting a command to move, though, because you say that you want to let people enter commands to e.g. go east.

And yes, disabling multi-hit will remove the multiple attacks per attempt.
#10
What i mean that while in combat you type try to move east it tells you "No way! You are still fighting!" But I should have known there would be no easy fix to combat ;) I'll just have a go at writing it myself. Was hoping I could just get away with removing some if checks and call it good

USA #11
No, (un)fortunately the combat system is rather embedded in the code, so it's not a simple question of removing a check here or there. If you just removed the check that prevented the move, you might end up with people fighting each other across rooms because the fight structures are still around.