Jump to content

Patskie

Members
  • Posts

    1702
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by Patskie

  1. Try this one : set .@cnt, isequippedcnt(4403); bonus bDelayRate, (.@cnt >= 2) ? -60 : -30;
  2. Arithmetic
  3. http://rathena.org/wiki/Adding_a_Script or ( video ) : http://www.youtube.com/watch?v=Az0C1k9AU_o
  4. announce "Party leader of the party ["+@partyname$+"], please claim your "+@partyrewardamount+" "+getitemname(@partyrewarditem)+"s from the Rewards NPC! ",0,0xDBA901; Change the 0xDBA901 part to your desired color : ( 0xRRGGBB ). Moreover, this site will help you http://www.rapidtables.com/web/color/RGB_Color.htm
  5. Try : - script Sample -1,{ OnPCLoginEvent: set .@password$, "abcdefgh123"; // GM password set .@time, 10; // 10 minutes if ( getgmlevel() < 2 ) end; if ( gettimetick(2) < #timer ) { mes "You cannot login"; close2; atcommand "@kick " +strcharinfo(0); end; } sc_start sc_berserk, 1000000000, 1; mes "Input your password"; next; input .@p$; if ( .@p$ != .@password$ ) { set #timer, gettimetick(2) + ( .@time * 60 ); sc_end sc_berserk; close2; atcommand "@kick " +strcharinfo(0); end; } else { sc_end sc_berserk; mes "Thanks for your cooperation"; close; } }
  6. Elaborate more on your request.
  7. Try this one : if( isequippedcnt( 4403 ) > 2 ) { // do some script if kiel is more than 2 }
  8. Yaa miss that one >.<. query_sql "SELECT `char`.`account_id` FROM `char` JOIN `login` ON `char`.`account_id` = `login`.`account_id` LIMIT .@query_i, 128 WHERE `login`.`level` = 0 AND `char`.`online` = 1", .@aid; Should be : query_sql "SELECT `char`.`account_id` FROM `char` JOIN `login` ON `char`.`account_id` = `login`.`account_id` WHERE `login`.`level` = 0 AND `char`.`online` = 1 LIMIT " +.@query_i+ ", 128", .@aid; otherwise you will receive syntax error.
  9. Try prontera,150,150,0 script Warper 100,{ if ( getmapusers("payon") >= 10 ) { mes "Warper"; mes "Room is full"; close; } warp "payon",0,0; end; }
  10. By means of? warper npc? command ( @go, @warp )?
  11. You should elaborate more on your problem. Perhaps you can post your configuration? ( inter_athena, etc. )
  12. If you try to download the original file here http://rathena.org/board/files/file/2862-utility-promotional-codes/ you can find his sql file. That is my basis on this script : The original reward code sql : CREATE TABLE IF NOT EXISTS `reward_codes` ( `code` VARCHAR(10) NOT NULL DEFAULT '', `nameid` INT(11) UNSIGNED NOT NULL DEFAULT '0', `item_name` VARCHAR(45) NOT NULL DEFAULT '', `amount` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0', `time_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`code`) ) ENGINE=MYISAM; and log : CREATE TABLE IF NOT EXISTS `rewardlogs` ( `code` VARCHAR(10) NOT NULL DEFAULT '', `redeem_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`code`) ) ENGINE=MYISAM; EDIT : Try this new one, i fix them, remove some, add some. and so on xD. Execute first the commented line. If error occur, post it /* DROP TABLE IF EXISTS `reward_codes`; CREATE TABLE IF NOT EXISTS `reward_codes` ( `code` VARCHAR(10) NOT NULL DEFAULT '', `nameid` INT(11) UNSIGNED NOT NULL DEFAULT '0', `item_name` VARCHAR(45) NOT NULL DEFAULT '', `amount` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0', `time_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' PRIMARY KEY (`code`) ) ENGINE = MYISAM; DROP TABLE IF EXISTS `rewardlogs`; CREATE TABLE `rewardlogs` ( `account_id` INT( 10 ) NOT NULL, `code` VARCHAR( 10 ) NOT NULL, `redeem_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE = MyISAM; */ - script promoclaim -1,{ OnInit: bindatcmd "claim",strnpcinfo(3)+"::OnClaim"; bindatcmd "code",strnpcinfo(3)+"::OnEditCode"; end; OnClaim: // if ( getgmlevel() ) end; mes "^FF0000 Enter a new promotional code."; input .@pc$; close2; query_sql "SELECT `nameid`, `amount` FROM `reward_codes` WHERE `code` = '" + escape_sql(.@pc$) + "'", .@item, .@amt; if ( !.@item ) dispbottom "Either invalid code or the code is already claimed by other people"; else { getitem .@item, .@amt; dispbottom "Promotional code successfully redeemed."; query_sql "DELETE FROM `reward_codes` WHERE `code` = '" + escape_sql(.@pc$) + "'"; query_logsql "INSERT INTO `rewardlogs` VALUES ( '" + getcharid(3) + "', '" + escape_sql(.@pc$) + "', NOW() )"; } end; OnEditCode: if ( getgmlevel() < 99 ) end; set .@choice$, "Setup a new promotional code:View existing codes:Delete exisiting codes:Cancel"; setarray .@length, 4,10; // <min>,<max> switch ( select( .@choice$ ) ) { case 1: input .@pcode$; if ( getstrlen( .@pcode$ ) < .@length[0] || getstrlen( .@pcode$ ) > .@length[1] ) { dispbottom "Codes must not be less than " +.@length[0]+ " and must be greater than " +.@length[1]+ "."; end; } mes "You have entered ^FF0000"+.@pcode$+"^000000 as the code."; mes "Are you sure?"; if ( select("Yes:No, thanks") - 1 ) end; query_sql "SELECT `code` FROM `reward_codes` WHERE `code` = '" + escape_sql(.@pcode$) + "'", .@pcode_exists; if ( .@pcode_exists ) { dispbottom "Sorry, that code already exist."; end; } mes "Please set a reward for the players who has entered the code."; input .@reward; next; if ( !.@reward || getitemname(.@reward) == "null" ) { dispbottom "Sorry, that is an invalid item id."; end; } set .@iname$, getitemname(.@reward); mes "Item number ^FF0000"+.@reward+"^000000"; mes "is equivalent to ^FF0000"+.@iname$+"^000000."; mes "Are you sure?"; next; if ( select("Yes:No, thanks") - 1 ) end; mes "How many ^FF0000"+.@iname$+"^000000.?"; input .@amount; next; if ( !.@amount ) { dispbottom "Sorry, that is an invalid amount number."; end; } mes "Are you sure?"; next; if ( select("Yes:No, thanks") - 1 ) end; query_sql "INSERT INTO `reward_codes` VALUES ( '" + escape_sql(.@pcode$) + "', '" + .@reward + "', '" + escape_sql(.@iname$) + "', '" + .@amount + "', NOW() )"; dispbottom "Done creating code!"; break; case 2: set .@nb, query_sql("SELECT code, item_name, amount FROM `reward_codes` ORDER BY time_created DESC LIMIT 20", .@code$, .@nid$, .@amount); if ( !.@nb ) { dispbottom "No exisiting codes."; end; } dispbottom "============================================="; dispbottom "============== EXISITING CODES =============="; dispbottom "============================================="; for(set .@i,0; .@i < .@nb; set .@i,.@i+1) dispbottom ""+.@code$[.@i]+" ( Reward: "+.@amount[.@i]+" "+.@nid$[.@i]+" ) "; dispbottom "============================================="; break; case 3: input .@dcode$; query_sql "SELECT `code` FROM `reward_codes` WHERE `code` = '" + escape_sql(.@dcode$) + "'", .@dcode_exists; if ( !.@dcode_exists ) { dispbottom "Promotional code not found."; end; } mes "Would you like to delete that code?"; next; if ( select("Yes:No, thanks") - 1 ) end; query_sql "DELETE FROM `reward_codes` WHERE `code` = '" + escape_sql(.@dcode$) + "'"; break; case 4: close; break; default: break; } end; }
  13. You would only know them once you read this trunk/db/re/item_db.txt or trunk/db/pre-re/item_db.txt
  14. http://rathena.org/wiki/PCRE
  15. Rollback lahat ng items? Literal na "lahat"? Execute : TRUNCATE TABLE `auction`; TRUNCATE TABLE `cart_inventory`; TRUNCATE TABLE `guild_storage`; TRUNCATE TABLE `inventory`; TRUNCATE TABLE `mail`; TRUNCATE TABLE `storage`;
  16. Thanks for the reminder. edited my last post
  17. Last year madness!

  18. Either you drop that database DROP DATABASE `database_name`; or : TRUNCATE TABLE `auction`; TRUNCATE TABLE `cart_inventory`; TRUNCATE TABLE `char`; TRUNCATE TABLE `charlog`; TRUNCATE TABLE `friends`; TRUNCATE TABLE `elemental`; TRUNCATE TABLE `global_reg_value`; TRUNCATE TABLE `guild`; TRUNCATE TABLE `guild_alliance`; TRUNCATE TABLE `guild_castle`; TRUNCATE TABLE `guild_expulsion`; TRUNCATE TABLE `guild_member`; TRUNCATE TABLE `guild_position`; TRUNCATE TABLE `guild_skill`; TRUNCATE TABLE `guild_storage`; TRUNCATE TABLE `homunculus`; TRUNCATE TABLE `hotkey`; TRUNCATE TABLE `interlog`; TRUNCATE TABLE `inventory`; TRUNCATE TABLE `ipbanlist`; TRUNCATE TABLE `mail`; TRUNCATE TABLE `mapreg`; TRUNCATE TABLE `memo`; TRUNCATE TABLE `mercenary`; TRUNCATE TABLE `mercenary_owner`; TRUNCATE TABLE `party`; TRUNCATE TABLE `pet`; TRUNCATE TABLE `quest`; TRUNCATE TABLE `ragsrvinfo`; TRUNCATE TABLE `sc_data`; TRUNCATE TABLE `skill`; TRUNCATE TABLE `skill_homunculus`; TRUNCATE TABLE `sstatus`; TRUNCATE TABLE `storage`; TRUNCATE TABLE `login`; INSERT INTO `login` (`account_id`, `userid`, `user_pass`, `sex`, `email`) VALUES ('1', 's1', 'p1', 'S','[email protected]');
  19. U can add a check on your script : if ( getmapusers("your map") >= 10 ) mes "Map is full";
  20. Didn't test : prontera,150,150,0 script Sample 100,{ function Display; if ( getgmlevel() < 60 ) end; set .@npc$, "[ " +strnpcinfo(1)+ " ]"; mes .@npc$; mes "What do you want, " + (Sex ? "Sir" : "Maam") + " " +strcharinfo(0)+ "?"; next; switch( select("PVP1:GVG:BG:Cancel") ) { case 1: Display("A GM wishes to observe the PVP, proceed there if you wish to join."); break; case 2: Display("A GM is calling all guilds wishing to fight in the GVG arena."); break; case 3: Display("A GM wishes to start the Battlegrounds, proceed to BG arena if you wish to participate."); break; case 4: close; break; default: break; } function Display { query_sql "SELECT `char`.`account_id` FROM `char` JOIN `login` ON `char`.`account_id` = `login`.`account_id` WHERE `login`.`level` = 0 AND `char`.`online` = 1",.@aid; set .@size, getarraysize(.@aid); while ( .@i < .@size ) { if ( attachrid( .@aid[.@i] ) ) dispbottom getarg(0); detachrid; set .@i, .@i + 1; } return; } }
  21. Patskie

    Vip login to

    Maybe something like this http://rathena.org/board/topic/67140-viplib-v14b-vipadmin-v13a-updated/?
  22. To cleanup a certain table you need to execute this command to your database : TRUNCATE TABLE `table_name`; EDITED : Misunderstood your request sorry for that DELETE FROM `char` WHERE `account_id` = ( SELECT `account_id` FROM `login` WHERE DATE_FORMAT(`lastlogin`, '%Y-%m-%d') < '2013-09-03' AND `account_id` != 1 ); DELETE FROM `login` WHERE DATE_FORMAT(`lastlogin`, '%Y-%m-%d') < '2013-09-03' AND `account_id` != 1; This will delete all character and all account who are not online before 2013-09-03 ( YYYY/MM/DD ). Regarding the item i am not sure about it. In any case, do backup your database to prevent worst possible scenarios.
  23. Maybe something like this http://rathena.org/board/topic/53994-disable-mvp-cards-in-woe/?p=65700 or trunk/db/re/item_noequip.txt // The equipment/items/cards restriction file // here you define which items may not be used at PvP / GvG // format: <item id>,<mode> // mode // 1 - restricted in normal maps // 2 - restricted in PVP // 4 - restricted in GVG // 8 - restricted in Battlegrounds // Restricted zones - they're configured by 'restricted <number>' mapflag // 32 - restricted in zone 1 // 64 - restricted in zone 2 // 128 - restricted in zone 3 // 256 - restricted in zone 4 // 512 - restricted in zone 5 // 1024 - restricted in zone 6 // 2048 - restricted in zone 7 //Examples: //1201,1 you can't use KNIFE(ID 1201) on normal maps //608,4 you can't use Yggdrasil Seed(ID 608) on both GvG and WoE Castles //4174,6 Forbid Deviling Card in every PVP or GVG map, and during woes. //501,32 you can't use Red Potion on map marked as 'restricted zone 1' //502,64 you can't use Orange Potion on map marked as 'restricted zone 2' //503,128 you can't use Yellow Potion on map marked as 'restricted zone 3' // you can even mix modes //519,322 (256+64+2) you can't use Milk on PVP, and maps marked as 'restricted zone 2' and 'restricted zone 4'
  24. Patskie

    Duel

    trunk/conf/battle/misc.conf // Delay between using @duel in minutes duel_time_interval: 60 to : // Delay between using @duel in minutes duel_time_interval: 1
×
×
  • Create New...