Help - Search - Members - Calendar
Full Version: Hatred Reset For Star Gladiator
eAthena Support Board > Modifications > Source > Modifications Support
Radical Blues
The command to reset Star Gladiator's assignated maps via "Feeling" skill is pretty simple:
charcommand strcharinfo(0)+":#feelreset "+strcharinfo(0);

Is there aw ay to reset Star Gladiator's assignated monsters via "Hatred" skill?

Thank you! laughing.gif
~AnnieRuru~
there are no hatret reset currently ...

*Move from Script Support to Modification Support*
GodLesZ
/* src/map/atcommand.c */

add anywhere above 'AtCommandInfo atcommand_info[] = {'

CODE
/*==========================================
* Hatred Reset [GodLesZ]
*------------------------------------------*/
int atcommand_hatredreset(const int fd, struct map_session_data* sd, const char* command, const char* message){
    pc_resethate(sd);
    clif_displaymessage(sd->fd, "Reset 'Hatred' state~");
    return 0;
}


add below 'AtCommandInfo atcommand_info[] = {'
CODE
    { "hatredreset",        0,        atcommand_hatredreset }, // [GodLesZ]






/* src/map/charcommand.c */

add anywhere above 'CharCommandInfo charcommand_info[] = {'

CODE
/*==========================================
* Hatred Reset [GodLesZ]
*------------------------------------------*/
int charcommand_hatredreset(const int fd, struct map_session_data* sd, const char* command, const char* message){
char char_[NAME_LENGTH];
char output[200];
struct map_session_data *pl_sd;

memset(character, '\', sizeof(character));
memset(output, '\', sizeof(output));

if (!message || !*message || sscanf(message, "%23[^\n]", char_) < 1) {
clif_displaymessage(sd->fd, "Please, enter a player name (usage: #hatredreset <charname>).");
return -1;
}

if ((pl_sd = map_nick2sd(character))) {
if (pc_isGM(sd) >= pc_isGM(pl_sd)) {
pc_resethate(pl_sd);
sprintf(output, "%s 'Hatred' state was resetet~", char_);
clif_displaymessage(sd->fd, output);
clif_displaymessage(pl_sd->fd, "your 'Hatred' state was resetet.");
} else {
clif_displaymessage(sd->fd, msg_txt(81));
return -1;
}
} else {
clif_displaymessage(sd->fd, msg_txt(3));
return -1;
}

return 0;
}


add below 'CharCommandInfo charcommand_info[] = {'
CODE
    { "hatredreset",        60,        charcommand_hatredreset }, // [GodLesZ]
Radical Blues
I love you GodLesZ, thanks a lot, really! ^^
DeathRose
Thanks GodLesZ!!

added to my serv
Foby
hello! (sorry for my bad english)

i have a little question about one of the star gladiator's hidden skill called: angel of the sun,moon,stars
it's a passiv skill which can reset 'hatred' and 'feeling' targets (i think), but it have only 0.000000000001%chance to be activated. ((When you sit next to another TK, be in "happy" status and doing /doridori....))

i just want to know how can i increase this very low chance for 0.10% or higher?

thank you.
Houtei
i was just trying to add this and i get all t hese errors after doing what it says

charcommand.c: In function `charcommand_hatredreset':
charcommand.c:62: error: `character' undeclared (first use in this function)
charcommand.c:62: error: (Each undeclared identifier is reported only once
charcommand.c:62: error: for each function it appears in.)
charcommand.c:62: error: missing terminating ' character
charcommand.c:63: error: missing terminating ' character
charcommand.c:65: error: syntax error before "if"
charcommand.c:58: warning: unused variable `char_'
charcommand.c:60: warning: unused variable `pl_sd'
charcommand.c: At top level:
charcommand.c:70: error: syntax error before "if"
charcommand.c:51: warning: 'get_charcommandinfo_byname' declared `static' but never defined
charcommand.c:52: warning: 'get_charcommandinfo_byfunc' declared `static' but never defined
gmake[1]: *** [obj_sql/charcommand.o] Error 1
gmake: *** [map_sql] Error 2
Funt
CODE
memset(character, '\', sizeof(character));
memset(output, '\', sizeof(output));

After output, '\ put zero.
Zathrox
I know this topic is pretty old, but I've deemed it useful and I've just recently added this to the source code and recompiled, but i'm getting this error

CODE
Compiling...
charcommand.c
..\src\map\charcommand.c(1450) : error C2065: 'character' : undeclared identifier
..\src\map\charcommand.c(1450) : warning C4022: 'memset' : pointer mismatch for actual parameter 1
..\src\map\charcommand.c(1450) : error C2001: newline in constant
..\src\map\charcommand.c(1450) : error C2015: too many characters in constant
..\src\map\charcommand.c(1451) : error C2146: syntax error : missing ')' before identifier 'memset'
..\src\map\charcommand.c(1451) : error C2168: 'memset' : too few actual parameters for intrinsic function
..\src\map\charcommand.c(1458) : error C2065: 'character' : undeclared identifier
..\src\map\charcommand.c(1458) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
..\src\map\charcommand.c(1458) : warning C4024: 'map_nick2sd' : different types for formal and actual parameter 1


any ideas how to fix this? or why its doing it in the first place?
Funt
Replace
CODE
char char_[NAME_LENGTH];

With:
CODE
char character[NAME_LENGTH];
Orcao
You can reset hatred through scripts, without touching the source, like this:
set PC_HATE_MOB_SUN,0;
set PC_HATE_MOB_MOON,0;
set PC_HATE_MOB_STAR,0;

After setting these variables, the character must relog for it to take effect.
Zathrox
Thanks for the help, I managed to get the Atcommand version working, and to put that into a script is simple enough, since I probably wont be manually be doing it with a GM character so Charcommand isn't needed, but I will try the suggestions posted to see if it doesn't fix the problem ^^
eaQ
@GodLesZ: Grate work!
Sven3dfx
charcommand.c


Serverversion 14083

Die Datei gibs bei mir nich was nun?

Ich hab mir auch mal die aktuelle svn geladen fehlt die datei auch....
Unstoppable1990
QUOTE (Sven3dfx @ Jan 27 2010, 05:30 AM) *
charcommand.c


Serverversion 14083

Die Datei gibs bei mir nich was nun?

Ich hab mir auch mal die aktuelle svn geladen fehlt die datei auch....


=> he is saying that he doesn't have charcommand.c

I am not sure but I think you only have to add it as a normal atcommand then. I saw the source checking for both '@' and '#' signs to see if it is an atcommand.
FusionWeiss
Thanks! I just added this today.
Masao
Hmm, pretty old topic but anyway since a friend of mine asked me for it xD

open atcommand.c

Find atcommand_feelreset

place below this atcommand the following:

CODE

/*==========================================
* Hatred Reset [Masao]
*------------------------------------------*/
ACMD_FUNC(hatereset)
{
pc_resethate(sd);
clif_displaymessage(fd, "Reset 'Hatred' mobs.");

return 0;
}


Now find in atcommand.c the following:

{ "feelreset", 10,10, atcommand_feelreset },

and place below

{ "hatereset", 10,10, atcommand_hatereset },

After that is done, save the file. Now open the pc.c file and search for

int pc_resethate

now replace that code with the following:

CODE

/*==========================================
* /resethatred [Masao]
*------------------------------------------*/
int pc_resethate(struct map_session_data* sd)
{
int i;
nullpo_retr(0, sd);

for (i=0; i<3; i++)
{
sd->hate_mob[i] = -1;
pc_setglobalreg(sd,sg_info[i].hate_var,0);
}
return 0;
}


Now save the file. After that just open up in your conf folder the atcommand_athena.conf and search for feelreset and then there you add below this:

// Resets a Star Gladiator's marked hatred mobs
hatereset: 10,10

Now save the file, and recompile your server and it works!

Credits and everything goes of course to Godlesz

Regards
Masao
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.