Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/15/22 in all areas

  1. this: opendressroom(1); thanks i will try
    1 point
  2. try this, just insert command for refresh - script paytowinbuffs -1,{ end; OnBuffs: .@size = getarraysize(.buffs$); for( .@i = 0; .@i < .@size; .@i++){ .@menu$ = .@menu$ + ""+.buffs$[.@i]+"" + ":"; } .@i = select(.@menu$) -1; sc_start .elements[.@i],180000,5; atcommand "@refresh "+strcharinfo(0); end; OnInit: setarray .buffs$, "Fire", "Water", "Earth", "Wind", "Holy", "Shadow", "Poison"; setarray .elements, 96, 97, "99", "98", "37", "144", "26"; bindatcmd "buffs2","paytowinbuffs::OnBuffs",5,99; end; }
    1 point
  3. As https://github.com/rathena/rathena/commit/88aaa9be98c4e9f8494a2012cb3b7700d3b844f5 map_nick2sd need a second parameter to accept (true) or not (false) partial name. sd = map_nick2sd( script_getstr(st,2),false );
    1 point
  4. @Yonko createchatroom works as the following // createchatroom( <char|account|name>, <title>, <password>, {<limit>, <type>} ); the title is the 2nd parameter - script atcmd_example -1,{ OnInit: bindatcmd "question",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: warp "prontera",150,150; if ( .@atcmd_numparameters == 0 ) .@atcmd_parameters$[0] = "Question";// default value createchatroom( getcharid(3), .@atcmd_parameters$[0], "",5 ); sit; end; }
    1 point
  5. there is a little bug when loading from another map, it could be your issue ie you see -- warp -- loading (create the chat when loading, don't display the chat) -- sit maybe add a sleep2 after the warp warp "prontera",150,150; sleep2 2000; createchatroom( getcharid(3), "Question", "",5 );
    1 point
  6. You can use getitem2 to do this... Here's a small example I came up with. - script at_signed_item -1,{ function sf { function s; .@a = getarg(2); .@len = getarg(3); return ( sprintf( getarg(0), s(.@a, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)) ) +(( .@a+1 < .@len )?":Next":":") +(( .@a-11 > 0 )?":Back":":") +":Cancel" ); function s { if( getarg(0) >= getarg(1) ) return ""; else { .@name$ = getelementofarray( getarg(2), getarg(0) ); return .@name$=="null"?"":"Character [^0054ff"+.@name$+"^000000]"; } }; }; function nex { return((getarg(0)+10)<getarg(1)?getarg(0)+10:getarg(1)-(getarg(1)%10)); }; function bac { return((getarg(0)-10)>=0?getarg(0)-10:0); }; OnCreate: //@signeditem <item_id>{ "<Signed Name>"{ <amount>{ <refine>{ <VVV Strong>{ <element>{ "Receiving Player"}}}}}; switch( .@atcmd_numparameters ) { default: dispbottom "Error: Too many parameters sent! ( @signeditem <item_id>{ <Signed Name>{ <amount>{ <refine>{ <VVV Strong>{ <element>{ Receiving Player}}}}}} ) "; end; case 7: .@player = getcharid( 3, .@atcmd_parameters$[6] ); if( !.@player ) { dispbottom "Error: Player not found! ( Maybe they aren't online! )"; end; } case 6: .@element = atoi( .@atcmd_parameters$[5] ); if( .@element > 4 ) { dispbottom "Error: Element not found! ( 1 - Ice, 2 - Earth, 3 - Fire, 4 - Wind )"; end; } case 5: .@strong = atoi( .@atcmd_parameters$[4] ); case 4: .@refine = atoi( .@atcmd_parameters$[3] ); case 3: .@amount = atoi( .@atcmd_parameters$[2] ); case 2: .@signature$ = .@atcmd_parameters$[1]; case 1: .@item = atoi( .@atcmd_parameters$ ); } .@len = query_sql( "SELECT `char_id`,`name` FROM `char` WHERE `name` LIKE '%"+.@signature$+"%' LIMIT 127;", .@cid, .@c_name$ ); if( .@len > 1 ) { mes "[ Signed @item ]"; mes "There was more than one result. Please select the correct name."; .@format$ = "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s"; next; while( 1 ) { select( sf( .@format$, .@c_name$, .@a, .@len ) ); switch( @menu ) { case 11: .@a = nex( .@a, .@len ); break; case 12: .@a = bac( .@a ); break; case 13: end; default: .@select = .@a+@menu-1; mes "[ Signed @item ]"; mes "You've selected ^0000FF["+.@c_name$[.@select]+"]^000000, is this correct?"; next; if( select("Yes:No") == 1 ) callsub Sub_NamedItem, .@item, .@cid[.@select], .@amount, .@refine, .@strong, .@element, .@player; close; } } } else if( .@len ) callsub Sub_NamedItem, .@item, .@cid, .@amount, .@refine, .@strong, .@element, .@player; dispbottom "Error: Signature could not be identified! ( Maybe that player doesn't exist! )"; end; Sub_NamedItem: .@cid = getarg(1); .@card3 = .@cid & 65535; .@card4 = .@cid >> 16; .@item = !getarg(0,501)?501:getarg(0); .@amount = !getarg(2,1)?1:getarg(2); .@refine = getarg(3,0); .@equip = getiteminfo( .@item, 5 ); if( .@equip == 0 || .@equip == 32768 ) .@card1 = 254; else { .@sc = getarg(4,0); .@ele = getarg(5,0); .@card1 = 255; .@card2 = .@ele+((.@sc*5)<<8); } if( .@player ) getitem2 .@item, .@amount, 1, .@refine, 0, .@card1, .@card2, .@card3, .@card4, .@player; else getitem2 .@item, .@amount, 1, .@refine, 0, .@card1, .@card2, .@card3, .@card4; dispbottom "Item"+((.@amount>1)?"s":"")+" Created!"; end; OnInit: bindatcmd "signeditem", "at_signed_item::OnCreate", 99, 99; } Usage: @signeditem <item_id>{ "<Signed Name>"{ <amount>{ <refine>{ <VVV Strong>{ <element>{ "Receiving Player"}}}}}; Example: @signeditem 1599 Lovely 1 10 3 >> +10 Very Very Very Strong Lovely's Fire Angra Manyu x1 Alternately the command can be used to search for players by letter or displaying the first 127 results directly from the database if nothing is provided.
    1 point
  7. prontera,150,150,0 script Sample 100,{ OnInit: setarray .Buffs[0], SC_BLESSING, SC_KYRIE, SC_ANGELUS; setarray .Effects[0], EF_BLESSING, EF_KYRIE, EF_ANGELUS; set .Size, getarraysize( .Buffs ); set .Buff, 0; // 1 to enabled buff, 0 otherwise set .Price, 100000; defpattern 1, "buff please", "OnBuff"; activatepset 1; end; OnBuff: if ( Zeny < .Price ) { npctalk "Can't buff you " + strcharinfo( 0 ) + ", You don't have zeny"; end; } Zeny -= .Price; percentheal 100, 100; specialeffect2 EF_HEAL2; if ( .Buff ) { for ( .@i = 0; .@i < .Size; .@i++ ) { specialeffect2 .Effects[ .@i ]; sc_start .Buffs[ .@i ], 300000, 10; } } end; }
    1 point
  8. - script atcmd_example -1,{ OnInit: bindatcmd "question",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: warp "prontera",150,150; createchatroom( getcharid(3), "Question", "",5 ); sit; end; } Add in src/custom/script.inc // createchatroom( <char|account|name>, <title>, <password>, {<limit>, <type>} ); // password : only enabled for type 0 // limit[ 1,20 ], 1 by default // type : 1 -> public, 0 -> private BUILDIN_FUNC(createchatroom) { int len = strlen( script_getstr(st,3) ); int limit = 1; char title[ CHATROOM_TITLE_SIZE ]; char password[ CHATROOM_PASS_SIZE ]; bool type = 1;// chat public by default TBL_PC *sd = NULL; if ( script_isstring(st,2) ) sd = map_nick2sd( script_getstr(st,2) ); else { int id = script_getnum(st,2); sd = map_charid2sd(id) ? map_charid2sd(id) : map_id2sd(id); } if ( sd == NULL ) { ShowWarning( "createchatroom : none player attached.\n" ); return 0; } if ( (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM) || (battle_config.basic_skill_check && pc_checkskill(sd,NV_BASIC) < 4 ) || npc_isnear(&sd->bl) ) return 0; if ( len > CHATROOM_TITLE_SIZE || strlen( script_getstr(st,4) ) > CHATROOM_PASS_SIZE ) return 0; if ( sd->chatID != 0 ) return 0; safestrncpy( title, script_getstr(st,3), min( len+1,CHATROOM_TITLE_SIZE ) ); safestrncpy( password, script_getstr(st,4), CHATROOM_PASS_SIZE ); if ( script_hasdata(st,5) ) { int tmp = script_getnum(st,5); if ( tmp > limit && tmp <= 20 ) limit = tmp; else if ( tmp > 20 ) limit = 20; } if ( script_hasdata(st,6) && script_getnum(st,6) == 0 ) type = 0; chat_createpcchat( sd, title, password, limit, type ); chat_changechatstatus( sd, title, password, limit, type ); return 0; } and in src/custom/script_def.inc BUILDIN_DEF(createchatroom,"vss??"), then recompile
    1 point
  9. prontera,155,181,5 script Sample 757,{ end; OnInit: npcspeed 200; while( 1 ){ npcwalkto rand( 150,160 ),rand( 175,185 ); sleep 15000; } end; } prontera,155,181,5 script Sample 757,{ if( .location ) end; set .location,select( implode( .map_name$,":" ) ); close2; while( .location ){ npcwalkto .npc_x[.location-1],.npc_y[.location-1]; sleep 5000; getmapxy( .@npc_map$,.@npc_x,.@npc_y,1 ); if( .@npc_x == .coordinate_y[.location-1] && .@npc_y == .coordinate_y[.location-1] ){ npctalk "You reached.."; set .location,0; sleep 3000; break; } } movenpc strnpcinfo(0),.npc_x,.npc_y; end; OnInit: npcspeed 200; getmapxy( .npc_map$,.npc_x,.npc_y,1 ); setarray .map_name$,"Location 1","Location 2","Location 3"; setarray .coordinate_x,150,160,170; setarray .coordinate_y,174,180,160; end; }
    1 point
  10. how you reload the script upon edit.. use @Loadnpc ? or restart server or @reloadscript.. if you use @loadnpc...then it wont be work .... because OnInit Label wont be trigger by using @loadnpc.. you have to either Restart server or use @reloadscript
    1 point
  11. each Job Class got 1 Room ?? try this prontera,155,181,5 script Sample 733,{ set .name$,"[PvP Room]"; set .@menu$, "All Jobs:"; for( set .@i, 1; .@i < getarraysize(.pvproomsjob); set .@i, .@i+1) { set .@menu$, .@menu$ + "^FF0000[" + .@i + "] ^0000FF"+jobname(.pvproomsjob[.@i])+"^000000:"; } set .@choice, select(.@menu$) -1; if(!.@choice) { warp .mapname$[.@choice],0,0; // Edit map for All Jobs end; } if(Class != .pvproomsjob[.@choice]) { mes "You are not of Class "+jobname(.pvproomsjob[.@choice]); close; } mapannounce .mapname$[.@choice],strcharinfo(0) + " Entered the PvP Room.",0; warp .mapname$[.@choice],0,0; end; OnInit: setarray .pvproomsjob[1],4009,4016,4010,4017,4011,4018,4012,4019,4013,4020; // Put job id's here setarray .mapname$[0],"guild_vs5","pvp_y_7-2","pvp_y_6-2","pvp_y_5-2","pvp_y_4-2","pvp_y_3-2","pvp_y_2-2","pvp_y_1-2","pvp_y_8-2","pvp_y_6-5","pvp_y_7-5"; // Put map name for those jobs. end; } the 1st Map is "All Job Class" the rest will follow the Job Id Lists
    1 point
×
×
  • Create New...