stop kill trigger

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
3 months 4 weeks ago #7978 by JTP
stop kill trigger was created by JTP
Hey

Anyone who ever made a trigger to prevent people from killing a mob...i know there are settings in medit..

But i would like it to also say something differently.

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #7988 by WhiskyTest
Replied by WhiskyTest on topic stop kill trigger
Triggers aren't my forte but...
What about teleporting the player out and back into the room?

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
3 months 3 weeks ago #7989 by JTP
Replied by JTP on topic stop kill trigger
Would prefere a Way so If they type: kill mayer

They get a message from the mayer, and fighting never begins.

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #7990 by WhiskyTest
Replied by WhiskyTest on topic stop kill trigger
Well, this stops a player from typing 'hit', but they can still 'kill', 'bash', 'kick' etc so I don't think it is going to be very useful..

Name: 'No combat', VNum: [18600], RNum: [ 1135]
Trigger Intended Assignment: Mobiles
Trigger Type: Command , Numeric Arg: 100, Arg list: hit
Commands:
%echo% Nope.

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
3 months 3 weeks ago #7993 by JTP
Replied by JTP on topic stop kill trigger
Well the problem is not solved :(

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago - 3 months 3 weeks ago #7994 by Krell
Replied by Krell on topic stop kill trigger
If you're using triggers, can't you use 'Arg list:: +' to glob any commands the player enters and then use the variable %cmd.mudcommand% to circumvent the action on the mob normally taken by the MUD? I'm not sure if this can be attached to a mob though.

> help mudcommand
MUDCOMMAND CMD.MUDCOMMAND %CMD.MUDCOMMAND% %MUDCOMMAND% CMD.MUDCOMMAND 

   Used to match text to existing commands in the MUD. This will also match
any abbreviations.
 
* check for command sit with arg chair. Also matching any abbreviations. 
if %cmd.mudcommand% == sit && chair /= %arg% && %arg%

Examples: TSTAT 81, 52, 62

> 
Last edit: 3 months 3 weeks ago by Krell.

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
3 months 2 weeks ago #8024 by JTP
Replied by JTP on topic stop kill trigger
Well hope someone May know the answer to a trigger that prevents Any form for fighing, kill, kick, bash etc.

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago - 3 months 2 weeks ago #8027 by lacrc
Replied by lacrc on topic stop kill trigger
Well I don't think there's a way to check if commands are 'violent', the commands are different ACMDs (bash is different from kill) and each has it's own checks regarding peaceful rooms for example.

You would have to create a script that checks all commands that you want to check (just like Krell said). But I think the arg needs to be set to '*' and not '+' maybe?

The script would be something like:
if (%cmd.mudcommand% == kill || %cmd.mudcommand% == kick || %cmd.mudcommand% == bash || ... )
    ....
end
Last edit: 3 months 2 weeks ago by lacrc.

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
3 months 2 weeks ago #8028 by JTP
Replied by JTP on topic stop kill trigger
Ohh that wil be complicated, think i have 65 offensive skills

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago - 3 months 2 weeks ago #8029 by Krell
Replied by Krell on topic stop kill trigger
You could do it as a switch if it makes it easier to read and keep track of which skills you're checking.

switch %cmd.mudcommand%
  case kill
  ....
  break
  case kick
etc... 

But there may be a limit on how many cases you can switch on. If so you may have to do a spec proc in the codebase.

Good luck.
Last edit: 3 months 2 weeks ago by Krell.

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago #8030 by Krell
Replied by Krell on topic stop kill trigger

lacrc wrote: (lke Krell said). But I think the arg needs to be set to '*' and not '+' maybe?


Yeah, when I'm responding on my phone I can't always tell if I'm entering the * or + with my soft keyboard. Editing on this forum with a phone is also a pain as it's hard to expand the field without a lot of fiddling. :(

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago #8031 by thomas
Replied by thomas on topic stop kill trigger

Editing on this forum with a phone is also a pain as it's hard to expand the field without a lot of fiddling. :(

Hmm.. I think that should be fixable. I'll look into it.

About the original question - this is a case where there is no relevant triggers. As the suggestions show, a command trigger for this quickly becomes unwieldy. If you add all of your damaging skills here, what do you do with casters? And when you add a spell, it's another place to make sure you add it.

So, no trigger types make sense here. Let's make a new one. I'll just show you the general idea:
- Add new mob trigger type in dg_, and add one to the max in dg_olc.h.
- Add the text for it in constants.h
- Add a trigger handler in dg_triggers.c/h
- Now, add a trigger check in damage() in fight.c, just after the peaceful room check
Make it respect the return value, -1 means disallow damage (as if room was peaceful), 0 means miss, >0 means do this damage. Default is just to do the same damage.

I've created a branch in github showing how it works: github.com/tbamud/tbamud/compare/damager...er-addition?expand=1

Also, a trigger to show it off - this one stops the fight from starting:
1) Name         : Damage trigger example
2) Intended for : Mobiles
3) Trigger types: Damage 
4) Numeric Arg  : 100
5) Arguments    : 
6) Commands:
%echo% Damage trigger triggered
%echo% actor: %actor.name%
%echo% victim: %victim.name%
%echo% dam: %damage%
%echo% attacktype: %attacktype%
return -1
The following user(s) said Thank You: Krell, lacrc

Please Log in or Create an account to join the conversation.

More
3 months 1 week ago #8065 by Parnassus
Replied by Parnassus on topic stop kill trigger
There are various ways to do anything, depending on the situation.

Personal story here: when I was working on a Smaug mud, a friend asked, "Why do paladins get disarm? How honourable is it to knock away someone's weapon and fight an unarmed person?" That led me to write a trigger. The paladin-type king would take all and then try to disarm the player. If successful, the king would teleport out to a dump room, drop all, wait (I think it was 2 sec), heal himself, teleport back and take all again. The pause would be enough to stop the fight without actually being visible to the player if there's no teleport message. I didn't like the message about fighting someone who wasn't there but the rest worked well. The king would have the weapon because of that second take all, give it back to the player and suggest they stop fighting.

If it's not the fighting so much as the killing that you want to stop, have the mob keep repairing any damage and you can add the message you want to the trigger.

Please Log in or Create an account to join the conversation.

Time to create page: 1.612 seconds