-
Posts
248 -
Joined
-
Last visited
-
Days Won
19
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Winterfox
-
[Error]: script:op_2: invalid data for operator C_EQ
Winterfox replied to eloscar23's question in Scripting Support
I didn't test it, but I would do write the kind of script you want to do like this: prontera,146,161,5 script CheckRank 118,{ mes .npc_name; mes "Hello, this is a MvP Ranker"; mes "Would you like to know the MvP Ranking?"; next; if(select("Top 20:Leave") == 2) { mes.npcranker; mes "Bye"; close; } mes.npc_name; for(.@i = 0; .@i < 20; .@i++) mes "The Top " + (.@i + 1) + " MVP: " + $top_mvp_names$[.@i] + " Killed: " + $top_mvp_kills$[.@i] + "."; close; OnInit: .npc_name = "[MvP Ranker]"; } - script MVP_RANKER FAKE_NPC,{ OnNPCKillEvent: if(killedrid != 1002) end; mvp_rank_points++; dispbottom("You have obtained 1 Rank Point. You now have " + mvp_rank_points + "."); callfunc("updateMVPRank", strcharinfo(0), mvp_rank_points); } function script updateMVPRank { .@curr_name$ = getarg(0); .@curr_kills = getarg(1); for(.@i = 0; .@i < 20; .@i++) { if($top_mvp_kills$[.@i] < .@curr_kills && $top_mvp_names$[.@i] != .@curr_name$) { .@new_name = .@curr_name; .@new_kills = .@curr_kills; .@curr_name = $top_mvp_names$[.@i]; .@curr_kills = $top_mvp_kills$[.@i]; $top_mvp_names$[.@i] = .@new_name; $top_mvp_kills$[.@i] = .@new_kills; continue; } if($top_mvp_kills$[.@i] < .@curr_kills) { $top_mvp_kills$[.@i] = .@curr_kills; break; } } } -
[Error]: script:op_2: invalid data for operator C_EQ
Winterfox replied to eloscar23's question in Scripting Support
.@nombre == strcharinfo(0) You compare a numeric variable with a string. -
It would be helpful if you would explain exactly what is not working and how you expect it to.
-
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;
-
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
-
You can achieve that by using the achievement system: https://github.com/rathena/rathena/blob/master/doc/achievements.md
-
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.
-
I tested the script and could not reproduce the error.
-
- 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
-
- 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
-
- 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
-
NPC Script Not Detecting Equipped Item
Winterfox replied to Dolphin86's question in Scripting Support
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"); } -
NPC Script Not Detecting Equipped Item
Winterfox replied to Dolphin86's question in Scripting Support
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)) { -
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; }
-
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; }
-
Requesting help for Release of Truth and Scales of Judgement combo
Winterfox replied to Xeraphiel's question in Database Requests
Without the complete script, it is hard to help you. -
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; }
-
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.
-
Help for Guild Party and Online members checking
Winterfox replied to friomixx's question in Scripting Support
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++; } } -
Help for Guild Party and Online members checking
Winterfox replied to friomixx's question in Scripting Support
if(getcharid(2,$@partymembername$[.@i] != getarg(0))) { Has to be: if(getcharid(2,$@partymembername$[.@i]) != getarg(0)) { -
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); }
-
- 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); }
-
How To find Chief Officer On Prontera City
Winterfox replied to Cyborg's question in Scripting Support
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. -
Warper npc with disable mvp map function
Winterfox replied to Dolphin86's question in Scripting Support
You need to declare the function mvp_maps before using it. function Go; function Disp; function Pick; function Restrict; function mvp_maps; -
Why don't you use barter shops to get rid of the verbosity regarding the item price?