Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by Capuche

  1. Maybe because of the quotes 'mvp_point+1' ? query_sql("UPDATE `char` SET `mvp_point` = mvp_point+1 WHERE char_id = '"+ getcharid(0) +"'");
  2. Yes it's correct. The winner get the prize sunday then the table is truncated monday 00:00
  3. He searchs a job changer Emistry Try to replace if (Class == Job_Ninja || Class == Job_Gunslinger) by if (Class == Job_Ninja) setarray .@exp[0], ( Sex ? Job_Kagerou : Job_Oboro ), 70;
  4. Insert into an item the script if ( getskilllv("KN_RIDING") ) { if ( eaclass()&EAJ_THIRDMASK == EAJ_RUNE_KNIGHT ) setdragon; else if ( eaclass()&EAJ_THIRDMASK == EAJ_ROYAL_GUARD ) setriding !checkriding(); }
  5. Try this uggly npc /* CREATE TABLE IF NOT EXISTS `random` ( `char_id` int(11) unsigned NOT NULL DEFAULT '0', `name` varchar(30) NOT NULL default '', `tickets` int(11) unsigned NOT NULL DEFAULT '0', `mytickets` int(11) unsigned NOT NULL DEFAULT '0', `leader` tinyint(3) unsigned NOT NULL default '0', KEY `char_id` (`char_id`) ) ENGINE=MyISAM; */ prontera,150,150,5 script junon 87,{ .@ticket_id = 501; // ticket ID setarray .@item[0], 501,1; // reward if ( .winner$ == "" ) { query_sql( "select ( select mytickets from random where char_id = "+ getcharid(0) +" ),"+ "( select tickets from random where char_id = "+ getcharid(0) +" ), max( tickets ) from random", .@my_tickets, .@tickets, .@total ); mes "you bet "+ .@my_tickets +" ticket on a total of "+ .@total +" tickets."; mes "now how many tickets do you want to bet ?"; input .@amount; if ( .@amount == 0 ) close; next; if ( countitem( .@ticket_id ) < .@amount ) { mes "you don't have enough ticket"; close; } mes "you will bet "+ .@amount +" ticket. Is that ok?"; next; if ( select( "quit", "It's ok" ) == 1 ) close; mes "Alright good luck !"; delitem .@ticket_id, .@amount; if ( .@my_tickets == 0 ) query_sql "insert into random select "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', ( COALESCE( max( tickets ),0 ) + "+ .@amount +" ), "+ .@amount +", 0 from random"; else { query_sql "update random set tickets = tickets + "+ .@amount +" where tickets >= "+ .@tickets; query_sql "update random set mytickets = mytickets + "+ .@amount +" where char_id = "+ getcharid(0); } } else { if ( .winner$ == strcharinfo(0) ) { mes "congrat you win"; if ( .winner == 1 ) { getitem .@item[0], .@item[1]; query_sql "update random set leader = 2 where char_id = "+ getcharid(0); .winner = 2; } } else mes "the winner is "+ .winner$; } close; // OnInit: OnSun0000: query_sql "select max( tickets ) from random", .@max; query_sql "update random set leader = 1 where tickets <= ( rand() * "+ .@max +" ) order by tickets desc limit 1";// little trick with tickets column to select a random char following the tickets weight query_sql "select name, leader from random where leader > 0 limit 1", .winner$, .winner; end; OnMon0000: query_sql "truncate table random"; .winner$ = ""; .winner = 0; end; }
  6. It's an old version, do you have the const EAJL_THIRD in const.txt?
  7. https://rathena.org/board/topic/62757-reloadscript/
  8. Use this structure for permanent spawn. Otherwise use monster script command in a NPC. https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L5543
  9. poring_w02,177,176,5 pointshop Mvp Points Trader 112,#monster_points,7539:1 remove the 116 number (what is it about?)
  10. Try -%TAB%pointshop%TAB%<NPC Name>%TAB%<sprite id>,<costvariable>{:<discount>},<itemid>:<price>{,<itemid>:<price>...} <map name>,<x>,<y>,<facing>%TAB%pointshop%TAB%<NPC Name>%TAB%<sprite id>,<costvariable>{:<discount>},<itemid>:<price>{,<itemid>:<price>...} where <costvariable> is your variable name #skull_points
  11. What about https://github.com/rathena/rathena/blob/master/npc/custom/jobmaster.txt ? Just need to replace the line if (Class == Job_Ninja || Class == Job_Gunslinger) by the line if (Class == Job_Ninja)
  12. WHERE `group_id` > '0') group by account_id LIMIT 128 try
  13. Capuche

    Fusion Item

    God I should reread replace if ( .@argcount -3 == 4 ) { by if ( .@argcount -3 == (.@total *2) ) {
  14. Capuche

    Fusion Item

    Mistake mes "Choose something."; next; switch( select( "Fused Turtle General Card", "Fused 2nd card", "Fused 3rd card" ) ) { case 1: // <reward ID>, <chance success>, <item ID req 1>,<amount 1>, <item ID req 2>,<amount 2>, ..., <desc>; callsub S_Fuse, 4305,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy."; case 2: callsub S_Fuse, 4318,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy."; case 3: callsub S_Fuse, 4263,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy."; } S_Fuse: .@argcount = getargcount(); .@success = getarg(1); mes "[ Fused Card ]"; mes "-- Fused "+ getitemname( getarg(0) ) +" --"; mes "-- Requirements --"; for ( .@i = 2; .@i < .@argcount -1; .@i += 2 ) { if ( countitem(getarg(.@i)) >= getarg(.@i+1) ) { .@total++; .@color$ = "^0000ff1"; } else .@color$ = "^ff00000"; mes "x"+ .@color$ +"/"+ getarg(.@i+1) +" "+ getitemname(getarg(.@i)); } next; mes "-- New Effect --"; mes getarg( .@argcount -1 ); next; mes "-- Success Rate --"; mes ( 100 - .@success ) +"% Fail and "+ .@success +"% success."; if ( .@argcount -3 == 4 ) { next; if ( select( "Do it", "Bye" ) == 1 ) { if ( rand(1,100) <= .@success ) { mes "Success !"; getitem getarg(0),1; } else { mes "Failed"; } for ( .@i = 2; .@i < .@argcount -1; .@i += 2 ) delitem getarg(.@i),getarg(.@i+1); } } close;
  15. Capuche

    Fusion Item

    This? mes "Choose something."; next; switch( select( "Fused Turtle General Card", "Fused 2nd card", "Fused 3rd card" ) ) { case 1: // <reward ID>, <chance success>, <item ID req 1>,<amount 1>, <item ID req 2>,<amount 2>, ..., <desc>; callsub S_Fuse, 4305,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy."; case 2: callsub S_Fuse, 4318,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy."; case 3: callsub S_Fuse, 4263,10, 501,1, 502,1, 503,2, "HIT +150.\n Add a 5% chance of auto casting Stone Curse status when hit by enemy."; } S_Fuse: .@argcount = getargcount(); .@success = getarg(1); mes "[ Fused Card ]"; mes "-- Fused "+ getitemname( getarg(0) ) +" --"; next; mes "-- Requirements --"; for ( .@i = 2; .@i < .@argcount -1; .@i++ ) { if ( countitem(getarg(.@i)) >= getarg(.@i+1) ) { .@total++; .@color$ = "^0000ff1"; } else .@color$ = "^ff00000"; mes "x"+ .@color$ +"/"+ getarg(.@i+1) +" "+ getitemname(getarg(.@i)); } next; mes "-- New Effect --"; mes getarg( .@argcount -1 ); next; mes "-- Success Rate --"; mes ( 100 - .@success ) +"% Fail and "+ .@success +"% success."; if ( .@argcount -3 == 4 ) { next; if ( select( "Do it", "Bye" ) == 1 ) { if ( rand(1,100) <= .@success ) { mes "Success !"; getitem getarg(0),1; } else { mes "Failed"; } for ( .@i = 2; .@i < .@argcount -1; .@i++ ) delitem getarg(.@i),getarg(.@i+1); } } close;
  16. Capuche

    Fusion Item

    Additionnal item reward or required ? I don't understand what you want please reformulate !
  17. Ha yes maybe you forgot the args? Invasion( 1870,1,1898,30,1898,20,1898,10,1898,5 );
  18. OnMinute25: function Invasion { monster .SelectedMap$,0,0,"INVASION BOSS",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled"; for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 ) monster .SelectedMap$,0,0,"INVASION MOB",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled"; announce "Zombie Simulator at "+.SelectedMap$+" .. Hurry Up !!.",0; } here you def the function but you don't execute it function Invasion { monster .SelectedMap$,0,0,"INVASION BOSS",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled"; for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 ) monster .SelectedMap$,0,0,"INVASION MOB",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled"; announce "Zombie Simulator at "+.SelectedMap$+" .. Hurry Up !!.",0; } OnMinute25: Invasion; end;
  19. Use rAthena or add pcblockmove command in script.c
  20. What about mysql? I believe it would be more efficient
  21. You can do a trick setarray .@array_acid[0], 2000000, 2000001; setarray getd( ".@array_item"+ .@array_acid[0] ), 501, 502, 503; .@array_item2000000[0] == 501 .@array_item2000000[1] == 502 .@array_item2000000[2] == 503
×
×
  • Create New...