Jump to content

Dark Theme was set as default for all members. Please report any issues here.

  • 0
Sign in to follow this  
Kuroe

@die delay on hit

Question

2 answers to this question

Recommended Posts

  • 1

almost similar to this

 

#include "common/hercules.h"
#include "map/pc.h"
#include "map/atcommand.h"
#include "common/timer.h"
#include "common/memmgr.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
	"die_delay",
	SERVER_TYPE_MAP,
	"x_O",
	HPM_VERSION,
};

ACMD(kill) {
	if ( DIFF_TICK( timer->gettick(), sd->canlog_tick ) < battle->bc->prevent_logout ) {
		char msg[CHAT_SIZE_MAX];
		safesnprintf( msg, CHAT_SIZE_MAX, "There is a %d seconds delay of using this command to kill the character again", battle->bc->prevent_logout /1000 );
		clif->message( fd, msg );
		return false;
	}
	status_kill( &sd->bl );
	clif->message( sd->fd, msg_fd( fd, 13 )); // A pity! You've died.
	if ( fd != sd->fd )
		clif->message( fd, msg_fd( fd, 14 )); // Character killed.
	return true;
}

HPExport void plugin_init (void) {
	addAtcommand( "kill", kill );
}

this assume your prevent_logout in your battle_config has default setting

// Prevent logout of players after being hit for how long (in ms, 0 disables)?
prevent_logout: 10000

// When should the server prevent a player from logging out? Have no effect if prevent_logout is disabled. (Note 3)
// Official servers prevent players from logging out after attacking, casting skills, and taking damage.
// 0 = Players can always logout
// 1 = Prevent logout on login
// 2 = Prevent logout after attacking
// 4 = Prevent logout after casting skill
// 8 = Prevent logout after being hit
prevent_logout_trigger: 14

prevent_logout_trigger have to at least has 2+8

Share this post


Link to post
Share on other sites
  • 0
40 minutes ago, AnnieRuru said:

almost similar to this

 

#include "common/hercules.h"
#include "map/pc.h"
#include "map/atcommand.h"
#include "common/timer.h"
#include "common/memmgr.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
	"die_delay",
	SERVER_TYPE_MAP,
	"x_O",
	HPM_VERSION,
};

ACMD(kill) {
	if ( DIFF_TICK( timer->gettick(), sd->canlog_tick ) < battle->bc->prevent_logout ) {
		char msg[CHAT_SIZE_MAX];
		safesnprintf( msg, CHAT_SIZE_MAX, "There is a %d seconds delay of using this command to kill the character again", battle->bc->prevent_logout /1000 );
		clif->message( fd, msg );
		return false;
	}
	status_kill( &sd->bl );
	clif->message( sd->fd, msg_fd( fd, 13 )); // A pity! You've died.
	if ( fd != sd->fd )
		clif->message( fd, msg_fd( fd, 14 )); // Character killed.
	return true;
}

HPExport void plugin_init (void) {
	addAtcommand( "kill", kill );
}

this assume your prevent_logout in your battle_config has default setting

// Prevent logout of players after being hit for how long (in ms, 0 disables)?
prevent_logout: 10000

// When should the server prevent a player from logging out? Have no effect if prevent_logout is disabled. (Note 3)
// Official servers prevent players from logging out after attacking, casting skills, and taking damage.
// 0 = Players can always logout
// 1 = Prevent logout on login
// 2 = Prevent logout after attacking
// 4 = Prevent logout after casting skill
// 8 = Prevent logout after being hit
prevent_logout_trigger: 14

prevent_logout_trigger have to at least has 2+8

Thank you :)

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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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