Jump to content
  • 0

Script Event Manager


ZelosAvalon

Question


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   33
  • Joined:  11/11/12
  • Last Seen:  

i really need help on this script event manager will trade my event coins for another event coins and items!

but i'm newbie on scripts and need help, this script dont work =(

txt file : event_manager-zelos.txt


//=============================================
//== Event Manager  ======
//== Version: =================================
//== 1.0
//== by Zelos: ================================
//==
//=============================================
prontera,165,155,2 script Event manager 804,{
mes "[Event manager]";
mes "Hello "+StrCharInfo(0)+"!";
mes "I'm the Event Manager.";
mes "You give me Event Coins, i reward you. It's that simple!";
next;

switch(select("1 - Tell me more about Event coins and rewards:2 - I want to convert my Event Coins:3 - I want to receive my rewards:4 - Well,it was nice meeting you"))

case 1:
mes "[Event Manager]";
mes "There are 3 types of Event Coins you may win from Events:";
mes " - "+getitemname(8032);
mes " - "+getitemname(8033);
mes " - "+getitemname(8034);
next;
mes "[Event manager]";
mes "The exchange rates between Event Coin are:";
mes " 1 Golden Coin = 5 Silver Coins";
mes " 1 Silver Coin = 5 Bronze Coins";
next;
mes "[Event mMnager]";
mes "Here is the list rewards you may receive from your Event Coins:";
mes "( Note that in this list, we have: GC = Golden Coins, SC = Silver Coins and BC = Bronze Coins )";
next;
mes "[Event Manager]";
mes "1.[10000] Zeny for 1 BC]";
mes "2.[10]Yggdrasil Seeds for 2 BC]";
mes "3.[10]Yggdrasil Berry for 2 SC]";
mes "4."";
mes "5."";
}
goto Main;

case 2:
mes "[Event Manager]";
mes "Remeber the conversion rates:";
mes " 1 Golden Coin = 5 Silver Coins";
mes " 1 Silver Coin = 5 Bronze Coins";
next;
mes "so, which type of conversion would you like to do?";

switch(select("1-Silver Coin => Golden Coin:2-Bronze Coin => Silver Coin:3-Silver Coin => Bronze Coin:4-Golden Coin => Silver Coin:5-Nothing for now..."))

case 2-1:
{
mes "[Event Manager]";
mes "How many Silver Coins do you want to get from Golden Coins ?:";
input .sc;  
next;  
{ if(countitem(8033) >= .sc)
delitem 8033,.sc;
mes "[Event Manager]";
mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
getitem 8032,(.sc/5);
close;
}
case 2-2:
{
mes "[Event Manager]";
mes "How many Silver Coins do you want to get from Golden Coins ?:";
input .sc;  
next;  
{ if(countitem(8033) >= .sc)
delitem 8033,.sc;
mes "[Event Manager]";
mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
getitem 8032,(.sc/5);
close;
}
case 2-3:
{
mes "[Event Manager]";
mes "How many Silver Coins do you want to get from Golden Coins ?:";
input .sc;  
next;  
{ if(countitem(8033) >= .sc)
delitem 8033,.sc;
mes "[Event Manager]";
mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
getitem 8032,(.sc/5);
close;
}
case 2-4:
{
mes "[Event Manager]";
mes "How many Silver Coins do you want to get from Golden Coins ?:";
input .sc;  
next;  
{ if(countitem(8033) >= .sc)
delitem 8033,.sc;
mes "[Event Manager]";
mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
getitem 8032,(.sc/5);
close;
}
case 2-5:
{
mes "[Event Manager]";
mes "Ok, no problem.";
close;
}
case 3:
mes "[Event Manager]";
mes "Here is the rewards you may receive from your Event Coins:";
mes "( Note that in this list, we have: GC = Golden Coins, SC = Silver Coins and BC = Bronze Coins )";
next;

switch(select("1.[10000] Zeny for 1 BC:2.[10]Yggdrasil Seeds for 2 BC:3.[10]Yggdrasil Berry for 2 SC"))

case 3-1:

mes "[Event Manager]";
mes "You want to trade 1 BC for 10000 Zeny?";
switch(select("yes:no"))

case 3-1-1(yes):

next;
if(countitem(8034) < 1) goto nocoin;
if(countitem(8034) >= 1)
delitem 8034,1;
mes "[Event Manager]";
mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more zeny.";
set Zeny,Zeny+10000;
close;

case 3-1-2(no):
mes "[Event Manager]";
mes "Ok, back when you want to change something";
close;

case 3-2:

mes "[Event Manager]";
mes "You want to trade 2 BC for 10 Ygg Seed?";
switch(select("yes:no"))

case 3-2-1(yes):

next;
if(countitem(8034) < 2) goto nocoin;
if(countitem(8034) >= 2)
delitem 8034,2;
mes "[Event Manager]";
mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more items.";
getitem 608,10;
close;

case 3-2-2(no):
mes "[Event Manager]";
mes "Ok, back when you want to change something";
close;

case 3-3:

mes "[Event Manager]";
mes "You want to trade 2 SC for 10 Ygg Berry?";
switch(select("yes:no"))

case 3-3-1(yes):

next;
if(countitem(8033) < 2) goto nocoin;
if(countitem(8033) >= 2)
delitem 8034,2;
mes "[Event Manager]";
mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more items.";
getitem 607,10;
close;


case 3-3-2(no):
mes "[Event Manager]";
mes "Ok, back when you want to change something";
close;


nocoin:
mes "[Event Manager]";
mes "You don't have enough Event Coins to obtain this reward";
close;

Edited by ZelosAvalon
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   2
  • Joined:  08/23/12
  • Last Seen:  

Hello Zelos, Do you have the screenshots of the error?

Kindly post some screenshots for fast assistance.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   33
  • Joined:  11/11/12
  • Last Seen:  

Hello Zelos, Do you have the screenshots of the error?

Kindly post some screenshots for fast assistance.

the npc didn't start! the structure of the npc's that, but dont work!

I take long to do all this because I am newbie and did not work!

help me please!

check this npc for me.

i dont know who i can put for work this npc!

best regards. Zelos

Edited by ZelosAvalon
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   46
  • Joined:  10/30/12
  • Last Seen:  

To many error found.. Check back on your " { " code.. Better use Notepad++ to check the problem or test on your server. You will know which line is error.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

//=============================================
//== Event Manager  ======
//== Version: =================================
//== 1.0
//== by Zelos: ================================
//==
//=============================================
prontera,165,155,2 script Event manager 804,{
mes "[Event manager]";
mes "Hello "+StrCharInfo(0)+"!";
mes "I'm the Event Manager.";
mes "You give me Event Coins, i reward you. It's that simple!";
next;
switch(select("1 - Tell me more about Event coins and rewards","2 - I want to convert my Event Coins","3 - I want to receive my rewards","4 - Well,it was nice meeting you")){
case 1:
mes "[Event Manager]";
mes "There are 3 types of Event Coins you may win from Events:";
mes " - "+getitemname(8032);
mes " - "+getitemname(8033);
mes " - "+getitemname(8034);
next;
mes "[Event manager]";
mes "The exchange rates between Event Coin are:";
mes " 1 Golden Coin = 5 Silver Coins";
mes " 1 Silver Coin = 5 Bronze Coins";
next;
mes "[Event mMnager]";
mes "Here is the list rewards you may receive from your Event Coins:";
mes "( Note that in this list, we have: GC = Golden Coins, SC = Silver Coins and BC = Bronze Coins )";
next;
mes "[Event Manager]";
mes "1.[10000] Zeny for 1 BC]";
mes "2.[10]Yggdrasil Seeds for 2 BC]";
mes "3.[10]Yggdrasil Berry for 2 SC]";
mes "4."";
mes "5."";
close;
case 2:
mes "[Event Manager]";
mes "Remeber the conversion rates:";
mes " 1 Golden Coin = 5 Silver Coins";
mes " 1 Silver Coin = 5 Bronze Coins";
mes "so, which type of conversion would you like to do?";
next;
switch(select("1-Gold Coin => Silver Coin","2-Silver Coin => Bronze Coin","3-Bronze Coin => Silver Coin","4-Silver Coin => Golden Coin","5-Nothing for now...")){
 case 1:
 mes "[Event Manager]";
 mes "How many Golden Coins you want to convert?";
 input .sc;
 next;
 if(countitem(8032) < .sc){mes "[Event Manager]";mes "You don't have enough Golden Coins.";close;}
 delitem 8032,.sc;
 mes "[Event Manager]";
 mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
 getitem 8033,.sc;
 close;
 case 2:
 mes "[Event Manager]";
 mes "How many Silver Coins you want to convert?";
 input .sc;
 next;
 if(countitem(8033)<.sc){mes "[Event Manager]";mes "You don't have enough Silver Coins.";close;}
 delitem 8033,.sc;
 mes "[Event Manager]";
 mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
 getitem 8034,.sc;
 close;
 case 3:
 mes "[Event Manager]";
 mes "How many Silver Coins do you want to get?";
 input .sc;
 next;
 if(countitem(8034<(.sc*5)){mes "[Event Manager]";mes "You don't have enough Bronze Coins.";close;}
 delitem 8034,(.sc*5);
 mes "[Event Manager]";
 mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
 getitem 8033,.sc;
 close;
 case 4:
 mes "[Event Manager]";
 mes "How many Golden Coins do you want to get?";
 input .sc;
 next;
 if(countitem(8033<(.sc*5)){mes "[Event Manager]";mes "You don't have enough Silver Coins.";close;}
 delitem 8033,(.sc*5);
 mes "[Event Manager]";
 mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
 getitem 8032,.sc;
 close;
 case 5:
 mes "[Event Manager]";
 mes "Ok, no problem.";
 close;
 }
case 3:
mes "[Event Manager]";
mes "Here is the rewards you may receive from your Event Coins:";
mes "( Note that in this list, we have: GC = Golden Coins, SC = Silver Coins and BC = Bronze Coins )";
next;
switch(select("1.[10000] Zeny for 1 BC","2.[10]Yggdrasil Seeds for 2 BC","3.[10]Yggdrasil Berry for 2 SC")){
 case 1:
 mes "[Event Manager]";
 mes "You want to trade 1 BC for 10000 Zeny?";
 next;
 switch(select("yes","no")){
  case 1:
  if(countitem(8034) < 1) goto nocoin;
  delitem 8034,1;
  mes "[Event Manager]";
  mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more zeny.";
  set Zeny,Zeny+10000;
  close;
  case 2:
  mes "[Event Manager]";
  mes "Ok, back when you want to change something";
  close;
  }
 case 2:
 mes "[Event Manager]";
 mes "You want to trade 2 BC for 10 Ygg Seed?";
 next;
 switch(select("yes","no")){
  case 1:
  if(countitem(8034) < 2) goto nocoin;
  delitem 8034,2;
  mes "[Event Manager]";
  mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more items.";
  getitem 608,10;
  close;
  case 2:
  mes "[Event Manager]";
  mes "Ok, back when you want to change something";
  close;
  }
 case 3:
 mes "[Event Manager]";
 mes "You want to trade 2 SC for 10 Ygg Berry?";
 next;
 switch(select("yes","no")){
  case 1:
  if(countitem(8033) < 2) goto nocoin;
  delitem 8034,2;
  mes "[Event Manager]";
  mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more items.";
  getitem 607,10;
  close;
  case 2:
  mes "[Event Manager]";
  mes "Ok, back when you want to change something";
  close;
  }
case 4:
mes "[Event Manager]";
mes "Ok, back when you want to change something";
close;
}
}
nocoin:
mes "[Event Manager]";
mes "You don't have enough Event Coins to obtain this reward";
close;
}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   33
  • Joined:  11/11/12
  • Last Seen:  

mes "How many Silver Coins do you want to get?";
 input .sc*5;( here u will input number coin u have example: if you have 10 silver coins( note: 5 silver coins = 1 golden coin ) and input here 10 silver u will get 2 golden coins! )



if(countitem(8034<(.sc*5)) (<-here will check if I have the number of coins that I said in the "input" ) {mes "[Event Manager]";mes "You don't have enough Bronze Coins.";close;}
delitem 8034,(.sc*5);(<-here will delete the number of coins that I said in the "input" )

getitem 8032,.sc; (<-here will receive the number of coins that I said in the"input / 5" )( note: 5 silver coins = 1 golden coin ) ( if i put 5 silver on"input" here i will get 5 / 5 = 1 golen or if i put 10 silver on "input" here i will get 10 / 5 = 2 golden ) )

i dont know who i can edit it!

Edited by ZelosAvalon
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   2
  • Joined:  08/23/12
  • Last Seen:  

Try to replace this :

.sc*5;

Into :

.@coins

Actually im still downloading my test server. And cannot try this script. Im bored reading script.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   33
  • Joined:  11/11/12
  • Last Seen:  

i get this erro [Error]: Missing 1 right curlys at file 'npc/custom/ragnarebirth/event_manager-zelos.txt', line '169'.


//=============================================
//== Event Manager  ======
//== Version: =================================
//== 1.0
//== by Zelos: ================================
//==
//=============================================

prontera,165,155,2 script EventManager 804,{

mes "[Event manager]";
mes "Hello "+StrCharInfo(0)+"!";
mes "I'm the Event Manager.";
mes "You give me Event Coins, i reward you. It's that simple!";
next;
switch(select("1 - Tell me more about Event coins and rewards","2 - I want to convert my Event Coins","3 - I want to receive my rewards","4 - Well,it was nice meeting you")){
case 1:
mes "[Event Manager]";
mes "There are 3 types of Event Coins you may win from Events:";
mes " - "+getitemname(8032);
mes " - "+getitemname(8033);
mes " - "+getitemname(8034);
next;
mes "[Event manager]";
mes "The exchange rates between Event Coin are:";
mes " 1 Golden Coin = 5 Silver Coins";
mes " 1 Silver Coin = 5 Bronze Coins";
next;
mes "[Event mMnager]";
mes "Here is the list rewards you may receive from your Event Coins:";
mes "( Note that in this list, we have: GC = Golden Coins, SC = Silver Coins and BC = Bronze Coins )";
next;
mes "[Event Manager]";
mes "1.[10000] Zeny for 1 BC]";
mes "2.[10]Yggdrasil Seeds for 2 BC]";
mes "3.[10]Yggdrasil Berry for 2 SC]";
close;
case 2:
mes "[Event Manager]";
mes "Remeber the conversion rates:";
mes " 1 Golden Coin = 5 Silver Coins";
mes " 1 Silver Coin = 5 Bronze Coins";
mes "so, which type of conversion would you like to do?";
next;
switch(select("1-Gold Coin => Silver Coin","2-Silver Coin => Bronze Coin","3-Bronze Coin => Silver Coin","4-Silver Coin => Golden Coin","5-Nothing for now...")){
 case 1:
 mes "[Event Manager]";
 mes "How many Golden Coins you want convert to Silver?";
 input .sc;
 next;
 if(countitem(8032) < .sc){
 mes "[Event Manager]";
 mes "You don't have enough Golden Coins.";
 close;
 }
 delitem 8032,.sc;
 mes "[Event Manager]";
 mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
 getitem 8033,(.sc*5);
 close;
 case 2:
 mes "[Event Manager]";
 mes "How many Silver Coins you want convert to Bronze?";
 input .sc;
 next;
 if(countitem(8033)<.sc){
 mes "[Event Manager]";
 mes "You don't have enough Silver Coins.";close;
 }
 delitem 8033,.sc;
 mes "[Event Manager]";
 mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
 getitem 8034,(.sc*5);
 close;
 case 3:
 mes "[Event Manager]";
 mes "How many Bronze Coins do you want converto to Silver?";
 input .sc;
 next;
 if (countitem(8034)<.sc) {
 mes "[Event Manager]";
 mes "You don't have enough Bronze Coins.";
 close;
 }
 delitem 8034,(.sc);
 mes "[Event Manager]";
 mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
 getitem 8033,(.sc/5);
 close;
 case 4:
 mes "[Event Manager]";
 mes "How many Silver Coins do you want to convert to Golden Coins?";
 input .sc;
 next;
if (countitem(8033)<.sc) {
 mes "[Event Manager]";
 mes "You don't have enough Silver Coins.";
 close;
 }
 delitem 8033,(.sc);
 mes "[Event Manager]";
 mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
 getitem 8032,(.sc*/5);
 close;
 case 5:
 mes "[Event Manager]";
 mes "Ok, no problem.";
 close;
 }
case 3:
mes "[Event Manager]";
mes "Here is the rewards you may receive from your Event Coins:";
mes "( Note that in this list, we have: GC = Golden Coins, SC = Silver Coins and BC = Bronze Coins )";
next;
switch(select("1.[10000] Zeny for 1 BC","2.[10]Yggdrasil Seeds for 2 BC","3.[10]Yggdrasil Berry for 2 SC")){
 case 1:
 mes "[Event Manager]";
 mes "You want to trade 1 BC for 10000 Zeny?";
 next;
 switch(select("yes","no")){
  case 1:
  if(countitem(8034) < 1) goto nocoin;
  delitem 8034,1;
  mes "[Event Manager]";
  mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more zeny.";
  set Zeny,Zeny+10000;
  close;
  case 2:
  mes "[Event Manager]";
  mes "Ok, back when you want to change something";
  close;
  }
 case 2:
 mes "[Event Manager]";
 mes "You want to trade 2 BC for 10 Ygg Seed?";
 next;
 switch(select("yes","no")){
  case 1:
  if(countitem(8034) < 2) goto nocoin;
  delitem 8034,2;
  mes "[Event Manager]";
  mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more items.";
  getitem 608,10;
  close;
  case 2:
  mes "[Event Manager]";
  mes "Ok, back when you want to change something";
  close;
  }
 case 3:
 mes "[Event Manager]";
 mes "You want to trade 2 SC for 10 Ygg Berry?";
 next;
 switch(select("yes","no")){
  case 1:
  if(countitem(8033) < 2) goto nocoin;
  delitem 8034,2;
  mes "[Event Manager]";
  mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more items.";
  getitem 607,10;
  close;
  case 2:
  mes "[Event Manager]";
  mes "Ok, back when you want to change something";
  close;
  }
  }
case 4:
mes "[Event Manager]";
mes "Ok, back when you want to change something";
close;
}
nocoin:
mes "[Event Manager]";
mes "You don't have enough Event Coins to obtain this reward";
close;
}

Working ! thanks but this line getitem 8033,(.sc/5); dont work, i need to getitem example : if i put .sc= 10 silver i will get .sc=10/5 = 2

who is this script for divide ? does not exist? or / divide is not considered? tried to put: getitem 8033,(.sc*0,2); but dont work too =(

Help me please!

best regards Zelos

Try to replace this :

.sc*5;

Into :

.@coins

Actually im still downloading my test server. And cannot try this script. Im bored reading script.

Working ! but this line getitem 8033,(.sc/5); dont work, i need to getitem example : if i put .sc= 10 silver i will get .sc=10/5 = 2

who is this script for divide ? does not exist? or / divide is not considered? tried to put: getitem 8033,(.sc*0,2); but dont work too =(

Help me please!

best regards Zelos

Edited by ZelosAvalon
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Avoid multi switch <<

//=============================================
//== Event Manager  ======
//== Version: =================================
//== 1.0
//== by Zelos: ================================
//==
//=============================================

prontera,165,155,2    script    EventManager    804,{

   mes "[Event manager]";
   mes "Hello "+strcharinfo(0)+"!";
   mes "I'm the Event Manager.";
   mes "You give me Event Coins, i reward you. It's that simple!";
   next;
   switch( select("1 - Tell me more about Event coins and rewards",
                   "2 - I want to convert my Event Coins",
                   "3 - I want to receive my rewards",
                   "4 - Well,it was nice meeting you") ) {
       case 1:
           mes "[Event Manager]";
           mes "There are 3 types of Event Coins you may win from Events:";
           mes " - "+getitemname(8032);
           mes " - "+getitemname(8033);
           mes " - "+getitemname(8034);
           next;
           mes "[Event manager]";
           mes "The exchange rates between Event Coin are:";
           mes " 1 Golden Coin = 5 Silver Coins";
           mes " 1 Silver Coin = 5 Bronze Coins";
           next;
           mes "[Event mMnager]";
           mes "Here is the list rewards you may receive from your Event Coins:";
           mes "( Note that in this list, we have: GC = Golden Coins, SC = Silver Coins and BC = Bronze Coins )";
           next;
           mes "[Event Manager]";
           mes "1.[10000] Zeny for 1 BC]";
           mes "2.[10]Yggdrasil Seeds for 2 BC]";
           mes "3.[10]Yggdrasil Berry for 2 SC]";
           close;
       case 2:
           mes "[Event Manager]";
           mes "Remeber the conversion rates:";
           mes " 1 Golden Coin = 5 Silver Coins";
           mes " 1 Silver Coin = 5 Bronze Coins";
           mes "so, which type of conversion would you like to do?";
           next;
           switch(select("1-Gold Coin => Silver Coin","2-Silver Coin => Bronze Coin","3-Bronze Coin => Silver Coin","4-Silver Coin => Golden Coin","5-Nothing for now...")){
               case 1:
                   mes "[Event Manager]";
                   mes "How many Golden Coins you want convert to Silver?";
                   input .@sc;
                   next;
                   if(countitem(8032) < .@sc){
                       mes "[Event Manager]";
                       mes "You don't have enough Golden Coins.";
                       close;
                   }
                   delitem 8032,.@sc;
                   mes "[Event Manager]";
                   mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
                   getitem 8033,(.@sc*5);
                   close;
               case 2:
                   mes "[Event Manager]";
                   mes "How many Silver Coins you want convert to Bronze?";
                   input .@sc;
                   next;
                   if(countitem(8033)<.@sc){
                       mes "[Event Manager]";
                       mes "You don't have enough Silver Coins.";close;
                   }
                   delitem 8033,.@sc;
                   mes "[Event Manager]";
                   mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
                   getitem 8034,(.@sc*5);
                   close;
               case 3:
                   mes "[Event Manager]";
                   mes "How many Bronze Coins do you want converto to Silver?";
                   input .@sc;
                   next;
                   if ( countitem(8034) < 5 || countitem(8034) < .@sc ) {
                       mes "[Event Manager]";
                       mes "You don't have enough Bronze Coins to convert.";
                       close;
                   }
                   delitem 8034, ( .@sc - .@sc%5 );
                   mes "[Event Manager]";
                   mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
                   getitem 8033,(.@sc/5);
                   close;
               case 4:
                   mes "[Event Manager]";
                   mes "How many Silver Coins do you want to convert to Golden Coins?";
                   input .@sc;
                   next;
                   if ( countitem(8033) < 5 || countitem(8033) < .@sc ) {
                       mes "[Event Manager]";
                       mes "You don't have enough Silver Coins.";
                       close;
                   }
                   delitem 8033, ( .@sc - .@sc%5 );
                   mes "[Event Manager]";
                   mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
                   getitem 8032,(.@sc/5);
                   close;
               case 5:
                   mes "[Event Manager]";
                   mes "Ok, no problem.";
                   close;
           }
       case 3:
           mes "[Event Manager]";
           mes "Here is the rewards you may receive from your Event Coins:";
           mes "( Note that in this list, we have: GC = Golden Coins, SC = Silver Coins and BC = Bronze Coins )";
           next;
           switch(select("1.[10000] Zeny for 1 BC","2.[10]Yggdrasil Seeds for 2 BC","3.[10]Yggdrasil Berry for 2 SC")){
               case 1:
                   mes "[Event Manager]";
                   mes "You want to trade 1 BC for 10000 Zeny?";
                   next;
                   switch(select("yes","no")){
                       case 1:
                           if(countitem(8034) < 1) goto nocoin;
                           delitem 8034,1;
                           mes "[Event Manager]";
                           mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more zeny.";
                           set Zeny,Zeny+10000;
                           close;
                       case 2:
                           mes "[Event Manager]";
                           mes "Ok, back when you want to change something";
                           close;
                   }
               case 2:
                   mes "[Event Manager]";
                   mes "You want to trade 2 BC for 10 Ygg Seed?";
                   next;
                   switch(select("yes","no")){
                       case 1:
                           if(countitem(8034) < 2) goto nocoin;
                           delitem 8034,2;
                           mes "[Event Manager]";
                           mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more items.";
                           getitem 608,10;
                           close;
                       case 2:
                           mes "[Event Manager]";
                           mes "Ok, back when you want to change something";
                           close;
                   }
               case 3:
                   mes "[Event Manager]";
                   mes "You want to trade 2 SC for 10 Ygg Berry?";
                   next;
                   switch(select("yes","no")){
                       case 1:
                           if(countitem(8033) < 2) goto nocoin;
                           delitem 8034,2;
                           mes "[Event Manager]";
                           mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more items.";
                           getitem 607,10;
                           close;
                       case 2:
                           mes "[Event Manager]";
                           mes "Ok, back when you want to change something";
                           close;
                   }
           }
       case 4:
           mes "[Event Manager]";
           mes "Ok, back when you want to change something";
           close;
   }
nocoin:
   mes "[Event Manager]";
   mes "You don't have enough Event Coins to obtain this reward";
   close;
}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   33
  • Joined:  11/11/12
  • Last Seen:  

Avoid multi switch <<

//=============================================
//== Event Manager  ======
//== Version: =================================
//== 1.0
//== by Zelos: ================================
//==
//=============================================

prontera,165,155,2	script	EventManager	804,{

mes "[Event manager]";
mes "Hello "+strcharinfo(0)+"!";
mes "I'm the Event Manager.";
mes "You give me Event Coins, i reward you. It's that simple!";
next;
switch( select("1 - Tell me more about Event coins and rewards",
				"2 - I want to convert my Event Coins",
				"3 - I want to receive my rewards",
				"4 - Well,it was nice meeting you") ) {
	case 1:
		mes "[Event Manager]";
		mes "There are 3 types of Event Coins you may win from Events:";
		mes " - "+getitemname(8032);
		mes " - "+getitemname(8033);
		mes " - "+getitemname(8034);
		next;
		mes "[Event manager]";
		mes "The exchange rates between Event Coin are:";
		mes " 1 Golden Coin = 5 Silver Coins";
		mes " 1 Silver Coin = 5 Bronze Coins";
		next;
		mes "[Event mMnager]";
		mes "Here is the list rewards you may receive from your Event Coins:";
		mes "( Note that in this list, we have: GC = Golden Coins, SC = Silver Coins and BC = Bronze Coins )";
		next;
		mes "[Event Manager]";
		mes "1.[10000] Zeny for 1 BC]";
		mes "2.[10]Yggdrasil Seeds for 2 BC]";
		mes "3.[10]Yggdrasil Berry for 2 SC]";
		close;
	case 2:
		mes "[Event Manager]";
		mes "Remeber the conversion rates:";
		mes " 1 Golden Coin = 5 Silver Coins";
		mes " 1 Silver Coin = 5 Bronze Coins";
		mes "so, which type of conversion would you like to do?";
		next;
		switch(select("1-Gold Coin => Silver Coin","2-Silver Coin => Bronze Coin","3-Bronze Coin => Silver Coin","4-Silver Coin => Golden Coin","5-Nothing for now...")){
			case 1:
				mes "[Event Manager]";
				mes "How many Golden Coins you want convert to Silver?";
				input .@sc;
				next;
				if(countitem(8032) < .@sc){
					mes "[Event Manager]";
					mes "You don't have enough Golden Coins.";
					close;
				}
				delitem 8032,.@sc;
				mes "[Event Manager]";
				mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
				getitem 8033,(.@sc*5);
				close;
			case 2:
				mes "[Event Manager]";
				mes "How many Silver Coins you want convert to Bronze?";
				input .@sc;
				next;
				if(countitem(8033)<.@sc){
					mes "[Event Manager]";
					mes "You don't have enough Silver Coins.";close;
				}
				delitem 8033,.@sc;
				mes "[Event Manager]";
				mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
				getitem 8034,(.@sc*5);
				close;
			case 3:
				mes "[Event Manager]";
				mes "How many Bronze Coins do you want converto to Silver?";
				input .@sc;
				next;
				if ( countitem(8034) < 5 || countitem(8034) < .@sc ) {
					mes "[Event Manager]";
					mes "You don't have enough Bronze Coins to convert.";
					close;
				}
				delitem 8034, ( .@sc - .@sc%5 );
				mes "[Event Manager]";
				mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
				getitem 8033,(.@sc/5);
				close;
			case 4:
				mes "[Event Manager]";
				mes "How many Silver Coins do you want to convert to Golden Coins?";
				input .@sc;
				next;
				if ( countitem(8033) < 5 || countitem(8033) < .@sc ) {
					mes "[Event Manager]";
					mes "You don't have enough Silver Coins.";
					close;
				}
				delitem 8033, ( .@sc - .@sc%5 );
				mes "[Event Manager]";
				mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with beautiful items.";
				getitem 8032,(.@sc/5);
				close;
			case 5:
				mes "[Event Manager]";
				mes "Ok, no problem.";
				close;
		}
	case 3:
		mes "[Event Manager]";
		mes "Here is the rewards you may receive from your Event Coins:";
		mes "( Note that in this list, we have: GC = Golden Coins, SC = Silver Coins and BC = Bronze Coins )";
		next;
		switch(select("1.[10000] Zeny for 1 BC","2.[10]Yggdrasil Seeds for 2 BC","3.[10]Yggdrasil Berry for 2 SC")){
			case 1:
				mes "[Event Manager]";
				mes "You want to trade 1 BC for 10000 Zeny?";
				next;
				switch(select("yes","no")){
					case 1:
						if(countitem(8034) < 1) goto nocoin;
						delitem 8034,1;
						mes "[Event Manager]";
						mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more zeny.";
						set Zeny,Zeny+10000;
						close;
					case 2:
						mes "[Event Manager]";
						mes "Ok, back when you want to change something";
						close;
				}
			case 2:
				mes "[Event Manager]";
				mes "You want to trade 2 BC for 10 Ygg Seed?";
				next;
				switch(select("yes","no")){
					case 1:
						if(countitem(8034) < 2) goto nocoin;
						delitem 8034,2;
						mes "[Event Manager]";
						mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more items.";
						getitem 608,10;
						close;
					case 2:
						mes "[Event Manager]";
						mes "Ok, back when you want to change something";
						close;
				}
			case 3:
				mes "[Event Manager]";
				mes "You want to trade 2 SC for 10 Ygg Berry?";
				next;
				switch(select("yes","no")){
					case 1:
						if(countitem(8033) < 2) goto nocoin;
						delitem 8034,2;
						mes "[Event Manager]";
						mes "Thank you for choosing RagnaRebirth that luck be with you in future events, and you can win many Coins, and exchange with more items.";
						getitem 607,10;
						close;
					case 2:
						mes "[Event Manager]";
						mes "Ok, back when you want to change something";
						close;
				}
		}
	case 4:
		mes "[Event Manager]";
		mes "Ok, back when you want to change something";
		close;
}
nocoin:
mes "[Event Manager]";
mes "You don't have enough Event Coins to obtain this reward";
close;
}

I already said that I love you? LOOOL

Working 100% ty very much!!!!!

thanks all for help NPC working now!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Well, multi switches isn't really my style. I'm just editing his script :P

In fact, I don't know those item id, I'm just guessing hehe..

  • Upvote 1
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...