· 7 years ago · Dec 05, 2018, 07:16 AM
1
2
3/*
4CREATE TABLE IF NOT EXISTS `E-WOE Ladder` (
5 `account_id` int(11) unsigned NOT NULL default '0',
6 `char_id` int(11) unsigned NOT NULL auto_increment,
7 `name` varchar(30) NOT NULL DEFAULT '',
8 `kill` int(11) unsigned NOT NULL default '0',
9 `death` int(11) unsigned NOT NULL default '0',
10 PRIMARY KEY (`char_id`),
11 KEY `account_id` (`account_id`),
12 KEY `name` (`name`)
13) ENGINE=MyISAM;
14*/
15
16- script Sample -1,{
17OnStart:
18if( select("View Ladder:Cancel") == 1 )
19 if( query_sql("SELECT `name`,`kill`,`death` FROM `E-WOE Ladder` ORDER BY `kill` DESC LIMIT 127",.@Name$,.@Kill,.@Death ) ){
20 mes "WOE Ladder : Kill / Death";
21 for( set .@i,0; .@i < getarraysize( .@Name$ ); set .@i,.@i + 1 )
22 mes ( .@i + 1 )+". "+.@Name$[.@i]+" - ^0055FF"+.@Kill[.@i]+" / ^FF0000"+.@Death[.@i]+"^000000";
23 }else
24 mes "No Record found.";
25close;
26
27OnInit:
28setarray .Map$[0],"gefg_cas04","prtg_cas03";
29end;
30
31OnPCKillEvent:
32if( getgmlevel() < 80 && agitcheck() && killedrid != getcharid(3) )
33 for( set .@i,0; .@i < getarraysize( .Map$ ); set .@i,.@i + 1 )
34 if( strcharinfo(3) == .Map$[.@i] )
35 if( query_sql("SELECT `kill` FROM `E-WOE Ladder` WHERE `name`='"+strcharinfo(0)+"'",.@Kill ) ){
36 set .@Kill,.@Kill + 1;
37 query_sql("UPDATE `WOE Ladder` SET `kill`='"+.@Kill+"' WHERE `name`='"+strcharinfo(0)+"'");
38 }else{
39 query_sql("INSERT INTO `E-WOE Ladder` ( `account_id`,`char_id`,`name`,`kill`,`death` ) VALUES ( '"+getcharid(3)+"','"+getcharid(0)+"','"+strcharinfo(0)+"','1','0' )");
40 }
41end;
42
43OnPCDieEvent:
44if( getgmlevel() < 80 && agitcheck() && killerrid != getcharid(3) )
45 for( set .@i,0; .@i < getarraysize( .Map$ ); set .@i,.@i + 1 )
46 if( strcharinfo(3) == .Map$[.@i] )
47 if( query_sql("SELECT `death` FROM `E-WOE Ladder` WHERE `name`='"+strcharinfo(0)+"'",.@Death ) ){
48 set .@Death,.@Death + 1;
49 query_sql("UPDATE `E-WOE Ladder` SET `death`='"+.@Death+"' WHERE `name`='"+strcharinfo(0)+"'");
50 }else{
51 query_sql("INSERT INTO `E-WOE Ladder` ( `account_id`,`char_id`,`name`,`kill`,`death` ) VALUES ( '"+getcharid(3)+"','"+getcharid(0)+"','"+strcharinfo(0)+"','0','1' )");
52 }
53end;
54}
55
56
57prontera,155,181,5 script Sample#1 757,{
58 doevent "Sample::OnStart";
59}