Need a @sleep script for Hercules

snowflake1963

New member
Messages
97
Points
0
Hello All ^^

I have a script for @sleep that I used with rAthena and tried it here and failed
default_sad.png


I really like this command and would like to use it still.

Here is my script:

/*
*===================================
* Sleep (@sleep)
*-----------------------------------
*/

ACMD_FUNC(sleep){

  if (agit_flag) // skill not useable in WOE [A17kaliva]
  {
clif_displaymessage(fd, "Cannot use this command during WOE.");
return -1;
  }
  if(!battle_config.prevent_logout || DIFF_TICK(gettick(), sd->canlog_tick) > 10) {
  if(sd->sc.opt1 != 0 && sd->sc.opt1 != OPT1_SLEEP){
clif_displaymessage(fd, msg_txt(sd,807));
  return -1;
  }
  if(sd->sc.opt1 != OPT1_SLEEP){
sc_start(NULL,&sd->bl, SC_TRICKDEAD, 100, 1, 1000);
sd->sc.opt1 = OPT1_SLEEP;
//sc_start(NULL,&sd->bl, SC_COMA,100,1,skill_get_time2(185,1));
clif_displaymessage(fd, msg_txt(sd,805)); // sleeping
  } else {
sd->sc.opt1 = 0;
clif_emotion(&sd->bl,45);
status_change_end(&sd->bl, SC_TRICKDEAD, -1);
//sc_start(NULL,&sd->bl, SC_COMA,100,1,skill_get_time2(185,1));
clif_displaymessage(fd, msg_txt(sd,806)); // awake
  }

clif_changeoption(&sd->bl);
  return 0;
  }
clif_displaymessage(fd, msg_txt(sd,807));
  return -1;
}
 

Can anyone PLEASE help me to make this work?

 
I did what you suggested and the compiler gave the following errors:

Code:
  atcommand.cc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(3646): warning C4013: 'intif_broadcast' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8392): error C2065: 'agit_flag': nichtdeklarierter Bezeichnerc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8394): warning C4013: 'clif_displaymessage' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8397): warning C4013: 'gettick' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4002: Zu viele übergebene Parameter für das Makro 'sc_start'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): error C2440: 'Funktion': 'block_list *' kann nicht in 'sc_type' konvertiert werdenc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 2c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8409): warning C4013: 'clif_emotion' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8415): warning C4013: 'clif_changeoption' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1  atcommand.cc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(3646): warning C4013: 'intif_broadcast' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8392): error C2065: 'agit_flag': nichtdeklarierter Bezeichnerc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8394): warning C4013: 'clif_displaymessage' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8397): warning C4013: 'gettick' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8399): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4002: Zu viele übergebene Parameter für das Makro 'sc_start'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): error C2440: 'Funktion': 'block_list *' kann nicht in 'sc_type' konvertiert werdenc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 2c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8406): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8409): warning C4013: 'clif_emotion' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8412): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8415): warning C4013: 'clif_changeoption' undefiniert; Annahme: extern mit Rückgabetyp intc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4002: Zu viele übergebene Parameter für das Makro 'msg_txt'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4047: 'Funktion': Anzahl der Dereferenzierungen bei 'int' und 'map_session_data *' unterschiedlichc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8418): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 1
 
Thank you for your help
default_smile.png


I put in the code and i still have 3 errors when recompiling:

c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4002: Zu viele übergebene Parameter für das Makro 'sc_start'c:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): error C2440: 'Funktion': 'block_list *' kann nicht in 'sc_type' konvertiert werdenc:usersuserdesktopro server trunkssnow3 - hercules trunksrcmapatcommand.c(8403): warning C4024: 'Funktionszeiger': Unterschiedliche Typen für formalen und übergebenen Parameter 2
This points to line 8403 which is:

sc_start(NULL,&sd->bl, SC_TRICKDEAD, 100, 1, 1000);
Can you please explain?

mfg

Snowflake

 
Use the plugin, its good
default_happy.png
..


Isn't it same with afk? the sleep?

 
Last edited by a moderator:
@afk will kick the player offline, but the player will still be vulnerable

clif->chsys_quit(sd); clif->authfail_fd(sd->fd, 15);..

this @sleep will just make the player invulnerable by using novice's trick dead skill, but doesn't kick the player offline

quite good if you want to idle(go to toilet hahaha) inside a dungeon where aggressive monsters around

 
Followed your hint and the guide. Sadly my compiler give a fatal error now:

c:transfersnowhercules serversnow3 - hercules trunksrcpluginsat_sleep.c(10): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "../common/HPMDataCheck.h": No such file or directory

mfg

Snowflake

 
how old is your hercules ?

at least update to the latest one

if you are using outdated hercules then use the patch

 
Followed your hint and used GIT update. Compile was fine. 0 errors.

BUT now i have millions of errors pointing to the mob_db. I think the server forgot how to read mob_db2, cause all errors say non-existing mob with my custom mobid's.

Really need HELP with that

mfg

Snowflake

The Mob error is gone, it was a setting in mob.h. Sorry was extrem confused in that moment.

Will test @sleep now
default_smile.png


mfg

Snowflake

 
Last edited by a moderator:
@afk will kick the player offline, but the player will still be vulnerable

clif->chsys_quit(sd); clif->authfail_fd(sd->fd, 15);..

this @sleep will just make the player invulnerable by using novice's trick dead skill, but doesn't kick the player offline

quite good if you want to idle(go to toilet hahaha) inside a dungeon where aggressive monsters around
I see, Thank you

 
I just found a bug on my plugin

my test server has prevent_logout defaulted to 0 inside my import folder, makes me forget to change this

change this line

if ( !battle_config.prevent_logout || DIFF_TICK( timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout ) {into
Code:
if ( !battle->bc->prevent_logout || DIFF_TICK( timer->gettick(), sd->canlog_tick) > battle->bc->prevent_logout ) {
then add this below
Code:
	battle = GET_SYMBOL("battle");
..

.

the patch is unaffected

.... just redownload the plugin will do, I've changed that

 
Last edited by a moderator:
you type @sleep and then your character lays down ( looks like Novice Skill Trickdead ) and sleeps ( zZzZzZ ~ over your head ).

Type @sleep again to wake up. While you sleep you can not be attacked.

Usefull to go pee or poo in real life while your charcter is on a field or in a dungeon with agressive mobs.
default_smile.png


mfg

Snowflake

 
Last edited by a moderator:
Back
Top