Jump to content
  • 0
Sign in to follow this  
GmOcean

MapServer Crash - Equip2

Question

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

Edited by GmOcean

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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->exists
then just add them into the plugin_init function as this
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

Share this post


Link to post
Share on other sites
  • 0

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*

Edited by GmOcean

Share this post


Link to post
Share on other sites
  • 0

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 ) );

Share this post


Link to post
Share on other sites
  • 0

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.

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.