Jump to content
  • 0

A New type of rewarder


stydianx

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

I want to request a rewarder script that goes like this:

 

this rewarder give players who comes to a map for the 1st time.

-Checks IP.

-Also gives Exp

-One per account

 

thanks :)

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


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

The first time on a special map or all maps?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

The first time on a special map or all maps?

 

only 2 special maps :)

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:  


- script welcome_on_my_map -1,{

OnPCLoadMapEvent:

.@map$ = strcharinfo(3);

while( .@i < .size_specialmap && .@map$ != .special_map$[.@i] ) .@i++;

if ( .@i == .size_specialmap || #variable_firstmap & ( 1 << .@i ) ) end;

query_sql "select max(`value`) from global_reg_value where `str` = '#variable_firstmap' and `account_id` in ( select `account_id` from `login` where `last_ip` = ( select `last_ip` from `login` where `account_id` = "+ getcharid(3) +" ) )", .@tmp;// null convert to 0 by serv

if ( .@tmp & ( 1 << .@i ) == 0 ) {

#variable_firstmap = #variable_firstmap | ( 1 << .@i );

query_sql "insert into global_reg_value (`char_id`, `str`, `value`, `type`, `account_id`) select 0, '#variable_firstmap', '"+ #variable_firstmap +"', 2, `account_id` from `login` where `account_id` in ( select `account_id` from `login` where `last_ip` = ( select `last_ip` from `login` where `account_id` = "+ getcharid(3) +" ) ) on duplicate key update value = '"+ #variable_firstmap +"'";

getexp .base_exp_gained[.@i], .job_exp_gained[.@i];// base exp, job exp gained

dispbottom "You got "+ .base_exp_gained[.@i] +" base exp and "+ .job_exp_gained[.@i] +" job exp.";

}

end;

Oninit:// setting

setarray .special_map$, "payon","geffen";// your map exp reward

setarray .base_exp_gained, 100, 100;// base exp given by map (payon, geffen..)

setarray .job_exp_gained, 100, 100;// job exp given by map (payon, geffen..)

// others

.size_specialmap = getarraysize( .special_map$ );

while( .@i < .size_specialmap ) {

setmapflag .special_map$[.@i], mf_loadevent;

.@i++;

}

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

THANKSSSS! :)

 

last question, how do i add items?

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:  

THANKSSSS! :)

 

last question, how do i add items?

after add your items (getitem <item id>, <amount>; )

	if ( .@tmp & ( 1 << .@i ) == 0 ) {
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

-	script	welcome_on_my_map	-1,{
OnPCLoadMapEvent:
	.@map$ = strcharinfo(3);
	while( .@i < .size_specialmap && .@map$ != .special_map$[.@i] ) .@i++;
	if ( .@i == .size_specialmap || #variable_firstmap & ( 1 << .@i ) ) end;
	query_sql "select max(`value`) from global_reg_value where `str` = '#variable_firstmap' and `account_id` in ( select `account_id` from `login` where `last_ip` = ( select `last_ip` from `login` where `account_id` = "+ getcharid(3) +" ) )", .@tmp;// null convert to 0 by serv
	if ( .@tmp & ( 1 << .@i ) == 0 ) {
getitem 607,100;
		#variable_firstmap = #variable_firstmap | ( 1 << .@i );
		query_sql "insert into global_reg_value (`char_id`, `str`, `value`, `type`, `account_id`) select 0, '#variable_firstmap', '"+ #variable_firstmap +"', 2, `account_id` from `login` where `account_id` in ( select `account_id` from `login` where `last_ip` = ( select `last_ip` from `login` where `account_id` = "+ getcharid(3) +" ) ) on duplicate key update value = '"+ #variable_firstmap +"'";
		getexp .base_exp_gained[.@i], .job_exp_gained[.@i];// base exp, job exp gained
		dispbottom "You got "+ .base_exp_gained[.@i] +" base exp and "+ .job_exp_gained[.@i] +" job exp.";
	}
	end;
Oninit:// setting
	setarray .special_map$, "payon","geffen";// your map exp reward
	setarray .base_exp_gained, 100, 100;// base exp given by map (payon, geffen..)
	setarray .job_exp_gained, 100, 100;// job exp given by map (payon, geffen..)

// others
	.size_specialmap = getarraysize( .special_map$ );
	while( .@i < .size_specialmap ) {
		setmapflag .special_map$[.@i], mf_loadevent;
		.@i++;
	}
}

 

 

did i do this right?

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:  

Yes that's right

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

Thanks  /kis2  +1

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