Jump to content
  • 0

Modify my script please


Pink Guy

Question


  • Group:  Members
  • Topic Count:  131
  • Topics Per Day:  0.03
  • Content Count:  371
  • Reputation:   3
  • Joined:  11/14/11
  • Last Seen:  

Here's my script.

//BTS Script
prt_in,225,25,4 script Break the Seal 999,{
if ( countitem(909) < 1 ){
mes "I am the Break the Seal NPC";
next;

mes "[Reward System]";
mes "5% - Vendor's Ring[2], Elite Clip[2], and Falcon Clip.";
mes "10% - Romantic Leaf";
mes "20% - Gold";
mes "50% - Chewing bubble gum and Dark Randgris Helm";
mes "80% - Jellopy, Jellopy, and Jellopy";
next;
mes "[Required Items]";
mes "1 Jellopy";
delitem 909,1;
mes "So you have all the items needed...and in exchange I will give you a nice item";

// This is the reward system..
set .@Random,rand( 100 );
//5%
if( .@Random < 5 ) setarray .@ItemID,5374,5013,5072;
//20%
else if( .@Random < 20 ) setarray .@ItemID,969;

//10% 
else if( .@Random < 10 ) setarray .@ItemID,2270;
//50%
else if( .@Random < 50 ) setarray .@ItemID,5597,5373;
//100%
else if( .@Random < 100 ) setarray .@ItemID,909;
//90% - wala pa e 
//else if( .@Random < 90 ) setarray .@ItemID,5528,7086,7090;
else end;
set .@Random,rand( getarraysize(.@ItemID) );
if( getarraysize(.@ItemID) )
//getitem v change the 1 to how many items you want to get...
getitem .@ItemID[.@Random],1;
announce ""+strcharinfo(0)+" just obtained the item " + getitemname(.@ItemID) + " after breaking the Seal of Valkyrie!",0;
close;
}

What happens if you get all the items needed is the npc just gives you the item and goes to the mes saying "So you have all the items needed... in exchange I will give you a nice item"

What I want to happen is the first 2 messages still appears and after the Required items message, there will be a menu of options. 1st option: Exchange items(This will proceed to the script) 2nd option: close(just close the npc).

Thanks in advance~

Edited by Instinct
Codeboxed.
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

mes "[Required Items]";
mes "1 Jellopy";
if( select("Exchange:Cancel") == 2 ) close;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  331
  • Reputation:   63
  • Joined:  11/29/11
  • Last Seen:  

Your script contains missing brackets and wrong info

In your script if Jellopy is less than 1 then only continue(An error cause in map-server bcoz deleting an item which is not in inventory!!)

prt_in,225,25,4    script    Break the Seal    999,{
if ( countitem(909) < 1 ) end;
mes "I am the Break the Seal NPC";
next;
mes "[Reward System]";
mes "5% - Vendor's Ring[2], Elite Clip[2], and Falcon Clip.";
mes "10% - Romantic Leaf";
mes "20% - Gold";
mes "50% - Chewing bubble gum and Dark Randgris Helm";
mes "80% - Jellopy, Jellopy, and Jellopy";
next;
mes "[Required Items]";
mes "1 Jellopy";
delitem 909,1;
mes "So you have all the items needed...and in exchange I will give you a nice item";
// This is the reward system..
set .@Random,rand( 100 );
if( .@Random < 5 ) setarray .@ItemID,5374,5013,5072;
else if( .@Random < 20 ) setarray .@ItemID,969;
else if( .@Random < 10 ) setarray .@ItemID,2270;
else if( .@Random < 50 ) setarray .@ItemID,5597,5373;
else if( .@Random < 100 ) setarray .@ItemID,909;
//else if( .@Random < 90 ) setarray .@ItemID,5528,7086,7090;
set .@Random,rand( getarraysize(.@ItemID) );
if( getarraysize(.@ItemID) ){
getitem .@ItemID[.@Random],1;
announce ""+strcharinfo(0)+" just obtained the item " + getitemname(.@ItemID) + " after breaking the Seal of Valkyrie!",0;
close;
}
}

Here's Fixed Script.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   26
  • Joined:  11/19/11
  • Last Seen:  

announce strcharinfo(0)+" just obtained the item " + getitemname(.@ItemID) + " after breaking the Seal of Valkyrie!",0;

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