Jump to content
  • 0

Custom bring me event


Takuyakii

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

Hello, can i request for an script 

 

Mechanics:

  You need to register to npc first, then after registrating,

you are now qualified to the quest,

 

First 200 Player That Bring you Example item Apple With quantity of 300,

will get reward example poring coin.

And once you done, you cannot repeat the quest.

1 Char per account.

Thank you.

 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

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

// https://rathena.org/board/topic/121262-custom-bring-me-event/

/* 
CREATE TABLE IF NOT EXISTS `bring_me_event` (
	`id` int(11) unsigned NOT NULL auto_increment,
	`aid` int(11) unsigned NOT NULL default '0',
	`cid` int(11) unsigned NOT NULL default '0',
	`last_ip` varchar(100) NOT NULL default '',
	`last_unique_id` varchar(100) NOT NULL default '',
	`time` datetime NOT NULL,
) ENGINE=MyISAM;
*/

prontera,0,0,0	script	Sample	444,{
	.@aid = getcharid(3);
	.@cid = getcharid(0);
	.@ip$ = getcharip();
	.@unique_id$ = get_unique_id();
	
	query_logsql("SELECT `id`,`time` FROM `bring_me_event` WHERE `aid` = "+.@aid+" OR `last_ip` = '"+escape_sql(.@ip$)+"' OR `last_unique_id` = '"+escape_sql(.@unique_id$)+"' LIMIT 1", .@id, .@time$);
	query_logsql("SELECT COUNT(`id`) FROM `bring_me_event`", .@size);
	if (.@size >= .max_redeem) {
		mes "you missed the reward, only "+.max_redeem+" players got the reward.";
	}
	else if (.@id) {
		mes "You've already claimed the rewards on "+.@time$+".";
	}
	else {
		mes "Bring me "+.amount+"x "+getitemname(.item_id);
		if (countitem(.item_id) >= .amount) {
			if (select("Okay","Cancel") == 1) {
				delitem .item_id, .amount;
				query_logsql("INSERT INTO `bring_me_event` (`aid`,`cid`,`last_ip`,`last_unique_id`,`time`) VALUES ("+.@aid+","+.@cid+",'"+escape_sql(.@ip$)+"','"+escape_sql(.@unique_id$)+"', NOW())");
				getitem 501,1;
				getitem 502,1;
				getitem 503,1;
				mes "you are the "+(.@size+1)+"/"+.max_redeem+" players who got the reward";
			}
		}
	}
	close;
	
	OnInit:
		.item_id = 512;
		.amount = 300;
		.max_redeem = 200;
		end;
}

you can try this.

  • Upvote 1
  • Like 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:  

On 10/14/2019 at 11:15 AM, Emistry said:

// https://rathena.org/board/topic/121262-custom-bring-me-event/

/* 
CREATE TABLE IF NOT EXISTS `bring_me_event` (
	`id` int(11) unsigned NOT NULL auto_increment,
	`aid` int(11) unsigned NOT NULL default '0',
	`cid` int(11) unsigned NOT NULL default '0',
	`last_ip` varchar(100) NOT NULL default '',
	`last_unique_id` varchar(100) NOT NULL default '',
	`time` datetime NOT NULL,
) ENGINE=MyISAM;
*/

prontera,0,0,0	script	Sample	444,{
	.@aid = getcharid(3);
	.@cid = getcharid(0);
	.@ip$ = getcharip();
	.@unique_id$ = get_unique_id();
	
	query_logsql("SELECT `id`,`time` FROM `bring_me_event` WHERE `aid` = "+.@aid+" OR `last_ip` = '"+escape_sql(.@ip$)+"' OR `last_unique_id` = '"+escape_sql(.@unique_id$)+"' LIMIT 1", .@id, .@time$);
	query_logsql("SELECT COUNT(`id`) FROM `bring_me_event`", .@size);
	if (.@size >= .max_redeem) {
		mes "you missed the reward, only "+.max_redeem+" players got the reward.";
	}
	else if (.@id) {
		mes "You've already claimed the rewards on "+.@time$+".";
	}
	else {
		mes "Bring me "+.amount+"x "+getitemname(.item_id);
		if (countitem(.item_id) >= .amount) {
			if (select("Okay","Cancel") == 1) {
				delitem .item_id, .amount;
				query_logsql("INSERT INTO `bring_me_event` (`aid`,`cid`,`last_ip`,`last_unique_id`,`time`) VALUES ("+.@aid+","+.@cid+",'"+escape_sql(.@ip$)+"','"+escape_sql(.@unique_id$)+"', NOW())");
				getitem 501,1;
				getitem 502,1;
				getitem 503,1;
				mes "you are the "+(.@size+1)+"/"+.max_redeem+" players who got the reward";
			}
		}
	}
	close;
	
	OnInit:
		.item_id = 512;
		.amount = 300;
		.max_redeem = 200;
		end;
}

you can try this.

i have error. how to fix this? 

add_word: invalid word. A word consists of undercores and/or alphanumeric characters, and valid variable prefixes/postfixes.

 

.@unique_id$ = get_unique_id();

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

On 10/14/2019 at 11:15 AM, Emistry said:
// https://rathena.org/board/topic/121262-custom-bring-me-event/

/* 
CREATE TABLE IF NOT EXISTS `bring_me_event` (
	`id` int(11) unsigned NOT NULL auto_increment,
	`aid` int(11) unsigned NOT NULL default '0',
	`cid` int(11) unsigned NOT NULL default '0',
	`last_ip` varchar(100) NOT NULL default '',
	`last_unique_id` varchar(100) NOT NULL default '',
	`time` datetime NOT NULL,
) ENGINE=MyISAM;
*/

prontera,0,0,0	script	Sample	444,{
	.@aid = getcharid(3);
	.@cid = getcharid(0);
	.@ip$ = getcharip();
	.@unique_id$ = get_unique_id();
	
	query_logsql("SELECT `id`,`time` FROM `bring_me_event` WHERE `aid` = "+.@aid+" OR `last_ip` = '"+escape_sql(.@ip$)+"' OR `last_unique_id` = '"+escape_sql(.@unique_id$)+"' LIMIT 1", .@id, .@time$);
	query_logsql("SELECT COUNT(`id`) FROM `bring_me_event`", .@size);
	if (.@size >= .max_redeem) {
		mes "you missed the reward, only "+.max_redeem+" players got the reward.";
	}
	else if (.@id) {
		mes "You've already claimed the rewards on "+.@time$+".";
	}
	else {
		mes "Bring me "+.amount+"x "+getitemname(.item_id);
		if (countitem(.item_id) >= .amount) {
			if (select("Okay","Cancel") == 1) {
				delitem .item_id, .amount;
				query_logsql("INSERT INTO `bring_me_event` (`aid`,`cid`,`last_ip`,`last_unique_id`,`time`) VALUES ("+.@aid+","+.@cid+",'"+escape_sql(.@ip$)+"','"+escape_sql(.@unique_id$)+"', NOW())");
				getitem 501,1;
				getitem 502,1;
				getitem 503,1;
				mes "you are the "+(.@size+1)+"/"+.max_redeem+" players who got the reward";
			}
		}
	}
	close;
	
	OnInit:
		.item_id = 512;
		.amount = 300;
		.max_redeem = 200;
		end;
}

you can try this.

It works. Can you further enhance this like configurable via in game like your promo code script? Lets talk.

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