Jump to content

Winterfox

Members
  • Posts

    234
  • Joined

  • Last visited

  • Days Won

    18

Community Answers

  1. Winterfox's post in CUSTOMIZED LEVELING ROOM was marked as the answer   
    I see. I went with the first solution I came up with from the top of my head. But it isn't that hard to do it the way you are showing either.
    You simply can use an invisible npc with an OnTouchNPC label that teleports the mob back into the desired area.
    - script EXAMPLE_SPAWN -1,{ OnInit: areamonster("prontera", 151, 149, 155, 143, "", "poring", 2); } - script MOB_BOUNDARY_CELL -1,{ OnTouchNPC: unitwarp(getattachedrid(), "this", 153, 147); } prontera,150,150,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#01 -1,0,0 prontera,151,150,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#02 -1,0,0 prontera,152,150,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#03 -1,0,0 prontera,153,150,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#04 -1,0,0 prontera,154,150,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#05 -1,0,0 prontera,155,150,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#06 -1,0,0 prontera,156,150,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#07 -1,0,0 prontera,150,149,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#08 -1,0,0 prontera,150,148,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#09 -1,0,0 prontera,150,147,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#10 -1,0,0 prontera,150,146,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#11 -1,0,0 prontera,150,145,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#12 -1,0,0 prontera,150,144,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#13 -1,0,0 prontera,150,144,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#14 -1,0,0 prontera,151,144,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#15 -1,0,0 prontera,152,144,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#16 -1,0,0 prontera,153,144,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#17 -1,0,0 prontera,154,144,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#18 -1,0,0 prontera,155,144,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#19 -1,0,0 prontera,156,144,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#20 -1,0,0 prontera,156,149,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#21 -1,0,0 prontera,156,148,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#22 -1,0,0 prontera,156,147,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#23 -1,0,0 prontera,156,146,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#24 -1,0,0 prontera,156,145,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#25 -1,0,0 prontera,156,144,0 duplicate(MOB_BOUNDARY_CELL) MOB_BOUNDARY_CELL#26 -1,0,0  
  2. Winterfox's post in H>Universal Rental was marked as the answer   
    //===== eAthena Script ======================================= //= Breeder //===== By: ================================================== //= Ace //===== Current Version: ===================================== //= 1.2 //===== Compatible With: ===================================== //= rAthena SVN 15400 and up. //= Client that supports new mounts. //===== Description: ========================================= //= Known as "Universal Rental NPC" //= Let's a player rent a pecopeco, falcon, cart, warg //= or ride a dragon, gryphon, and mado. //===== Changelog: =========================================== //= 1.1 Added Peco peco option, forgot to. //= Changed KN_RIDING to RK_DRAGONTRAINING //= for renting dragons. //= 1.2 Added restrictions for renting falcons and wargs. //= Added Warg Mastery skill requirement. //===== Additional Comments: ================================= //= No bugs found so far. //= Please report bugs to me([email protected]) //============================================================ - script gbreeder 726,{ mes "^FF0000Universal Rental NPC^000000"; mes "Greetings " + strcharinfo(0) + "!"; mes "I provide you with the service to "; mes "rent a cart or animal companion."; mes "The price for this service is " + .service_fee + "z."; mes "How may I help you today?"; next; if(select("Rental Services:Cancel") == 2) { mes "^FF0000Universal Rental NPC^000000"; mes "Alright, come again!"; close; } if(.service_fee > Zeny) { mes "^FF0000Universal Rental NPC^000000"; mes "Sadly you don't have enoug money."; mes "Please come back when you have it."; close; } mes "^FF0000Universal Rental NPC^000000"; mes "Please select from the items below:"; switch(select("PecoPeco:Cart:Falcon")) { case 1: // Pecopeco if(checkriding() || getskilllv("KN_RIDING")) { mes "Sorry, please make sure that you have the required job and skill, also not riding one."; close; } setriding(); mes "There you go, enjoy your Peco Peco!"; close; case 2: // Cart if(checkcart() || getskilllv("MC_PUSHCART")) { mes "Sorry, please make sure that you have the required job and skill, also not having a cart."; close; } setcart(); mes "There you go, enjoy your cart!"; close; case 3: // Falcon if(BaseClass != Job_Archer || checkfalcon() && getskilllv("HT_FALCON")) { mes "Sorry, please make sure that you have the required job and skill, also not having a falcon."; close; } if((Class == Job_Ranger || Class == Job_Ranger_T) && checkriding()) { mes "Sorry, You can't rent a falcon while having a warg with you."; close; } setfalcon(); mes "There you go, have fun with your falcon!"; close; } OnTimer0050: showscript("Universal Rental", getnpcid(0)); initnpctimer(); end; OnInit: .service_fee = 500; initnpctimer(); end; } //===== Duplicates: ========================================== //payon,140,222,5 duplicate(gbreeder) Universal Rental NPC#1 726 payon,151,167,5 duplicate(gbreeder) Universal Rental NPC#1 726 //============================================================ eclage,116,37,5 duplicate(gbreeder) Universal Rental NPC#100 726 bg_lobby,60,42,4 duplicate(gbreeder) Universal Rental NPC#1123 726  
  3. Winterfox's post in H>Hateffect infinite loop was marked as the answer   
    *freeloop({<toggle>}) Toggling this to enabled (1) allows the script instance to bypass the infinite loop protection, allowing your script to loop as much as it may need. Disabling (0) will warn you if an infinite loop is detected. The command will return the state of freeloop for the attached script, even if no argument is provided. Example: freeloop(1); // enable script to loop freely // be careful with what you do here for ( .@i = 0; .@i < .@bigloop; .@i++ ) { dothis; // will sleep the script for 1ms when detect an infinity loop to // let rAthena do what it needs to do (socket, timer, process, etc.) } freeloop(0); // disable freeloop for ( .@i = 0; .@i < .@bigloop; .@i++ ) { dothis; // throw an infinity loop error }  
  4. Winterfox's post in npc equip item was marked as the answer   
    You should look in the script documentation to solve such problems yourself first. You can find it here: https://github.com/rathena/rathena/blob/master/doc/script_commands.txt
    There you can find the following:
    *equip <item id>{,<char_id>}; *autoequip <item id>,<option>; These commands are to equip a equipment on the attached character. The equip function will equip the item ID given when the player has this item in his/her inventory, while the autoequip function will equip the given item ID when this is looted. The option parameter of the autoequip is 1 or 0, 1 to turn it on, and 0 to turn it off. Examples: //This will equip a 1104 (falchion) on the character if this is in the inventory. equip 1104; //The invoked character will now automatically equip a falchion when it's looted. autoequip 1104,1; //The invoked character will no longer automatically equip a falchion. autoequip 1104,0;  
  5. Winterfox's post in [SOLVED] M>Healer NPC was marked as the answer   
    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;  
  6. Winterfox's post in custom command # was marked as the answer   
    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>};  
  7. Winterfox's post in add a simple global message was marked as the answer   
    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; }  
  8. Winterfox's post in PVP_Reward NPC im getting SQL DB error was marked as the answer   
    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`;  
  9. Winterfox's post in error adding custom command for specific group was marked as the answer   
    You should check out the script documentation. There you can see that bindatcmd takes the minimum group level that is allowed to run the atcommand as the third parameter.
    *bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; This command will bind a NPC event label to an atcommand. Upon execution of the atcommand, the user will invoke the NPC event label. Each atcommand is only allowed one binding. If you rebind, it will override the original binding. Note: The default level for atcommand is 0 while the default level for charcommand is 100.  
  10. Winterfox's post in Remove Mail Tax was marked as the answer   
    I assume what you are searching for is called "Customize Rodex tax" in the WARP Patcher.

  11. Winterfox's post in Random item drop on specific map was marked as the answer   
    For your script: The OnNPCKillEvent only gets executed when the killed mob doesn't have an attached label. 
    For your YAML: You can't use tabs for indentation in YAML files, you also forgot to place a space between - and Index and between each parameter and its value.

    Here is an example of the YAML:
    Header: Type: MAP_DROP_DB Version: 2 Body: - Map: lhz_dun_n Globaldrops: - Index: 0 Item: Bio_Reseearch_Docu Rate: 2 - Index: 1 Item: Bio_Test_Fragment Rate: 2  
  12. Winterfox's post in how to use ground skill from mob A to mob B (1 time per cells) was marked as the answer   
    - script SKILL_DEMO FAKE_NPC,{ OnInit: monster("prontera", 150, 170, "Helper A", 1002, 1); .@mob_a = $@mobid[0]; unitblockmove(.@mob_a, 1); getunitdata(.@mob_a, .@mob_a_data); .@pos_x = .@mob_a_data[UMOB_X]; .@pos_y = .@mob_a_data[UMOB_Y]; monster("prontera", 140, 160, "Helper B", 1002, 1); .@mob_b = $@mobid[0]; while(.@pos_x != .@target_x || .@pos_y != .@target_y) { getunitdata(.@mob_b, .@mob_b_data); .@target_x = .@mob_b_data[UMOB_X]; .@target_y = .@mob_b_data[UMOB_Y]; if(.@pos_x != .@target_x) .@pos_x += (.@pos_x < .@target_x) ? 1 : -1; if(.@pos_y != .@target_y) .@pos_y += (.@pos_y < .@target_y) ? 1 : -1; unitskillusepos(.@mob_a, "MG_THUNDERSTORM", 10, .@pos_x, .@pos_y, -5, false, 0, true); sleep(1000); } }  
  13. Winterfox's post in Making each duplicate individual npc was marked as the answer   
    - script Workbench FAKE_NPC,{ .@wrkb_id = atoi(strnpcinfo(2)); if($wrkb_crafting_state[.@wrkb_id] == 1) { mes "Please wait until the crafting process is finished. "; close; } if($wrkb_crafting_state[.@wrkb_id] == 2) { mes "Here are your crafted items."; for(.@i = 0; .@i < getarraysize(getd("$wrkb_" + .@wrkb_id + "_products")); .@i += 2) getitem(getd("$wrkb_" + .@wrkb_id + "_products[" + .@i + "]"), getd("$wrkb_" + .@wrkb_id + "_products[" + (.@i + 1) + "]")); delwaitingroom; $wrkb_crafting_state[.@wrkb_id] = 0; close; } mes "=============================="; mes "^ff0000 Any item crafted by using the public Workbench can be stolen by other players !! ^000000"; mes "=============================="; next; mes "What do you want to craft?"; next; switch(select("Stone Dagger:Stone Axe:Ropes:Stone Chunk:Cancel")) { case 1: if(countitem(40005) < 4) { mes "^ff0000 Stone Dagger ^000000"; mes "Requires:-"; mes "- [4] Rocks"; close; } delitem(40005, 4); setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40007, 1, 40009, 1); goto OnCraftingStart; case 2: if(countitem(40018) < 1 || countitem(40014) < 2 || countitem(40003) < 1 ) { mes "^ff0000 Stone Axe ^000000"; mes "Requires:-"; mes "- [1] Rock Chunk"; mes "- [2] Ropes"; mes "- [1] Branch"; close; } delitem(40018, 1); delitem(40014, 2); delitem(40003, 1); setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40007, 1, 40017, 1); goto OnCraftingStart; case 3: if(countitem(40008) < 4) { mes "^ff0000 Ropes ^000000"; mes "Require:-"; mes "- [4] Stalk"; close; } delitem(40008, 4); setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40007, 1, 40014, 1); goto OnCraftingStart; case 4: if(countitem(40005) < 4) { mes "^ff0000 Rock Chunk ^000000"; mes "Requires:-"; mes "- [4] Rock"; close; } delitem(40005, 4); setarray(getd("$wrkb_" + .@wrkb_id + "_products"), 40007, 1, 40018, 1); goto OnCraftingStart; case 5: mes "Crafting canceled."; close; } end; OnCraftingStart: $wrkb_crafting_state[.@wrkb_id] = 1; waitingroom("CRAFTING...", 0); initnpctimer; end; OnTimer60000: $wrkb_crafting_state[atoi(strnpcinfo(2))] = 2; delwaitingroom; waitingroom("COMPLETED!", 0); end; OnInit: .@wrkb_id = atoi(strnpcinfo(2)); if(.@wrkb_id < 1) end; if($wrkb_crafting_state[.@wrkb_id] == 1) goto OnCraftingStart; } //Duplicate //===================================================== new_1-3,98,58,6 duplicate(Workbench) Workbench#1 665 new_1-3,98,50,6 duplicate(Workbench) Workbench#2 665 new_1-3,98,43,6 duplicate(Workbench) Workbench#3 665 //new_1-3,113,45,6 duplicate(Workbench) Workbench#4 665 //new_1-3,114,39,6 duplicate(Workbench) Workbench#5 665 //new_1-3,110,36,6 duplicate(Workbench) Workbench#6 665 //new_1-3,114,33,6 duplicate(Workbench) Workbench#7 665  
  14. Winterfox's post in NPC Script Not Detecting Equipped Item was marked as the answer   
    new_1-3,105,59,6 script Benimaru 483,{ switch(BeginnerQuest) { case 0: cutin "3rd_sura_master.bmp",2; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Welcome to Durengo Online"; mes "my name is ^ff9300 Benimaru ^000000."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Ok. let's get to the basics,"; mes "of Durengo Online."; mes "This is no place for"; mes "a new survivor like you."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "That is why i am here,"; mes "to help you."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "There is still a lot of work to do, "; mes "but lets begin with the basic stuff,"; mes "now then, are you ready?"; next; if(select("- Yes, please help me!:- I need a minute..") == 2) { mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Come back when your ready"; close3; } mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Great, now in this world, you will have"; mes "to gather materials for your tools and"; mes "craft your own equipment."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Unless you are skilled blacksmith,"; mes "you may only craft a limited number of equipments."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Also, monsters will not"; mes "drop any equipment, and npcs do not"; mes "sell any equipment as well.."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "We shall start with ^c90076 [ Stone Dagger ] ^000000."; mes "A Stone Dagger is a gathering tool."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "It allows you to gather ^c90076 [ Stalk ] ^000000, ^c90076 [ Meat ] ^000000"; mes "and ^c90076 [ Bone ] ^000000, which later can be used to craft"; mes "better gear and tools."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Let's craft ^c90076 [ Stone Dagger ] ^000000"; mes "now. If you look around there should be"; mes "^2986cc A Pile Of Rocks ^000000."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Gather ^c90076 4 x [ Rocks ] ^000000"; mes "and come back to me when you have them."; BeginnerQuest = 1; close3; case 1: cutin "3rd_sura_master.bmp",2; if(countitem(40005) < 4 ) { mes "=== ^ff9300 Benimaru ^000000 ==="; mes "I did say you need ^c90076 4 x [ Rocks ] ^000000."; mes "Look around there should be"; mes "a ^2986cc Pile Of Rocks ^000000 nearby."; close3; } mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Good, now if you take a look, next"; mes "to me should be a workbench."; mes "You can start working on crafting"; mes "your own ^c90076 [ Stone Dagger ] ^000000 there."; BeginnerQuest = 2; close3; case 2: cutin "3rd_sura_master.bmp",2; if(!isequipped(40001)) { mes "=== ^ff9300 Benimaru ^000000 ==="; mes "If you do have a ^c90076 [ Stone Dagger ] ^000000"; mes "equip it."; mes "If you don't, go craft one."; x next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Remember you need the following to craft one:"; mes "^c90076 4 x [ Rocks ] ^000000"; close3; } mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Great now you have your first"; mes "^c90076 [ Stone Dagger ] ^000000."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Now i will teach you how to craft"; mes "a ^c90076 [ Stone Axe ] ^000000."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "With a ^c90076 [ Stone Axe ] ^000000 you can gather logs"; mes "and some other stuff."; mes "To make one we need ^c90076 8 x [ Stalk ] ^000000"; mes "^c90076 1 x [ Rock Chunk ] ^000000 and a ^c90076 [ Branch ] ^000000"; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Out of the ^c90076 8 x [ Stalk ] ^000000 you can make ^c90076 2 x [ Ropes ] ^000000."; mes "You can gather ^c90076 [ Stalk ] ^000000 from ^2986cc Tall Grass ^000000."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "To make a ^c90076 [ Rock Chunk ] ^000000 you need"; mes "^c90076 4 x [ Rocks ] ^000000, i assume you know where to find the ^c90076 [ Rocks ] ^000000?"; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "The last item is a ^c90076 [ Branch ] ^000000, you can get from a ^2986cc Tree ^000000."; mes "It is as simple as that."; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Remember you need the following to craft a ^c90076 [ Stone Axe ] ^000000:"; mes "^c90076 8 x [ Stalk ] ^000000 = ^c90076 2 x [ Ropes ] ^000000 (workbench)"; mes "^c90076 1 x [ Rock Chunk ] ^000000 = ^c90076 4 x [ Rock ] ^000000 (workbench)"; mes "^c90076 1 x [ Branch] ^000000"; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Come back to me when you have crafted one."; BeginnerQuest = 3; close3; case 3: cutin "3rd_sura_master.bmp",2; if(!isequipped(40016)) { mes "=== ^ff9300 Benimaru ^000000 ==="; mes "If you do have the Stone Axe"; mes "equip it."; mes "==================="; mes "if you dont have it, go craft one"; next; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Remember you need the following to craft one:"; mes "^c90076 8 x [ Stalk ] ^000000 = ^c90076 2 x [ Ropes ] ^000000 (workbench)"; mes "^c90076 1 x [ Rock Chunk ] ^000000 = ^c90076 4 x [ Rock ] ^000000 (workbench)"; mes "^c90076 1 x [ Branch] ^000000"; close3; } mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Great work !"; next; mes "...."; BeginnerQuest = 4; close3; case 4: cutin "3rd_sura_master.bmp",2; mes "=== ^ff9300 Benimaru ^000000 ==="; mes "Still needs to be implemented.." close3; } end; OnInit: setunitdata(getnpcid(0), UNPC_GROUP_ID, 2); setunittitle(getnpcid(0), "Newbies Trainer"); }  
  15. Winterfox's post in Error with = set_label : dup label was marked as the answer   
    new_1-3,118,54,5 script Workbench 665,{ if($wrkb_crafting_state == 1) { mes "[" + .npc_name + "]"; mes "Please wait until the crafting process is finished. "; close; } if($wrkb_crafting_state == 2) { mes "[" + .npc_name + "]"; mes "Here are your products."; for(.@i = 0; .@i < getarraysize($product); .@i += 2) getitem($product[.@i], $product[.@i + 1]); delwaitingroom; $wrkb_crafting_state = 0; close; } mes "[" + .npc_name + "]"; mes "What do you want to craft?"; next; switch(select("Stone Dagger:Ropes:Cancel")) { case 1: if(countitem(40005) < 4) { mes "[" + .npc_name + "]"; mes "^ff0000 You do not have enough rocks ^000000"; close; } delitem(40005, 4); setarray($product, 40007, 1, 40009, 1); goto OnCraftingStart; case 2: if(countitem(40008) < 8) { mes "[" + .npc_name + "]"; mes "^ff0000 You do not have enough stalk ^000000"; close; } delitem(40008, 8); setarray($product, 40007, 1, 40014, 1); goto OnCraftingStart; case 3: mes "[" + .npc_name + "]"; mes "Crafting canceled."; close; } end; OnCraftingStart: $wrkb_crafting_state = 1; waitingroom("CRAFTING...", 0); initnpctimer; end; OnTimer60000: $wrkb_crafting_state = 2; delwaitingroom; waitingroom("COMPLETED!", 0); end; OnInit: .npc_name = strnpcinfo(1); if($wrkb_crafting_state == 1) goto OnCraftingStart; }  
  16. Winterfox's post in Request Notification NPC was marked as the answer   
    prontera,155,177,5 script Request Notification NPC 100,{ if($rn_crafting_state == 1) end; if($rn_crafting_state == 2) { mes .npc_name$; mes "Here is the crafting result."; getitem(.crafted_item[0], .crafted_item[1]); $rn_crafting_state = 0; delwaitingroom; close; } for(.@i = 0; .@i < getarraysize(.required_items); .@i += 2) { if(countitem(.required_items[.@i]) < .required_items[.@i + 1]) { mes .npc_name$; mes "You are missing " + .required_items[.@i + 1] + " x " + getitemname(.required_items[.@i]) + "."; close; } } for(.@i = 0; .@i < getarraysize(.required_items); .@i += 2) delitem(.required_items[.@i], .required_items[.@i + 1]); $rn_crafting_state = 1; waitingroom("CRAFTING", 0); initnpctimer; end; OnTimer60000: delwaitingroom; waitingroom("CRAFTING COMPLETED", 0); $rn_crafting_state = 2; end; OnInit: .npc_name$ = strnpcinfo(1); setarray(.required_items, 501, 1, 502, 1, 503, 1); setarray(.crafted_item, 504, 1); }  
  17. Winterfox's post in Help for Guild Party and Online members checking was marked as the answer   
    if(getcharid(2,$@partymembername$[.@i] != getarg(0))) { Has to be:
    if(getcharid(2,$@partymembername$[.@i]) != getarg(0)) {  
  18. Winterfox's post in Item Drop When Carry An Item was marked as the answer   
    - script MOB_DROP FAKE_NPC,{ OnNPCKillEvent: if(countitem(.required_item) < 1) end; for(.@i = 0; .@i < getarraysize(.item_drops); .@i += 2) getitem(.item_drops[.@i], .item_drops[.@i + 1]); end; OnInit: .required_item = 13038; setarray(.item_drops, 517, 1, 932, 1); }  
  19. Winterfox's post in How To find Chief Officer On Prontera City was marked as the answer   
    Use a text editor that allows to search all files in a directory for a specific text snippet and search for Chief Officer.
    If you did that, you would find that the NPC is defined in npc/quests/quests_nameless.txt on line 6474.
  20. Winterfox's post in Buy And Sell in NPC was marked as the answer   
    If you have logging enabled, you can check the picklog table for rows where type is S.
    // 0x00000010 - (S) Log NPC transactions (buy/sell) For details, check log_athena.conf. The logging part is directly at the beginning of the file.
  21. Winterfox's post in [solved] marketshop quantity was marked as the answer   
    If you want to update the stock programmatically, for example on a certain event, you can use npcshopupdate.
    *npcshopupdate "<name>",<item_id>,<price>{,<stock>} Update an entry from a shop. If the price is 0 it won't be changed. May also be used for marketshop to update the stock quantity. For unlimited stock, use -1. For other shop types, the stock value has no effect. Which means to reset the stock of item 1010 in the market_refine_prt_in shop, you would do it like this:
    npcshopupdate("market_refine_prt_in", 1010, 0, 999999); If you want to simply change the stock for testing purposes, you could edit the shop in the market table in the database.

    In your NPCs case, if you check line 588 in the file npc/merchants/refine.txt, you will see the NPC refine_barter_init.
    Which uses above-mentioned npcshopupdate to update the stocks of the NPCs in your post when the script gets loaded.

    So if you only care about resetting the stock of those, reloading only the script where the shops are defined should suffice.
    You can use this command to do this:
    @reloadnpcfile npc/merchants/refine.txt  
  22. Winterfox's post in Item Addition was marked as the answer   
    https://www.divine-pride.net/database/item/18935/there-is-something-1
  23. Winterfox's post in [solved] Simple Fishing rand was marked as the answer   
    Your pick code throws 4 dice with 10 eyes and checks if at least one fits, and then picks an item randomly.
    Which means your script decides if it should give loot or not (Which contradicts your 4. Rule) but in case it drops an item, it gives every item an equal chance to be dropped.

    Except Yggrasil Berry, which gets a 1% chance to be dropped regardless of if there was already a drop, which also contradicts your 4. Rule.
    Here is what I would do to change your script to make it fit your given rules:
     
    prt_fild00,278,237,0 script Fishing School 10065,{ if (!isequipped(.rod)) { dispbottom("[Fishing] You need a Fishing Rod."); end; } specialeffect(EF_BUBBLE, "Fishing School"); soundeffect("_attack_axe.wav", 0); dispbottom("[Fishing] Casting..."); progressbar("ffffff", .cast_delay); .@pick = rand(1, .catch_weight_sum); for(.@i = 0; .@i < getarraysize(.catches); .@i += 2) { .@pick -= .catches[.@i + 1]; if(.@pick <= 0) { .@catch = .catches[.@i]; break; } } getitem(.@catch, 1); specialeffect2(610); soundeffectall("see_otter_damage.wav", 0, strcharinfo(3)); dispbottom("[Fishing] You got "+ getitemname(.@catch) + "."); end; OnInit: .rod = 2764; .cast_delay = 5; // Red Herb 40%; Yellow Herb 30%; White Herb 20%, Blue Herb 10%, Yggdrasil Berry 0.01% setarray(.catches, 507, 4000, 508, 3000, 509, 2000, 510, 1000, 607, 1); for(.@i = 0; .@i < getarraysize(.catches); .@i += 2) .catch_weight_sum = .catches[.@i + 1]; }  
  24. Winterfox's post in [solved] autospell mammonite should not casted while 0 zeny was marked as the answer   
    This won't work as expected. The script is only run on onequip. So, the code you provide leads to the bonus3 only to be applied when the player has 500 zeny or more at the time he equips the item, but it doesn't check it on every autospell trigger.

    That means if mammonite consumes the last 500 zeny the following casts will still be done, since the check doesn't happen at the time of the casting.

    The solution would be either to instead of just providing a skill name, you could provide a script on each trigger like autobonus works or a parameter to tell the function it should check skill requirements before casting it.
    But those are things that need a source change.

    What could work but is kinda messy would be this:
    autobonus2("{ if(zeny >=500) bonus3(bAutoSpellWhenHit,\"MC_MAMMONITE\",5,5); }", 1000, 1000); I didn't test it but what it should do in theory is to check on each hit if the player has at least 500 zeny and if he does, apply the bonus for 1 second to check if it should trigger mammonite according to its chance.
    But this is very speculative. It could easily be that the bonus3 doesn't work on the attack that triggered the attachment via autobonus, but instead only on the successive attacks because of the way the state flow is organized.
  25. Winterfox's post in Barter Shop (increase item req limit from 5 to 10?) was marked as the answer   
    The errormessage already tells you what is wrong. The Barters don't support more than 5 items.

    I am not sure why the limit is hard-coded to five, if it is because the original behavior is like this or because the client doesn't support more than five.

    What you could try though is to raise the limit and recompile rathena. You can find the definition of the limit in the mmo.hpp on line 117.
     
    #define MAX_BARTER_REQUIREMENTS 5  
×
×
  • Create New...