Jump to content
  • 0

request modify my reward newbie.


kangfredy

Question


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

guys can i request this is npc can check IP address if same IP in login database..player cannot take this item.

 

newbiereward.txt

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  115
  • Reputation:   4
  • Joined:  10/25/12
  • Last Seen:  

 
 

Use my Newbie Rewarder sir..

 

you can modify by yourself. It support refined equipment and IP check.

 

 // Reward Array <Item Id>, <Qty>, <Refine>
  // Set refine option to 0 if non-refinable.
  setarray .@rwd[0],1208,1,0,2424,1,6,2528,1,6;

that means:

get Main Gauche[4], Tidal Shoes +6, and Wool Scarf +6.

if unrefineable items, just set to: 0

 

empiremain,108,62,3	script	Newbie Gift	90,{

  // Reward Array <Item Id>, <Qty>, <Refine>
  // Set refine option to 0 if non-refinable.
  setarray .@rwd[0],20009,1,0,2424,1,6,2528,1,6;

  query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);

  if ( getd("$" + .@lip$ + "_NG") > 0 || #NewbieGift > 0)
  {
	mes "[Newbie Gift]";
	mes "Sorry, You've get one.^^";
	close;
  }

  mes "[Newbie Gift]";
  mes "Welocme to xxx RO.";
  mes "This is your reward for Newbie:";

  // List all the items.
  for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 3 )
	// Check if refined option is not 0.
	if(.@rwd[.@i+2] != 0) {
	   mes .@rwd[.@i+1] + " x +" + .@rwd[.@i+2] + " " + getitemname(.@rwd[.@i]);
	}else{
	   mes .@rwd[.@i+1] + " x " + getitemname(.@rwd[.@i]);
  }

  close2;

  // Get Items
  for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 3 )
	// Check if refined option is not 0.
	if(.@rwd[.@i+2] != 0) {
   	  // getitem2 <id>, <qty>, <identify>, <refine>, <attribute>, <card1>, <card2>, <card3>, <card4>
   	  getitem2 .@rwd[.@i], .@rwd[.@i+1], 1, .@rwd[.@i+2], 0, 0, 0, 0, 0;
	}else{
	   getitem .@rwd[.@i], .@rwd[.@i+1];
	}

  // Set variable to make sure player can't get items again.
  set #NewbieGift, 1;
  setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1;

  end;

  OnInit:
	waitingroom "Newbie Gift!",0;
	end;
}

 

Newbie_Rewarder.txt

 

 
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

sory i have been change.........tq for inspiring me.

 

im using from your script just this.


 

query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);

if ( getd("$" + .@lip$ + "_NG") > 0 || #NewbieGift > 0)
{
    mes "[Newbie Gift]";
    mes "Sorry, You've get one.^^";
    close;
}

 mes"this is it";

getitem blablabla;

getitem blablabla:

set zeny...:

next;

 

mes"tq for playing";

close;

 

set #NewbieGift, 1;
setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1;

 


Edited by kangfredy
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:  

guys can i request this is npc can check IP address if same IP in login database..player cannot take this item.

 

attachicon.gifnewbiereward.txt

or that

 

new_1-1,60,113,6	script	Newbiereward	823,{

	if( #redemgive1 ) {
L_dont:
		mes "I already give your items.";
		close;
	}

// Check if already give in other account
	query_sql "SELECT `last_ip` FROM `login` WHERE `account_id` = "+ getcharid(3), .@last_ip$;
	query_sql "SELECT CAST(`value` AS UNSIGNED) " + 
			  "FROM global_reg_value " + 
			  "LEFT JOIN `login` ON global_reg_value.account_id=`login`.account_id " + 
			  "WHERE global_reg_value.`str`='#redemgive1' " +
			  "AND `login`.`last_ip` LIKE '"+ escape_sql( .@last_ip$ ) +"' " +
			  "ORDER BY CAST(`value` AS UNSIGNED) DESC LIMIT 10", 
			  .@reward;
	
	for( .@i = 0; .@i < getarraysize( .@reward ); .@i++ )
		if( .@reward[ .@i ] ) goto L_dont;

	mes "this is your rewards";
	getitem 7179, 20;
	getitem 616, 3;
	getitem 12623, 1;
	set zeny,zeny + 1000000;
	set #redemgive1, 1;
	close;
}

This one avoid $variables

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.03
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

guys can i request this is npc can check IP address if same IP in login database..player cannot take this item.

 

attachicon.gifnewbiereward.txt

or that

 

new_1-1,60,113,6	script	Newbiereward	823,{

	if( #redemgive1 ) {
L_dont:
		mes "I already give your items.";
		close;
	}

// Check if already give in other account
	query_sql "SELECT `last_ip` FROM `login` WHERE `account_id` = "+ getcharid(3), .@last_ip$;
	query_sql "SELECT CAST(`value` AS UNSIGNED) " + 
			  "FROM global_reg_value " + 
			  "LEFT JOIN `login` ON global_reg_value.account_id=`login`.account_id " + 
			  "WHERE global_reg_value.`str`='#redemgive1' " +
			  "AND `login`.`last_ip` LIKE '"+ escape_sql( .@last_ip$ ) +"' " +
			  "ORDER BY CAST(`value` AS UNSIGNED) DESC LIMIT 10", 
			  .@reward;
	
	for( .@i = 0; .@i < getarraysize( .@reward ); .@i++ )
		if( .@reward[ .@i ] ) goto L_dont;

	mes "this is your rewards";
	getitem 7179, 20;
	getitem 616, 3;
	getitem 12623, 1;
	set zeny,zeny + 1000000;
	set #redemgive1, 1;
	close;
}

This one avoid $variables

 

but capuche..can you explain me your script work?it's different from my script? in post nummber 3 http://rathena.org/board/topic/79683-request-modify-my-reward-newbie/?p=184595 ???

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:  

My script does the same as your (I guess)

But mine avoid $variables

 

setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1;

Yours create $variables for each IP, not mine. It's better to avoid $variable if you can otherwise, one day, if you abuse of this variable your server will lag. Just to prevent this just in case

Edited by Capuche
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...