Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    52

Everything posted by Capuche

  1. For one player, all? update storage set refine = 0 where refine = 10; update mail set refine = 0 where refine = 10; update guild_storage set refine = 0 where refine = 10; update inventory set refine = 0 where refine = 10; update cart_inventory set refine = 0 where refine = 10; execute this when your server is offline
  2. No it's my mistake. It should be .@rand_index = rand( 1,( getarraysize( getd( ".@box"+ .@i ) ) -1 )/2 ) *2 -1;
  3. http://rathena.org/board/topic/89128-rank-mvp/?p=252676 From Rules Rules Duplicate topics are not allowed. Post your topic once, in the correct section. If you accidentally post in the wrong section, use the Report button to report your own post.
  4. You get this infinity loop because I thought you would copy/past the chance of your previous script.. so I didn't make anything to prevent the loop. The "chance" in the last box must be 100 (or more)
  5. Capuche

    [Rank] MvP

    you take this script from a previous request ; the guy wanted to reset the points when the player gets more than 200 points prontera,162,152,4 script MVP Ladder 619,{ query_sql( "DELETE FROM `mvp_ranking` WHERE `name` NOT IN ( SELECT `name` FROM `char` )" ); set .@size, query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, .@name$, .@points ); mes "[^FF0000MvP ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]"; for (set .@c, 0; .@c < .@size; set .@c, .@c + 1) mes "Top ^FF0000" +(.@c + 1) +"^000000 ^0000FF" + .@name$[.@c] +"^000000 with ^FF0000" + .@points[.@c] +"^000000 MvP killed."; close; OnInit: // Script Configuration set .a, 1; // Broadcast who killed the MvP and wich MvP and wick Map [0 Off - 1 On] set .top, 10; // Max. Top Rank (Hihgly recommended between 5~10, more maybe bug the server (limited variables) waitingroom "MvP Rank",0; end; OnNPCKillEvent: // Script execution if ( getmonsterinfo( killedrid,MOB_MODE ) & 0x0020 == 0 ) end;// not an mvp if (.a) // If announce On announce "Player [" +strcharinfo(0) +"] had killed MVP [" +getmonsterinfo(killedrid,0) +"] in [" +strcharinfo(3) +"]",bc_blue|bc_all; query_sql "insert into `mvp_ranking` value ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', 1 ) on duplicate key update `points` = `points` + 1"; end; }
  6. Tss my mistake try with this // rewards <item ID>, <number> setarray .reward, 7732, 5; .size_reward = getarraysize( .reward ); .@t = gettimetick(1); if ( .@t > 10*60 && .@t < 12*60*60 || .@t > ( 12*60*60 + 10*60 ) ) disablenpc strnpcinfo(3); end; OnClock0000: OnClock1200: enablenpc strnpcinfo(3); announce "The rebirth npc appear!", 0; end; OnClock0010: OnClock1210: disablenpc strnpcinfo(3); announce "The rebirth npc is gone!", 0; end; }
  7. rand(100) throws a number between 0 and 99 and you don't give any item when it throws 0 here my view function script randbox { getitem 32020,1; mes "Do you really want to open one(1) Lottery Box?"; mes "^FF0000NOTE: Dont press cancel(beside OK) or the box will be gone.^000000"; mes "No refund will be given if you do so."; //next; if ( select("Yes Please:No! Not yet!") == 2 ) close; // setarray .@box1, "chance", item id, amount... setarray .@box1, 5, 32008,1, 32009,1, 32010,1, 32011,1, 32012,1, 32013,1; setarray .@box2, 10,32025,1, 8400,2, 8403,2, 8402,6, 607,25, 8400,10, 8402,20, 8403,8, 32025,3; setarray .@box3, 20,32007,1, 32006,1, 32005,1, 32004,1, 32003,1, 32002,1; // etc.. delitem 32020,1; set .@r, rand(100); while( .@r >= getd( ".@box"+ .@i ) ) .@i++; .@rand_index = rand( ( getarraysize( getd( ".@box"+ .@i ) ) -1 )/2 ) *2 -1; getitem getd( ".@box"+ .@i +"["+ .@rand_index +"]" ), getd( ".@box"+ .@i +"["+ (.@rand_index +1) +"]" ); emotion e_grat,1; close; }
  8. maybe this
  9. Thinking about it now, I should set an account variable to prevent the player using an ip dynamic /* CREATE TABLE IF NOT EXISTS `guildpack` ( `id` int(11) NOT NULL auto_increment, `account_id` int(11) NOT NULL default '0', `name` varchar(23) NOT NULL default '', `last_ip` varchar(100) NOT NULL default '', PRIMARY KEY (`account_id`), KEY (`id`) ) ENGINE=MyISAM; */ //====================================================================================================== prontera,130,172,5 script Guild Pack Info 468,{ if ( getcharid(2) == 0 ) { mes "You have no guild!"; close; } if ( #gpack || callsub( L_check ) ) { #gpack = 1; mes "^616D7EYou already given a Guild Package"; close; } mes "[Guild Pack NPC]"; mes "Hello there, it seems you are claiming for a Guild Pack."; next; mes "[Guild Pack NPC]"; mes "Let me gift you a guild pack for joining and"; mes "playing in Lunar RO, we hope you enjoy them."; next; mes "These guild pack is not duplicable and not dropable."; next; switch(select("Yes:No")) { case 1: .@myip$ = getcharip(); if ( callsub( L_check ) ) { mes "^616D7EIt seems you have same IP Address among Guild Mates: ^ff0000" + .@myip$ + "^000000. Sorry, but its not allowed."; close; } query_sql("INSERT INTO `guildpack` VALUES (NULL," + getcharid(3) + ",'" + escape_sql(strcharinfo(0)) + "','" + .@myip$ + "')"); //THIS PART WERE all items they will get getitem 29828,1; getitem 29851,1; getitem 29868,1; getitem 29834,1; getitem 29804,1; getitem 29835,1; getitem2 5170,1,1,7,0,0,0,0,0; getitem2 2319,1,1,7,0,4141,0,0,0; getitem2 2114,1,1,7,0,4058,0,0,0; getitem2 2528,1,1,7,0,4133,0,0,0; getitem2 2424,1,1,7,0,4097,0,0,0; getitem 2607,2; getitem 4035,5; getitem 4064,2; getitem 4079,2; getitem 14175,1; getitem 671,1; getitem 607,300; getitem 12045,100; getitem 12060,100; getitem 12050,100; getitem 12055,100; getitem 12065,100; getitem 12070,100; set #gpack, 1; warp "prontera",156,172; close; case 2: mes "^616D7ENevermind~, You can come back again later!"; close; } end; L_check: return query_sql("SELECT 1 FROM `guildpack` join login on login.`last_ip` = `guildpack`.`last_ip` where login.account_id = "+ getcharid(3), .@tmp ); OnInit: waitingroom "Guild Package",0; end; }
  10. Use OnClock and disablenpc/enablenpc // rewards <item ID>, <number> setarray .reward, 7732, 5; .size_reward = getarraysize( .reward ); end; OnClock0000: OnClock1200: disablenpc strnpcinfo(3); end; OnClock0010: OnClock1210: enablenpc strnpcinfo(3); end; }
  11. http://www.eathena.ws/board/index.php?s=&showtopic=186284&view=findpost&p=1058530
  12. Renewal exp enabled?
  13. .@equip = select( "","Armor","L-Hand","R-Hand","Garment","Shoe","Acc L","Acc R","","" );
  14. /* CREATE TABLE IF NOT EXISTS `E-MVPRank` ( `char_id` int(11) unsigned NOT NULL default '0', `name` varchar(30) NOT NULL DEFAULT '', `Class` smallint(6) unsigned NOT NULL default '0', `Count` int(11) unsigned NOT NULL default '0', PRIMARY KEY (`char_id`) ) ENGINE=MyISAM; */ prontera,162,152,4 script MVP Ladder 619,{ .@size = query_sql( "SELECT `name`,`Count` FROM `E-MVPRank` ORDER BY `Count` DESC LIMIT 5",.@Name$,.@Count ); if( .@size ){ for( set .@i,0; .@i < .@size; set .@i,.@i + 1 ) mes "[ "+( .@i + 1 )+". ] "+.@Name$[.@i]+" - "+.@Count[.@i]+" MvP killed"; }else{ mes "No Record Found."; } close; OnNPCKillEvent: if( getmonsterinfo( killedrid,MOB_MVPEXP ) ) query_sql( "INSERT INTO `E-MVPRank` SET `char_id`='"+getcharid(0)+"',`name`='"+strcharinfo(0)+"',`Class` = "+ Class +", `Count`='1' ON DUPLICATE KEY UPDATE `Count`=`Count`+1" ); OnMinute31: query_sql( "SELECT `name`,`Class`,`Count` FROM `E-MVPRank` ORDER BY `Count` DESC LIMIT 1",.@Name$,.@Class,.@Count ); delwaitingroom; waitingroom "TOP : "+.@Name$+" ("+jobname( .@Class )+") : "+.@Count+" Kill",0; end; }
  15. Capuche

    [Rank] MvP

    Add desc prontera,162,152,4 script MVP Ladder 619,{ set .@size, query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, .@name$, .@points ); //etc..
  16. /* CREATE TABLE IF NOT EXISTS `guildpack` ( `id` int(11) NOT NULL auto_increment, `account_id` int(11) NOT NULL default '0', `name` varchar(23) NOT NULL default '', `last_ip` varchar(100) NOT NULL default '', PRIMARY KEY (`account_id`), KEY (`id`) ) ENGINE=MyISAM; */ //====================================================================================================== prontera,130,172,5 script Guild Pack Info 468,{ if ( getcharid(2) == 0 ) { mes "You have no guild!"; close; } if ( @gpack || callsub( L_check ) ) { @gpack = 1; mes "^616D7EYou already given a Guild Package"; close; } mes "[Guild Pack NPC]"; mes "Hello there, it seems you are claiming for a Guild Pack."; next; mes "[Guild Pack NPC]"; mes "Let me gift you a guild pack for joining and"; mes "playing in Lunar RO, we hope you enjoy them."; next; mes "These guild pack is not duplicable and not dropable."; next; switch(select("Yes:No")) { case 1: .@myip$ = getcharip(); if ( callsub( L_check ) ) { mes "^616D7EIt seems you have same IP Address among Guild Mates: ^ff0000" + .@myip$ + "^000000. Sorry, but its not allowed."; close; } query_sql("INSERT INTO `guildpack` VALUES (NULL," + getcharid(3) + ",'" + escape_sql(strcharinfo(0)) + "','" + .@myip$ + "')"); //THIS PART WERE all items they will get getitem 29828,1; getitem 29851,1; getitem 29868,1; getitem 29834,1; getitem 29804,1; getitem 29835,1; getitem2 5170,1,1,7,0,0,0,0,0; getitem2 2319,1,1,7,0,4141,0,0,0; getitem2 2114,1,1,7,0,4058,0,0,0; getitem2 2528,1,1,7,0,4133,0,0,0; getitem2 2424,1,1,7,0,4097,0,0,0; getitem 2607,2; getitem 4035,5; getitem 4064,2; getitem 4079,2; getitem 14175,1; getitem 671,1; getitem 607,300; getitem 12045,100; getitem 12060,100; getitem 12050,100; getitem 12055,100; getitem 12065,100; getitem 12070,100; set @gpack, 1; warp "prontera",156,172; close; case 2: mes "^616D7ENevermind~, You can come back again later!"; close; } end; L_check: return query_sql("SELECT 1 FROM `guildpack` join login on login.`last_ip` = `guildpack`.`last_ip` where login.account_id = "+ getcharid(3), .@tmp ); OnInit: waitingroom "Guild Package",0; end; }
  17. Replace under oninit OnInit: freeloop 1; .@list$ = "4001,4002";// black list card normal mob .@total = query_sql("select distinct left( name_japanese, 1 ) as aaa 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 aaa", .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] +"' and mob_db.dropcardid not in ("+ .@list$ +") 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; } .@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 mexp = 0 group by item_db.id order by name_japanese limit 128", .@id ); npcshopdelitem "card_mob#miniboss", 501; for ( .@i = 0; .@i < .@nb; .@i++ ) npcshopadditem "card_mob#miniboss", .@id[.@i], 1000000; npcshopdelitem "card_mob#miniboss", 4147; // lol ... ok me lazy already .@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 mexp != 0 group by item_db.id order by name_japanese limit 128", .@id ); npcshopdelitem "card_mob#MVP", 501; for ( .@i = 0; .@i < .@nb; .@i++ ) npcshopadditem "card_mob#MVP", .@id[.@i], 1000000; freeloop 0; end; .@list$ = "4001,4002";// black list card normal mob
  18. Your emulator? revision?
  19. Mapflag#restricted.txt
  20. Line if(!strcharinfo(1)) { strcharinfo return a string. You can't use a logical not operator with string replace it by if( strcharinfo(1) == "" ) {
  21. 2 tricks found using the search button http://rathena.org/board/topic/90832-warp-npc/?hl=addrid#entry237148 http://rathena.org/board/topic/91510-lucky-pick-event/?hl=addrid#entry240207
  22. Yes plsssssssss and give me something else plssss like a milk! Geez this request is too difficult for me, I don't even know what is a "Paty". Well really! first post : empty request. If you don't put more effort to say what you want no one will help you
  23. que_temsky,146,143,6 script Quest Shop 775,{ delwaitingroom; waitingroom "Quest Shop",0; if ( !isequipped( 5102,5751,5138,5383,5395,5308 ) ) { mes "i only talk to people wearing :"; mes "- Blank Eyes"; mes "- Minstrel Song Hat"; mes "- Magic Eyes"; mes "- Hunter's Cap"; mes "- Striped Hat"; mes "- Brazil National Flag Hat"; close; } //etc..
  24. prontera,154,171,5 script Investor 100,{ .@price$ = "#CASHPOINTS"; .@cost = 10; .@bmax = 99; .@jmax = 50; if( compare(jobname(Class),"Mechanic") && BaseLevel == .@bmax && JobLevel == .@jmax ) { mes "[ Investor ]"; mes "So would you like to invest in this big project I'm working on?"; mes "It'll cost you 10 cash points!"; next; if(select("Yes:No")==1) { if(getd(.@price$)>=.@cost) { investment++; .@i = investment; setd(.@price$,getd(.@price$)-.@cost); callfunc( "package_func", 929, 20, 50, //Immortal Heart 970, 20, 50, //Alcohol 909, 100, 100, //Jellopy 7444, 5, 20, //Treasure Box 603, 1, 1*.@i, //Old Blue Box 4047, 1, 1 //Ghostring Card ); mes "[ Investor ]"; mes "Congratulations, but maybe next time you'll get something even better!"; } else { mes "[ Investor ]"; mes "It seems you don't have enough cash points better luck next time."; } close; } mes "[ Investor ]"; mes "Alright, maybe next time."; } else { mes "[ Investor ]"; mes "I don't have time for you!"; } close; } /// callfunc("package_func",<itemid>,<amount>,<chance>{,<itemid>,<amount>,<chance>{,<itemid>,<amount>,<chance>{,...},<accountid>}}) function script package_func { set .@len, getargcount()-((getarg(getargcount()-1)>=2000000)?1:0); set .@id, ((getarg(getargcount()-1)>=2000000)?getarg(getargcount()-1):getcharid(3)); while(set(.@i,.@i+3)-3<.@len) if(rand(101)<=getarg(.@i-1)) getitem(set(@package_item[++.@a-1],getarg(.@i-3)),set(@package_amount[.@a-1],getarg(.@i-2)),.@id); return .@a; }
×
×
  • Create New...