08 May, 2007, Mordis wrote in the 1st comment:
Votes: 0
Hello this is my first post here, I'm looking for some assistance with something I'm trying to put together, I'm running a "mildly" modified version of QuickMUD.

Basicly what i'm going for is, during character creation adding a yes/no option to join the pkill system. Obviously pkilling isn't for everyone and I'd like to open it up to both the pkiller, and the social non pkiller. Now that stated. I don't want these new pkilling characters to join the pkill/clan system at level 1. Although it would be interesting to see how many level 10's sit at the enterance to "mud school". Currently I've configured my mud to "auto-loner" all characters when they hit level 15. However I only want this to trigger for people that who have opted to join the pkilling system.

Has anyone been able (or even tried) to accomplish this?

I'm guessing I'd have to add a new flag for the way the pfile is generated "pkillon = 1/0" however I haven't quite been able to wrap my head around how character creation is generated. FYI I am a novice programer, I have been able to add some new commands/features. However to date I think this is the most complicated (which I'm sure it's not, I'm just not looking at it the right way) thing I've decided to take on.

Any assistance would be great, if/when I get it working, I'll gladly post the final code for y'all to use if you want.


Thanks,
08 May, 2007, Conner wrote in the 2nd comment:
Votes: 0
Welcome aboard. :)
I don't know how quickmud is set-up (or if it's set-up for pk/non-pk at all), but you might look at how some of the other codebases handle it. For example, in smaug PK is a flag (PCFLAG_DEADLY) so you could just, in character creation, have a state like CON_GET_PKILL which is entered immediately after the question of joining the pkill system that basically does a switch with cases for N, n, Y, y, and default (if they don't give a y/n response). Your N/n cases would tell them your rules for non-PKs and move them to the next state, your case for Y/y could set the flag for them and tell them your PK rules, and your default case might look a bit like:
default:
write_to_buffer( d, "Please type Yes or No.", 0 );
break;

Overall, it should be a pretty simple addition, but again, I don't know anything about Quickmud's chargen process, let alone how your copy has been modified already.
11 May, 2007, Hades_Kane wrote in the 3rd comment:
Votes: 0
Here is what I would do…

Add an act_flag for whether or not a player can be killed or not. Say for example you call it 'PLR_PK' and then in character creation, when they select yes, have it do a "SET_BIT(ch->act,PLR_PK);"

Now, you have the basis in place for a character to PK. Your concern about the level, however, is a simple fix. Rather than having anything "activate" or anything like that, simply add a check for a PC killing another PC with consideration for both the PLR_PK flag and the level of the character. What I would recommend is working inside your 'bool is_safe' function that you can find in fight.c. Look for the comment where it says '/* player doing the killing */' and you can add in something like:

if (!IS_SET (victim->act, PLR_PK) || !IS_SET (ch->act, PLR_PK))
return TRUE;
else if (IS_SET (victim->act, PLR_PK) && victim->level >= 15
&& IS_SET (ch->act, PLR_PK) && ch->level >= 15)
return FALSE;


That should take care of it unless I overlooked something. Also, be sure your 'if (is_safe (ch, victim))' check is in do_kill (which it should already be) and make sure that it is also in any other command a character may use to attack another and it should work just fine. In fact, if you go this route, you may be able to strip all of the clan stuff out if you want the only restriction to PK be opting-in and being at least level 15.

This should be enough for you to figure it out, however if it isn't, feel free to post again :) Good luck!
11 May, 2007, kiasyn wrote in the 4th comment:
Votes: 0
be sure that it checks that victim and ch have both passed !IS_NPC checks
06 Jun, 2007, Kjwah wrote in the 5th comment:
Votes: 0
You could stick a boolean into the pc_data structure or whatever it's called(been so long since I've coded). After they login pop the question, "Will you marry me?"..

Wait.. Wrong question..

Anyways, you get my point.
18 Aug, 2007, Vorlin wrote in the 6th comment:
Votes: 0
Quickmud, from what I've been working with, doesn't have a pk opt-in section and therefore would have to have it put in.

What you can do, as mentioned, is create a boolean PK flag in the pc_data section of merc.h (this is the section that's relating to player characters only).

merc.h:
struct pc_data
{
…lots of stuff here…
bool pk_set;
}


Then you could make it so that right before CON_READ_MOTD on the new character creation in nanny.c, set ch->pcdata->pk_set = FALSE and have a new command created (something like do_pkset) that requires them to type it twice (much like the do_delete command) to confirm. Once they do, then ch->pcdata->pk_set = TRUE. Then go to fight.c and look up do_kill (you'll notice that the KILLER and THIEF flags were commented out, you could uncomment them too while you're at it), and add code in for A: checking to see if the victim is a player and not an NPC and then do a check to see if some level difference is met (like more than 7 levels below the attacker and if so, set the KILLER flag) otherwise if the victim is more than 7 levels higher, have at since they won't win probably). You might think about adding a timer in pc_data that's an int value of something like 3 minutes or something and when they attack a player, that gets set and no room is considered safe. They could be pushed, dragged, summoned, etc out of any "safe" room until that goes off. If you do, then you'd have to make sure that timer goes down with each PULSE_TICK or whatever in update.c. Actually, using PULSE_TICK and have it set to something like 5 or 6 might be easier since those go down anyways and you don't have to have it set to seconds (it's already done for you).
18 Aug, 2007, KaVir wrote in the 7th comment:
Votes: 0
Mordis said:
Basicly what i'm going for is, during character creation adding a yes/no option to join the pkill system. Obviously pkilling isn't for everyone and I'd like to open it up to both the pkiller, and the social non pkiller. Now that stated. I don't want these new pkilling characters to join the pkill/clan system at level 1. Although it would be interesting to see how many level 10's sit at the enterance to "mud school". Currently I've configured my mud to "auto-loner" all characters when they hit level 15. However I only want this to trigger for people that who have opted to join the pkilling system.


Out of curiousity…if they can't PK until level 15 anyway, why not let them decide once they've reached level 15?
19 Aug, 2007, Vorlin wrote in the 8th comment:
Votes: 0
Mordis said:
Basicly what i'm going for is, during character creation adding a yes/no option to join the pkill system. Obviously pkilling isn't for everyone and I'd like to open it up to both the pkiller, and the social non pkiller. Now that stated. I don't want these new pkilling characters to join the pkill/clan system at level 1. Although it would be interesting to see how many level 10's sit at the enterance to "mud school". Currently I've configured my mud to "auto-loner" all characters when they hit level 15. However I only want this to trigger for people that who have opted to join the pkilling system.


Hehe, I remember Sanctuary, my first mud…wasn't in the game 10 seconds and I was already ganked by a level 6 that was tweaked out. What you can do to rememdy this is add a new flag to the area data section in merc.h so that upon reading, set areas to non_pk or something (bool value would be easiest) and if you have OLC, which Quickmud does, you can add a new command so that the editor changes this from false to true (and vice versa). This allows areas like mud school and areas basically level 10 and under to be a bit more "friendly" and the other areas, especially high up, to be set true so that the more experienced players can fight it out. Of course, make sure flags are checked for KILLER and THIEF and pk timers and the like, even in non-pk areas. Course, you could go one step further and make it so that after level 5 or 10 or whatever, a player can't teleport, enter, flee, push, drag, or summon another character into those areas as they're designated newbies-only.
0.0/8