Jump to content
  • 0

First 50 NPC Reward NPC


ScarrFace

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   0
  • Joined:  10/23/19
  • Last Seen:  

Anyone can help me to have First 50 Reward NPC with pub of remaining players to claim the first 50? 

with using the last unique id of gepard

and

with using IP or account based

Thank you in advance.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

prontera,123,123,1	script	Reward NPC	123,{
	.@unique_id$ = get_unique_id();
	if($reward_status > 0 || $reward_count < 1){
		mes "[ Reward NPC ]";
		mes "Sorry, but the first 50 rewards are out. Better luck next time.";
		close;
	}
	if(getd("$ID_" + .@unique_id$) > 0 || #NPCREWARD > 0){
		mes "[ Reward NPC ]";
		mes "You have already claimed your reward.";
		close;
	}
	mes "[ Reward NPC ]";
	mes "Here's your reward. Have a nice day!";
	setd "$ID_" + .@unique_id$,1;
	#NPCREWARD = 1;
	$reward_count -= 1;
	for(.@i = 0; .@i < getarraysize(.rewards); .@i += 2)
		getitem .rewards[.@i],.rewards[.@i+1];
	if($reward_count == 0)
		$reward_status = 1;
	end;
	
OnInit:
	.reward_count = 50;
	if($reward_status == 0 && $reward_count == 0)
		$reward_count = .reward_count;
	setarray .rewards,501,10,502,10;
	while($reward_count > 0){
		delwaitingroom;
		waitingroom "Rewards left - " + $reward_count, 0;
		sleep 10000;
	}
	end;
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   0
  • Joined:  10/23/19
  • Last Seen:  

56 minutes ago, crazyarashi said:

prontera,123,123,1	script	Reward NPC	123,{
	.@unique_id$ = get_unique_id();
	if($reward_status > 0 || $reward_count < 1){
		mes "[ Reward NPC ]";
		mes "Sorry, but the first 50 rewards are out. Better luck next time.";
		close;
	}
	if(getd("$ID_" + .@unique_id$) > 0 || #NPCREWARD > 0){
		mes "[ Reward NPC ]";
		mes "You have already claimed your reward.";
		close;
	}
	mes "[ Reward NPC ]";
	mes "Here's your reward. Have a nice day!";
	setd "$ID_" + .@unique_id$,1;
	#NPCREWARD = 1;
	$reward_count -= 1;
	for(.@i = 0; .@i < getarraysize(.rewards); .@i += 2)
		getitem .rewards[.@i],.rewards[.@i+1];
	if($reward_count == 0)
		$reward_status = 1;
	end;
	
OnInit:
	.reward_count = 50;
	if($reward_status == 0 && $reward_count == 0)
		$reward_count = .reward_count;
	setarray .rewards,501,10,502,10;
	while($reward_count > 0){
		delwaitingroom;
		waitingroom "Rewards left - " + $reward_count, 0;
		sleep 10000;
	}
	end;
}

 

it work. thank you so much

 

can you give me ip based and account based? please? thank you in advance. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  416
  • Reputation:   73
  • Joined:  05/16/19
  • Last Seen:  

2 hours ago, ScarrFace said:

it work. thank you so much

 

can you give me ip based and account based? please? thank you in advance. 

Quote

Prefix: scope and extent
nothing  - A permanent variable attached to the character, the default variable
           type. They are stored by char-server in the `char_reg_num` and
           `char_reg_str`.
"@"      - A temporary variable attached to the character.
           SVN versions before 2094 revision and RC5 version will also treat
           'l' as a temporary variable prefix, so beware of having variable
           names starting with 'l' if you want full backward compatibility.
"$"      - A global permanent variable.
           They are stored by map-server in database table `mapreg`.
"$@"     - A global temporary variable.
           This is important for scripts which are called with no RID
           attached, that is, not triggered by a specific character object.
"."      - A NPC variable.
           They exist in the NPC and disappear when the server restarts or the
           NPC is reloaded. Can be accessed from inside the NPC or by calling
           'getvariableofnpc'. Function objects can also have .variables which
           are accessible from inside the function, however 'getvariableofnpc'
           does NOT work on function objects.
".@"     - A scope variable.
           They are unique to the instance and scope. Each instance has its
           own scope that ends when the script ends. Calling a function with
           callsub/callfunc starts a new scope, returning from the function
           ends it. When a scope ends, its variables are converted to values
           ('return .@var;' returns a value, not a reference).
"'"      - An instance variable.
           These are used with the instancing system and are unique to each
           instance type. Can be accessed from inside the instance or by calling
           'getvariableofinstance'.
"#"      - A permanent local account variable.
           They are stored by char-server in the `acc_reg_num` table and
           `acc_reg_str`.
"##"     - A permanent global account variable stored by the login server.
           They are stored in the `global_acc_reg_num` table and
           `global_acc_reg_str`.
           The only difference you will note from normal # variables is when
           you have multiple char-servers connected to the same login server.
           The # variables are unique to each char-server, while the ## variables
           are shared by all these char-servers.

replace the # with one of these 

Edited by Naruto
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  830
  • Reputation:   316
  • Joined:  02/11/19
  • Last Seen:  

6 hours ago, ScarrFace said:

Anyone can help me to have First 50 Reward NPC with pub of remaining players to claim the first 50? 

with using the last unique id of gepard

and

with using IP or account based

Thank you in advance.

https://rathena.org/board/topic/121239-prize-for-the-first-50/#comment-367696

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   0
  • Joined:  10/23/19
  • Last Seen:  

On 11/12/2019 at 8:36 AM, Naruto said:

replace the # with one of these 

how? can you edit it for me? sorry i am really newbie. thank you

On 11/12/2019 at 9:08 AM, Gdevien said:

i saw that already but i request different from that one. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  416
  • Reputation:   73
  • Joined:  05/16/19
  • Last Seen:  

9 hours ago, ScarrFace said:

how? can you edit it for me? sorry i am really newbie. thank you

Cheeck out the script the lovely arashi posted

prontera,123,123,1	script	Reward NPC	123,{
	.@unique_id$ = get_unique_id();
	if($reward_status > 0 || $reward_count < 1){
		mes "[ Reward NPC ]";
		mes "Sorry, but the first 50 rewards are out. Better luck next time.";
		close;
	}
	if(getd("$ID_" + .@unique_id$) > 0 || #NPCREWARD > 0){
		mes "[ Reward NPC ]";
		mes "You have already claimed your reward.";
		close;
	}
	mes "[ Reward NPC ]";
	mes "Here's your reward. Have a nice day!";
	setd "$ID_" + .@unique_id$,1;
	#NPCREWARD = 1;
	$reward_count -= 1;
	for(.@i = 0; .@i < getarraysize(.rewards); .@i += 2)
		getitem .rewards[.@i],.rewards[.@i+1];
	if($reward_count == 0)
		$reward_status = 1;
	end;
	
OnInit:
	.reward_count = 50;
	if($reward_status == 0 && $reward_count == 0)
		$reward_count = .reward_count;
	setarray .rewards,501,10,502,10;
	while($reward_count > 0){
		delwaitingroom;
		waitingroom "Rewards left - " + $reward_count, 0;
		sleep 10000;
	}
	end;
}

if($reward_status > 0 || $reward_count < 1){

setd "$ID_" + .@unique_id$,1; #NPCREWARD = 1; $reward_count -= 1;

if(getd("$ID_" + .@unique_id$) > 0 || #NPCREWARD > 0){ mes "[ Reward NPC ]"; mes "You have already claimed your reward."; close; }

 

# and ## were IP and character is blank so just remove the # all together

 

the $ money signs are used for the 50 available units, dont touch this oh no

Edited by Naruto
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   0
  • Joined:  10/23/19
  • Last Seen:  

thank you. but can i request it will create own table like "reward_table" and all recorded in the table when player claim the reward this is IP based or account based.

sorry for asking too much. newbie on developing

On 11/12/2019 at 5:24 AM, crazyarashi said:

prontera,123,123,1	script	Reward NPC	123,{
	.@unique_id$ = get_unique_id();
	if($reward_status > 0 || $reward_count < 1){
		mes "[ Reward NPC ]";
		mes "Sorry, but the first 50 rewards are out. Better luck next time.";
		close;
	}
	if(getd("$ID_" + .@unique_id$) > 0 || #NPCREWARD > 0){
		mes "[ Reward NPC ]";
		mes "You have already claimed your reward.";
		close;
	}
	mes "[ Reward NPC ]";
	mes "Here's your reward. Have a nice day!";
	setd "$ID_" + .@unique_id$,1;
	#NPCREWARD = 1;
	$reward_count -= 1;
	for(.@i = 0; .@i < getarraysize(.rewards); .@i += 2)
		getitem .rewards[.@i],.rewards[.@i+1];
	if($reward_count == 0)
		$reward_status = 1;
	end;
	
OnInit:
	.reward_count = 50;
	if($reward_status == 0 && $reward_count == 0)
		$reward_count = .reward_count;
	setarray .rewards,501,10,502,10;
	while($reward_count > 0){
		delwaitingroom;
		waitingroom "Rewards left - " + $reward_count, 0;
		sleep 10000;
	}
	end;
}

 

hello how to reset this?

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