Jump to content
  • 0

Who's Online Event (random pick of online player)


Question

10 answers to this question

Recommended Posts

Posted (edited)

As per the script that EL Dragon posted, here's a GM activated version.

prontera,100,100,4	script	Who's Online Event	99,{

if (getgroupid() == 99) goto Event_Menu;
mes "[Who's Online Event]";
mes "Only GM's are allowed to use this NPC.";
close;

Event_Menu:
	set .@invokeid,getcharid(3);
	mes "[Who's Online Event]";
	mes "Enable event?";
	menu "Yes",-,"No",Event_End;
	
	while(1){
	query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
	attachrid .@aid;
	if( CheckVending() ){
		DetachRID();
		continue;
	}
	announce strcharinfo(0) +" won 500 Cash in Who's Online Event", 0,0x00FF00;
	set #CASHPOINTS,#CASHPOINTS+500;
	dispbottom "You got 500 cash point";
	break;
	}
	attachrid(.@invokeID);
	close;

Event_End:
close;
}
Edited by Jyabil
Posted

sorry it was automatic script

//http://rathena.org/board/topic/53877-lucky-pick-event/
//emistry script

- script AutoFunEvent -1,{
OnInit:
OnClock0000:
set .LuckyTime,rand(24);
OnMinute00:
if( gettime(3) == .LuckyTime ){
set .DelayMin,rand(60);
sleep ( .DelayMin * 60000 );
while(1){
  query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
  attachrid .@aid;
  if( CheckVending() ){
   DetachRID();
   continue;
   }
  announce strcharinfo(0) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00;
  set #CASHPOINTS,#CASHPOINTS+500;
  dispbottom "you got 500 cash point";
  break;
}
}
end;
}
Posted (edited)

Thanks El Dragon and Jyabil, but how can I set the prize to item ID though? 

And also announce a line before actually announcing who's the winner?

 

If you want the prize to be items instead of cash points, remove

set #CASHPOINTS,#CASHPOINTS+500;

and change it to

getitem 501,1; // In example, this code will give you 1 pc of Red Potion

To add announcement, add these before the announcing of the winner

announce "Your Message Here",0,0x00FF00;
sleep 1000; // 1 second delay before announcing the winner, configure it to your liking
Edited by Jyabil
  • Upvote 1
Posted

 

sorry it was automatic script

//http://rathena.org/board/topic/53877-lucky-pick-event/
//emistry script

- script AutoFunEvent -1,{
OnInit:
OnClock0000:
set .LuckyTime,rand(24);
OnMinute00:
if( gettime(3) == .LuckyTime ){
set .DelayMin,rand(60);
sleep ( .DelayMin * 60000 );
while(1){
  query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
  attachrid .@aid;
  if( CheckVending() ){
   DetachRID();
   continue;
   }
  announce strcharinfo(0) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00;
  set #CASHPOINTS,#CASHPOINTS+500;
  dispbottom "you got 500 cash point";
  break;
}
}
end;
}

If im not mistaken this is every 1 hour?

Posted

Sir how to add time for example i want it to set 4 times a day if i would like to pick 12PM 5PM 9PM
 

it this gonna be like this?

 

OnInit:

OnClock1200:

OnClock1700:

OnClock2100:

set .LuckyTime,rand(24);
OnMinute00:
if( gettime(3) == .LuckyTime ){

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