Jump to content
  • 0

Help on my floating rates


chromus28

Question


  • Group:  Members
  • Topic Count:  91
  • Topics Per Day:  0.02
  • Content Count:  263
  • Reputation:   1
  • Joined:  04/25/13
  • Last Seen:  

guys can anyone help me with this one? 

prontera.gat,128,193,6	script	Floating Rates#2	402,{
//-------------------------
//Main Configuration
set $oribrate,30000;
//Your Original Base Exp Rate.
set $orijrate,30000;
//Your Original Job Exp Rate.
set $zenyneeded,50000000;
//Zeny needed to activate Floating Rates.
set .@curzeny,readparam(20);
//Reads the current zeny of the player.
set .@bfloatrate,rand(30000,40000);
//Floating Base Exp.
set .@jfloatrate,rand(30000,40000);
//Floating Job Exp.
set @nn$,"[Floating Rates]";
//NPC Name.
//-------------------------
//Main Script
if ( getgmlevel() >= 60 ) goto L_GM;
L_Normal:
mes @nn$;
mes "Hello!";
mes "If we reach the ^00ff0050,000,000^000000 Zeny balance then we start a floating rates!";
next;
mes @nn$;
mes "Current Balance : ^00ff00"+$fzeny+"^000000 Zeny.";
mes "We need more ^ff0000"+($zenyneeded-$fzeny)+" ^000000Zeny before we can start the floating rates";
mes "Do you want to contribute some zeny?";
next;
menu "Yes",-,"No",L_End;
mes @nn$;
mes "Currently you have ^0000ff"+Zeny+"^000000 Zeny.";
mes "So,what do you say?";
next;
menu "I would like to contribute some zeny!",L_Contribute,"Sorry I need that zeny.",L_End;
L_Contribute:
mes @nn$;
mes "How many zeny do you like to spend?";
input .@zcontribute;
if ( .@zcontribute == 0 ) {
next;
mes @nn$;
mes "I don't think you contribute something";
mes "Please be serious.";
goto L_End;
}
if ( .@zcontribute > .@curzeny ) {
next;
mes @nn$;
mes "Sorry you don't have that much Zeny.";
goto L_End;
}
mes "Thanks for your contribution!";
set $fzeny,$fzeny+.@zcontribute;
set Zeny,Zeny-.@zcontribute;
if ($fzeny >= $zenyneeded) {
set $fzeny,$fzeny - $zenyneeded;
set $frate2,1;
set $bexp,.@bfloatrate;
set $jexp,.@jfloatrate;
setbattleflag "base_exp_rate",$bexp;
setbattleflag "job_exp_rate",$jexp;
atcommand "@reloadmobdb";
mes "Floating Base Exp rate: "+$bexp/100+"";
mes "Floating Base Exp rate: "+$jexp/100+"";
set $rema2,gettimetick(2) + 3600;
set $time2, $rema2 - gettimetick(2);
set $min2,  $time2 % (24*60*60) % (60*60) / (60);
set $sec2,  $time2 % (24*60*60) % (60*60) % (60);
announce "Floating Rates were sponsored by many players for 1 hour. The Floating Rates are :",0;
close2;
// sleep2 3000;
announce "Base EXP Rate :  "+getbattleflag("base_exp_rate")/100+"",0;
// sleep2 3000;
announce "Job EXP Rate :  "+getbattleflag("job_exp_rate")/100+"",0;
goto L_room;
end;
}
next;
goto L_Normal;
L_fix:
  setbattleflag "base_exp_rate",$oribrate;
  setbattleflag "job_exp_rate",$orijrate;
  atcommand "@rates";
close2;
end;
L_GM:
mes @nn$;
mes "How can I help you?";
next;
menu "Stop the floating rates",L_StopFR,"Start the floating rates",L_StartFR,"Bring me to normal menu",L_Normal;
L_StopFR:
if ($frate2 == 1) {
set $gmstop,1;
set $rema2,0;
set $frate2,0;
announce "The Floating Rates where stoped by the Game Master. Thanks to many people for Floating Rates!",0;
delwaitingroom;
setbattleflag("base_exp_rate",$oribrate);
setbattleflag("job_exp_rate",$orijrate);
atcommand "@reloadmobdb";
end;
}
next;
mes @nn$;
mes "The floating rates haven't started yet.";
next;
goto L_GM;
L_StartFR:
if ($frate2 == 0) {
set $frate2,1;
set $bexp,.@bfloatrate;
set $jexp,.@jfloatrate;
setbattleflag "base_exp_rate",$bexp;
setbattleflag "job_exp_rate",$jexp;
atcommand "@reloadmobdb";
mes "Floating Base Exp rate: "+$bexp/100+"";
mes "Floating Base Exp rate: "+$jexp/100+"";
set $rema2,gettimetick(2) + 3600;
set $time2, $rema2 - gettimetick(2);
set $min2,  $time2 % (24*60*60) % (60*60) / (60);
set $sec2,  $time2 % (24*60*60) % (60*60) % (60);
announce "Floating Rates were sponsored by GM for 1 hour. The Floating Rates are :",0;
close2;
// sleep2 3000;
announce "Base EXP Rate :  "+getbattleflag("base_exp_rate")/100+"",0;
// sleep2 3000;
announce "Job EXP Rate :  "+getbattleflag("job_exp_rate")/100+"",0;
goto L_room;
}
next;
mes @nn$;
mes "The floating rates already started.";
goto L_GM;
L_End:
next;
mes @nn$;
mes "Goodbye!";
close;
end;
L_room:
  sleep 1000;
  delwaitingroom;
  set $time2, $rema2 - gettimetick(2);
  set $min2,  $time2 % (24*60*60) % (60*60) / (60);
  set $sec2,  $time2 % (24*60*60) % (60*60) % (60);
  if ($rema2 <= 59 && $rema2 >= 1) {
  delwaitingroom;
  waitingroom ""+$sec2+" Seconds remaining.",0;
  goto L_room;
  } else if ($rema2 == gettimetick(2)) {
  delwaitingroom;
  announce "The Floating Rates ended. Thanks to many people for Floating Rates!",0;
  setBattleFlag "base_exp_rate",$oribrate;
  setBattleFlag "job_exp_rate",$orijrate;
  set $frate2,0;
  atcommand "@reloadmobdb";
  end;
  } else if ($rema2 >= 60) {
  delwaitingroom;
  waitingroom ""+$min2+" min "+$sec2+" sec remaining.",0;
  goto L_room;
  }
  end;
OnPcLoginEvent:
if ($frate2 == 1) {
announce "Floating Rates were sponsored by many players for 1 hour. The Floating Rates are : ",bc_self;
// sleep2 3000;
announce "Base EXP Rate :  "+getbattleflag("base_exp_rate")/100+"",bc_self;
// sleep2 3000;
announce "Job EXP Rate :  "+getbattleflag("job_exp_rate")/100+"",bc_self;
// sleep2 3000;
announce "The remaining time of the Floating Rates : "+$min2+" minutes "+$sec2+" seconds.",bc_self;
end;
} else {end;}
OnInit:
  if ($rema2 <= 59) {
  if ($frate2 == 0) end;
  delwaitingroom;
  waitingroom ""+$sec2+" Seconds remaining.",0;
  goto L_room;
  } else if ($rema2 == gettimetick(2)) {
  if ($frate2 == 0) end;
  delwaitingroom;
  if ($sp$ == "") end;
  announce "The Floating Rates ended. Thanks to many people for Floating Rates!",0;
  setBattleFlag "base_exp_rate",$oribrate;
  setBattleFlag "job_exp_rate",$orijrate;  
  set $frate2,0;
  atcommand "@reloadmobdb";
  end;
  } else if ($rema2 >= 60) {
  if ($frate2 == 0) end;
  delwaitingroom;
  waitingroom ""+$min2+" min "+$sec2+" sec remaining.",0;
  goto L_room;
  }
  }
- script frate#2 -1,{
OnWhisperGlobal:
if (@whispervar0$ == "end" || @whispervar0$ == "e") {
  if (getgmlevel() >= 60) {
  if ($frate2 == 1) {
  set $gmstop,1;
  set $rema2,0;
  set $frate2,0;
  announce "The Floating Rates where stoped by the Game Master. Thanks to many people for Floating Rates!",0;
  delwaitingroom;
  setbattleflag("base_exp_rate",$oribrate);
  setbattleflag("job_exp_rate",$orijrate);
  atcommand "@reloadmobdb";
  end;
  }
  }
  }
  }

coz i got this error

 

[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/custom/floating_rates.txt', line '200'. Stopping...
 * w1=- script frate#2 -1,{
 * w2=
 * w3=
 * w4=
 
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


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

The header follows the structure :

-TABULATEscript frate#2TABULATE-1,{

 

More infos on Basic_Scripting#NPC. Please read it carefully, it's the basics if you want to implement a npc.

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