Jump to content
  • 0

Lucky Pick Event


Question

Posted

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;
}

6 answers to this question

Recommended Posts

Posted

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

Posted (edited)

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

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;

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