Jump to content

Winterfox

Members
  • Posts

    236
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Winterfox

  1. - script SHOP_COIN_CONVERTER -1,{ OnInit: .exchange_item = 501; .conversion_rate = 1000; // 1000 to 1. initnpctimer; end; OnTimer1800000: // Reset the timer. initnpctimer; // Add all players on the server to the script. addrid(0); // Check if the player is autotrading and exit if not. if(!(checkvending(strcharinfo(0)) & 2)) end; // Convert .conversion_rate zeny into amount to exchange. .@exchange_amount = floor(Zeny / .conversion_rate, 1); // If the exchange amount is below 1 exit. if(.@exchange_amount < 1) end; // If the player can't carry all the items exit. if((getiteminfo(.exchange_item, ITEMINFO_WEIGHT) * .@exchange_amount + Weight) > MaxWeight) end; // Subtract zeny. Zeny -= .@exchange_amount * .conversion_rate; // Handout the item in .@exchange_amount. getitem(.exchange_item, .@exchange_amount); }
  2. You can use the last parameter of bindatcmd. The default of charcommand level is 100 so that it basically is disabled by default. If you set it to a group level someone has, you should be able to use that command like a char command. bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>};
  3. if(BaseLevel >= 90) { if(Zeny < .@price) { message(strcharinfo(0), "Healing costs " + callfunc("F_InsertComma",.@Price) + " Zeny."); end; } Zeny -= .@price; } specialeffect2 EF_HEAL2; percentheal 100,100;
  4. That symbol and message is created by a status effect. You will need to add a new status effect to your client. Afterward, you can use the status effect id in a script as a parameter for sc_start to make it appear for players that you want to see it for the duration you would like them to see it.
  5. Winterfox

    Quest Shop

    You could create a copy of the item so that it has a unique id you can check for in the NPC that collects the quest requirement.
  6. That is something you need to change in the source, not via script.
  7. You could create a custom teleport, that only lets you enter without a party and use a mapflag to prevent the creation of new a party on the target map to make sure there are no partys on that map. prontera,150,150,4 script #nopartyteleport WARPNPC,3,3,{ end; OnTouch_: if(getcharid(1)) { dispbottom("Players with a party can't enter!"); end; } warp("izlude", 155, 155); } izlude mapflag partylock
  8. https://github.com/rathena/rathena/blob/master/doc/script_commands.txt: *sc_start <effect type>,<ticks>,<value 1>{,<rate>,<flag>{,<GID>}}; Optional value <rate> is the chance that the status will be invoked (100 = 1%). This is used primarily in item scripts. When used in an NPC script, a flag MUST be defined for the rate to work. sc_start SC_BOSSMAPINFO,600000,0,5000;
  9. Could you provide more information, like what problem happens when you many people at the same time use that script? Could you also provide the script we talk about?
  10. The solution depends on the payment method you want to use. If you want to use cashpoints or kafrapoints as currency, you can replace shop at the bottom with cashshop. If you want to use items as currency, you can use itemshop. Finally, if you want to use some variable where the currency is stored, you can use pointshop. There are other types of shops available: cashshop - use "cashshop" in place of "shop" to use the Cash Shop interface, allowing you to buy items with special points that are stored as account variables called #CASHPOINTS and #KAFRAPOINTS. This type of shop will not allow you to sell items at it, only make purchases. The layout used to define sale items still count, and "<price>" refers to how many points will be spent purchasing the them. "itemshop" and "pointshop" use the Shop interface, allowing you to buy items with a specific item or special points from a variable. 'pointshop' only supports permanent character variables, temporary character variables, permanent local account variables or permanent global account variables. These variables must be of integer type, not string. 'discount' flag is an optional value which makes the price at that shop become affected by discount skill.
  11. prontera,150,150,6 script Dev 123,{ // get player coordinates. getmapxy(.@map$, .@x, .@y); // clear array of mob ids and spawn the mobs at the players coordinates. cleararray($@mobid[0], 0, getarraysize($@mobid)); monster(.@map$, .@x, .@y, "", .mob_id, .mob_amount); // add the spawned mobs to the mob queue. for(.@i = 0; .@i < getarraysize($@mobid); .@i++) { .@next_index = getarraysize(.mob_queue); .mob_queue[.@next_index] = $@mobid[.@i]; .mob_queue[.@next_index + 1] = gettimetick(2); } end; OnInit: // config .mob_id = 1002; .mob_amount = 1; .timeout = 10; // start a infinite loop that.. freeloop(1); while(true) { // checks every second for mobs that have existed for .timeout seconds, kill them and remove them from the mob queue. for(.@i = 0; .@i < getarraysize(.mob_queue); .@i += 2) { if(gettimetick(2) - .mob_queue[.@i + 1] == .timeout) { unitkill(.mob_queue[.@i]); deletearray(.mob_queue[.@i], 2); .@i -= 2; } } sleep(1000); } freeloop(0); }
  12. function script randombox { setarray(.@box_items, 501, 505, 522); .@item = .@box_items[rand(getarraysize(.@box_items))]; getitem(.@item, 1); announce(strcharinfo(0) + " got a " + getitemname(.@item) + "!"); return; }
  13. function script randombox { setarray(.@box_items, 501, 505, 522); .@item = .@box_items[rand(getarraysize(.@box_items))]; getitem(.@item, 1); announce(strcharinfo(0) + " got a " + getitemname(.@item) + "!"); return; }
  14. #DAILYRENTREWARD is a global account variable, that means it is the same for all NPCs and all characters of one account. So if the cooldown is set, it will be set for all NPCs that check for it.
  15. prontera,142,173,5 script Recompensas Diarias 911,{ .@cd = 60 * 60 * 24; // 24 hrs .@time = gettimetick(2); if ( #DAILYRENTREWARD + .@cd > .@time ) { mes "Volte novamente em " + Time2Str(#DAILYRENTREWARD + .@cd) + " para pegar sua recompensa!"; close; } mes "Aqui está sua recompensa, aproveite-a!"; close2; // Pick one item index randomly as reference. .@reward_item_index = rand(getarraysize(.reward_items)); // Use the reference to get the item id and duration of the referenced item. rentitem(.reward_items[.@reward_item_index], .reward_item_durations[.@reward_item_index]); #DAILYRENTREWARD = .@time; end; OnInit: // Set the list of possible items and how long they should be rentable. setarray(.reward_items, 4302, 720); setarray(.reward_item_durations, 7200, 7200); }
  16. //===== rAthena Script ============================================ //= Party vs Party //===== By: ======================================================= //= AnnieRuru //===== Current Version: ========================================== //= 0.2 //===== Compatible With: ========================================== //= rathena 2020-09-23 //===== Description: ============================================== //= GM has to manually pick which 2 party to fight //===== Topic ===================================================== //= https://rathena.org/board/topic/125939-looking-for-a-tournament-npc-sytem-pt-vs-pt/ //===== Additional Comments: ====================================== //= came over to rathena forum for a while, glad to see potential members on the other side //================================================================= prontera,155,177,5 script PartyVsParty 100,{ goto OnWarStart; end; OnInit: .eventlasting = 60; // 60 seconds .partysize = 1; bindatcmd "startmatch", strnpcinfo(3)+"::OnWarStart", 99,99; setarray .available_type$, " ^00FF00Available^000000", " ^FF0000Unavailable^000000", " ^FF0000Offline^000000"; setmapflag "guild_vs3", mf_battleground, 2; setmapflag "guild_vs3", mf_nosave; setmapflag "guild_vs3", mf_nomemo; setmapflag "guild_vs3", mf_nowarp; setmapflag "guild_vs3", mf_nowarpto; setmapflag "guild_vs3", mf_noteleport; setmapflag "guild_vs3", mf_nopenalty; end; OnWarStart: if (.start) { mes "The match is in progress ..."; mes "The current score is "+ .partyAscore +":"+ .partyBscore; mes "Terminate ?"; next; if (select("No", "Yes") == 1) close; if (select("Yes", "No") == 2) close; .skip = true; awake strnpcinfo(0); close; } mes "Welcome, what do you want to do?"; callsub L_display_party_members, .partyA, "A"; callsub L_display_party_members, .partyB, "B"; next; switch(select("Set Party Size", "Select Party A", "Select Party B", "Start Match")) { case 1: mes "input exact party size"; mes "if 3vs3, input 3"; next; input .partysize, 1, 12; goto OnWarStart; case 2: .partyA = callsub(L_select_party, "A", .partyA, .partyB); goto OnWarStart; case 3: .partyB = callsub(L_select_party, "B", .partyB, .partyA); goto OnWarStart; case 4: .@conditions = 0; .@conditions += callsub(L_check_party_conditions, .partyA, "A"); .@conditions += callsub(L_check_party_conditions, .partyB, "B"); if (.@conditions < 2 || .start) goto OnWarStart; else goto L_start; } close; L_display_party_members: if (!getarg(0)) mes "Party "+ getarg(1) +" = ^FF0000None^000000"; else { getpartymember getarg(0), 0; getpartymember getarg(0), 1; getpartymember getarg(0), 2; .@origin = getcharid(3); .@online = .@unavailable = 0; for (.@i = 0; .@i < $@partymembercount; ++.@i) { if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) { attachrid $@partymemberaid[.@i]; if (getmapflag(strcharinfo(3), mf_nowarp)) { .@type[.@i] = 1; ++.@online; ++.@unavailable; } else { .@type[.@i] = 0; ++.@online; } } else .@type[.@i] = 2; } attachrid .@origin; mes "Party "+ getarg(1) +" = ["+ getpartyname(.partyA) +"] "+( ($@partymembercount == .partysize && .@online == .partysize && !.@unavailable)? "^00FF00Ready": "^FF0000Not Qualify" )+"^000000"; mes "Online = "+ .@online +((.@unavailable)? ", Unavailable = "+ .@unavailable : ""); for (.@i = 0; .@i < $@partymembercount; ++.@i) mes "- "+ $@partymembername$[.@i] + .available_type$[.@type[.@i]]; } return; L_select_party: mes "input a player name"; input .@tmp$; if (getcharid(3, .@tmp$) == 0) { mes "player not available"; next; return getarg(1); } .@partyid = getcharid(1, .@tmp$); if (!.@partyid) { mes "that player doesn't have a party"; next; return getarg(1); } if (.@partyid == getarg(2)) { mes "that player is a member on the other party"; next; return getarg(1); } mes "are you sure you want the party"; mes getpartyname(.@partyid) +" as Party "+ getarg(0) +"?"; next; if (select("Yes","No") == 2) return getarg(1); return .@partyid; L_check_party_conditions: if (!getarg(0)) { mes "Party"+ getarg(1) +" hasn't been configure"; next; return false; } getpartymember getarg(0), 0; getpartymember getarg(0), 1; getpartymember getarg(0), 2; .@origin = getcharid(3); for (.@i = 0; .@i < $@partymembercount; ++.@i) { if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) { attachrid $@partymemberaid[.@i]; ++.@online; if (getmapflag(strcharinfo(3), mf_nowarp)) .@index[.@c++] = .@i; } } attachrid .@origin; if ($@partymembercount != .partysize) { mes "Party"+ getarg(1) +" has changed its party size"; next; return false; } if (!.@online) { mes "Party"+ getarg(1) +" don't have any players online at the moment"; next; return false; } if (.@online != .partysize) { mes "Party"+ getarg(1) +" has a few members gone offline"; next; return false; } if (.@c > 0) { mes "Party"+ getarg(1) +" has "+ .@c +" party members not ready, still attending on other event maps"; for (.@i = 0; .@i < .@c; ++.@i) mes "- "+ $@partymembername$[.@index[.@i]]; next; return false; } return true; L_register_bg_party: getpartymember getarg(0), 1; getpartymember getarg(0), 2; for (.@i = 0; .@i < $@partymembercount; ++.@i) { if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) { bg_join getarg(4), "guild_vs3", getarg(2), getarg(3), $@partymembercid[.@i]; set getarg(1), getarg(1) +1; } } return; L_start: .start = true; announce "Party Vs Party : ["+ getpartyname(.partyA) +"] VS ["+ getpartyname(.partyB) +"]", bc_all; .partyAid = bg_create( "guild_vs3", 13,50, strnpcinfo(0)+"::OnpartyAQuit", strnpcinfo(0)+"::OnpartyADead" ); .partyBid = bg_create( "guild_vs3", 86,50, strnpcinfo(0)+"::OnpartyBQuit", strnpcinfo(0)+"::OnpartyBDead" ); callsub L_register_bg_party, .partyA, .partyAscore, 13,50, .partyAid; callsub L_register_bg_party, .partyB, .partyBscore, 86,50, .partyBid; bg_updatescore "guild_vs3", .partyAscore, .partyBscore; setwall "guild_vs3", 19,55, 12, DIR_SOUTH, false, "partyvspartyA"; setwall "guild_vs3", 80,55, 12, DIR_SOUTH, false, "partyvspartyB"; sleep 3000; for (.@i = 5; .@i > 0; --.@i) { mapannounce "guild_vs3", "["+ .@i +"]", bc_map; if (!.skip) sleep 1000; } mapannounce "guild_vs3", "Start!", bc_map; delwall "partyvspartyA"; delwall "partyvspartyB"; if (!.skip) sleep .eventlasting * 1000; if ( .partyAscore > .partyBscore ) { mapannounce "guild_vs3", "Party ["+ getpartyname(.partyA) +"] is victorious!", bc_map; callsub L_Reward, .partyAid; } else if ( .partyBscore > .partyAscore ) { mapannounce "guild_vs3", "Party ["+ getpartyname(.partyB) +"] is victorious!", bc_map; callsub L_Reward, .partyBid; } else mapannounce "guild_vs3", "- The match has ended in a draw! -", bc_map; bg_warp .partyAid, "prontera",152,178; bg_warp .partyBid, "prontera",154,178; bg_destroy .partyAid; bg_destroy .partyBid; .start = .skip = false; .partyAscore = .partyBscore = 0; end; L_Reward: bg_get_data getarg(0), 1; for ( .@i = 0; .@i < $@arenamemberscount; ++.@i ) getitem 512, 1, $@arenamembers[.@i]; return; OnpartyADead: callsub L_Dead, .partyAscore; OnpartyBDead: callsub L_Dead, .partyBscore; L_Dead: set getarg(0), getarg(0) -1; bg_updatescore "guild_vs3", .partyAscore, .partyBscore; bg_leave; if (!getarg(0)) { .skip = true; awake strnpcinfo(0); } end; OnpartyAQuit: callsub L_Quit, .partyAscore; OnpartyBQuit: callsub L_Quit, .partyBscore; L_Quit: set getarg(0), getarg(0) -1; bg_updatescore "guild_vs3", .partyAscore, .partyBscore; percentheal 100, 100; if (!getarg(0)) { .skip = true; awake strnpcinfo(0); } end; }
  17. Then i assume there is a function that gives you the unique id of a connected user, that you can use.
  18. It takes a number from 0 to 2 and depending on which number you give it, it returns one of the described values.
  19. - script STREAMER_SUPPLY FAKE_NPC,{ OnInit: bindatcmd("registerStreamer", strnpcinfo(3) + "::OnRegisterStreamer", 99); bindatcmd("unregisterStreamer", strnpcinfo(3) + "::OnUnregisterStreamer", 99); .reward_item_id = 502; .reward_item_amount = 2; end; OnRegisterStreamer: OnUnregisterStreamer: if(.@atcmd_numparameters < 1) dispbottom("Usage: " + .@atcmd_command$ + " <charname>"); .@switch = (.@atcmd_command$ == "@registerStreamer") ? 1 : 0; charcommand("#set " + .@atcmd_parameters$[0] + " #STREAMER " + .@switch); end; // Every night at 00 OnHour00: // Get all streamers query_sql("SELECT account_id FROM acc_reg_num WHERE `key` = \"#STREAMER\" AND value = 1;", .@streamer_acc_ids); for(.@i = 0; .@i < getarraysize(.@streamer_acc_ids); .@i) { // If the streamer is online hand out a reward. if(attachrid(.@streamer_acc_ids[.@i])) { getitem(.reward_item_id, .reward_item_amount); detachrid; } } } prontera,124,201,1 script Streamer Supplies 726,{ mes "[ Streamer Supplies ]"; mes "You are " + ((#STREAMER == 0) ? "no" : "an") + " Streamer!"; close; }
  20. You need an additional modification in your client to send some unique identifier based on the players pc to the server, that you can at least identify a unique pc to prevent most of the abuse via the usage of multiple accounts. You will also need the server to be able to handle the send unique id and to have it hand it over to your script so that it can make use of it. But even then it will be possible to abuse the it by the usage of virtual machines for example. There isn't any fool proof method to make sure, a player can't somehow abuse free giveaway items.
  21. You get those errors on your screenshot because the OnInit label in the PBE#disable NPC gets called before the walls it tries to delete have been created.
  22. You need to alter the char table and add the pvpreward colum. The sql is even inside the script you posted. ALTER TABLE `char` ADD `pvpreward` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `fame`;
  23. // Change setarray(.crafting_recipe_p1_t2_products, 40101, 1,40102, 1,40103, 1,40104, 1,40105, 1); // to setarray(.crafting_recipe_p1_t2_products, 40101, 40102, 40103, 40104, 40105); setarray(.crafting_recipe_p1_t2_amounts, 1, 1, 1, 1, 1); // To handout 1 random item you do it like this: .@item_index = rand(getarraysize(.crafting_recipe_p1_t2_products)); getitem(.crafting_recipe_p1_t2_products[.@item_index], .crafting_recipe_p1_t2_amounts[.@item_ind//sex]); // To handout all items you do it like this: for(.@i = 0; .@i < getarraysize(.crafting_recipe_p1_t2_products); .@i++) { getitem(.crafting_recipe_p1_t2_products[.@i], .crafting_recipe_p1_t2_amounts[.@i]); }
  24. I assume what you are searching for is called "Customize Rodex tax" in the WARP Patcher.
×
×
  • Create New...