MapServer Crash - Equip2

GmOcean

Community Contributors
Messages
371
Points
0
Emulator
Okay, so I followed the guide and manged to get this added in. With no mentions of errors while compiling and the such. However, it does fatally crash the map server when ever the command is used.....

Perhaps one of you guys can help me out with this one lol, because it works on rAthena, and I " think " I converted it to Hercules correctly D:

equip2.c

 

Attachments

Last edited by a moderator:
wow ... already trying to use plugin on the 1st day o.o

it actually took me about 1~2 weeks for me to understand what is plugin when I 1st came LOL

ok ... you actually enter the final phase when writing a plugin

which is testing for map-server to crash

the final step is search for every commands that has '->'

in your script, having ...

script->rid2sdpc->equipitemmap->id2sditemdb->existsthen just add them into the plugin_init function as this
Code:
HPExport void plugin_init (void) {	script = GET_SYMBOL("script");	pc = GET_SYMBOL("pc");	map = GET_SYMBOL("map");	itemdb = GET_SYMBOL("itemdb");	addScriptCommand( "equip2", "viiiiii?", equip2);}
..

.

and although already tested working in my test server too

prontera,156,184,5 script kjdhfksjfs 100,{ getitem2 1201, 1,1,0,0, 0,0,0,0; equip2 1201, 0,0, 0,0,0,0; sleep2 1000; getitem2 1201, 1,1,0,0, 0,0,0,4001; equip2 1201, 0,0, 0,0,0,4001; end;}your command keep spamming the npc coordinate in console, because you did a 'return 0;'
in rathena, commands are return by

return SCRIPT_CMD_SUCCESS; (0)

return SCRIPT_CMD_FAILURE; (1)

in hercules, note that its actually opposite

return true; (1)

return false; (0)

so change that 'return 0;' into 'return true;'

http://upaste.me/4b092e

 
Last edited by a moderator:
Yeah, I tried it normally at first, but i ended up with similar results, I figured maybe there was a conflict between src code, so using Herc's plugin system, that ' shouldn't ' be too big an issue, since I could define and structure alot without the need of breaking other commands since only my code would be effected (at least this is what i think it is capable of).

Also, originally I had it as true/false, but since it failed, I decided to revert it back to how it was before I made minor changes in the code, so that it could be easier for you plugin experts to help me lmao.

Lastly, at the searching for all the -> parts. Yeah, this I completely didn't know LOL. I looked at it and assumed, it was pointers to tell the plugin what .c files I was pluging into or rather what files (script.c, pc.c ... etc etc.).

But thank you very much, this actually clears up quite a bit of things... Now lets see if I can successfully add the rest of my modifications @.@;

*bookmarks page lol*

 
Last edited by a moderator:
IMO,I would  add one more checking  to prevent warnning on which the equiment already be equiped

  ARR_FIND( 0, MAX_INVENTORY, i,( sd->status.inventory.nameid == nameid &&
                 sd->status.inventory.equip == 0 &&
                 sd->status.inventory.refine == ref &&
                 sd->status.inventory.attribute == attr &&
                 sd->status.inventory.card[0] == c0 &&
                 sd->status.inventory.card[1] == c1 &&
                 sd->status.inventory.card[2] == c2 &&
                 sd->status.inventory.card[3] == c3 ) );

 
Hmm, that would be a good thing to add, right now it's not an issue for me being as I unequip all items before using the command. Atleast in my script that is. But, i'm sure going to add that now lol.

 
Back
Top