- /*
- ALTER TABLE `guild` ADD `agit_points` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0';
- */
- prontera,155,188,0 script Agit Points 837,{
- mes "[Guild Ranking]";
- if (query_sql("SELECT `name`,agit_points FROM guild WHERE agit_points ORDER BY agit_points DESC LIMIT 128", .@guild_name$,.@agit_points) == 0) {
- mes "The list is empty.";
- } else {
- for (set .@i,0; .@i<getarraysize(.@guild_name$); set .@i,.@i+1)
- mes (.@i+1)+". "+.@guild_name$[.@i]+" ("+.@agit_points[.@i]+" "+( (.@agit_points[.@i]==1) ? "point" : "points" )+")";
- }
- close;
- OnAgitEnd:
- sleep 500; // make sure WoE-ending scripts finished triggering
- query_sql "SELECT castle_id,guild_id FROM guild_castle WHERE guild_id>0 AND castle_id BETWEEN 0 AND 23", .@castle_id,.@guild_id;
- for (set .@i,0; .@i<getarraysize(.@guild_id); set .@i,.@i+1)
- query_sql "UPDATE guild SET agit_points = agit_points+"+.castle_points[.@castle_id[.@i]]+" WHERE guild_id="+.@guild_id[.@i];
- end;
- OnAgitEnd2:
- sleep 500; // make sure WoE-ending scripts finished triggering
- query_sql "SELECT castle_id,guild_id FROM guild_castle WHERE guild_id>0 AND castle_id BETWEEN 24 AND 33", .@castle_id,.@guild_id;
- for (set .@i,0; .@i<getarraysize(.@guild_id); set .@i,.@i+1)
- query_sql "UPDATE guild SET agit_points = agit_points+"+.castle_points[.@castle_id[.@i]]+" WHERE guild_id="+.@guild_id[.@i];
- end;
- OnInit:
- setarray .castle_points[0],
- // Aldebaran
- 1, // 0-aldeg_cas01, Neuschwanstein
- 1, // 1-aldeg_cas02, Hohenschwangau
- 1, // 2-aldeg_cas03, Nuernberg
- 1, // 3-aldeg_cas04, Wuerzburg
- 1, // 4-aldeg_cas05, Rothenburg
- // Geffen
- 1, // 5-gefg_cas01, Repherion
- 1, // 6-gefg_cas02, Eeyolbriggar
- 1, // 7-gefg_cas03, Yesnelph
- 1, // 8-gefg_cas04, Bergel
- 1, // 9-gefg_cas05, Mersetzdeitz
- // Payon
- 1, //10-payg_cas01, Bright Arbor
- 1, //11-payg_cas02, Scarlet Palace
- 1, //12-payg_cas03, Holy Shadow
- 1, //13-payg_cas04, Sacred Altar
- 1, //14-payg_cas05, Bamboo Grove Hill
- // Prontera
- 3, //15-prtg_cas01, Kriemhild
- 2, //16-prtg_cas02, Swanhild
- 1, //17-prtg_cas03, Fadhgridh
- 1, //18-prtg_cas04, Skoegul
- 1, //19-prtg_cas05, Gondul
- // Novice Castles
- 1, //20-nguild_alde, Earth
- 1, //21-nguild_gef, Air
- 1, //22-nguild_pay, Water
- 1, //23-nguild_prt, Fire
- // Yuno
- 1, //24-schg_cas01, Himinn
- 1, //25-schg_cas02, Andlangr
- 1, //26-schg_cas03, Viblainn
- 1, //27-schg_cas04, Hljod
- 1, //28-schg_cas05, Skidbladnir
- // Rachel
- 1, //29-arug_cas01, Mardol
- 1, //30-arug_cas02, Cyr
- 1, //31-arug_cas03, Horn
- 1, //32-arug_cas04, Gefn
- 1; //33-arug_cas05, Bandis
- if (query_sql("SELECT ORDINAL_POSITION FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA=(SELECT DATABASE()) AND TABLE_NAME='guild' AND COLUMN_NAME='agit_points'", .@i) == 0) {
- debugmes "[Agit Points] adding column to `guild` table ...";
- query_sql "ALTER TABLE `guild` ADD `agit_points` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0'";
- }
- end;
- }
Agit Points - http://rathena.org/board/topic/78562-agit-points/
Posted by Anonymous on Sat 16th Feb 2013 04:40
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
rathena.kpaste.net RSS