Jump to content
  • 0

Check this script please?


Keim

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  221
  • Reputation:   12
  • Joined:  12/18/11
  • Last Seen:  

Somethings wrong...when you kill the "Amon Ra Summoner" it's supposed to come up with a dialogue which doesn't appear..

In between *if(countitem(7220)...* and the end is where the error is...apparently.


payon,163,226,3 script Monster Quest 1511,{
mes "[Amon Ra]";
mes "What do you want, you little rat?";
next;
mes "[Amon Ra]";
mes "Is it that you want to get zeny?!";
next;
switch(select("Oh..Yes.:I don't think so.")) {
case 1:
mes "[Amon Ra]";
mes "Oh...then, you will need a special item I call the Ectoplasm.";
next;
mes "[Amon Ra]";
mes "You will need 50 of those Ectoplasms.";
mes "Or else I don't let you get zeny.";
next;
mes "Do you have my ectoplasms?";
next;
switch(select("Yes, I do.:No, Sorry!")) {
case 1:
mes "[Amon Ra]";
mes "Well well, give it then!";
next;
if(countitem(7220)>=50) goto L_Apples;
mes "[Amon Ra]";
mes "You don't have my item! GO AWAY!";
close;
L_Apples:
mes "[Amon Ra]";
mes "Oh, you have it. I'm sorry I didn't tell you, you must fight my summoner first!";
monster "payon" ,166,226, "Amon Ra Summoner",1511,1, "Monster Quest::OnPoringKilled";
close;
OnPoringKilled:
set $PoringKilled,$PoringKilled+1;
if ($PoringKilled==1) goto L_AllDead;
end;
L_AllDead:
mes "[Amon Ra]";
mes "Congratulations, you have killed my summoner. Here is your zeny.";
set Zeny,Zeny+100000000;
next;
mes "[Amon Ra]";
mes "And an announcement!";
announce "Amon Ra: Oh My! "+strcharinfo(0)+" has killed my summoner and gained my zeny!",bc_blue|bc_all;
next;
mes "[Amon Ra]";
mes "Until next time!";
close;
case 2:
mes "[Amon Ra]";
mes "THEN GET IT!";
close;
}
case 2:
mes "[Amon Ra]";
mes "Oh...so you don't want my marvelous zeny then!?";
next;
warp "niflheim" ,90,108;
close;
}
}
[/codeBOX]

Edited by Keim
Codeboxed
Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

OnPoringKilled:
set $PoringKilled,$PoringKilled+1;
if ($PoringKilled==1) goto L_AllDead;
end;

You're using a global variable. If you've run this before, your variable might be greater than 1 already.

Also instead of goto use donpcevent

*donpcevent "{NPC NAME}::<event label>";

This command invokes the event label code within an another NPC or NPCs. If
event label has the form "NpcName::OnLabel", then only given NPC's event label
will be invoked (much like 'goto' into another NPC). If the form is "::OnLabel"
(NpcName omitted), the event code of all NPCs with given label will be invoked,
one after another. In both cases the invoked script will run without an attached
RID, whether or not the invoking script was attached to a player. The event
label name is required to start with On.

This command can be used to make other NPCs act, as if they were responding to
the invoking NPC's actions, such as using an emotion or talking.

place,100,100,1%TAB%script%TAB%NPC%TAB%53,{
	mes "Hey NPC2 copy what I do";
	close2;
	set .@emote, rand(1,30);
	donpcevent "NPC2::OnEmote";
OnEmote:
	emotion .@emote;
	end;
}

place,102,100,1%TAB%script%TAB%NPC2%TAB%53,{
	mes "Hey NPC copy what I do";
	close2;
	set .@emote, rand(1,30);
	donpcevent "NPC::OnEmote";
OnEmote:
	emotion .@emote;
	end;
}

Whichever of the both NPCs is talked to, both will show a random emotion at the
same time.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  221
  • Reputation:   12
  • Joined:  12/18/11
  • Last Seen:  

Still not getting it...the 1 on the second line would be 1 because I only summon one monster, the first +1 i'm not sure, i took it from script_commands.txt.

Is it possible for you to give me the actual code so i can put it? Because I don't know which code to replace for that one (or change).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

I didn't actually load/test it on a server. I'm just basing it from what I know.

if ($PoringKilled==1) goto L_AllDead;

Replace goto L_AllDead with donpcevent "Monster Quest::OnAllDead"

Do note you have to replace your L_AllDead label with OnAllDead

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   25
  • Joined:  11/28/11
  • Last Seen:  

Try this (not tested or anything):

payon,163,226,3 script Monster Quest 1511,{
   mes "[Amon Ra]";
   mes "What do you want, you little rat?";
   next;
   mes "[Amon Ra]";
   mes "Is it that you want to get zeny?!";
   next;
   switch(select("Oh..Yes.:I don't think so.")) {
       case 1:
           mes "[Amon Ra]";
           mes "Oh...then, you will need a special item I call the Ectoplasm.";
           next;
           mes "[Amon Ra]";
           mes "You will need 50 of those Ectoplasms.";
           mes "Or else I don't let you get zeny.";
           next;
           mes "Do you have my ectoplasms?";
           next;
           switch(select("Yes, I do.:No, Sorry!")) {
               case 1:
                   mes "[Amon Ra]";
                   mes "Well well, give it then!";
                   next;
                   if(countitem(7220)>=50) {
                       mes "[Amon Ra]";
                       mes "Oh, you have it. I'm sorry I didn't tell you, you must fight my summoner first!";
                       monster "payon" ,166,226, "Amon Ra Summoner",1511,1, "Monster Quest::OnPoringKilled";
                   } else {
                       mes "[Amon Ra]";
                       mes "You don't have my item! GO AWAY!";
                   }
                   close;
               case 2:
                   mes "[Amon Ra]";
                   mes "THEN GET IT!";
                   close;
           }
       case 2:
           mes "[Amon Ra]";
           mes "Oh...so you don't want my marvelous zeny then!?";
           next;
           warp "niflheim" ,90,108;
           close;
   }

OnPoringKilled:
   mes "[Amon Ra]";
   mes "Congratulations, you have killed my summoner. Here is your zeny.";
   set Zeny,Zeny+100000000;
   next;
   mes "[Amon Ra]";
   mes "And an announcement!";
   announce "Amon Ra: Oh My! "+strcharinfo(0)+" has killed my summoner and gained my zeny!",bc_blue|bc_all;
   next;
   mes "[Amon Ra]";
   mes "Until next time!";
   close;
}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  221
  • Reputation:   12
  • Joined:  12/18/11
  • Last Seen:  

Thanks Terces & Arcenciel, works now :)

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...