Ultimate Guild Ranker

Dastgir

Core Developer
Messages
3,805
Points
0
Discord
Dastgir#1460
IRC Nickname
Dastgir
Github
dastgirp
Emulator
Client Version
2019-02-28 RE
thumb-781e4ec58901c0933b65ae671a1f21c3-screenhercules011.jpg


File Name: Ultimate Guild Ranker

File Submitter: Dastgir

File Submitted: 17 Mar 2014

File Category: PvP, WoE, GvG, & Battleground

Script By Request : http://herc.ws/board/topic/4756-ultimate-guild-ranking

Code:
Percentage Changes:AgitCount= 20%Emp Break = 50%Active Participants = 20%KDR = 10%
Features:

  • Guild Ranking
  • Previous Month Guild Ranking
  • Rewards based on previous month

Edits to made after installing the Script:

Open npc/guild/agit_main.txt

Add Following Line

Code:
    doevent "UltimateRanker#00::OnEmpBreak";
Before

Code:
    // Adjust Economy Invest Level for Castle	set .@Economy,getcastledata(strnpcinfo(2),2) - 5;
Have a Custom WoE? And its not triggering the Script??

Solution: add the following line on EmperiumBreaking Label.

Code:
doevent "UltimateRanker#00::OnEmpBreak";
Please report any bugs/suggestions.

Click here to download this file

 
Last edited by a moderator:
[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: getcharid (1 parameter):[Debug]: Data: number value=2[Debug]: Source (NPC): UltimateRanker#00 (invisible/not on a map)

change this

donpcevent "UltimateRanker#00::OnEmpBreak";
to this

doevent "UltimateRanker#00::OnEmpBreak";
to get rid of this error

 
Last edited by a moderator:
[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: getcharid (1 parameter):[Debug]: Data: number value=2[Debug]: Source (NPC): UltimateRanker#00 (invisible/not on a map)

change this

donpcevent "UltimateRanker#00::OnEmpBreak";
to this

doevent "UltimateRanker#00::OnEmpBreak";
to get rid of this error
Seems like I bymistakely diffed a wrong folder....

Anyways,Uploaded a fixed version.

 
very nice , thank you sir
default_smile.png


Question :

Percentage Changes:AgitCount= 20%Emp Break = 50%Active Participants = 20%KDR = 10%

Can i change this to :

Percentage Changes:AgitCount= 20%Emp Break = 50%Active Participants = 10%KDR = 20%

From OnInit ?

 
Last edited by a moderator:
very nice , thank you sir
default_smile.png


Question :

Percentage Changes:AgitCount= 20%Emp Break = 50%Active Participants = 20%KDR = 10%

Can i change this to :

Percentage Changes:AgitCount= 20%Emp Break = 50%Active Participants = 10%KDR = 20%

From OnInit ?
Yes, that's the reason I have included those variables in OnInit:

You can change those to any values you want.

 
Got this error

Code:
[SQL]: DB error - Table 'hercules.ugr_guild_infoV' doesn't exist[Debug]: at script.c:14613 - INSERT INTO `ugr_guild_infoV` (`date`,`HighEmpBreak`) VALUES (201403,1) ON DUPLICATE KEY UPDATE `HighEmpBreak`=1[Debug]: Source (NPC): UltimateGuildRanker at amatsu (128,161)
 
^

create these tables

Code:
---- Table structure for table `ugr_guild_info`--CREATE TABLE IF NOT EXISTS `ugr_guild_info` (  `guild_id` mediumint(6) NOT NULL DEFAULT '0',  `breaks` smallint(5) NOT NULL DEFAULT '0',  `kills` smallint(5) NOT NULL DEFAULT '0',  `deaths` smallint(5) NOT NULL DEFAULT '0',  `APart` mediumint(6) NOT NULL DEFAULT '0',  `percent` SMALLINT(4) NOT NULL DEFAULT '0',  `date` MEDIUMINT(7) NOT NULL DEFAULT '0',  `claim` tinyint(1) NOT NULL DEFAULT '1',  UNIQUE KEY `guild_id` (`guild_id`,`date`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;---- Table structure for table `ugr_guild_infov`--CREATE TABLE IF NOT EXISTS `ugr_guild_infov` (  `date` MEDIUMINT(7) NOT NULL DEFAULT '0',  `AgitCount` mediumint(6) NOT NULL DEFAULT '1',  `HighEmpBreak` MEDIUMINT(6) NOT NULL DEFAULT '0',  UNIQUE KEY `date` (`date`,`AgitCount`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
^

create these tables

---- Table structure for table `ugr_guild_info`--CREATE TABLE IF NOT EXISTS `ugr_guild_info` (  `guild_id` mediumint(6) NOT NULL DEFAULT '0',  `breaks` smallint(5) NOT NULL DEFAULT '0',  `kills` smallint(5) NOT NULL DEFAULT '0',  `deaths` smallint(5) NOT NULL DEFAULT '0',  `APart` mediumint(6) NOT NULL DEFAULT '0',  `percent` SMALLINT(4) NOT NULL DEFAULT '0',  `date` MEDIUMINT(7) NOT NULL DEFAULT '0',  `claim` tinyint(1) NOT NULL DEFAULT '1',  UNIQUE KEY `guild_id` (`guild_id`,`date`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;---- Table structure for table `ugr_guild_infov`--CREATE TABLE IF NOT EXISTS `ugr_guild_infov` (  `date` MEDIUMINT(7) NOT NULL DEFAULT '0',  `AgitCount` mediumint(6) NOT NULL DEFAULT '1',  `HighEmpBreak` MEDIUMINT(6) NOT NULL DEFAULT '0',  UNIQUE KEY `date` (`date`,`AgitCount`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
Yea i already run it on my sql, still getting that error.

Edited : FIXED. thanks to Dastgir

 
Last edited by a moderator:
1. Whenever I @agitstart & @agitstop and @reloadnpc this executes set $AgitCount, $AgitCount + 1;. and may high percentage / guild points bug.

2.

[SQL]: DB error - Column 'percent' cannot be null[Debug]: at c:testsrcmapscript.c:14582 - UPDATE `ugr_guild_info` SET `percent`=( ((1/3*100)*20/100)+((`kills`/(`deaths`+1)*100)*10/100)+((`breaks`/1*100)*50/100)+((`APart`/(select count(*) FROM `guild` WHERE `guild`.`guild_id`=`ugr_guild_info`.`guild_id`)*100)*20/100)) WHERE `date`=201403[Debug]: Source (NPC): UltimateGuildRanker at prontera (153,181)
break emperium and use @breakguild then check UGR npc.

These are the problems I've encountered so far.. ^^

 
Last edited by a moderator:
1. Whenever I @agitstart & @agitstop and @reloadnpc this executes set $AgitCount, $AgitCount + 1;. and may high percentage / guild points bug.

2.

[SQL]: DB error - Column 'percent' cannot be null[Debug]: at c:testsrcmapscript.c:14582 - UPDATE `ugr_guild_info` SET `percent`=( ((1/3*100)*20/100)+((`kills`/(`deaths`+1)*100)*10/100)+((`breaks`/1*100)*50/100)+((`APart`/(select count(*) FROM `guild` WHERE `guild`.`guild_id`=`ugr_guild_info`.`guild_id`)*100)*20/100)) WHERE `date`=201403[Debug]: Source (NPC): UltimateGuildRanker at prontera (153,181)
break emperium and use @breakguild then check UGR npc.

These are the problems I've encountered so far.. ^^
1) & 2) I will fix it in next update. (you could have lowered the percent of agitcount too,  but anyways, included some options to prevent unnecessary increment of AgitCount)

Added a new configuration .Config_UGR[4](set seconds here), if WoE Starts again within x seconds, then AgitCount will not increase.

(you were using v1.0b, while v1.0c was out, anyways new version will be v1.0d, and will have these problems fixed.)

 
Last edited by a moderator:
@Suggestion

Use bc_self so that output will be clearer..

and

if ( getguildname( .guild_id[.i] ) == "null" ) requestguildinfo .guild_id[.i];
Other guild names become NULL when you restart your server.

mes "Sending data...";    announce "Format: Data Based on "+gettime(5)+"Days/"+$AgitCount+" Castles",bc_self,0xff6622;    announce "[GuildName] - Breaks - Kills - Death - GuildPoints "+((getgmlevel()>=getvariableofnpc(.Config_UGR[4],"UltimateRanker#00"))?"- Active Partrticipant":"")+" ",bc_self,0xff6622;    announce "----------------------",bc_self,0xff6622;    for (.i=0; .i<getarraysize(.guild_id); .i++){    if ( getguildname( .guild_id[.i] ) == "null" ) requestguildinfo .guild_id[.i];      announce (.i+1) +". [ "+getguildname(.guild_id[.i])+" ] - "+.breaks[.i]+" - ^66D729"+.kills[.i]+" - "+.deaths[.i]+"0 - "+.percent[.i]+" "+((getgmlevel()>=getvariableofnpc(.Config_UGR[4],"UltimateRanker#00"))?"- "+.apart[.i]+"":"")+"",bc_self,0xff6622;    }    announce "----------------------",bc_self,0xff6622;

@question

What is this for?

Code:
((getgmlevel()>=getvariableofnpc(.Config_UGR[4],"UltimateRanker#00"))?" - Active Partrticipant":"")+" "
if gm level is greater than or equals 3600 show "- Active Partrticipant" ? correct me if i am wrong.
default_biggrin.png


 
Last edited by a moderator:
@Suggestion

Use bc_self so that output will be clearer..

and

if ( getguildname( .guild_id[.i] ) == "null" ) requestguildinfo .guild_id[.i];
Other guild names become NULL when you restart your server.

mes "Sending data...";    announce "Format: Data Based on "+gettime(5)+"Days/"+$AgitCount+" Castles",bc_self,0xff6622;    announce "[GuildName] - Breaks - Kills - Death - GuildPoints "+((getgmlevel()>=getvariableofnpc(.Config_UGR[4],"UltimateRanker#00"))?"- Active Partrticipant":"")+" ",bc_self,0xff6622;    announce "----------------------",bc_self,0xff6622;    for (.i=0; .i<getarraysize(.guild_id); .i++){    if ( getguildname( .guild_id[.i] ) == "null" ) requestguildinfo .guild_id[.i];      announce (.i+1) +". [ "+getguildname(.guild_id[.i])+" ] - "+.breaks[.i]+" - ^66D729"+.kills[.i]+" - "+.deaths[.i]+"0 - "+.percent[.i]+" "+((getgmlevel()>=getvariableofnpc(.Config_UGR[4],"UltimateRanker#00"))?"- "+.apart[.i]+"":"")+"",bc_self,0xff6622;    }    announce "----------------------",bc_self,0xff6622;

@question

What is this for?

((getgmlevel()>=getvariableofnpc(.Config_UGR[4],"UltimateRanker#00"))?" - Active Partrticipant":"")+" "


if gm level is greater than or equals 3600 show "- Active Partrticipant" ? correct me if i am wrong.
default_biggrin.png
Seems like i messed away the getgmlevel Part, First i implemented these, than after seeing your comment here, i used [4] for time, and it messed away.

Other guild names become NULL when you restart your server. 
Never experienced this, but yet, i will implement your way.

About bc_self,(I don't like announce, that's why i have chosen npc dialog...)

 
is this fine?? 
15g9xxy.jpg


when i try to check the "Previous Month Top 10 Guilds" that Warning & Debug appears... 

hmmm and if you're open for suggestion.. 

can you add a Reward when WOE Ends

is it possible?

 
is this fine?? 
15g9xxy.jpg


when i try to check the "Previous Month Top 10 Guilds" that Warning & Debug appears... 

hmmm and if you're open for suggestion.. 

can you add a Reward when WOE Ends

is it possible?
Fixed the warning,

Reward Claim by npc or auto? and reward given to GuildMaster or each member?

 
auto reward when woe ends.. and each member who participated the woe for 1 hour will get the reward..

 
Is this currently counting all player kills and not only the ones that happen in woe?

Not sure if this is meant to be a woe ranking or more of a general guild ranking, in which case you could have stuff like mvps killed by guild affect ranking too (suggestion)?

 
Is this currently counting all player kills and not only the ones that happen in woe?

Not sure if this is meant to be a woe ranking or more of a general guild ranking, in which case you could have stuff like mvps killed by guild affect ranking too (suggestion)?
Its Guild Ranking, so all kills are currently counted..

 
Back
Top