Jump to content

Leic

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by Leic

  1. can someone direct me to a script that does the following 1. if a character reaches 99 it will give a reward 2. total of 100 rewards only on 1st 99 characters 3. if a character leveled to 99 but the count is 101 99 characters, the script will not give reward
  2. thanks for the reply. how about auto sizing the picture and making it 50% opacity?
  3. could anyone tell me on how to add a background image on the bootstrap theme of fluxcp? TIA
  4. well it's a very old script. I was trying to figure out what bugs it will still encounter. Thanks for the help
  5. from the original topic above //////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------// // PROMOTIONAL CODES // // AUTHOR: LIL TROLL//COLDFIRE // //--------------------------------------------------------------------// // RATHENA SCRIPT // //--------------------------------------------------------------------// // Version 1.2.3 // //--------------------------------------------------------------------// // FEATURES: (Modified Promotional Code by sir Patskie) // // // // #1 5`Degree of Abuse-Protection(+ItemBound = 6) // // - IP,ACCOUNT,COUNTLIMIT,DOUBLECHECK,MIX // // #2 Code can be deleted/detected by gm. // // #3 Friendly User Interface. // // #4 Very easy to configure. // // #5 Code auto delete at certain variable setup(limit pool). // // #6 GM can view codes when claiming. // // #7 GM can set limitation of usage of the codes. // // #8 Automatically delete any codes that set to desirable // // pool limit by gm claimed by players. // // #9 GM can set random code with random item! :D // // #10 GM toggle (when claiming the code, restriction) included. // //--------------------------------------------------------------------// //////////////////////////////////////////////////////////////////////// /* DROP TABLE IF EXISTS `reward_codes`; DROP TABLE IF EXISTS `reward_logs`; CREATE TABLE IF NOT EXISTS `reward_codes` ( `promo` VARCHAR(26) NOT NULL DEFAULT '', `nameid` INT(11) UNSIGNED NOT NULL DEFAULT '0', `item_name` VARCHAR(50) NOT NULL DEFAULT '', `amount` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0', `time_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `limit` INT(10) UNSIGNED NOT NULL DEFAULT '0', `pool` INT(10) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`promo`) ) ENGINE = MYISAM; CREATE TABLE IF NOT EXISTS `reward_logs` ( `account_id` int(11) unsigned NOT NULL default '0', `last_ip` BINARY( 9 ) NOT NULL, `code` VARCHAR( 26 ) NOT NULL, `redeem_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `claim` INT( 10 ) NOT NULL, PRIMARY KEY (`code`) ) ENGINE = MYISAM; */ - script LilTrollPCodes -1,{ OnInit: //initnpctimer; // I USED THIS FOR TESTING PURPOSES WITH ONTIMER bindatcmd "claim",strnpcinfo(3)+"::OnClaim"; bindatcmd "code",strnpcinfo(3)+"::OnEditCode"; setarray .promoprize[0],501,502,503,504,505,506,507,508,509,510; // SET ITEM ID HERE FOR REWARDS setarray .prizeamount[0],1,2,3,4,5,6,7,8,9,10; // AMOUNT OF REWARDS setarray .claimlimit[0],1,2,3,4,5,6,7,8,9,10; // CLAIM LIMITATION setarray .length,5,15; // <MIN>,<MAX> LENGTH CHECK // 5 Recommended Minimum due to not recognizing 1234 from garbage deletion. setarray .gm,0, // 1 Enable, 0 Disable GM Restriction in Claiming Promo Codes. 99; // GM claims doesnt affect claim limit pool. query_sql "CREATE TABLE IF NOT EXISTS `reward_codes` (`promo` VARCHAR(26) NOT NULL DEFAULT '',`nameid` INT(11) UNSIGNED NOT NULL DEFAULT '0',`item_name` VARCHAR(50) NOT NULL DEFAULT '',`amount` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0',`time_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',`limit` INT(10) UNSIGNED NOT NULL DEFAULT '0',`pool` INT(10) UNSIGNED NOT NULL DEFAULT '0',PRIMARY KEY (`promo`)) ENGINE = MYISAM"; query_sql "CREATE TABLE IF NOT EXISTS `reward_logs` (`account_id` int(11) unsigned NOT NULL default '0',`last_ip` BINARY( 9 ) NOT NULL,`code` VARCHAR( 26 ) NOT NULL,`redeem_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',`claim` INT( 10 ) NOT NULL,PRIMARY KEY (`code`)) ENGINE = MYISAM"; end; // 15 maximum characters supported in random code generation. //OnTimer20000: // I USED THIS FOR TESTING PURPOSES WITH INITNPCTIMER OnMinute0000: // Refreshes every 1 Hour. Automatically delete 0 pool count promos. // Change this if you want. // ****************************************************** BIRBE WIRE *************************************************** set .@promotional,query_sql("SELECT `promo`,`pool` FROM `reward_codes` ORDER BY pool ASC LIMIT 50",.@promo$,.@remaining); for(set .@i,1; .@i <= .@promotional; set .@i,.@i++) { query_sql "DELETE FROM `reward_codes` WHERE `promo` = '" + escape_sql(.@promo$[0]) + "' AND `pool` = '0'"; // Number 1 row will be deleted. query_sql "DELETE FROM `reward_codes` WHERE `promo` = '" + escape_sql(.@promo$[.@i]) + "' AND `pool` = '0'"; // Numbers from 2-10 rows will be deleted. } debugmes "Promotional Codes garbage are deleted."; // ****************************************************** BIRBE WIRE *************************************************** //initnpctimer; // I USED THIS FOR TESTING PURPOSES WITH ONTIMER end; // ****************************************************** BIRBE WIRE *************************************************** OnDay0101: OnDay0102: OnDay0103: OnDay0104: OnDay0105: OnDay0106: // Clean sql garbage every 1st day of the month. OnDay0107: OnDay0108: OnDay0109: OnDay0110: OnDay0111: OnDay0112: set .@garbage,query_sql("SELECT `codes`,`redeem_time` FROM `reward_logs` ORDER BY pool ASC LIMIT 25",.@code$); for(set .@i,1; .@i <= .@garbage; set .@i,.@i++) { query_sql "DELETE FROM `reward_logs` WHERE `codes` = '" + escape_sql(.@code$[0]) + "'"; // Number 1 row will be deleted. query_sql "DELETE FROM `reward_logs` WHERE `codes` = '" + escape_sql(.@code$[.@i]) + ""; // Numbers from 2-25 rows will be deleted. } debugmes "reward_logs garbage has been deleted."; end; // ****************************************************** BIRBE WIRE *************************************************** OnClaim: // ONCLAIM COMMAND STARTS if ( getgmlevel() < 99 ) { mes "^00007fENTER SERVER NAME^000000"; // INPUT YOUR SERVERNAME mes "Promotional Code Rewards"; // YOU CAN CHANGE ALL MES DIALOGUES mes "Input the correct [ ^ff0000Code^000000 ]"; } if ( getgmlevel() == 99 ) { // CHECK GM LEVEL // QUERY SQL SELECT "DONT CHANGE" set .@nb, query_sql("SELECT `promo`,`pool` FROM `reward_codes` ORDER BY time_created DESC LIMIT 20",.@promo$,.@pool); // QUERY SQL SELECT "DONT CHANGE" mes "^00007fPROMOTIONAL REWARDS^000000"; mes "^ff0000GM MENU:^000000"; mes "^005500Codes:Claim Limit^000000"; // FOR STATEMENT DONT CHANGE IF YOU DONT KNOW WHAT YOU ARE DOING. for(set .@i,0; .@i < .@nb; set .@i,.@i+1) // FOR STATEMENT DONT CHANGE IF YOU DONT KNOW WHAT YOU ARE DOING. mes ""+.@promo$[.@i]+" : "+.@pool[.@i]+""; } input .@pcode$; set .@pc$,strtoupper(.@pcode$); // CLAIM INPUT CODE if ( getstrlen( .@pc$ ) < .length[0] || getstrlen( .@pc$ ) > .length[1] ) { // CHECK LENGHT OF THE CODE announce "Incorrect input. Code is not less than " +.length[0]+ " and must be greater than " +.length[1]+ ".",bc_self; end;// ---------------------------------------------------------------------- } // END CHECK LENGHT close2; // CLOSE2 COMMAND SCRIPTS WOULD CONTINUE // QUERY SQL SELECT "DONT CHANGE" query_sql "SELECT `promo`,`nameid`, `amount`,`limit`,`pool` FROM `reward_codes` WHERE `promo` = '" + escape_sql(.@pc$) + "'", .@promo$, .@item, .@amt,.@limit,.@pool; query_sql "SELECT `account_id`,`last_ip`,`code`,`claim` FROM `reward_logs` WHERE `code` = '" + escape_sql(.@pc$) + "'",.@aid,.@lip$,.@code$,.@claim; // QUERY SQL SELECT "DONT CHANGE" if(.gm[0] == 1) { if ( getgmlevel() == .gm[1] ) { getitem .@item, .@amt; // GM CAN CLAIM REWARDS WITHOUT RESTRICTION end; } // END IF GM CONDTION } if ( !.@item ) { // CHECK IF CODE IS INVALID announce "Invalid code.",bc_self; end; } // END CHECK INVALID CODE // DONT CHANGE! THIS IS THE 5th DEGREE of ABUSE PROTECTION, COMBO-MIX LOL! ------------------------------------------ if ( getcharip(strcharinfo(0)) == .@lip$ && .@code$ == .@pc$ && .@pool == 0 && getcharid(3) == .@aid && .@claim >= 1 ) { // Double Check MIX // ------------------------------------------------------------------------------------------------------------------ announce "Code claim limit reach. Also either you already got this promo or other player in different IP might used code.",bc_self; // NOTE: YOU CAN CHANGE ABOVE ANNOUNCE DIALOGUE. end; } // END OF 5th DEGREE ABUSE PROTECTION // DONT CHANGE! THIS IS THE 4th DEGREE of ABUSE PROTECTION, THE COMBO XD if ( .@code$ == .@pc$ && .@pool == 0 && getcharid(3) == .@aid && .@claim >= 1 ) { // ---------------------------------------------------------------------- announce "Code claim limit reach. And you already got this promo.",bc_self; // NOTE: YOU CAN CHANGE ABOVE ANNOUNCE DIALOGUE. end; } // END OF 4th DEGREE ABUSE PROTECTION //DONT CHANGE! THIS IS THE 3th DEGREE of ABUSE PROTECTION, POOL LIMIT if ( .@code$ == .@pc$ && .@pool == 0 ) { // ========================================================================== if(.@code$ == .@pc$ && .@limit == 1 ) { announce "Code "+.@pc$+" claim limit reached. "+.@limit+" player already redeemed the code.",bc_self; // NOTE: YOU CAN CHANGE ABOVE ANNOUNCE DIALOGUE. end; } if(.@code$ == .@pc$ && .@limit >= 1 ) { announce "Code "+.@pc$+" claim limit reached. "+.@limit+" players already redeemed the codes.",bc_self; // NOTE: YOU CAN CHANGE ABOVE ANNOUNCE DIALOGUE. end; } } // END OF 3th DEGREE OF ABUSE PROTECTION //DONT CHANGE! THIS IS THE 2nd DEGREE of ABUSE PROTECTION, ACOUNT BASE LIMIT if(.@code$ == .@pc$ && getcharid(3) == .@aid && .@claim >= 1) { // ---------------------------------------------------------------------- announce "Your Account already claimed "+.@pc$+" code.",bc_self; // NOTE: YOU CAN CHANGE ABOVE ANNOUNCE DIALOGUE. end; } // END OF 2nd DEGREE OF ABUSE PROTECTION //DONT CHANGE! THIS IS THE 2nd DEGREE of ABUSE PROTECTION, IP BASE LIMIT if (.@code$ == .@pc$ && getcharip(strcharinfo(0)) == .@lip$ && .@claim >= 1 ) { // ---------------------------------------------------------------------- announce "IP that you used already claimed "+.@pc$+" code.",bc_self; // NOTE: YOU CAN CHANGE ABOVE ANNOUNCE DIALOGUE. end; } // END OF 1st DEGREE OF ABUSE PROTECTION getitem .@item, .@amt; // CODE SUCCESSFULLY REDEEMED! AFTER 5th DEGREE OF CHECKING! announce "Promotional code : "+.@pc$+" successfully redeemed!",bc_self; // NOTE: YOU CAN CHANGE ABOVE ANNOUNCE DIALOGUE. // ****************************************** BIRBE WIRE ************************************************* // SQL QUERY SERIES, PLEASE DONT CHANGE ANYTHING BELOW IF YOU DONT KNOW WHAT YOU ARE DOING! // CLAIM COUNT if(query_sql("SELECT `claim` FROM `reward_logs` WHERE `code` = '" + escape_sql(.@pc$) + "'",.@claim)) { set .@claim,1; query_sql("UPDATE `reward_logs` SET `claim` = '"+1+"' WHERE `code` = '" + escape_sql(.@pc$) + "'"); } else { query_sql("INSERT INTO `reward_logs` (`account_id`,`last_ip`,`code`,`redeem_time`,`claim`) VALUES ('"+getcharid(3)+"','"+getcharip(strcharinfo(0))+"','"+escape_sql(.@pc$)+"',NOW(),'"+1+"')"); } // POOL COUNT if(query_sql("SELECT `pool` FROM `reward_codes` WHERE `promo` = '" + escape_sql(.@pc$) + "'",.@pool)){ set .@pool,.@pool-1; query_sql("UPDATE `reward_codes` SET `pool` = '"+.@pool+"' WHERE `promo` = '" + escape_sql(.@pc$) + "'"); } else { if(.@pool == 0) { end; } if(.@pool >= 1) { query_sql "INSERT INTO `reward_codes` VALUES `pool` = '"+.@pool+"'"; end; } } // SQL QUERY SERIES, PLEASE DONT CHANGE ANYTHING ABOVE IF YOU DONT KNOW WHAT YOU ARE DOING! // ****************************************** BIRBE WIRE ************************************************* end; // END OF ONCLAIM COMMAND OnEditCode: // ONEDITCODE STARTS MainMenu: goto EditCode; EditCode: if ( getgmlevel() < 99 ) end; // CHECK GM LEVEL mes "[ ^ff0000Promotional-Code Generator^000000 ]"; // YOU CAN CHANGE MES DIALOGUES HERE mes " ^ff5500Select from the options below:^000000"; mes "==================================="; // SQL QUERY DO NOT CHANGE ========================= set .@nb, query_sql("SELECT `promo`,`pool` FROM `reward_codes` ORDER BY time_created DESC LIMIT 20",.@promo$,.@pool); // ================================================= mes "^005500Available Codes:^000000"; // FOR STATEMENT DONT CHANGE IF YOU DONT KNOW ANYTHING for(set .@i,0; .@i < .@nb; set .@i,.@i+1) mes ""+.@promo$[.@i]+" : "+.@pool[.@i]+""; // =================================================== next; menu "^55007f[ Create Codes ]^000000",Setup,"^005500[ View Codes ]^000000",View,"^6a6a4f[ Delete Codes ]^000000",Delete; close; Setup: next; menu "[ Create Manualy ]",Bling,"[ Random Code ]",Bleng,"[ All Random ]",Blung,"[ Main Menu ]",EditCode; Bling: goto Promo; Promo: goto step1; step1: mes "[ ^ff0000Promotional Code Generator^000000 ]"; mes "^ff5500Input the desired code.^000000."; input .@pc$; set .@pcode$,strtoupper(.@pc$); if ( getstrlen( .@pcode$ ) < .length[0] || getstrlen( .@pcode$ ) > .length[1] ) { announce "The code length must not be less than " +.length[0]+ " and must not be greater than " +.length[1]+ ".",bc_self; next; menu "[ Re-Enter ]",step1,"[ Cancel ]",Done; close; } query_sql "SELECT `promo` FROM `reward_codes` WHERE `promo` = '"+ escape_sql(.@pcode$) + "'",.@rcodes$; if (.@pcode$ == .@rcodes$) { mes "The Code : [^ff0000"+.@pcode$+"^000000] is already existing."; next; menu "[ Re-Enter ]",step1,"[ Cancel ]",Done; close; } goto step2; step2: mes "You have entered [ ^FF0000"+.@pcode$+"^000000 ]."; mes "Set the ^005500Promotional Item^000000."; input .@reward; if ( !.@reward || getitemname(.@reward) == "null" ) { announce "Sorry, that is an invalid item id.",bc_self; next; menu "[ Re-Enter ]",step2,"[ Cancel ]",Done; close; } goto step3; step3: set .@iname$, getitemname(.@reward); mes "Item ^FF0000"+.@reward+"^000000 is ^FF0000"+.@iname$+"^000000."; mes "Now, set the ^00007fAmount^000000."; input .@amount; if ( !.@amount ) { announce "Sorry, that is an invalid amount number.",bc_self; next; menu "[ Re-Enter ]",step3,"[ Cancel ]",Done; close; } if (.@amount > 1 ) { mes ""+.@amount+" pieces of reward."; } else { mes ""+.@amount+" piece of reward."; } next; menu "[ Proceed ]",Proceed,"[ Done ]",Done; close; Proceed: goto LilTroll; LilTroll: mes "[ ^ff0000Promotional Code Generator^000000 ]"; mes "Check the promo below:"; mes "Code: ^ff0000"+.@pcode$+"^000000 : ^005500"+.@reward+"^000000"; mes "^55007f"+getitemname(.@reward)+"^000000) : ^00007f"+.@amount+"^000000 "; mes "Set claim limitation."; input .@limitation; if(.@limitation == 0){ announce "You must set atleast 1 limitation.",bc_self; close; } set .@limit,.@limitation; mes "Code-Pool usage ends at "+.@limit+"."; mes "Create your Promo Code now?"; next; if ( select("Generate:Stop") - 1 ) close; // QUERY SQL, PLEASE DONT CHANGE ANYTHING IF YOU DONT KNOW THIS ==================================================================================================================================================================================================== query_sql ("INSERT INTO `reward_codes` (`promo`,`nameid`,`item_name`,`amount`,`time_created`,`limit`,`pool`) VALUES ( '" + escape_sql(.@pcode$) + "', '" + .@reward + "', '" + escape_sql(.@iname$) + "', '" + .@amount + "', NOW() ,'"+.@limit+"','"+.@limit+"' )"); // ==================================================================================================================================================================================================== =========================================================== announce "Done creating "+.@pcode$+"!",bc_self; next; menu "[ Create Another Code ]",Setup,"[ Done ]",Done; close; Bleng: goto RandCode; RandCode: // ******************** IF YOU TOUCH BELOW THIS! TESLA COIL WILL ELECTRIFY AND TOAST YOU! RESULTING INSTANT DEATH! ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************* setarray .@s$[0],"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0"; set .@it,.promoprize[rand(getarraysize(.promoprize))]; set .@am,.prizeamount[rand(getarraysize(.prizeamount))]; set .@lim,.claimlimit[rand(getarraysize(.claimlimit))]; if(.length[1]==15) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==14) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==13) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==12) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==11) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==10) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==9) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==8) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==7) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==6) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==5) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; // ******************** IF YOU TOUCH ABOVE THIS! TESLA COIL WILL ELECTRIFY AND TOAST YOU! RESULTING INSTANT DEATH! ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************* mes "[ ^ff0000Promotional Code Generator^000000 ]"; mes "Random Generator:"; mes "Code : "+.@randomcodes$+" "; next; menu "[ Re-Generate ]",RandCode,"[ Proceed ]",RandProceed,"[ Return ]",Setup; close; RandProceed: goto RandomProceed; RandomProceed: query_sql "SELECT `promo` FROM `reward_codes` WHERE `promo` = '"+ escape_sql(.@pcode$) + "'",.@rcodes$; if (.@randomcodes$ == .@rcodes$) { mes "The Code : [^ff0000"+.@pcode$+"^000000] is already existing."; next; menu "[ Re-Generate ]",RandCode,"[ Cancel ]",Done; close; } goto RandProceed1; RandProceed1: mes "Randon code is : "; mes "[ ^FF0000"+.@randomcodes$+"^000000 ]."; mes "Set the ^005500Promotional Item^000000."; input .@reward; if ( !.@reward || getitemname(.@reward) == "null" ) { announce "Sorry, that is an invalid item id.",bc_self; next; menu "[ Re-Enter ]",RandProceed1,"[ Cancel ]",Done; close; } goto RandProceed2; RandProceed2: set .@iname$, getitemname(.@reward); mes "Item ^FF0000"+.@reward+"^000000 is ^FF0000"+.@iname$+"^000000."; mes "Now, set the ^00007fAmount^000000."; input .@amount; if ( !.@amount ) { announce "Sorry, that is an invalid amount number.",bc_self; next; menu "[ Re-Enter ]",RandProceed2,"[ Cancel ]",Done; close; } if (.@amount > 1 ) { mes ""+.@amount+" pieces of reward."; } else { mes ""+.@amount+" piece of reward."; } next; menu "[ Proceed ]",RandFinalize,"[ Done ]",Done; close; RandFinalize: goto LilTrollol; LilTrollol: mes "[ ^ff0000Promotional Code Generator^000000 ]"; mes "Check the promo below:"; mes "Code: ^ff0000"+.@randomcodes$+"^000000 : ^005500"+.@reward+"^000000"; mes "^55007f"+getitemname(.@reward)+"^000000) : ^00007f"+.@amount+"^000000 "; mes "Set claim limitation."; input .@limitation; if(.@limitation == 0){ announce "You must set atleast 1 limitation.",bc_self; close; } set .@limit,.@limitation; mes "Code-Pool usage ends at "+.@limit+"."; mes "Create your Promo Code now?"; next; if ( select("Generate:Stop") - 1 ) close; // QUERY SQL, PLEASE DONT CHANGE ANYTHING IF YOU DONT KNOW THIS ==================================================================================================================================================================================================== query_sql ("INSERT INTO `reward_codes` (`promo`,`nameid`,`item_name`,`amount`,`time_created`,`limit`,`pool`) VALUES ( '" + escape_sql(.@randomcodes$) + "', '" + .@reward + "', '" + escape_sql(.@iname$) + "', '" + .@amount + "', NOW() ,'"+.@limit+"','"+.@limit+"' )"); // ==================================================================================================================================================================================================== =========================================================== announce "Done creating code!",bc_self; next; menu "[ Create Another Code ]",Setup,"[ Done ]",Done; close; Blung: goto String; String: // ******************** IF YOU TOUCH BELOW THIS! TESLA COIL WILL ELECTRIFY AND TOAST YOU! RESULTING INSTANT DEATH! ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************* setarray .@s$[0],"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0"; set .@it,.promoprize[rand(getarraysize(.promoprize))]; set .@am,.prizeamount[rand(getarraysize(.prizeamount))]; set .@lim,.claimlimit[rand(getarraysize(.claimlimit))]; if(.length[1]==15) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==14) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==13) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==12) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==11) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==10) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==9) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==8) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==7) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==6) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; if(.length[1]==5) set .@randomcodes$,""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""+.@s$[rand(0,61)]+""; // ******************** IF YOU TOUCH ABOVE THIS! TESLA COIL WILL ELECTRIFY AND TOAST YOU! RESULTING INSTANT DEATH! ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************* mes "[ ^ff0000Promotional Code Generator^000000 ]"; mes "Random Generator:"; mes "Code : "+.@randomcodes$+" "; mes "Item : "+getitemname(.@it)+" "; mes "Item ID : "+.@it+""; set .@itn$,getitemname(.@it); mes "Amount : "+.@am+" "; mes "Limit : "+.@lim+" "; next; menu "[ Re-Generate Codes ]",string,"[ Confirm ]",confirm,"[ Cancel ]",done; close; Done: close; Confirm: // QUERY SQL DONT CHANGE ANYTHING HERE ==================================================================================================================================================================================================================== query_sql ("INSERT INTO `reward_codes` (`promo`,`nameid`,`item_name`,`amount`,`time_created`,`limit`,`pool`) VALUES ( '" + escape_sql(.@randomcodes$) + "', '" + .@it + "', '" + escape_sql(.@itn$) + "', '" + .@am + "', NOW() ,'"+.@lim+"','"+.@lim+"' )"); // ======================================================================================================================================================================================================================================================== announce "Promotional Code : "+.@randomcodes$+" has been created.",bc_self; next; menu "[ Create Another Code ]",Setup,"[ Done ]",Done; close; View: goto Existing; Existing: // QUERY SQL DONT CHANGE ANYTHING HERE ========================================================================================================================= set .@nb, query_sql("SELECT `promo`, `item_name`, `amount`, `pool` FROM `reward_codes` ORDER BY time_created DESC LIMIT 20", .@code$, .@nid$, .@amount, .@pool); // QUERY SQL DONT CHANGE ANYTHING HERE ========================================================================================================================= if ( !.@nb ) { announce "No exisiting codes.",bc_self; close; } mes "[ ^ff0000Promotional Code Generator^000000 ]"; mes "==================================="; mes "======= EXISITING CODES ======="; mes "==================================="; mes "Code:ID:Item:Amount:Limit"; // FORE STATEMENT DONT CHANGE ANY OF HERE ================================= for(set .@i,0; .@i < .@nb; set .@i,.@i+1) mes "["+.@code$[.@i]+"]:["+.@nid$[.@i]+"]["+.@amount[.@i]+"]["+.@pool+"]"; // ======================================================================== mes "==================================="; next; menu "[ Main Menu ]",EditCode,"[ Done ]",Done; close; Delete: goto Deletenow; Deletenow: // QUERY SQL DONT CHANGE ANYTHING HERE =========================================================================================== set .@nb, query_sql("SELECT `promo`,`time_created` FROM `reward_codes` ORDER BY time_created ASC LIMIT 10", .@promo$,.@time$); // =============================================================================================================================== mes "[ ^ff0000Promotional Code Generator^000000 ]"; mes "==================================="; mes "======= EXISITING CODES ======="; mes "==================================="; // FORE STATEMENT DONT CHANGE ANY OF HERE === for(set .@i,0; .@i < .@nb; set .@i,.@i+1){ mes ""+.@promo$[.@i]+" : "+.@time$+""; } // ========================================== mes "==================================="; input .@dcode$; next; mes "[ ^ff0000Promotional Code Generator^000000 ]"; mes "Would you like to delete the code?"; mes ""+.@dcode$+""; next; if ( select("[ Confirm ]:[ Cancel ]") - 1 ) close; // QUERY SQL DONT CHANGE ANYTHING HERE =========================================================================================== query_sql "SELECT `promo` FROM `reward_codes` WHERE `promo` = '" + escape_sql(.@dcode$) + "'",.@dcode_exists$; if(.@dcode$ == .@dcode_exists$ ) { announce "Promotional Code : ["+.@dcode$+"] has been deleted.",bc_self; query_sql "DELETE FROM `ragnarok`.`reward_codes` WHERE `promo` = '" + escape_sql(.@dcode$) + "'"; query_sql "DELETE FROM `ragnarok`.`reward_logs` WHERE `code` = '" + escape_sql(.@dcode$) + "'"; // QUERY SQL DONT CHANGE ANYTHING HERE =========================================================================================== next; menu "[ Main Menu ]",Proceed,"[ Done ]",Done; close; } else { announce "Promotional code not found.",bc_self; next; menu "[ Main Menu ]",MainMenu,"[ Done ]",Done; close; } end; // ENDS ONEDITCODES } // ENDS LILTROLLPCODES although this is working, it doesn't recognize spaces as the same as the code. For example: if you put "test111" and "tes111 " or "test111 " it doesn't recognize the space as the same as the "test111" w/o space thus giving the character the item/s again and again
  6. although it works. it still has some bugs. 1. when you type "test111" and type "test111 " "test111 " with spaces it doesn't recognize the code as already received.
  7. hi, i would like to request for a world boss timer that will list all the bosses/MVP that are available and what map they are. If the bosses/MVP are dead, it should also list who killed it and what time. If it is not killed [UP] is indicated on that boss.
  8. OnNPCKillEvent: if (killedrid == 1491){ set $ZPOINTS,$ZPOINTS+rand(0,1); } On the script above, i have set that when you kill a specific monster, you will get random +1 or 0. however, everyone that is killing it on that map recieves also the ZPoints. How can i make it gain only on the person that killed the monster on that map?
  9. thanks. how about a script that will delete the current pin code if you entered the warp?
  10. case 1: warp "turbo_room",100,100; break; is there a query that if the character account's pin code is not set then he cannot warp on that room?
  11. is there a way that rathena can differentiate mobile users (using andRO) and pc users?
  12. Leic

    Cards A-Z

    may i know where is the main repo?
  13. I would like to request a simple instanced summoning room where if 1 player with or without party enters it creates an instance room then if all players die on that room or there's no more monsters on that room an NPC will appear to take them back. the instance is only 1 map farm_01 (custom map)
  14. [Error]: parse_char: Received unknown packet 0x0 from ip 'the ip addess'! Disconnecting! I got that error code can anyone tell me how to fix it?
  15. Leic

    Cards A-Z

    Im using the script below //===== rAthena Script ======================================= //= Card Seller A-Z //===== By: ================================================== //= AnnieRuru //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= Sells all cards dropped by mobs, grouped alphabetically. //= MVP cards are excluded from the list. //= //= NOTE: Requires SQL item and mob databases. //===== Additional Comments: ================================= //= 1.0 First version, edited. [Euphy] //============================================================ turbo_room,94,125,4 script A-Z Cards 100,{ mes "[Card Seller]"; mes "Welcome!"; mes "I can sell you any normal monster card in the game. Would you like to have a look?"; next; .@s = select( .alphabet_menu$ ) -1; close2; callshop "card_mob#"+ .alphabet$[.@s], 1; end; OnInit: waitingroom "Card Seller",0; if (checkre(0)) { .@mob_db$ = "mob_db_re"; .@item_db$ = "item_db_re"; } else { .@mob_db$ = "mob_db"; .@item_db$ = "item_db"; } freeloop 1; .@total = query_sql( "SELECT DISTINCT LEFT( `name_japanese`, 1 ) AS alphabets FROM `"+ .@item_db$ +"` RIGHT JOIN `"+ .@mob_db$ +"` ON `"+ .@item_db$ +"`.`id` = `"+ .@mob_db$ +"`.`dropcardid` WHERE ~(`MODE`) & 32 AND `type` = 6 GROUP BY `name_japanese` ORDER BY alphabets;", .alphabet$ ); for ( .@i = 0; .@i < .@total; .@i++ ) { .alphabet_menu$ = .alphabet_menu$ + .alphabet$[.@i] +" Cards:"; .@nb = query_sql( "SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` RIGHT JOIN `"+ .@mob_db$ +"` ON `"+ .@item_db$ +"`.`id` = `"+ .@mob_db$ +"`.`dropcardid` WHERE ~(`MODE`) & 32 AND `type` = 6 AND LEFT( `name_japanese`, 1 ) = '"+ .alphabet$[.@i] +"' GROUP BY `name_japanese` ORDER BY `name_japanese` LIMIT 128;", .@id ); npcshopdelitem "card_mob#"+ .alphabet$[.@i], 501; for ( .@j = 0; .@j < .@nb; .@j++ ) npcshopadditem "card_mob#"+ .alphabet$[.@i], .@id[.@j], 1000000; } freeloop 0; end; } - shop card_mob#A -1,501:1000 - shop card_mob#B -1,501:1000 - shop card_mob#C -1,501:1000 - shop card_mob#D -1,501:1000 - shop card_mob#E -1,501:1000 - shop card_mob#F -1,501:1000 - shop card_mob#G -1,501:1000 - shop card_mob#H -1,501:1000 - shop card_mob#I -1,501:1000 - shop card_mob#J -1,501:1000 - shop card_mob#K -1,501:1000 - shop card_mob#L -1,501:1000 - shop card_mob#M -1,501:1000 - shop card_mob#N -1,501:1000 - shop card_mob#O -1,501:1000 - shop card_mob#P -1,501:1000 - shop card_mob#Q -1,501:1000 - shop card_mob#R -1,501:1000 - shop card_mob#S -1,501:1000 - shop card_mob#T -1,501:1000 - shop card_mob#U -1,501:1000 - shop card_mob#V -1,501:1000 - shop card_mob#W -1,501:1000 - shop card_mob#X -1,501:1000 - shop card_mob#Y -1,501:1000 - shop card_mob#Z -1,501:1000 my question is, Why are bosses are still included on the list? Also if there is a way to reverse it? All MVP and mini boss cards are shown but on a different npc?
  16. it's account based not character based. when i make a new character it says i already have the rewards. also novice isn't working it register supernovice as novice
  17. i stubled on a scipt https://rathena.org/board/topic/111397-utility-freebies-account-based/ is it possible to make it character based instead? also restrict if from nother jobs except novice getting it.
  18. I have edited a little on the default healing script. Can someone help me on adding a lvl restriction on buffs? ex. if lvl 98 and below = heal + buffs if level 99 = heal only - script Healer -1,{ .@Price = 0; // Zeny required for heal .@Buffs = 1; // Also buff players? (1: yes / 0: no) .@Delay = 2; // Heal delay, in seconds if (@HD > gettimetick(2)) end; if (.@Price) { message strcharinfo(0), "Healing costs " + callfunc("F_InsertComma",.@Price) + " Zeny."; if (Zeny < .@Price) end; if (select("^0055FFHeal^000000:^777777Cancel^000000") == 2) end; Zeny -= .@Price; } specialeffect2 EF_HEAL2; percentheal 100,100; if (.@Buffs) { sc_start SC_INCREASEAGI,3600000,10; sc_start SC_BLESSING,3600000,10; sc_start SC_ANGELUS,3600000,10; sc_start SC_IMPOSITIO,3600000,10; sc_start SC_GLORIA,3600000,10; sc_start SC_ASSUMPTIO,3600000,10; sc_start SC_MAGNIFICAT,3600000,10; sc_start SC_PARRYING,3600000,10; } if (.@Delay) @HD = gettimetick(2) + .@Delay; end; }
  19. does anyone has a mirror link? I cannot download the file.
×
×
  • Create New...