Jump to content
  • 0

Daily Reward NPC limited to An account


Question

Posted (edited)

How do i make the Daily NPC limit to 1 time per account. Players tend to make many chars and abuse it ><// //=====// /==/ /==/

/==/	
//	   //	 //	 /==/	 /==/  /=/	 /==/		
//	  //=====//			  /==/  /=/			 /==============/	 /========/   /==//===/	/==/	 /==/
//	 //=//////	/==/	  /==//=/	   /==/	/==/==/==/==/==/	 /	 /  /   /==/		 /==/	 /==/
//	// ==		/==/	  /==//=/	   /==/	/==/  /==/  /==/	 ======/  /   /==/		 /==/	 /==/
//   //   ==	  /==/	  /==/  /=/	 /==/	/==/  /==/  /==/	 / /===/  /   /==/		 /==/	 /==/
//  //	 ==	/==/	  /==/   /=/	/==/	/==/  /==/  /==/	 / /===/  /   /==/		 /==/=====/==/
// //	   ==  /==/	  /==/	/=/   /==/	/==/  /==/  /==/	 /========/   /==/		 /==///////==/
// ================ rAthena Script ====================================================================
//=== Made by Rikimaru
//==================== Information ====================================================================
//==== Daily Reward Script
//================= Version : =========================================================================
//=== V 1.1   Fixed a typo in the Script [ Rikimaru ]
//=== V 1.0   Finished Scripting the Daily Reward Script [ Rikimaru ]
//============== Credits : ============================================================================
//=== Credits to Rikimaru for the Daily Reward Script
//=== rAthena Profile Link : [url="http://rathena.org/board/user/434-rikimaru/"]http://rathena.org/b...r/434-rikimaru/[/url]
//=====================================================================================================
//*************************************************************************
dicastes01,233,155,6 script Daily Reward 906,{
//=========================== Settings ================================================================
set .@rewname$,"^0000FF[ Daily Reward ]^000000";// YOU MAY CHANGE THE NAME OF THE NPC
set .rewardid,7227;// CHANGE THE XXXXX TO THE ITEM ID,WHICH THE PLAYER SHOULD GET
set @rewardamount,2;// CHANGE THE XX TO THE AMOUNT OF THE ITEM WHICH YOU WANT THE PLAYER TO GET
//======================= Settings End ================================================================
//*****************************************************************************************************
if(gettimetick(2) - lastTimeTalked > (60 * 60 * 24)) {
mes .@rewname$;
mes "Hello "+strcharinfo(0)+",I";
mes "am here to give you a daily";
mes "Reward. Do you want to have it?";
next;
switch(select("-Yes,sure!:-No,bye!:-Cancel")) {
case 1:
mes .@rewname$;
mes "Okay going to give you the item!";
next;
mes .@rewname$;
getitem .rewardid,@rewardamount;
mes "Okay have fun with it!";
set lastTimeTalked,gettimetick(2);
close;
case 2:
mes .@rewname$;
mes "Okay goodbye!";
close;
case 3:
close;
}
}
mes .@rewname$;
mes "Sorry you can get the";
mes "Reward again after ";
mes "24 Hours are over!";
close;
}

Edited by Emistry
Please use [CODEBOX] or Attachments for long contents.

1 answer to this question

Recommended Posts

Posted

http://svn.rathena.org/svn/rathena/trunk/doc/script_commands.txt

Prefix: scope and extent

nothing - A permanent variable attached to the character, the default variable

type. They are stored with all the account data in "save\athena.txt"

in TXT versions and in the SQL versions in the `global_reg_value`

table using type 3.

...

"#" - A permanent local account variable.

They are stored with all the account data in "save\accreg.txt" in

TXT versions and in the SQL versions in the 'global_reg_value'

table using type 2.

So replace

lastTimeTalked

by

#lastTimeTalked

//    // // /==/ /==/  /=/ /==/
//   //=====//   /==/  /=/ /==============/ /========/   /==//===/    /==/ /==/
// //=//////    /==/   /==//=/    /==/    /==/==/==/==/==/ / /  /   /==/ /==/ /==/
//    // ==	 /==/   /==//=/    /==/    /==/  /==/  /==/ ======/  /   /==/ /==/ /==/
//   //   ==   /==/   /==/  /=/ /==/    /==/  /==/  /==/ / /===/  /   /==/ /==/ /==/
//  // ==    /==/   /==/   /=/    /==/    /==/  /==/  /==/ / /===/  /   /==/ /==/=====/==/
// //    ==  /==/   /==/    /=/   /==/    /==/  /==/  /==/ /========/   /==/ /==///////==/
// ================ rAthena Script ====================================================================
//=== Made by Rikimaru
//==================== Information ====================================================================
//==== Daily Reward Script
//================= Version : =========================================================================
//=== V 1.1   Fixed a typo in the Script [ Rikimaru ]
//=== V 1.0   Finished Scripting the Daily Reward Script [ Rikimaru ]
//============== Credits : ============================================================================
//=== Credits to Rikimaru for the Daily Reward Script
//=== rAthena Profile Link : http://rathena.org/b...r/434-rikimaru/
//=====================================================================================================
//*************************************************************************
dicastes01,233,155,6    script    Daily Reward    906,{
//=========================== Settings ================================================================
   set .@rewname$,"^0000FF[ Daily Reward ]^000000";// YOU MAY CHANGE THE NAME OF THE NPC
   set .rewardid,7227;// CHANGE THE XXXXX TO THE ITEM ID,WHICH THE PLAYER SHOULD GET
   set @rewardamount,2;// CHANGE THE XX TO THE AMOUNT OF THE ITEM WHICH YOU WANT THE PLAYER TO GET
//======================= Settings End ================================================================
//*****************************************************************************************************
   if(gettimetick(2) - #lastTimeTalked > (60 * 60 * 24)) {
       mes .@rewname$;
       mes "Hello "+strcharinfo(0)+",I";
       mes "am here to give you a daily";
       mes "Reward. Do you want to have it?";
       next;
       switch(select("-Yes,sure!:-No,bye!:-Cancel")) {
       case 1:
           mes .@rewname$;
           mes "Okay going to give you the item!";
           next;
           mes .@rewname$;
           getitem .rewardid,@rewardamount;
           mes "Okay have fun with it!";
           set #lastTimeTalked,gettimetick(2);
           close;
       case 2:
           mes .@rewname$;
           mes "Okay goodbye!";
           close;
       case 3:
           close;
       }
   }
   mes .@rewname$;
   mes "Sorry you can get the";
   mes "Reward again after ";
   mes "24 Hours are over!";
   close;
}

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...