Jump to content
  • 0
ThyroDree

@pk command by Dastgir

Question

Hello Everyone!!

I'm just looking for some help here about sir Dastgirs PK plugin command, I got the latest PK Plugin.. when I run the plugin to my server. There's a problem, mostly servers who are using @pk command are set as PK mode server in misc.conf..

Quote

// PK Server Mode.
//   Turns entire server pvp(excluding towns).
//   Experience loss is doubled if killed by another player.
//   When players hunt monsters over 20 levels higher, they will receive 15%
//   additional exp., and 25% chance of receiving more items.
//   There is a nopvp.txt for setting up maps not to have pk on in this mode.
//   Novices cannot be attacked and cannot attack.
//   Normal pvp counter and rank display are disabled as well.
// Note: If pk_mode is set to 2 instead of 1, players will receive a
//   manner penalty of 5 each time they kill another player (see manner_system
//   config to adjust how this will affect players)
pk_mode: 1

So, my server is set to pk mode server and has this plugin 

Then I logged in 2 accounts to test the plugin, One character has PK mode & the other character has disabled PK (Used PK Plugin).. Supposedly both character cannot attack each other or they cannot cast skills on each other.. but they can!

Anyone can help me with this? :S

Share this post


Link to post
Share on other sites

15 answers to this question

Recommended Posts

  • 0

Your server is pk mode, so obviously they can attack anywhere to anyone.

You don't need pk mode to be enabled to use this plugin.

Share this post


Link to post
Share on other sites
  • 0
On 11/18/2017 at 2:36 PM, Dastgir said:

Your server is pk mode, so obviously they can attack anywhere to anyone.

You don't need pk mode to be enabled to use this plugin.

I tried to disable the PK Mode in Misc.conf, and toggled @pk with 2 character.. They both can attack each other but the cursor doesn't change, you must push the SHIFT button to have the sword cursor (attack cursor).

Share this post


Link to post
Share on other sites
  • 0
9 hours ago, ThyroDree said:

I tried to disable the PK Mode in Misc.conf, and toggled @pk with 2 character.. They both can attack each other but the cursor doesn't change, you must push the SHIFT button to have the sword cursor (attack cursor).

client side restriction, there is nothing we can do about that

the sword cursor are hard-coded in the client side and only change to sword depends on unittype - monster/player/pets - and the mapflags

Share this post


Link to post
Share on other sites
  • 0
10 hours ago, AnnieRuru said:

client side restriction, there is nothing we can do about that

the sword cursor are hard-coded in the client side and only change to sword depends on unittype - monster/player/pets - and the mapflags

When PK Mode in Misc.conf is enabled, the cursor changes to sword cursor automatically but it cant switch of by using the pk command.

Share this post


Link to post
Share on other sites
  • 0
15 minutes ago, ThyroDree said:

When PK Mode in Misc.conf is enabled, the cursor changes to sword cursor automatically but it cant switch of by using the pk command.

because in a pk server, every map is considered a pvp map
have to manually turn off by pvp off mapflag

Share this post


Link to post
Share on other sites
  • 0

isn't possible that this PK Plugin cannot disable the pk mode on each player?

and only its only applicable when the pk server is disabled at misc.conf? (but the cursor doesn't change if targeted to a player).

Share this post


Link to post
Share on other sites
  • 0

that's why I also don't really understand what is this plugin about, see the last few posts
the original patch from eathena was like that too

maybe some one should clarify to me again what this @pk really do ...

all I know is this .... plugin is popular, but I don't really know its intended purposes

Share this post


Link to post
Share on other sites
  • 0

Hello Ms. Annie,

I am using @pk commands for years since rAthena. It is being used in a High Rate server which is a PK Enabled on all maps because players want a different view of PK Place other than PvP Room. Sometimes, @pk is being used when a player wants to only farm and doesn't want to be killed. Sometimes, being used by newbies or if you have a Gold Room, they're also using it to avoid being killed.

Share this post


Link to post
Share on other sites
  • 0

so in other words, @pk command is actually use to turn off the pk mode instead of turn on ?

this actually reminds me of Diablo 2 ...
when press the P, in multiplayer mode, there is a double sword icon
press that will enable players to kill each other ...
image below found on internet ... google search image
225px-Party-menu1.jpg

in other words, @pk mode is use only on pk server,
and players can only enable the @pk mode in town, when they leave the map they can kill other players that also has @pk on right ?

Share this post


Link to post
Share on other sites
  • 0

Yes, I am making a high rate server same as si @Begin said, a PK Enabled Server that can be disabled via command by a player who doesn't want to be killed.

Is this possible in hercules to have?

Share this post


Link to post
Share on other sites
  • 0

Yes, Ms. Annie. You can only use the command in towns to prevent the abuse. You can also turn it ON or OFF. Only @PK ON enabled outside towns can kill each other while @PK OFF players cannot attack nor hit by other players. I dont really understand the request of Thyro because this plugin is already a good one and same like other old @pk scripts.

Share this post


Link to post
Share on other sites
  • 0
10 minutes ago, Begin said:

Yes, Ms. Annie. You can only use the command in towns to prevent the abuse. You can also turn it ON or OFF. Only @PK ON enabled outside towns can kill each other while @PK OFF players cannot attack nor hit by other players. I dont really understand the request of Thyro because this plugin is already a good one and same like other old @pk scripts.

@Begin I tried to use the plugin with PK Mode enabled (Misc.conf), the plugin can't disable or turn off the pk when a character used @pk off.

 I can still attack the character that disabled or turned off the pk..

Share this post


Link to post
Share on other sites
  • 0

Lemme check it again in my test server. Will update you.

----

I now get your point. The @pk is not working. Players can still attack each other even you are on PK OFF state.

Edited by Begin

Share this post


Link to post
Share on other sites
  • 0
52 minutes ago, Begin said:

Lemme check it again in my test server. Will update you.

----

I now get your point. The @pk is not working. Players can still attack each other even you are on PK OFF state.

Thank you,

Yes sir, i think its only applicable if the pk mode is off in misc.conf but the cursor doesnt change to attack mode, you must hold shift to attack when pk command is on. :o 

Share this post


Link to post
Share on other sites
  • 0

Hi anyone can update on this? This is way back 2018,\

Anyone can update this plugin? I have working plugin with no errors but the problem is It doesnt change the status of player (PK ON / OFF)

It will be a great help for us using Herc Plugin features, but this is outdated and needs to fix.

//===== Hercules Plugin ======================================
//= @pk command
//===== By: ==================================================
//= AnnieRuru (v1.1)
//===== Modified By: =========================================
//= Dastgir
//===== Current Version: =====================================
//= v1.3
//===== Compatible With: ===================================== 
//= Hercules
//===== Description: =========================================
//= PK Mode
//===== Topic ================================================
//= http://herc.ws/board/topic/11004-/
//============================================================

#include "common/hercules.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "map/atcommand.h"
#include "map/battle.h"
#include "map/clif.h"
#include "map/map.h"
#include "map/pc.h"

#include "common/memmgr.h"

#include "plugins/HPMHooking.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
	"@pk",
	SERVER_TYPE_MAP,
	"1.3",
	HPM_VERSION,
};

// bitwise checking
enum {
	PK_ENABLE_TOWN = 1,
	PK_ENABLE_OTHER = 2,
	PK_ENABLE_ALL = 3,
};

int config_delay = 5; // After turn pk on/off, how many seconds delay before the player allow to pk on/off ?

// maps where @pk command can be used
int enable_maps = PK_ENABLE_TOWN;
// Which map player can actually pk
int pk_maps = PK_ENABLE_ALL;

struct player_data {
	unsigned int pkmode :1;
	int pkmode_delay;
};

ACMD(pk)
{
	struct player_data *ssd;
	char output[CHAT_SIZE_MAX];
	if (!( ssd = getFromMSD(sd,0))) {
		CREATE(ssd, struct player_data, 1);
		ssd->pkmode = 0;
		addToMSD(sd, ssd, 0, true);
	}
	if ((enable_maps&PK_ENABLE_ALL) == 0 && (enable_maps&PK_ENABLE_TOWN) > 0 && !map->list[sd->bl.m].flag.town) {
		clif->message(sd->fd, "You can only change your PK state in towns.");
		return false;
	}
	if ((enable_maps&PK_ENABLE_ALL) == 0 && (enable_maps&PK_ENABLE_OTHER) > 0 && map->list[sd->bl.m].flag.town) {
		clif->message(sd->fd, "You cannot change your PK state in towns.");
		return false;
	}
	if (ssd->pkmode_delay + config_delay > (int)time(NULL)) {
		safesnprintf(output, CHAT_SIZE_MAX, "You must wait %d seconds before using this command again.", ssd->pkmode_delay + config_delay - (int)time(NULL));
		clif->message(sd->fd, output);
		return false;
	}
	if (ssd->pkmode == 0) {
		ssd->pkmode = 1;
		clif->message(sd->fd, "Your PK state is now ON");
	} else {
		ssd->pkmode = 0;
		clif->message(sd->fd, "Your PK state is now OFF");
	}
	ssd->pkmode_delay = (int)time(NULL);
	return true;
}

int battle_check_target_post(int retVal, struct block_list *src, struct block_list *target, int flag)
{
	if (retVal != 1 && src->type == BL_PC && target->type == BL_PC) {
		struct map_session_data *sd = BL_CAST(BL_PC, src);
		struct map_session_data *targetsd = BL_CAST(BL_PC, target);

		if ((pk_maps&PK_ENABLE_TOWN && map->list[sd->bl.m].flag.town) || (pk_maps&PK_ENABLE_OTHER && map->list[sd->bl.m].flag.town)) {
			if (sd->status.account_id != targetsd->status.account_id) {
				struct player_data *src_pc = getFromMSD(sd, 0);
				struct player_data *target_pc = getFromMSD(targetsd, 0);
				if (src_pc != NULL && target_pc != NULL && src_pc->pkmode && target_pc->pkmode) {
					hookStop();
					return 1;
				}
			}
		}
	}
	return retVal;
}

HPExport void plugin_init(void)
{
	addAtcommand("pk", pk);
	addHookPost(battle, check_target, battle_check_target_post);
}

HPExport void server_online(void)
{
	ShowInfo("'%s' Plugin by Dastgir/Hercules. Version '%s'\n", pinfo.name, pinfo.version);
}

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.