Jump to content
  • 0

Requesting Hourly CashPoints Plus NPC cashpoints


monzki3

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  08/31/13
  • Last Seen:  

//============================================================================//
//= Custom Hourly Points v1
//============================================================================//
//= Edited by : Expedia Team
//============================================================================//
//= Description :
//= 1. Allows player to have an outstanding points by staying in game for an
//= hour nor days.
//= 2. GM can add/edit/change some lines
//= 3. Start, Pause, Stop
//= 4. Get Prizes
//============================================================================//
prontera,165,163,5 script Mr. Zage 488,{
set .@n$,"[ Mr. Zage ]";

   mes .@n$;
   mes "How may I help you today?";
   next;
   swtich(select("- Check Points:- Commands:- Claim Prizes")){
 
  case 1:
  mes .@n$;
  mes "Character Name : "+strcharinfo(0)+"";
  mes "Points : "+.@points+"";
  mes "";
  mes "";
  mes "What do you want to do?";
  next;
  return;

  case 2:
  mes .@n$;
  mes "What do you want to do?";
  next;
  menu "- Start",Start,
    "- Pause",Pause,
    "- Stop",Stop;
 
  Start:
  mes .@n$;
  mes "I'm going to start your timer, right now!";
  next;
  attachtimer ""+strcharinfo(0)+"";
  initnpctimer;
  mes .@n$;
  mes "Have fun staying here!"
  close;

  Pause:
  mes .@n$;
  mes "I'm going to pause your timer, right now!";
  mes "";
  mes "";
  mes "And also I'd like to remind you that pubbing or vending will automatically pause your timer.";
  next;
  stopnpctimer;
  mes .@n$;
  mes "Have fun, come back here if you want to resume your timer...!";
  close;

  Stop:
  mes .@n$;
  mes "I'm going to stop your timer, right now!";
  mes "";
  mes "";
  mes "Pausing or Stopping time are the same...";
  next;
  stopnpctimer;
  mes .@n$;
  mes "Have fun! Come back here if you want to start your timer...!";
  close;

  case 3:
  goto Prizes;

  
  //============================================================================//
  //= Configuration :
  //============================================================================//
  OnMinute60000:
  set @mins, @mins + 1;
  if(@mins == 60){
  set @mins,0;
   set .@points,10;  //= Default points to be added
   if(checkVending() == 1) {
   dispbottom "The timer will automatically pause!";
   stopnpctimer;
   end;
   }
   else {
   set @totalpoints, @totalpoints + .@points;
   dispbottom "You have acquired "+.@points+" by staying ingame for 1 hour!";
   dispbottom "Your total points : "+@totalpoints"+";
   set @cons_hr, @cons_hr + 1;
   }
   }
  if(@cons_hr == 12){
  set @cons_hr,0;
  set @cons_hr_points,120;    //= Default is 50 | Points gained after staying in game for 12 hours
  set @totalpoints, @totalpoints + @cons_hr_points;
  dispbottom "You have acquired an additional "+@cons_hr_points+" by staying ingame for 12 hours!";
  dispbottom "Your total points : "+@totalpoints"+";
  }
   stopnpctimer;
   initnpctimer;
   end;
   }

  Prizes:
  mes .@n$;
  mes "Your total points : "+@totalpoints+"";
  mes "";
  mes "";
  mes " Redirecting to points converter!";
  next;
- shop exp_team01 -1,501:50
    mes .@n$;
  mes " Welcome "+strcharinfo(0)+"";
  mes " What do you want to do with your "+.Item+"?";
  switch(select("- Exchange Item:- Nothing")){
  case 1:
  mes .@n$;
  callshop "exp_team"+.a,1;
  npcshopattach "exp_team"+.a;
  end;
  OnInit:
//=======================================================================//
//= Settings and Functions
    set .a,strnpcinfo(2);    //= Do not touch this
    set .Item,@totalpoints;      //= Item Cost change this if you wanted
    setarray .item_id[0],7806,7776,2737;     //= You can add more items if you wanted
    setarray .item_co[0],1000,100,800;   //= You can change the item cost here
npcshopitem "exp_team'+.a,.item_id[0],.item_co[0];
for(set .et,1;.et<getarraysize(.item_id);set .et,.et+1){
npcshopadditem "exp_team"+.a,.item_id[.et],.item_co[.et];
    }
    end;
  
    OnBuyItem:
   getinventorylist;
   if(@item_quantity[@i] <= 0){
   goto OnCheck;
   end;
  
    for(set @i,0;@i<getarraysize(@item_nameid);set @i,@i+1){
    set .@value, getiteminfo( @item_nameid[.@i], 2 );
    if( .@value == 4 || .@value == 5 || .@value == 7 || .@value == 8 )
    set .@number, .@number+1;
    else {
    for(set .@a,0; .@a<@equiplist_count; set .@j,.@j+1)
    if ( @equiplist_id[.@i] == @item_nameid[.@i] )
    break;
    if ( .@a == @equiplist_count )
    set .@number, .@number+1;
    }
  
   for(set @i2,0;@i2<getarraysize(.item_id);set @i2,@i2+1){
   if(@item_nameid[@i]==.item_id[@i2]){
   set @ex,@ex+.item_co[@i2]*@item_quantity[@i];
   set @ep,@ep+getiteminfo(@item_nameid[@i],6)*@item_quantity[@i];
   }
   }
   }
 
    if( .@number + @itemlist_count > 100 ){
    announce "[Dynamic Shop]: Inventory is full.",bc_self;
    goto OnCheck;
    }

   if(countitem(.Item)<@ex){
   announce "[Dynamic Shop]: Not enough ["+getitemname(.Item)+"]",bc_self;
   goto OnCheck;
   end;
  
    }else{
    if(@ep>(MaxWeight-Weight)){
    announce "[Dynamic Shop]: Too heavy for you, transfer items please.",bc_self;
    goto OnCheck;
    end;
  
   }else{
   delitem .Item,@ex;
   for(set @i,0;@i<getarraysize(@item_nameid);set @i,@i+1){
   getitem @item_nameid[@i],@item_quantity[@i];
   }
   }
   }
  
    OnCheck:
    set .@ex,0;
    set .@ep,0;
    set .@i,0;
    set ,@i2,0;
    deletearray @item_quantity,getarraysize(@item_quantity);
    deletearray @item_nameid,getarraysize(@item_nameid);
    end;
  
   case 2:
   mes .@n$;
   mes " Okay, bye bye!";
   }
         }

 

I have this script taken from eathena forum. But I want to request like this script because i having problem with this script.

 

this is the error : I dunno how to solve.


unexpected newline at string line 135

//=======================================================================//
//= Settings and Functions
    set .a,strnpcinfo(2);          //= Do not touch this
    set .Item,@totalpoints;            //= Item Cost change this if you wanted
    setarray .item_id[0],7806,7776,2737;        //= You can add more items if you wanted
    setarray .item_co[0],1000,100,800;         //= You can change the item cost here
* 135 :    npcshopitem "exp_team'+.a,.item_id[0],.item_co[0];
    for(set .et,1;.et<getarraysize(.item_id);set .et,.et+1){
    npcshopadditem "exp_team"+.a,.item_id[.et],.item_co[.et];
       }
       end;

Edited by Emistry
added code bbcode.
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


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


npcshopitem "exp_team"+.a,.item_id[0],.item_co[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...