Jump to content
  • 0

Script crashing map server


Geowil

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

I am having some issues with a script from my eAthena server.  I think some things have changed with rAthena that are causing this issue but I am not sure what those are so here is the problem.  Whenever I try to use an item which calls a specific script my map server displays the following errors:

	[Warning]: Unable to restore stack! Double continuation!
	[Debug]: Previous script (lost):
	[Debug]: Source (NPC): FAKE_NPC (invisible/not on a map)
	[Debug]: Current script:
	[Debug]: Source (NPC): summonscript (invisible/not on a map)
	

 

Here is how I am calling the script from the item's script field:

getitem 57000,1; set $@homunsummoned,2; set $@summoner,getcharid(3); donpcevent "summonscript::OnItemSummonGlobal";

The item is consumed so I am first giving them the item back.  I am then setting a character variable storing the homunculus summoned as well as setting one which stores the accountid of the character that used the item.  Next I call the OnItemSummonGlobal function of my summonscript.  Here is the code for that below:

 

	-    script    summonscript    -1,{
OnItemSummonGlobal:
attachrid($@summoner);
if (class != 18  ||  class != 4017) goto beginsummon;
if (class == 18)  && (class == 4017) goto arealch;
	beginsummon:
mes "[Equivilant Trade]";
mes "The summoning prossess is now begining, you will need one Seed of Life, and one Dew of Yggdrasil.  Once those itmes are supplied you may begin.";
mes "Do you have these items?";
if (countitem(7140) < 1  ||  countitem(7141) < 1) { mes "You have not one or more of the items required.  Please go and get them then try once more.";
close; }
mes "You may now begin.";
set @fail,rand(1,100);
	//Chimera prossessing
//10%
if (failprecent == 0) { if (@fail == 10) { atcommand @monsterbig +"Chimera";
mes "Your Failure Rate is now at 10%.";
set failprecent,failprecent + 1;
goto removeItems;
close;
 }}
	//20%
if (failprecent == 1) { if (@fail <= 10 || @fail == 20) { atcommand @monsterbig +"Chimera";
mes "Your Failure Rate is now at 20%.";
set failprecent,failprecent + 1;
goto removeItems;
close;
 }}
 
 
 //30%
 if (failprecent == 2) { if (@fail <= 20 || @fail == 30 ) { atcommand @monsterbig +"Chimera";
 mes "Your Failure Rate is now at 30%.";
 set failprecent,failprecent + 1;
 goto removeItems;
 close;
 }}
 
 //40%
 if (failprecent == 3) { if (@fail <= 30 || @fail == 40 ) { atcommand @monsterbig +"Chimera";
  mes "Your Failure Rate is now at 40%.";
  set failprecent,failprecent + 1;
  goto removeItems;
  close;
 }}
 
 //50%
 if (failprecent == 4) { if (@fail <= 40 || @fail == 50 ) { atcommand @monsterbig +"Chimera";
  mes "Your Failure Rate is now at 50%.";
  set failprecent,failprecent + 1;
  goto removeItems;
  close;
 }}
	//60%
if (failprecent == 5) { if (@fail <= 50 || @fail == 60) { atcommand @monsterbig +"Chimera";
  mes "Your Failure Rate is now at 60%.";
  set failprecent,failprecent + 1;
  goto removeItems;
  close;
 }}
	//70%
if (failprecent == 6) { if (@fail <= 60 || @fail == 70) { atcommand @monsterbig +"Chimera";
  mes "Your Failure Rate is now at 70%.";
  set failprecent,failprecent + 1;
  goto removeItems;
  close;
 }}
	//80%
if (failprecent == 7) { if (@fail <= 70 || @fail == 80) { atcommand @monsterbig +"Chimera";
  mes "Your Failure Rate is now at 80%.";
  set failprecent,failprecent + 1;
  goto removeItems;
  close;
 }}
 
 //90%
 if (failprecent == 8) { if (@fail <= 80 || @fail == 90) { atcommand @monsterbig +"Chimera";
   mes "Your Failure Rate is now at 90%.";
   set failprecent,failprecent + 1;
   goto removeItems;
   close;
 }}
	//100%
if (failprecent == 9) { if (@fail <= 100) { atcommand @monsterbig +"Chimera";
   mes "Your Failure rate is now at 100%, this means you will spawn a Chimera at any time you try to summon. Please visit Hoenheim for help.";
   goto removeItems;
   close;
 }}
	
//Homunc prossessing
if ($@homunsummoned == 1) { atcommand @summon +"6001";
goto removeItems;
close;
 }
	if ($@homunsummoned == 2) { atcommand @summon +"6002";
goto removeItems;
close;
 }
 
 if ($@homunsummoned == 3) { atcommand @summon +"6003";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 4) { atcommand @summon +"6004";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 5) { atcommand @summon +"6005";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 6) { atcommand @summon +"6006";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 7) { atcommand @summon +"6007";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 8) { atcommand @summon +"6008";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 9) { atcommand @summon +"6009";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 10) { atcommand @summon +"6010";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 11) { atcommand @summon +"6011";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 12) { atcommand @summon +"6012";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 13) { atcommand @summon +"6013";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 14) { atcommand @summon +"6014";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 15) { atcommand @summon +"6015";
 goto removeItems;
 close;
 }
 
 if ($@homunsummoned == 16) { atcommand @summon +"6016";
 goto removeItems;
 close;
 }
 
removeItems:
    delitem 7140,1;
    delitem 7141,1;    
 
 
	arealch:
mes "You are a Creator or Alchemist, therefore you can not use this.  This is for Non-Alchemist tree individuals who do not know Alchemy.";
close;
	

 

This npc is nested within the npc file of a visible NPC in case that is important to know.

 

 

 

Edited by Geowil
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  660
  • Reputation:   665
  • Joined:  11/12/12
  • Last Seen:  

You should be using a function for your item instead (and don't use attachrid), something along the lines of:

getitem 57000,1; callfunc("summonfunction", 2);
function	script	summonfunction	{
	.@homunsummoned = getarg(0);
	// ...
	close/return;
}

 

Edited by Tokei
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

4 minutes ago, Tokei said:

You should be using a function for your item instead (and don't use attachrid), something along the lines of:


getitem 57000,1; callfunc("summonfunction", 2);

function	script	summonfunction	{
	.@homunsummoned = getarg(0);
	// ...
	close/return;
}

 

This is the answer use function script command's 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

Oh, cool thanks.  I also found I had to fix quite a bit in the script itself due to the way in which rAthena processes the atcommand script command.  Everything is working now though.

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...