Jump to content
  • 0

Lucky Pick Event


Kurihara

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  06/19/13
  • Last Seen:  

Is there a command that I can insert in this script so that it excludes GM lvl 20 or higher? Just like how this script excludes the vendors from being picked.

{
  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 in Lucky Pick Event.", 0;
  getitem 675,1;
  break;
}
end;
}
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  127
  • Reputation:   7
  • Joined:  02/10/13
  • Last Seen:  

Can't you fine tune the query_sql to exclude their ID's?

Im no good at sql commands but something like

 

query_sql "Select account_id from char where (gmlvl/groupID) =< 20 ", @aid; detachRID.@aid

I dunno if the scripting is accurate, but in essence this should find all account id's with a group id equal to or greater then 20. and then remove em with the DetachRID like for the venders.


Btw lemme know if that even remotely worked XD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

-	script	AutoFunEvent	-1,{
//OnInit:
OnClock2000:
OnClock2100:
	initnpctimer;
	addrid 0;
	if ( getgmlevel() < 20 && !checkvending() ) {
		setd ".aid"+ .aidcount, getcharid(3);
		.aidcount++;
	}
	end;
OnTimer1:
	if ( !.aidcount ) end;
	.@rand = rand( .aidcount );
	announce rid2name( getd(".aid"+ .@rand) ) +" won in Lucky Pick Event.", bc_all;
	getitem 675, 1, getd(".aid"+ .@rand);
	.aidcount = 0;
	stopnpctimer;
	end;
}
seems like a cheap hack

perhaps it can be improve

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  06/19/13
  • Last Seen:  

I tried AnnieRuru's but I'm getting this error

    parse_line: expect command, missing function name or calling undeclared function
    16 : OnClock1930:
    17 : Onclock2100:
    18 : OnClock2230:
    19 : OnCLock2359:
    20 : 	initnpctimer;
*   21 : 	'a'ddrid 0;
    22 : 	if ( getgmlevel() < 20 && !checkvending() ) {
    23 : 		setd ".aid"+ .aidcount, getcharid(3);
    24 : 		.aidcount++;
    25 : 	}
    26 : 	end;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

please put a "eAthena" under your user profile

so that we know you are using eAthena, not rAthena

go to [Edit my Profile], scroll down and look for "Which RO server emulator are you using?"

http://www.eathena.ws/board/index.php?s=&showtopic=275732&view=findpost&p=1512505

use the script on post#13

Edited by AnnieRuru
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 two cents contribution, for fun [paste=2boubox9ffzz]

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

hahaha

if you want to store all player's online account ID

I think it might be better to store them in permanent server array so no need to access SQL so many times

http://www.eathena.ws/board/index.php?showtopic=276326

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