Jump to content

Patskie

Forum Moderator
  • Posts

    1,702
  • Joined

  • Last visited

  • Days Won

    14

Community Answers

  1. Patskie's post in Annieruru bg_emp reward for loosing team request was marked as the answer   
    //===== rAthena Script ======================================= //= Battleground: Emperium //===== Description: ========================================= //= A simple battleground script: //= Destroy the opponent's Emperium to win the match. //===== Changelogs: ========================================== //= 1.0 First version, edited. [Euphy] [AnnieRuru] //= 1.1 Use up to date battleground script commands [AnnieRuru] //= 1.2 Fix player can be kill multiple times within 250ms time frame [AnnieRuru] //============================================================ - script bg_emp#control -1,{ OnInit: .minplayer2start = 5; // minimum players to start (ex. if 3vs3, set to 3) .eventlasting = 20*60; // event duration before auto-reset (20 minutes * seconds) setarray .rewarditem[0], // rewards for the winning team: <item>,<amount>,... 7829, 30; end; OnStart: if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start ) end; // create Battleground and teams .red = waitingroom2bg( "-", 0,0, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ ); .blue = waitingroom2bg( "-", 0,0, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ ); delwaitingroom .rednpcname$; delwaitingroom .bluenpcname$; setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red"; setwall "bat_a01", 154,51, 6, 4, 0, "bg_emp_town_blue"; bg_warp .red, "bat_a01", 171,346; bg_warp .blue, "bat_a01", 162,50; // delay before match begins sleep 6000; mapannounce "bat_a01", "The rules are simple. The first team to break the opponent's Emperium wins!", bc_map; sleep 3000; for ( [email protected] = 5; [email protected] > 0; [email protected] ) { mapannounce "bat_a01", "["+ [email protected] +"]", bc_map; sleep 1000; } mapannounce "bat_a01", "Start!", bc_map; // spawn Emperiums bg_monster .red,"bat_a01",171,346, "--ja--",1915, strnpcinfo(3)+"::OnRedDown"; bg_monster .blue,"bat_a01",162,50, "--ja--",1914, strnpcinfo(3)+"::OnBlueDown"; delwall "bg_emp_town_red"; delwall "bg_emp_town_blue"; // match duration sleep .eventlasting * 1000; // end match, destroy Battleground, reset NPCs killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown"; killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown"; if ( .winside ) { mapannounce "bat_a01", "- "+( (.winside == .red)? "Red" : "Blue" )+" Team is victorious! -", bc_map; bg_get_data .winside, 1; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) getitem .rewarditem[0], .rewarditem[1], [email protected][[email protected]]; bg_get_data .loseside, 1; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) getitem 7829, 15, [email protected][[email protected]]; } else mapannounce "bat_a01", "- The match has ended in a draw! -", bc_map; sleep 5000; bg_warp .red, "prontera", 155,182; bg_warp .blue, "prontera", 158,182; bg_destroy .red; bg_destroy .blue; .winside = 0; donpcevent .rednpcname$ +"::OnStart"; donpcevent .bluenpcname$ +"::OnStart"; end; // Emperium destroyed OnRedDown: callsub L_EmpDown, "Red", .blue; OnBlueDown: callsub L_EmpDown, "Blue", .red; L_EmpDown: mapannounce "bat_a01", strcharinfo(0) +" has destroyed "+ getarg(0) +" Team's Emperium.", bc_map; .winside = getarg(1); .loseside = .winside == .red ? .blue : .red; awake strnpcinfo(0); end; // "OnDeath" event OnRedDead: callsub L_Dead, 157,347; OnBlueDead: callsub L_Dead, 142,51; L_Dead: warp "bat_a01", getarg(0), getarg(1); percentheal 100,100; end; // "OnQuit" event OnRedQuit: callsub L_Quit, .red, "Red"; OnBlueQuit: callsub L_Quit, .blue, "Blue"; L_Quit: percentheal 100, 100; if ( !bg_get_data( getarg(0), 0 ) ) mapannounce "bat_a01", "All "+ getarg(1) +" team members have quit!", bc_map, 0xff3333; end; } bat_room,138,136,6 script Red Team#bg_emp 413,{ end; OnInit: sleep 1; set getvariableofnpc( .rednpcname$, "bg_emp#control" ), strnpcinfo(0); OnStart: waitingroom "Red Team", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" ); end; } bat_room,144,136,4 script Blue Team#bg_emp 417,{ end; OnInit: sleep 1; set getvariableofnpc( .bluenpcname$, "bg_emp#control" ), strnpcinfo(0); OnStart: waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" ); end; } bat_room,141,135,6 script BG EMP 858,{ mes "BG EMP 5 VS 5"; mes "Premio Equipo Ganador:"; mes "30 <ITEM>Valor Badge<INFO>7828</INFO></ITEM>"; mes "Premio Equipo Perdedor:"; mes "15 <ITEM>Valor Badge<INFO>7828</INFO></ITEM>"; end; } bat_a01 mapflag battleground bat_a01 mapflag nosave SavePoint bat_a01 mapflag nowarp bat_a01 mapflag nowarpto bat_a01 mapflag noteleport bat_a01 mapflag nomemo bat_a01 mapflag nopenalty bat_a01 mapflag nobranch bat_a01 mapflag noicewall bat_a01 mapflag hidemobhpbar  
  2. Patskie's post in R> Gold room when player die inside gold room 10% of gold loot will dropped was marked as the answer   
    Try below
    prontera,150,150,6 script Gold Room Warper 100,{ warp "ordeal_3-1", 149, 149; end; OnPCDieEvent: if (strcharinfo(3) != "ordeal_3-1" || !countitem(.item) || killerrid == getcharid(3)) end; getmapxy [email protected]$, [email protected], [email protected]; [email protected] = countitem(.item) / 10; if ([email protected]) end; delitem .item, [email protected]; makeitem .item, [email protected], [email protected]$, [email protected], [email protected]; end; OnInit: .item = 969; // Gold end; } ordeal_3-1,0,0 monster Dokebi 1110,50,5000  
  3. Patskie's post in Smart Refine Announcement when exceed on safe limit was marked as the answer   
    Change 
    if (getequiprefinerycnt([email protected]) >= 7) announce "[Hollgrehenn]: "+strcharinfo(0)+" has successfully refined "+getequipname([email protected])+" to +"+getequiprefinerycnt([email protected])+"!",0; To
    switch (getiteminfo(getequipid([email protected]), 13)) { case 1: [email protected] = 9; break; case 2: [email protected] = 8; break; case 3: [email protected] = 6; break; case 4: [email protected] = 5; break; default: break; } if (getequiprefinerycnt([email protected]) >= [email protected]) announce "[Hollgrehenn]: "+strcharinfo(0)+" has successfully refined "+getequipname([email protected])+" to +"+getequiprefinerycnt([email protected])+"!",0;  
  4. Patskie's post in NPC Guild Lv Up was marked as the answer   
    *guildgetexp <amount>; This will give the specified amount of guild experience points to the guild the invoking character belongs to. It will silently fail if they do not belong to any guild.  
  5. Patskie's post in How to disable super Novice, gunslinger, taekwondo, ninja? was marked as the answer   
    Change
    Job_Options([email protected]_opt,Job_Swordman, Job_Mage, Job_Archer, Job_Acolyte, Job_Merchant, Job_Thief, Job_Super_Novice, Job_Taekwon, Job_Gunslinger, Job_Ninja); To
    Job_Options([email protected]_opt,Job_Swordman, Job_Mage, Job_Archer, Job_Acolyte, Job_Merchant, Job_Thief);  
  6. Patskie's post in Requesting Freebies NPC was marked as the answer   
    https://rathena.org/board/files/file/3736-another-freebies-npc-with-easy-characc-bound-settings/
  7. Patskie's post in R> @PK mode updated for latest rA was marked as the answer   
    pk.patch
  8. Patskie's post in Auto Resurrection when died (Item) was marked as the answer   
    - script asdqwe -1,{ OnPCDieEvent: if (!countitem(501)) end; delitem 501, 1; specialeffect 77; atcommand "@alive"; end; } Change 501 to your item id
  9. Patskie's post in Problem with Instance_annouce command was marked as the answer   
    Try changing
    case 0: instance_announce 0, strcharinfo(0)+" from party, " +getpartyname( [email protected]_id )+", is entering the dungeon, "+.instance_name$+".",bc_map,"0x00ff99",FW_NORMAL,12; end; To
    case 0: instance_announce instance_id(IM_PARTY), strcharinfo(0)+" from party, " +getpartyname( [email protected]_id )+", is entering the dungeon, "+.instance_name$+".",bc_map,"0x00ff99",FW_NORMAL,12; end;  
  10. Patskie's post in Vend Control Error was marked as the answer   
  11. Patskie's post in Enchant Remove with Choices not working correctly was marked as the answer   
    Change 
    if([email protected] == 0)[email protected]$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]:"; else [email protected]$ = getitemname([email protected]); if([email protected] == 0)[email protected]$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]:"; else [email protected]$ = getitemname([email protected]); if([email protected] == 0)[email protected]$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]:"; else [email protected]$ = getitemname([email protected]); if([email protected] == 0)[email protected]$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]:"; else [email protected]$ = getitemname([email protected]); To 
    if([email protected] == 0)[email protected]$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]"; else [email protected]$ = getitemname([email protected]); if([email protected] == 0)[email protected]$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]"; else [email protected]$ = getitemname([email protected]); if([email protected] == 0)[email protected]$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]"; else [email protected]$ = getitemname([email protected]); if([email protected] == 0)[email protected]$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]"; else [email protected]$ = getitemname([email protected]); It happens because when you remove the first enchant item the selection menu becomes "- [ No Equip ]:", "Enchant1", "Enchant2", "Enchant3". The script engine reads ":" as delimiter in case of select command. Since it's there all the indexes of the select options are moved [ No Equp (1), empty string (2),  card2 (3), card3 (4), card4 (5) ].
  12. Patskie's post in PVP Point on specific Map was marked as the answer   
    You can try below script and let me know if it works 😛
    - shop PVPSHOP -1,501:20000 prontera,150,150,0 script PVP Points Shop 100,{ callshop "PVPSHOP", 1; npcshopattach "PVPSHOP"; end; OnBuyItem: for ([email protected] = 0; [email protected] < getarraysize(.items); [email protected] += 2) { for ([email protected] = 0; [email protected] < getarraysize(@bought_nameid); [email protected]++) { if (@bought_nameid[[email protected]] == .items[[email protected]]) { if (checkweight(@bought_nameid[[email protected]],@bought_quantity[[email protected]])) { if (#PVPPOINTS < .items[[email protected]+1] || #PVPPOINTS < (.items[[email protected]+1] * @bought_quantity[[email protected]])) dispbottom "You don't have enough PVP points"; else { #PVPPOINTS -= .items[[email protected]+1] * @bought_quantity[[email protected]]; getitem @bought_nameid[[email protected]], @bought_quantity[[email protected]]; } } else dispbottom "You cannot carry out more items with you"; } } } // clean up before ending deletearray @bought_quantity, getarraysize(@bought_quantity); deletearray @bought_nameid, getarraysize(@bought_nameid); end; OnInit: setarray .items, 1000,1,1001,2; // Usage : <item id>,<price>{,<item id>,<price>} npcshopitem "PVPSHOP",0,0; for ([email protected] = 0; [email protected] < getarraysize(.items); [email protected] += 2) npcshopadditem "PVPSHOP", .items[[email protected]], .items[[email protected]+1]; end; } - script Func_PVP -1,{ OnPCKillEvent: if (getcharid(3) == killedrid || strcharinfo(3) != "prontera") end; #PVPPOINTS += .p[0]; dispbottom "You won " + .p[0] + " pvp points. New pvp points is " + #PVPPOINTS; end; OnPCDieEvent: if (getcharid(3) == killerrid || strcharinfo(3) != "prontera") end; if (#PVPPOINTS > .p[1]) {#PVPPOINTS -= .p[1];} else {#PVPPOINTS = 0;} dispbottom "You lost " + .p[1] + " pvp points. New pvp points is " + #PVPPOINTS; end; OnCheckPoint: dispbottom "You currently have " + #PVPPOINTS + " pvp points."; end; OnInit: setarray .p[0], 2, 1; // points per kill, points per death bindatcmd "checkpoints", strnpcinfo(0) + "::OnCheckPoint"; end; }  
  13. Patskie's post in Will the floating rates script revert after 1 hour? was marked as the answer   
    You can try below
    - script FloatExp -1,{ OnMinute00: if (.floated) { setbattleflag "base_exp_rate", .currentRates[0]; setbattleflag "job_exp_rate", .currentRates[1]; announce "Server rates are now back to normal. Rates are " + getbattleflag("base_exp_rate") + "/" + getbattleflag("job_exp_rate"), bc_all; .floated = 0; } end; OnTrig: setarray [email protected][ 0 ], 100, 150, 200; [email protected] = [email protected][ rand( getarraysize( [email protected] ) ) ]; setbattleflag "base_exp_rate", [email protected]; setbattleflag "job_exp_rate", [email protected]; announce "Server rates are adjusted. New rates are " + getbattleflag("base_exp_rate") + "/" + getbattleflag("job_exp_rate"), bc_all; .floated = 1; end; OnInit: bindatcmd "floatexp", strnpcinfo(0) + "::OnTrig"; setarray .currentRates[0], getbattleflag("base_exp_rate"), getbattleflag("job_exp_rate"); end; } Use @floatexp to readjust the base/job exp rates
  14. Patskie's post in Advance Refiner ( Announce +9 +10 ) was marked as the answer   
    if ( getequiprefinerycnt( [email protected] ) > 8 ) announce strcharinfo( 0 ) + " got +" + getequiprefinerycnt( [email protected] ) + " now!", 0;

  15. Patskie's post in help Dragon Spawn. was marked as the answer   
    Check format :
    *monster "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>}; Should be : 
    monster "lunar01",0,0,"--ja--",1514,199; monster "lunar01",0,0,"--ja--",1514,1,strnpcinfo(0)+"::OnKilled";
  16. Patskie's post in @effect that affects all players in the map was marked as the answer   
    prontera,150,150,0 script Sample 100,{ addrid( 0 ); sc_start SC_FREEZE, 240000, 10; end; } Freeze all players on the whole server
  17. Patskie's post in MVP Check NPC was marked as the answer   
    Check this out
  18. Patskie's post in Autolooting custom itemdrop was marked as the answer   
    Change 
    makeitem 6187,1,[email protected]$,[email protected],[email protected]; to 
    getitem 6187,1;
  19. Patskie's post in R>Special MVP drops script was marked as the answer   
    - script Sample -1,{
    OnNPCKillEvent:
    if ( getmonsterinfo( killedrid, 22 ) ) {
    for ( [email protected] = 0; [email protected] < getarraysize( .items ); [email protected] += 3 ) {
    if ( rand( 100 ) < .items[ [email protected] + 2 ] ) {
    getitem .items[ [email protected] ], .items[ [email protected] + 1 ];
    announce "Wow! " +strcharinfo( 0 )+ " has obtained " +getitemname( .items[ [email protected] ] )+ " [" +.items[ [email protected] + 1 ]+ "] from " +getmonsterinfo(killedrid, 0)+ ".",0;
    }
    }
    }
    end;
    OnInit:
    // <item id>,<amount>,<chance>
    setarray .items[0],14232, 2, 5,
    7615, 1, 3,
    7227, 1, 2,
    7179, 1, 1;
    end;
    }

  20. Patskie's post in How can i give points? was marked as the answer   
    prontera,150,150,0 script Sample 100,{
    if ( getgmlevel( ) < 99 ) end;
    [email protected]$ = "[ ^FF0000" + strnpcinfo( 1 ) + "^000000 ]";
    [email protected] = getcharid( 3 );
    mes [email protected]$;
    mes "Enter the player name you want to give a reward point(s).";
    next;
    input [email protected]$;
    if ( !getcharid( 3, [email protected]$ ) ) {
    mes [email protected]$;
    mes "The player is not online.";
    close;
    }
    mes [email protected]$;
    mes "How many points do you want to give to " [email protected]$+ "?";
    next;
    input [email protected];
    if ( [email protected] ) {
    mes [email protected]$;
    mes "Invalid amount.";
    close;
    }
    if ( attachrid( getcharid( 3, [email protected]$ ) ) ) {
    set eventpoints, eventpoints + [email protected];
    dispbottom "You have given " + [email protected] + " event point" + ( [email protected] > 1 ? "s" : "" ) + " by " + rid2name( [email protected] ) + ".";
    dispbottom "You now have " + eventpoints + " event point" + ( eventpoints > 1 ? "s" : "" ) + ".";
    }
    attachrid( [email protected] );
    mes [email protected]$;
    mes "Done!";
    close;
    }

  21. Patskie's post in R>broadcaster using @broad cmd was marked as the answer   
    - script Broadcaster -1,{
    OnInit:
    bindatcmd "broad",strnpcinfo( 3 )+"::OnBroadCastMessage";
    end;
    OnBroadCastMessage:
    if ( timer > gettimetick( 2 ) ) {
    dispbottom "You can use the broadcast command after " + ( timer - gettimetick( 2 ) ) + " second" + ( ( timer - gettimetick( 2 ) ) > 1 ? "s" : "" ) + ".";
    end;
    }
    if ( Zeny < 1000000 ) {
    dispbottom "You don't have zeny to do broadcasting";
    end;
    }
    if ( [email protected]_parameters$[ 0 ] != "" ) {
    Zeny -= 1000000;
    announce "[" + strcharinfo( 0 ) + "] : " +implode([email protected]_parameters$, " "), 0, 0xFF0000;
    timer = gettimetick( 2 ) + 10;
    }
    end;
    }

  22. Patskie's post in MvP town onvader was marked as the answer   
    - script Sample -1,{ OnWhisperGlobal: if ( getgmlevel() < 99 ) end; if ( @whispervar0$ == "start" ) donpcevent strnpcinfo( 1 )+"::OnStart"; end; OnMinute00: if ( gettime( 3 ) % 4 ) end; donpcevent strnpcinfo( 1 )+"::OnStart"; end; OnStart: monster "prontera",150,150,"--ja--",1002,1,strnpcinfo( 1 )+"::OnKilledMonster"; end; OnKilledMonster: //announce strcharinfo( 0 )+ " won the event",0; getitem 501, 1; end; } whisper start
  23. Patskie's post in Log out item will auto removed and put in his/her inventory was marked as the answer   
    - script Sample -1,{
    OnInit:
    setarray .Items[0],1201, 1202, 5035;
    .size = getarraysize( .Items );
    end;
    OnPCLogoutEvent:
    for ( [email protected] = 1; [email protected] < 22; [email protected]++ ) {
    for ( [email protected] = 0; [email protected] < .size; [email protected]++ ) {
    if ( getequipid( [email protected] ) == .Items[ [email protected] ] )
    unequip( [email protected] );
    }
    }
    end;
    }

  24. Patskie's post in Q>about getitem was marked as the answer   
    *getitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
    *getitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
    This command will give an amount of specified items to the invoking character.
    If an optional account ID is specified, and the target character is currently
    online, items will be created in their inventory instead. If they are not
    online, nothing will happen. It works essentially the same as 'getitem' (it even
    works for negative ID numbers the same way) but is a lot more flexible.
    Those parameters that are different from 'getitem' are:
    identify - Whether you want the item to be identified (1) or not (0).
    refine - For how many pluses will it be refined.
    It will not let you refine an item higher than the max refine.
    attribute - Whether the item is broken (1) or not (0).
    card1,2,3,4 - If you want a card compound to it, place the card ID number into
    the specific card slot.
    Card1-card4 values are also used to store name information for named items, as
    well as the elemental property of weapons and armor. You can create a named item
    in this manner, however, if you just need a named piece of standard equipment,
    it is much easier to the 'getnameditem' function instead.
    You will need to keep these values if you want to destroy and then perfectly
    recreate a named item, for this see 'getinventorylist'.
    If you still want to try creating a named item with this command because
    'getnameditem' won't do it for you cause it's too limited, you can do it like
    this. Careful, minor magic ahead.
    // First, let's get an ID of a character who's name will be on the item.
    // Only an existing character's name may be there.
    // Let's assume our character is 'Adam' and find his ID.
    @charid = getcharid(0,"Adam");
    // Now we split the character ID number into two portions with a binary
    // shift operation. If you don't understand what this does, just copy it.
    @card3 = @charid & 65535;
    @card4 = @charid >> 16;
    // If you're inscribing non-equipment, @card1 must be 254.
    // Arrows are also not equipment.
    @card1 = 254;
    // For named equipment, card2 means the Star Crumbs and elemental
    // crystals used to make this equipment. For everything else, it's 0.
    @card2 = 0;
    // Now, let's give the character who invoked the script some
    // Adam's Apples:
    getitem2 512,1,1,0,0,@card1,@card2,@card3,@card4;
    This wasn't tested with all possible items, so I can't give any promises,
    experiment first before relying on it.
    To create equipment, continue this example it like this:
    // We've already have card3 and card4 loaded with correct
    // values so we'll just set up card1 and card2 with data
    // for an Ice Stiletto.
    // If you're inscribing equipment, @card1 must be 255.
    @card1 = 255;
    // That's the number of star crumbs in a weapon.
    @sc = 2;
    // That's the number of elemental property of the weapon.
    @ele = 1;
    // And that's the wacky formula that makes them into
    // a single number.
    @card2 = @ele+((@sc*5)<<8);
    // That will make us an Adam's +2 VVS Ice Stiletto:
    getitem2 1216,1,1,2,0,@card1,@card2,@card3,@card4;
    Experiment with the number of star crumbs - I'm not certain just how much will
    work most and what it depends on. The valid element numbers are:
    1 - Ice, 2 - Earth 3 - Fire 4 - Wind.
    You can, apparently, even create duplicates of the same pet egg with this
    command, creating a pet which is the same, but simultaneously exists in two
    eggs, and may hatch from either, although, I'm not sure what kind of a mess will
    this really cause.
  25. Patskie's post in database problem was marked as the answer   
    Execute this on your database :
    ALTER TABLE `picklog` ADD COLUMN `unique_id` bigint(20) unsigned NOT NULL default '0';
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.