koneko33 Posted November 19 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 5 Reputation: 0 Joined: 03/26/13 Last Seen: 15 hours ago Share Posted November 19 (edited) //===== rAthena Script ======================================= //= PvP Top 10 Ladder Weekly Reward prontera,166,188,3 script PVP REWARD 88,{ .@cid = getcharid(0); query_sql( "SELECT `pvpreward` FROM `char` WHERE `char_id` = "+.@cid[.@i]+" LIMIT 1",.@pvpreward ); query_sql( "UPDATE `char` SET `pvpreward` = 0 WHERE `char_id` = "+.@cid[.@i]+" LIMIT 1" ); set .PVP_Reward, 7227; set .TOP_1_PLAYER, 7227; set .TOP_2_PLAYER, 7227; // ITEM LISTED PRIZE switch ( .@pvpreward ) { case 1: getitem .TOP_1_PLAYER,50; break; case 2: getitem .TOP_2_PLAYER,45; break; case 3: getitem .PVP_Reward,40; break; case 4: getitem .PVP_Reward,30; break; case 5: getitem .PVP_Reward,20; break; case 6: getitem .PVP_Reward,10; break; case 7: getitem .PVP_Reward,5; break; case 8: getitem .PVP_Reward,5; break; case 9: getitem .PVP_Reward,5; break; case 10: getitem .PVP_Reward,5; break; default: mes "[PVP Gate Keeper]"; mes "You're not top pvp for this week. or you already claimed the rewards."; mes "The Reward Item is <ITEM>RTC<INFO>"+ .TOP_1_PLAYER +"</INFO></ITEM>."; mes "The Reward giving days"; mes "Start Claiming: ^0000FFSun12:00 Noon^000000"; mes "End Claiming: ^0000FFMon 12:00 Noon^000000"; close; } mes "[PVP Gate Keeper]"; mes "Congratulation "+ strcharinfo(0) +""; mes "You gained reward as top "+.@pvpreward+" PVP."; close; OnInit: // INITIATE THE LIMIT OF LADDER LISTED PRIZE .limit = 10; waitingroom "[PVP Reward]",0; end; //DATE TIME ASSIGN OnSun1200: // ************************************************************** // FIRST EMISTRY SCRIPT // ************************************************************** for ( .@i = 3; .@i > 0; .@i-- ){ announce "Top "+ .limit +" PVP Rewards will be given in "+.@i+" minutes, please login your characters to get the auto assigned rewards.",bc_all; sleep 60000; } //ITEM NAME ANNOUNCE ON THE DAY OF CLAIMING PRIZE // item id reward for top 10 pvp setarray .@itemid,50058,50006,50006,50006,50006,50006,50006,50006,50006,50006; // item quantity reward for top 10 pvp setarray .@itemid_qty,1,7,7,7,5,5,5,2,2,2; .@itemid_size = getarraysize( .@itemid ); query_sql ("SELECT c.`account_id`,c.`char_id` FROM `pvpladder` pvp INNER JOIN `char` c ON c.`char_id` = pvp.`char_id` WHERE pvp.`kills` > 0 ORDER BY pvp.`kills` DESC,pvp.`deaths` LIMIT "+.@itemid_size ,.@aid,.@cid ); .@cid_size = getarraysize( .@cid ); for ( .@i = 0; .@i < .@cid_size; .@i++ ) if ( .@aid[.@i] && isloggedin( .@aid[.@i],.@cid[.@i] ) ) { attachrid( .@aid[.@i] ); announce "Top "+( .@i+1 )+" PVP Rewards - "+strcharinfo(0)+" obtained "+.@itemid_qty[.@i]+"x "+getitemname( .@itemid[.@i] ),bc_all; } detachrid; query_sql( "SELECT `char_id` FROM `pvpladder` WHERE `kills` > 0 ORDER BY `kills` DESC,`deaths` LIMIT "+.limit,.@cid ); .@cid_size = getarraysize( .@cid ); for ( .@i = 0; .@i < .@cid_size; .@i++ ) query_sql("UPDATE `char` SET `pvpreward` = "+( .@i+1 )+" WHERE `char_id` = "+.@cid[.@i]+" LIMIT 1"); announce "Top 1 PVP Reward - "+.@cid_size+" players is selected as winner.",bc_all; //AUTO TRUNCATE DB announce "PVP Ladder Will Reset in Monday 12PM +8GMT. Claim your prize immediately",bc_all; end; } /* ALTER TABLE `char` ADD `pvpreward` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `fame`; //*/ - script PVPRESETLADDER#disable1 -1,{ //OnInit: OnMon1800: query_sql( "TRUNCATE `pvpladder`" ); announce "PVP Ladder completely reset.",bc_all; end; } Edited November 19 by Mael Use codebox Quote Link to comment Share on other sites More sharing options...
1 Winterfox Posted November 19 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 197 Reputation: 70 Joined: 06/30/18 Last Seen: 51 minutes ago Share Posted November 19 You need to alter the char table and add the pvpreward colum. The sql is even inside the script you posted. ALTER TABLE `char` ADD `pvpreward` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `fame`; Quote Link to comment Share on other sites More sharing options...
1 AceofSpades Posted November 19 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 99 Reputation: 5 Joined: 03/02/18 Last Seen: 7 hours ago Share Posted November 19 check your database if you have pvprewards table exist Quote Link to comment Share on other sites More sharing options...
0 koneko33 Posted November 19 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 5 Reputation: 0 Joined: 03/26/13 Last Seen: 15 hours ago Author Share Posted November 19 bump Quote Link to comment Share on other sites More sharing options...
0 koneko33 Posted November 21 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 5 Reputation: 0 Joined: 03/26/13 Last Seen: 15 hours ago Author Share Posted November 21 solve thank you On 11/19/2023 at 9:13 PM, Winterfox said: You need to alter the char table and add the pvpreward colum. The sql is even inside the script you posted. ALTER TABLE `char` ADD `pvpreward` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `fame`; Quote Link to comment Share on other sites More sharing options...
Question
koneko33
Use codebox
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.