Jump to content
  • 0
Sign in to follow this  
Zirius

@noatk ?? An atcommand that disable attacking?

Question

It keeps me bothered that game masters can hit players in PVP or GVG maps. :( (accidental)
Actually, I am trying to code a warper where players can watch GvG and PvP events by letting them use @hide temporarily, but they can still attack players, is there also atcommand for not letting invoking players to use skill nor attacks?

(would be great if it can be done via bindatcommand)

The closest I found was from rAthena but it was for GMs http://rathena.org/board/topic/60581-onoff-option-to-disable-gms-attackskill/#entry117746


Thanks!

Edited by Zirius

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0
Guest

You could give every player temporarily 90% weight (no atks), by using

 

​SC_WEIGHT90	54 

Just an idea, haven't tested it, good luck :)

Share this post


Link to post
Share on other sites
  • 0

(would be great if it can be done via bindatcommand)

I don't think you can make one using via bindatcommand unless there is a script command appropriate with it..

 

so here I make a simple HPM plugin for you..just browse the wiki on how to install it..enjoy.. :D

// Copyright (c) Hercules Dev Team, licensed under GNU GPL.// See the LICENSE file// Sample Hercules Plugin#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../common/HPMi.h"#include "../common/malloc.h"#include "../common/mmo.h"#include "../common/socket.h"#include "../common/strlib.h"#include "../map/clif.h"#include "../map/pc.h"#include "../map/script.h"#include "../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) *//* malufett@yourservice */HPExport struct hplugin_info pinfo = {"ATCMD_NO_ATK",  // Plugin nameSERVER_TYPE_MAP,// Which server types this plugin works with?"0.1",   // Plugin versionHPM_VERSION, // HPM Version (don't change, macro is automatically updated)};struct atk_state{int enabled;};ACMD(no_atk) {struct atk_state *data;if(!(data = getFromMSD(sd,0))){  CREATE(data,struct atk_state,1);  data->enabled = 0;  addToMSD(sd,data,0,true);}if(data->enabled){  data->enabled = 0;  clif->message(sd->fd, "You can now attack normally.");}else{  data->enabled = 1;  clif->message(sd->fd, "You are now disabled to attack.");}return true;}int hook_battle_check_target(int retVal, struct block_list *src, struct block_list *target,int *flag){struct map_session_data* sd;struct atk_state *data;struct block_list *s_bl = src;if( retVal != 1 || src->type != BL_PC ) return retVal;if( (s_bl = battle->get_master(src)) == NULL )  s_bl = src;sd = BL_CAST(BL_PC, s_bl);if(sd && *flag&BCT_ENEMY && (data = getFromMSD(sd,0)) && data->enabled)  return 0;return retVal;}HPExport void plugin_init (void) {char *server_type;char *server_name; /* core vars */server_type = GET_SYMBOL("SERVER_TYPE");server_name = GET_SYMBOL("SERVER_NAME");/* core interfaces */battle = GET_SYMBOL("battle");clif = GET_SYMBOL("clif");iMalloc = GET_SYMBOL("iMalloc");/* addAtcommand */addAtcommand("noatk",no_atk); // @noatkaddAtcommand("na",no_atk); // @na/* postHook */addHookPost("battle->check_target",hook_battle_check_target);ShowStatus ("Running HPM Plugin: '"CL_WHITE"%s"CL_RESET"'.n", pinfo.name);}

:meow:

Share this post


Link to post
Share on other sites
  • 0

 

 

(would be great if it can be done via bindatcommand)

I don't think you can make one using via bindatcommand unless there is a script command appropriate with it..

 

so here I make a simple HPM plugin for you..just browse the wiki on how to install it..enjoy.. :D

// Copyright (c) Hercules Dev Team, licensed under GNU GPL.// See the LICENSE file// Sample Hercules Plugin#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../common/HPMi.h"#include "../common/malloc.h"#include "../common/mmo.h"#include "../common/socket.h"#include "../common/strlib.h"#include "../map/clif.h"#include "../map/pc.h"#include "../map/script.h"#include "../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) *//* malufett@yourservice */HPExport struct hplugin_info pinfo = {"ATCMD_NO_ATK",  // Plugin nameSERVER_TYPE_MAP,// Which server types this plugin works with?"0.1",   // Plugin versionHPM_VERSION, // HPM Version (don't change, macro is automatically updated)};struct atk_state{int enabled;};ACMD(no_atk) {struct atk_state *data;if(!(data = getFromMSD(sd,0))){  CREATE(data,struct atk_state,1);  data->enabled = 0;  addToMSD(sd,data,0,true);}if(data->enabled){  data->enabled = 0;  clif->message(sd->fd, "You can now attack normally.");}else{  data->enabled = 1;  clif->message(sd->fd, "You are now disabled to attack.");}return true;}int hook_battle_check_target(int retVal, struct block_list *src, struct block_list *target,int *flag){struct map_session_data* sd;struct atk_state *data;struct block_list *s_bl = src;if( retVal != 1 || src->type != BL_PC ) return retVal;if( (s_bl = battle->get_master(src)) == NULL )  s_bl = src;sd = BL_CAST(BL_PC, s_bl);if(sd && *flag&BCT_ENEMY && (data = getFromMSD(sd,0)) && data->enabled)  return 0;return retVal;}HPExport void plugin_init (void) {char *server_type;char *server_name; /* core vars */server_type = GET_SYMBOL("SERVER_TYPE");server_name = GET_SYMBOL("SERVER_NAME");/* core interfaces */battle = GET_SYMBOL("battle");clif = GET_SYMBOL("clif");iMalloc = GET_SYMBOL("iMalloc");/* addAtcommand */addAtcommand("noatk",no_atk); // @noatkaddAtcommand("na",no_atk); // @na/* postHook */addHookPost("battle->check_target",hook_battle_check_target);ShowStatus ("Running HPM Plugin: '"CL_WHITE"%s"CL_RESET"'.n", pinfo.name);}
:meow:

 

 

Thank you very much! Wow. I will test this in my local dev before releasing to public.

 

Btw, I forgot, Is it too much if I also want to disable them from chatting like "red mute", it would be annoying for participants if the audience keeps chatting :( ?

Share this post


Link to post
Share on other sites
  • 0

Why not just use

@addperm disable_pvp

and/or

@addperm disable_pvm?

It lasts until relog, or until you use @rmvperm on them.

 

For the mute bubble just use @mute?

Share this post


Link to post
Share on other sites
  • 0

 

(would be great if it can be done via bindatcommand)

I don't think you can make one using via bindatcommand unless there is a script command appropriate with it..

 

so here I make a simple HPM plugin for you..just browse the wiki on how to install it..enjoy.. :D

// Copyright (c) Hercules Dev Team, licensed under GNU GPL.// See the LICENSE file// Sample Hercules Plugin#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../common/HPMi.h"#include "../common/malloc.h"#include "../common/mmo.h"#include "../common/socket.h"#include "../common/strlib.h"#include "../map/clif.h"#include "../map/pc.h"#include "../map/script.h"#include "../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) *//* malufett@yourservice */HPExport struct hplugin_info pinfo = {"ATCMD_NO_ATK",  // Plugin nameSERVER_TYPE_MAP,// Which server types this plugin works with?"0.1",   // Plugin versionHPM_VERSION, // HPM Version (don't change, macro is automatically updated)};struct atk_state{int enabled;};ACMD(no_atk) {struct atk_state *data;if(!(data = getFromMSD(sd,0))){  CREATE(data,struct atk_state,1);  data->enabled = 0;  addToMSD(sd,data,0,true);}if(data->enabled){  data->enabled = 0;  clif->message(sd->fd, "You can now attack normally.");}else{  data->enabled = 1;  clif->message(sd->fd, "You are now disabled to attack.");}return true;}int hook_battle_check_target(int retVal, struct block_list *src, struct block_list *target,int *flag){struct map_session_data* sd;struct atk_state *data;struct block_list *s_bl = src;if( retVal != 1 || src->type != BL_PC ) return retVal;if( (s_bl = battle->get_master(src)) == NULL )  s_bl = src;sd = BL_CAST(BL_PC, s_bl);if(sd && *flag&BCT_ENEMY && (data = getFromMSD(sd,0)) && data->enabled)  return 0;return retVal;}HPExport void plugin_init (void) {char *server_type;char *server_name; /* core vars */server_type = GET_SYMBOL("SERVER_TYPE");server_name = GET_SYMBOL("SERVER_NAME");/* core interfaces */battle = GET_SYMBOL("battle");clif = GET_SYMBOL("clif");iMalloc = GET_SYMBOL("iMalloc");/* addAtcommand */addAtcommand("noatk",no_atk); // @noatkaddAtcommand("na",no_atk); // @na/* postHook */addHookPost("battle->check_target",hook_battle_check_target);ShowStatus ("Running HPM Plugin: '"CL_WHITE"%s"CL_RESET"'.n", pinfo.name);}

:meow:

 

 

Bro, I am having this error in console after rebuilding:

 

[Error]: HPM:AddHook Fail! 'ATCMD_NO_ATK' tried to hook to 'battle->check_target
' but HPMHooking is disabled!

not sure if related to this: http://herc.ws/board/topic/7723-building-on-windows-platform-hpm-hooking-errors/#entry46426

 

Thanks!

Share this post


Link to post
Share on other sites
  • 0

 

 

(would be great if it can be done via bindatcommand)

I don't think you can make one using via bindatcommand unless there is a script command appropriate with it..

 

so here I make a simple HPM plugin for you..just browse the wiki on how to install it..enjoy.. :D

// Copyright (c) Hercules Dev Team, licensed under GNU GPL.// See the LICENSE file// Sample Hercules Plugin#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../common/HPMi.h"#include "../common/malloc.h"#include "../common/mmo.h"#include "../common/socket.h"#include "../common/strlib.h"#include "../map/clif.h"#include "../map/pc.h"#include "../map/script.h"#include "../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) *//* malufett@yourservice */HPExport struct hplugin_info pinfo = {"ATCMD_NO_ATK",  // Plugin nameSERVER_TYPE_MAP,// Which server types this plugin works with?"0.1",   // Plugin versionHPM_VERSION, // HPM Version (don't change, macro is automatically updated)};struct atk_state{int enabled;};ACMD(no_atk) {struct atk_state *data;if(!(data = getFromMSD(sd,0))){  CREATE(data,struct atk_state,1);  data->enabled = 0;  addToMSD(sd,data,0,true);}if(data->enabled){  data->enabled = 0;  clif->message(sd->fd, "You can now attack normally.");}else{  data->enabled = 1;  clif->message(sd->fd, "You are now disabled to attack.");}return true;}int hook_battle_check_target(int retVal, struct block_list *src, struct block_list *target,int *flag){struct map_session_data* sd;struct atk_state *data;struct block_list *s_bl = src;if( retVal != 1 || src->type != BL_PC ) return retVal;if( (s_bl = battle->get_master(src)) == NULL )  s_bl = src;sd = BL_CAST(BL_PC, s_bl);if(sd && *flag&BCT_ENEMY && (data = getFromMSD(sd,0)) && data->enabled)  return 0;return retVal;}HPExport void plugin_init (void) {char *server_type;char *server_name; /* core vars */server_type = GET_SYMBOL("SERVER_TYPE");server_name = GET_SYMBOL("SERVER_NAME");/* core interfaces */battle = GET_SYMBOL("battle");clif = GET_SYMBOL("clif");iMalloc = GET_SYMBOL("iMalloc");/* addAtcommand */addAtcommand("noatk",no_atk); // @noatkaddAtcommand("na",no_atk); // @na/* postHook */addHookPost("battle->check_target",hook_battle_check_target);ShowStatus ("Running HPM Plugin: '"CL_WHITE"%s"CL_RESET"'.n", pinfo.name);}

:meow:

 

 

Bro, I am having this error in console after rebuilding:

>> 

[Error]: HPM:AddHook Fail! 'ATCMD_NO_ATK' tried to hook to 'battle->check_target
' but HPMHooking is disabled!

not sure if related to this: http://herc.ws/board/topic/7723-building-on-windows-platform-hpm-hooking-errors/#entry46426

 

Thanks!

 

 

Simple enable it in conf/plugins.conf

 

plugins_list: [	/* Enable HPMHooking when plugins in use rely on Hooking */-	//"HPMHooking",+	"HPMHooking",	//"db2sql",	//"sample",	//"other",]

Share this post


Link to post
Share on other sites
  • 0

 

 

 

 

 

 

(would be great if it can be done via bindatcommand)

I don't think you can make one using via bindatcommand unless there is a script command appropriate with it..

 

so here I make a simple HPM plugin for you..just browse the wiki on how to install it..enjoy.. :D

// Copyright (c) Hercules Dev Team, licensed under GNU GPL.// See the LICENSE file// Sample Hercules Plugin#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../common/HPMi.h"#include "../common/malloc.h"#include "../common/mmo.h"#include "../common/socket.h"#include "../common/strlib.h"#include "../map/clif.h"#include "../map/pc.h"#include "../map/script.h"#include "../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) *//* malufett@yourservice */HPExport struct hplugin_info pinfo = {"ATCMD_NO_ATK",  // Plugin nameSERVER_TYPE_MAP,// Which server types this plugin works with?"0.1",   // Plugin versionHPM_VERSION, // HPM Version (don't change, macro is automatically updated)};struct atk_state{int enabled;};ACMD(no_atk) {struct atk_state *data;if(!(data = getFromMSD(sd,0))){  CREATE(data,struct atk_state,1);  data->enabled = 0;  addToMSD(sd,data,0,true);}if(data->enabled){  data->enabled = 0;  clif->message(sd->fd, "You can now attack normally.");}else{  data->enabled = 1;  clif->message(sd->fd, "You are now disabled to attack.");}return true;}int hook_battle_check_target(int retVal, struct block_list *src, struct block_list *target,int *flag){struct map_session_data* sd;struct atk_state *data;struct block_list *s_bl = src;if( retVal != 1 || src->type != BL_PC ) return retVal;if( (s_bl = battle->get_master(src)) == NULL )  s_bl = src;sd = BL_CAST(BL_PC, s_bl);if(sd && *flag&BCT_ENEMY && (data = getFromMSD(sd,0)) && data->enabled)  return 0;return retVal;}HPExport void plugin_init (void) {char *server_type;char *server_name; /* core vars */server_type = GET_SYMBOL("SERVER_TYPE");server_name = GET_SYMBOL("SERVER_NAME");/* core interfaces */battle = GET_SYMBOL("battle");clif = GET_SYMBOL("clif");iMalloc = GET_SYMBOL("iMalloc");/* addAtcommand */addAtcommand("noatk",no_atk); // @noatkaddAtcommand("na",no_atk); // @na/* postHook */addHookPost("battle->check_target",hook_battle_check_target);ShowStatus ("Running HPM Plugin: '"CL_WHITE"%s"CL_RESET"'.n", pinfo.name);}
:meow:

 

 

 

 

Bro, I am having this error in console after rebuilding:

 

>> 

 

[Error]: HPM:AddHook Fail! 'ATCMD_NO_ATK' tried to hook to 'battle->check_target

' but HPMHooking is disabled!iv>

not sure if related to this: http://herc.ws/board/topic/7723-building-on-windows-platform-hpm-hooking-errors/#entry46426

 

Thanks!

 

Simple enable it in conf/plugins.conf

 

plugins_list: [	/* Enable HPMHooking when plugins in use rely on Hooking */-	//"HPMHooking",+	"HPMHooking",	//"db2sql",	//"sample",	//"other",]

 

 

 

 

 

but...

 

[Warning]: HPM:plugin_load: failed to load 'plugins/HPMHooking_map.dll', skipping...[Warning]: HPM:plugin_load: failed to load 'plugins/HPMHooking_char.dll', skipping...[Warning]: HPM:plugin_load: failed to load 'plugins/HPMHooking_login.dll', skipping...
because...
------ Build started: Project: plugin-HPMHooking_map, Configuration: Release Win32 ------Build started 11/15/2014 2:30:20 PM.InitializeBuildStatus:  Creating "plugin-HPMHooking_mapReleaseplugin-HPMHooking_map.unsuccessfulbuild" because "AlwaysCreate" was specified.ClCompile:  HPMHooking.c..srcpluginsHPMHooking.c(78): fatal error C1189: #error :  HPMHooking plugin needs to be compiled for a specific server type. Please make sure your Makefiles are up to date.Build FAILED.Time Elapsed 00:00:06.11========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
from http://herc.ws/board/topic/7714-hpmhooking-charso-failed-to-load/

 

or, I just need to wait?

Edited by Zirius

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.