Jump to content

Skorm

Forum Moderator
  • Posts

    1282
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Skorm

  1. Change strlen to getstrlen.
  2. /* CREATE TABLE `ragnarok_logs`.`bst_market_log` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `name` VARCHAR(30) NOT NULL DEFAULT '', `message` VARCHAR(150) NOT NULL DEFAULT '', `time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE = MyISAM DEFAULT CHARACTER SET = utf8; */ - script bst_atcommand -1,{ OnInit: bindatcmd "bst",strnpcinfo(0)+"::OnCommand"; end; OnCommand: if ( !getstrlen(.@atcmd_parameters$) ) { message strcharinfo(0), "Please, enter a message (usage: @bst <message>)."; end; } if ( @bst_delay + 1800 > gettimetick(2) ) { message strcharinfo(0), "There is a 30 min delay of using this command again"; end; } @bst_delay = gettimetick(2); .@message$ = implode( .@atcmd_parameters$," " ); announce "[Market] "+ strcharinfo(0) +" : "+ .@message$, bc_all, 0x9999FF; query_logsql( "INSERT INTO `bst_market_log` ( `name`, `message` ) VALUES ( '"+escape_sql(strcharinfo(0))+"', '"+escape_sql( getstrlen(.@message$)>150?substr(.@message$,0,149):.@message$ )+"' );" ); end; }
  3. What exactly did you modify? I ran both files through a difference checker and it said they were exactly the same.
  4. I have a script like this in my paid selection. x_x I'd be willing to release it for free if others hadn't paid for it already. Basically it's a script that consists of 127 different item mvp and monster hunt quests. Using RO's offical quest system and it has a shop included.
  5. I've been on servers that have used the floating rates and it seemed to work fine, but I'm pretty sure it's rather old and maybe came before @reloadbattleconf you could try it either way. set $@brate(3500); set $@jrate(3500); set $@drate(1000); Should be... set $@brate, 3500; set $@jrate, 3500; set $@drate, 1000;
  6. Skorm

    Sign item for GM

    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.
  7. Here's an example done by Lupus, yeah? //===== rAthena Script ======================================= //= Floating Server Rates //===== By: ================================================== //= Lupus //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= It's a simply example of setbattleflag //= This script will change your server rates from 1x to 1.5x every 6 hours //= Note: It doesn't affect Card granted drops, MVP & Treasure Chests drops ^_- //= It also doesn't affect CARD drops, because they are just 0.01% //===== Additional Comments: ================================= //= You can make incredible scripts with 'setbattleflag'! //============================================================ - script FloatingRates -1,{ OnInit: //add any other HOURS OnHour00: OnHour06: OnHour12: OnHour18: //------------------- set $@brate,rand(100,150); set $@jrate,rand(100,150); set $@drate,rand(100,150); //Base exp setbattleflag("base_exp_rate",$@brate); //Job exp setbattleflag("job_exp_rate",$@jrate); //Drops setbattleflag("item_rate_common",$@drate); setbattleflag("item_rate_heal",$@drate); setbattleflag("item_rate_use",$@drate); setbattleflag("item_rate_equip",$@drate); //we don't change card drops rate, because these values won't change them anyway atcommand "@reloadmobdb"; announce "Current Rune-Midgard rates are: 1."+($@brate-100)+"x 1."+($@jrate-100)+"x 1."+($@drate-100)+"x",bc_all,0xFF6060; end; } OnSat0000: OnTue0000: For the labels used to activate the effects etc. More examples from the script_commands.txt Examples: // Will set the base experience rate to 20x (2000%) setBattleFlag "base_exp_rate",2000; // Will return the value of the base experience rate (when used after the above example, it would print 2000). mes getBattleFlag("base_exp_rate");
  8. /* Run this Query before installing this script! CREATE TABLE IF NOT EXISTS `gmprotect` ( `account_id` int(11) unsigned NOT NULL default '0', `password` varchar(24) NOT NULL default '', `gm_level` int(11) unsigned NOT NULL default '0', `switch` BOOLEAN NOT NULL default '0', PRIMARY KEY (`account_id`) ) ENGINE=MyISAM; */ - script GMPROTECT -1,{ OnPCLoginEvent: if( !.second_pass ) end; set @p, query_sql("SELECT `password`,`switch` FROM `gmprotect` WHERE `account_id` = "+getcharid(3)+";", @pass$, @a ); if( !@a || !.norm && getgmlevel() < 10 || getgmlevel() >= .bypass ) end; set @info, 1; if( strcharinfo(3) != "sec_pri" ) atcommand "@jail "+strcharinfo(0); end; OnPCLoadMapEvent: if( !@info ) end; atcommand "@mute 100 "+strcharinfo(0); if( !@p ) { mes "I see it's your first time logging in!"; if( .norm_mod ) { mes "Would you like to set a login password?"; next; if(select("Yes:No")&2) { query_sql "INSERT INTO `gmprotect` ( `account_id`, `gm_level` ) VALUES ( '"+getcharid(3)+"', "+getgmlevel()+" );"; mes "Alright, maybe next time."; @info = 0; callfunc "unlocker", strcharinfo(0), getcharid(3), 1; atcommand "@unjail "+strcharinfo(0); close; } } pass: mes "Please input your secondary password."; input( @pass$ ); while( @pass$ != .@pass2$ ) { mes "Again."; input(.@pass2$); set .@z,.@z+1; if( .@z > 1 ){ mes "I'm sorry, but your passwords didn't match, try again?"; next; if( .norm_mod ) if(select("Yes:No")&2) { mes "Alright, maybe next time."; query_sql "INSERT INTO `gmprotect` ( `account_id`, `gm_level` ) VALUES ( '"+getcharid(3)+"', "+getgmlevel()+" );"; @info = 0; callfunc "unlocker", strcharinfo(0), getcharid(3), 1; atcommand "@unjail "+strcharinfo(0); close; } set .@z,0; goto pass; } } query_sql "INSERT INTO `gmprotect` ( `account_id`, `password`, `gm_level`, `switch` ) VALUES ( '"+getcharid(3)+"', '"+escape_sql(((.md5)?md5(@pass$):@pass$))+"', "+getgmlevel()+", 1 );"; mes "Don't forget your password has been set to ["+@pass$+"]."; @pass$ = ""; @info = 0; callfunc "unlocker", strcharinfo(0), getcharid(3), 1; atcommand "@unjail "+strcharinfo(0); close; } setnpctimer 0; attachnpctimer(strcharinfo(0)); startnpctimer; mes "Please input your password, before 60 seconds are up."; next; input(.@input$); if(((.md5)?md5(.@input$):.@input$) == @pass$) { mes "Welcome back!"; close2; stopnpctimer; if( playerattached() ){ @pass$ = ""; @info = 0; callfunc "unlocker", strcharinfo(0), getcharid(3), 1; atcommand "@unjail "+strcharinfo(0); } } else { mes "Incorrect!"; close2; if( playerattached() ) callfunc "unlocker", strcharinfo(0), getcharid(3), 0; } end; OnTimer10000: if(playerattached()){ callfunc "unlocker", strcharinfo(0), getcharid(3), 0; } end; OnSwitch: set .second_pass, ((.second_pass)?0:1); end; OnInit: set .bypass, 100; //GMs this level or greater don't need passwords. set .md5, 1; //MD5 Passwords this is for added security (1=on:0=off) rAthena Only! set .norm, 1; //Enable Passwords for normal players (1=on:0=off) set .norm_mod, 0; //Players able to opt-out of second passwords. (1=on:0=off) set .second_pass, 1; //Enable disable second passwords. setmapflag "sec_pri", mf_loadevent; end; } //Example Changing Password NPC prontera,162,191,3 script Pass Setting 100,{ begin: query_sql("SELECT `password`,`switch` FROM `gmprotect` WHERE `account_id` = "+getcharid(3)+";",.@pass$,.@a); mes "Would you like to change or set a login password?"; next; select("Change Password:"+( ( getgmlevel()>=60 || getvariableofnpc(.norm_mod,"GMPROTECT") ) ?"Account Second Pass["+((.@a)?"On":"Off")+"]":"" )+":Cancel"); if(@menu==3) { mes "Alright, maybe next time."; close; } if(@menu==1) { mes "Please input your old password."; next; input(.@pass1$); if(((.md5)?md5(.@pass1$):.@pass1$)==.@pass$) { pass: mes "Please input your new password."; next; input(.@pass$); while(.@pass$!=.@pass2$) { mes "Again."; input(.@pass2$); set .@z,.@z+1; if(.@z>1){ mes "I'm sorry, but your passwords didn't match, try again?"; next; if(select("Yes:No")&2) { mes "Alright, maybe next time."; close; } set .@z,0; goto pass; } } query_sql "UPDATE `gmprotect` SET `password`='"+((.md5)?md5(.@pass$):.@pass$)+"', `switch`=1 WHERE `account_id`="+getcharid(3)+";"; mes "Don't forget your password has been set to ["+.@pass$+"]."; close; } else { mes "Sorry that's not your old password!"; close; } } else { if( getgmlevel() >= 99 ) { mes "Would you like to "+((getvariableofnpc(.second_pass,"GMPROTECT"))?"deactivate":"activate")+" server secondary passwords?"; next; if( select("Yes:No") == 1 ) { donpcevent "GMPROTECT::OnSwitch"; mes "Secondary passwords switched."; close; } mes "Instead would you like to "+((.@a)?"deactivate":"activate")+" your current secondary password?"; next; if( select("Yes:No") == 2 ) { mes "Ok maybe next time."; close; } } query_sql "UPDATE `gmprotect` SET `switch`="+((.@a)?0:1)+" WHERE `account_id`="+getcharid(3)+";"; goto begin; } end; OnInit: set .md5, getvariableofnpc(.md5,"GMPROTECT"); //MD5 Passwords this is for added security (1=on:0=off) rAthena Only! end; } function script unlocker { detachrid; if(getarg(2)){ atcommand "@unmute "+getarg(0); attachrid(getarg(1)); return; } atcommand "@unmute "+getarg(0); attachrid(getarg(1)); atcommand "@kick "+getarg(0); return; } Older script modified to work as suggested above.
  9. If one of the shop maps are set then yes... I would just recommend not setting vending maps. :0 This is more for woe, pvp, or pve.
  10. OnWhisperGlobal: if(isequipped(<item_id>)) goto Validation_whisp; end; If the head gear doesn't take all the head slots they can still morph other parts. Is it possible to put this script to save the last item headgear you had on when you un equip and equip it back? Ex. I have headgear A on if i change heqadgear A to let's say Angel Wings when i take off headgear A and put Headgear A back on it will stay as Angel Wings untill i change it with the commands like upper#ID BTW Headgear A= Dyna hat If you add "callfunc "MorphoEquip",<1,2,3>;" to the OnEquip segment of item A's datum it should already do that...
  11. OnInit: disablenpc strnpcinfo(0); end;
  12. Skorm

    MVP Warper

    I have something similar I could adapt it to what you're looking for free. When you say MVP do you really mean MVP? Because it sounds to me like more of an Endless Tower kind of thing.
  13. Why space it out so hard to read. xD
  14. Replace <item_id> with the ticket id. prontera,100,100,5 script Lotto Ticket 100,{ mes "[Lotto Ticket Dealer]"; mes "How many voting points would you like to exchange?"; mes "[10 Voting points = 1 Lotto Ticket]"; next; switch( input( .@pas1, 10, #KAFRAPOINTS ) ) { case -1: mes "[Lotto Ticket Dealer]"; mes "You can't go that low; the minimum value is 10."; close; case 1: mes "[Lotto Ticket Dealer]"; mes "You don't have that many voting points!"; close; } #KAFRAPOINTS = #KAFRAPOINTS - (.@pas1-(.@pas1%10)); mes " [Lotto Ticket Dealer]"; mes "Thank you please come again!"; getitem <item_id>, .@pas1/10; close; }
  15. - script hourlypoints -1,{ OnPCLoginEvent: attachnpctimer(); startnpctimer(); end; OnTimer3600000: if( checkidle() < 900 && !@autotrade ) { .@mes$ = ""; set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt; dispbottom "You received "+.point_amt+" Kafrapoints by staying in-game for 1 hour"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; set @consecutive_hour, @consecutive_hour + 1; //Check for 3 hours consecutive if(@consecutive_hour == 3) { set @consecutive_hour,0; set #KAFRAPOINTS, #KAFRAPOINTS + .cpoint_amt; dispbottom "You receive "+.cpoint_amt+" Kafrapoints for 3 consecutive hours of play."; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; } } else if( !getstrlen(.@mes$) ) { .@mes$ = "While afk for 15 minutes or more you will not receive hourly points."; dispbottom .@mes$; } attachnpctimer(); initnpctimer(); end; OnCommand: @autotrade = 1; atcommand "@autotrade"; end; OnInit: bindatcmd "autotrade","hourlypoints::OnCommand"; set .cpoint_amt, 50; //Points gained for consecutive time online. set .point_amt, 10; //Normal points gained. }
  16. Skorm

    Checkweight

    if( Weight > 1000 ) mes "You're overweight and can't enter this area."; else warp "prontera",0,0; close;
  17. Everything you need to know is right here... http://rathena.org/wiki/Custom_Items
  18. Use item_avail.txt and item_trade.txt in the db folder.
  19. You're sure that your server is pre-re? Try item_db_re? Honestly they keep changing the DBs so just add it to all of them until you find one that works... Make sure that your server is using txt db if it's using SQL db then it won't read from the txt db. Also make sure to reload the database and save after changes. Edit: If you're not making any graphical adjustments to the item I suggest you use item_avail.txt instead of iteminfo.lub.
  20. I'm pretty sure they just need to re-log to view added items in storage... <starter_map>,0,0,5 script notalk_freebie -1,500,500,{ OnTouch: if( !#freebies ) { // <itemid> <amount> <refine> <attribute> <card0> <card1> <card2> <card3> callsub( Sub_Insert, 1599 , 1 , 10 , 6 , 1599 , 1599 , 1599 , 1599); //+10 Ice Angra with 4 Angra's in card slot. callsub( Sub_Insert, 2199 , 1 , 10 , 6 , 2199 , 2199 , 2199 , 2199); //+10 Ice Ahura with 4 Ahura in card slot. //etc... #freebies++; dispbottom "Freebies have been added to your storage. Re-log to acquire them!"; } end; Sub_Insert: query_sql( "INSERT INTO `storage` (`account_id`,`nameid`,`amount`,`identify`,`refine`,`attribute`,`card0`,`card1`,`card2`,`card3`) "+ "VALUES ("+getcharid(3)+","+getarg(0)+","+getarg(1,1)+",1,"+getarg(2,0)+","+getarg(3,0)+","+getarg(4,0)+","+getarg(5,0)+","+getarg(6,0)+","+getarg(7,0)+");" ); return; } This is why I wish we had more control of the mail system from scripts. xD
  21. I've modified my above post at your request. http://rathena.org/board/topic/95948-requesting-for-pvp-pk-points-and-pvp-npc-shop-script-ty/?p=260180
  22. It's a rental item it's already there... rentitem 6269,3456000; rentitem <item_id>,<time_in_seconds>;
  23. There isn't an event trigger for guilds being broken. So we have to make one... onguildbreak.patch - script guildbreak -1,{ OnGuildBreak: if( countitem(512) ) delitem 512,1; end; }
×
×
  • Create New...