Jump to content

Winterfox

Members
  • Posts

    245
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by Winterfox

  1. It would be helpful if you would explain exactly what is not working and how you expect it to.
  2. 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;
  3. According to the error messages, the problem doesn't seem to be related to your function. It rather seems like it is a problem how it is called. You also could use item groups instead of writing your own script: https://github.com/rathena/rathena/blob/master/doc/item_group.txt
  4. You can achieve that by using the achievement system: https://github.com/rathena/rathena/blob/master/doc/achievements.md
  5. If you want to log vending for every npc shop, not for a specific one, this is a case for the source modification section. I see, well that is also a case for the source mod section.
  6. I tested the script and could not reproduce the error.
  7. - 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
  8. - 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[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
  9. - script Workbench FAKE_NPC,{ .@wrkb_id = 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($product); .@i += 2) getitem($product[.@i], $product[.@i + 1]); delwaitingroom; $wrkb_crafting_state[.@wrkb_id] = 0; close; } mes "=============================="; mes "^ff0000 Any crafted item using public Workbech can be stolen by other player !! ^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 To craft Stone Dagger ^000000"; mes "Require:-"; mes "- [4] Rocks"; close; } delitem(40005, 4); setarray($product, 40007, 1, 40009, 1); goto OnCraftingStart; case 2: if(countitem(40018) < 1 || countitem(40014) < 2 || countitem(40003) < 1 ) { mes "^ff0000 To craft Stone Axe ^000000"; mes "Require:-"; mes "- [1] Rock Chunk"; mes "- [2] Ropes"; mes "- [1] Branch"; close; } delitem(40018, 1); delitem(40014, 2); delitem(40003, 1); setarray($product, 40007, 1, 40017, 1); goto OnCraftingStart; case 3: if(countitem(40008) < 4) { mes "^ff0000 To craft Ropes ^000000"; mes "Require:-"; mes "- [4] Stalk"; close; } delitem(40008, 4); setarray($product, 40007, 1, 40014, 1); goto OnCraftingStart; case 4: if(countitem(40005) < 4) { mes "^ff0000 To craft Rock Chunk ^000000"; mes "Require:-"; mes "- [4] Rock"; close; } delitem(40005, 4); setarray($product, 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[strnpcinfo(2)] = 2; delwaitingroom; waitingroom("COMPLETED!", 0); end; OnInit: if($wrkb_crafting_state[strnpcinfo(2)] == 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
  10. 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"); }
  11. if(!isequipped(40016)) { Doesn't work because the ! negates the result of isequipped. Which means if something is equipped which results in true the ! turns it into false and vice versa. So to fix your problem, you just need to remove the !. if(isequipped(40016)) {
  12. 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; }
  13. 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]); $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; }
  14. 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]); $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; }
  15. The script uses a npc timer, that calls labels based on their time suffix. In the case of this script, the label is OnTimer60000 the 60000 means 60 seconds, since the time is given in milliseconds so 1 second = 1000 milliseconds.
  16. Another suggestion I have would be to improve readability by using continue, to jump to the next iteration of the loop to minimize nesting. for(.@i = 0; .@i < $@partymembercount; .@i++) { if(!isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) continue; .@partyMemberOnline++; if(getcharid(2, $@partymembername$[.@i]) != getarg(0)) { dispbottom $@partymembername$[.@i] + " is not a member of your guild."; .@partyMemberNotInGuild++; } }
  17. if(getcharid(2,$@partymembername$[.@i] != getarg(0))) { Has to be: if(getcharid(2,$@partymembername$[.@i]) != getarg(0)) {
  18. 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); }
  19. - 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); }
  20. 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.
  21. You need to declare the function mvp_maps before using it. function Go; function Disp; function Pick; function Restrict; function mvp_maps;
  22. Why don't you use barter shops to get rid of the verbosity regarding the item price?
  23. You could try to achieve this effect using autobonus by setting a short amount for the duration the script will last. *autobonus <bonus script>,<rate>,<duration>{,<flag>,{<other script>}}; *autobonus2 <bonus script>,<rate>,<duration>{,<flag>,{<other script>}}; *autobonus3 <bonus script>,<rate>,<duration>,<skill id>,{<other script>}; *autobonus3 <bonus script>,<rate>,<duration>,"<skill name>",{<other script>}; These commands are meant to be used in item scripts only! See 'petautobonus' for pet usage. What these commands do is 'attach' a script to the player which will get executed on attack (or when attacked in the case of autobonus2). Rate is the trigger rate of the script (1000 = 100%). Duration is the time in milliseconds that the bonus will last for since the script has triggered. Skill ID/skill name the skill which will be used as trigger to start the bonus. (autobonus3) The optional argument 'flag' is used to classify the type of attack where the script can trigger (it shares the same flags as the bAutoSpell bonus script): Range criteria: BF_SHORT: Trigger on melee attack BF_LONG: Trigger on ranged attack Default: BF_SHORT+BF_LONG Attack type criteria: BF_WEAPON: Trigger on weapon skills BF_MAGIC: Trigger on magic skills BF_MISC: Trigger on misc skills Default: BF_WEAPON Skill criteria: BF_NORMAL: Trigger on normal attacks BF_SKILL: Trigger on skills default: If the attack type is BF_WEAPON (only) BF_NORMAL is used, otherwise BF_SKILL+BF_NORMAL is used. The difference between the optional argument 'other script' and the 'bonus script' is that, the former one triggers only when attacking(or attacked) and the latter one runs on status calculation as well, which makes sure, within the duration, the "bonus" that get lost on status calculation is restored. So, 'bonus script' is technically supposed to accept "bonus" command only. And we usually use 'other script' to show visual effects. In all cases, when the script triggers, the attached player will be the one who holds the bonus. There is currently no way of knowing within this script who was the other character (the attacker in autobonus2, or the target in autobonus and autobonus3). //Grants a 1% chance of starting the state "all stats +10" for 10 seconds when //using weapon or misc attacks (both melee and ranged skills) and shows a special //effect when the bonus is active. autobonus "{ bonus bAllStats,10; }",10,10000,BF_WEAPON|BF_MISC,"{ specialeffect2 EF_FIRESPLASHHIT; }";
  24. You need to end the script after each label, so it doesn't fall through and executes the code of the next. OnBarDead1: setcell "grandarena",45,53,45,46,cell_walkable,1; end; OnBarDead2: setcell "grandarena",53,54,46,54,cell_walkable,1; end; ...
×
×
  • Create New...