This script was created originally by @Winterfox, i currently add a feature which the script will detect if player have an item before he/she can start crafting, everything was doing great and no error was shown, but somehow when the crafting process was completed i did not recive the crafted item, could someone help me what was wrong?
Spoiler
- script ArmorWorkTable FAKE_NPC,{.@workbench_id= atoi(strnpcinfo(2));.@workbench_crafting_state= getd("$workbench_"+.@workbench_id+"_crafting_state");if(.@workbench_crafting_state==1){
soundeffect "menu.wav",0;if(countitem(.instant_craft_item_id)>0){
mes "You have an "+ getitemname(.instant_craft_item_id)+".";
mes "Do you want to use it to instantly finish crafting ?";
next;if(select("Yes.:No.")){
delitem(.instant_craft_item_id),1;
stopnpctimer;goto(FINISH_CRAFTING);}}
mes "Please wait until the armor crafting process is finished.";
close;}if(.@workbench_crafting_state==2){
FINISH_CRAFTING:
soundeffect "menu.wav",0;
mes "Here are armor.";for(.@i=0;.@i< getarraysize(getd("$workbench_"+.@workbench_id+"_products"));.@i+=2){
getitem(getd("$workbench_"+.@workbench_id+"_products["+.@i+"]"), getd("$workbench_"+.@workbench_id+"_products["+(.@i+1)+"]"));}
delwaitingroom;
setd("$workbench_"+.@workbench_id+"_crafting_state",0);
close;}//=======================================================if(countitem(40040)==1){
callsub(Start_Armor);}
soundeffect "menu.wav",0;
mes "You will need Armor Crafting Tier 2";
mes "or above.";
close;Start_Armor:
deletearray(@product_recipe, getarraysize(@product_recipe));
soundeffect "menu.wav",0;
mes "^ff0000==============================";
mes "Any item created unattended by using the Public armor can be stolen by other players!";
mes "==============================^000000";
next;
soundeffect "menu.wav",0;
mes "^ff0000==============================";
mes "Private armor are shared with those who have acsess only!";
mes "==============================^000000";
next;
soundeffect "menu.wav",0;
mes "Select Armor Crafting.";switch(select("- Normal Armor")){case1:
clear;
soundeffect "menu.wav",0;
mes "Select Tools";switch(select("- Stone Knife")){case1:
clear;
soundeffect "menu.wav",0;
mes "Select Armor Location.";switch(select("- Upper:- Middle")){case1:
setarray(@product_recipe,40117,1,40005,1,1,40115,0,1,40166,0,1);break;case2:
setarray(@product_recipe,40119,1,40005,1,1,40115,0,1,40166,0,1);break;}}}//=====================================================================================if(getarraysize(@product_recipe)==0){
end;}.@product_id=@product_recipe[0];.@product_amount=@product_recipe[1];for(.@i=2;.@i< getarraysize(@product_recipe);.@i+=3){.@next_start_index= getarraysize(.@product_requirements);.@product_requirements[.@next_start_index]=@product_recipe[.@i];.@product_requirements[.@next_start_index+1]=@product_recipe[.@i+1];.@product_requirements[.@next_start_index+2]=@product_recipe[.@i+2];}
clear;
soundeffect "menu.wav",0;
mes "Require";for(.@i=0;.@i< getarraysize(.@product_requirements);.@i+=3){if(.@product_requirements[.@i+1]==1){.@item_amount= rentalcountitem(.@product_requirements[.@i]);}else{.@item_amount= countitem(.@product_requirements[.@i]);}.@item_requirement_text$=.@product_requirements[.@i+2]+" "+ getitemname(.@product_requirements[.@i]);if(.@item_amount<.@product_requirements[.@i+2]){.@not_enough_items=1;
mes "^ff0000- "+.@item_requirement_text$+"^000000";}else{
mes "^8fce00- "+.@item_requirement_text$+"^000000";}}if(.@not_enough_items==1){
close;}
soundeffect "menu.wav",0;
select("- Start");if(countitem(40040)==1){
armor_points +=1;
dispbottom("Gained +1 Armor Crafting Points");}for(.@i=0;.@i< getarraysize(.@product_requirements);.@i+=3){if(.@product_requirements[.@i+1]==0){
delitem(.@product_requirements[.@i],.@product_requirements[.@i+2]);}}
setarray(getd("$workbench_"+.@workbench_id+"_products"),.@product_id,.@product_amount);
setd("$workbench_"+.@workbench_id+"_crafting_state",1);
clear;
mes "The crafting armor process has started, please wait until it is finished.";OnCraftingStart:
waitingroom("CRAFTING...",0);
initnpctimer;
end;OnTimer60000:
setd("$workbench_"+ atoi(strnpcinfo(2))+"_crafting_state",2);
delwaitingroom;
waitingroom("COMPLETED!",0);
end;OnInit:.@workbench_id= atoi(strnpcinfo(2));if(.@workbench_id<1){.instant_craft_item_id =40014;
end;}if(getd("$workbench_"+.@workbench_id+"_crafting_state")==1){goto(OnCraftingStart);}
end;//=============================================================================}//Duplicate//=====================================================//new_1-3,91,143,6 duplicate(Armor Work Table) Public Armor Work Table#9000 11004//new_1-3,95,143,6 duplicate(Armor Work Table) Public Armor Work Table#9001 11004//new_1-3,99,143,6 duplicate(Armor Work Table) Public Armor Work Table#9002 11004//new_1-3,91,149,6 duplicate(Armor Work Table) Public Armor Work Table#9003 11004//veil//=====================================================
veil,135,45,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9004 11004
veil,140,45,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9005 11004
veil,145,45,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9006 11004
veil,150,45,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9007 11004
veil,135,41,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9008 11004
veil,140,41,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9009 11004
veil,145,41,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9010 11004
veil,150,41,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9011 11004
veil,135,37,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9012 11004
veil,140,37,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9013 11004
veil,145,37,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9014 11004
veil,150,37,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9015 11004
veil,145,33,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9016 11004
veil,150,33,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9017 11004
veil,145,29,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9018 11004
veil,150,29,6 duplicate(ArmorWorkTable)PublicArmorWorkTable#9019 11004//veil,223,55,6 duplicate(Armor Work Table) Public Armor Work Table#9020 11004//veil,208,55,6 duplicate(Armor Work Table) Public Armor Work Table#9021 11004//new_1-3,95,149,6 duplicate(Armor Work Table) Public Armor Work Table#9022 11004//new_1-3,99,149,6 duplicate(Armor Work Table) Public Armor Work Table#9023 11004//island//===============================================================
neko1,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9024 11004
neko1,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9025 11004
neko1,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9026 11004
neko1,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9027 11004//===============================================================
neko2,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9030 11004
neko2,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9031 11004
neko2,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9032 11004
neko2,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9033 11004//===============================================================
neko3,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9036 11004
neko3,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9037 11004
neko3,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9038 11004
neko3,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9039 11004//===============================================================
neko4,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9042 11004
neko4,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9043 11004
neko4,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9044 11004
neko4,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9045 11004//===============================================================
neko5,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9048 11004
neko5,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9049 11004
neko5,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9050 11004
neko5,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9051 11004//===============================================================
neko6,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9054 11004
neko6,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9055 11004
neko6,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9056 11004
neko6,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9057 11004//==============================================================
neko7,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9060 11004
neko7,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9061 11004
neko7,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9062 11004
neko7,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9063 11004//===============================================================
neko8,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9066 11004
neko8,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9067 11004
neko8,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9068 11004
neko8,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9069 11004//===============================================================
neko9,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9072 11004
neko9,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9073 11004
neko9,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9074 11004
neko9,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9075 11004//==============================================================
neko10,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9078 11004
neko10,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9079 11004
neko10,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9080 11004
neko10,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9081 11004//===============================================================
neko11,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9084 11004
neko11,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9085 11004
neko11,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9086 11004
neko11,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9087 11004//===============================================================
neko12,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9090 11004
neko12,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9091 11004
neko12,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9092 11004
neko12,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9093 11004//===============================================================
neko13,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9096 11004
neko13,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9097 11004
neko13,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9098 11004
neko13,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9099 11004//===============================================================
neko14,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9102 11004
neko14,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9103 11004
neko14,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9104 11004
neko14,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9105 11004//===============================================================
neko15,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9108 11004
neko15,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9109 11004
neko15,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9110 11004
neko15,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9111 11004//===============================================================
neko16,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9114 11004
neko16,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9115 11004
neko16,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9116 11004
neko16,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9117 11004//===============================================================
neko17,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9120 11004
neko17,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9121 11004
neko17,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9122 11004
neko17,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9123 11004//===============================================================
neko18,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9126 11004
neko18,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9127 11004
neko18,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9128 11004
neko18,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9129 11004//===============================================================
neko19,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9132 11004
neko19,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9133 11004
neko19,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9134 11004
neko19,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9135 11004//===============================================================
neko20,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9138 11004
neko20,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9139 11004
neko20,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9140 11004
neko20,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9141 11004//===============================================================
neko21,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9144 11004
neko21,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9145 11004
neko21,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9146 11004
neko21,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9147 11004//===============================================================
neko22,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9150 11004
neko22,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9151 11004
neko22,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9152 11004
neko22,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9153 11004//===============================================================
neko23,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9156 11004
neko23,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9157 11004
neko23,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9158 11004
neko23,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9159 11004//===============================================================
neko24,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9162 11004
neko24,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9163 11004
neko24,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9164 11004
neko24,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9165 11004//===============================================================
neko25,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9168 11004
neko25,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9169 11004
neko25,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9170 11004
neko25,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9171 11004//===============================================================
neko26,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9174 11004
neko26,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9175 11004
neko26,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9176 11004
neko26,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9177 11004//===============================================================
neko27,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9180 11004
neko27,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9181 11004
neko27,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9182 11004
neko27,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9183 11004//===============================================================
neko28,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9186 11004
neko28,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9187 11004
neko28,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9188 11004
neko28,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9189 11004//===============================================================
neko29,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9192 11004
neko29,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9193 11004
neko29,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9194 11004
neko29,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9195 11004//===============================================================
neko30,77,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9198 11004
neko30,81,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9199 11004
neko30,85,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9200 11004
neko30,89,136,6 duplicate(ArmorWorkTable)PrivateArmorWorkTable#9201 11004
Question
Dolphin86
This script was created originally by @Winterfox, i currently add a feature which the script will detect if player have an item before he/she can start crafting, everything was doing great and no error was shown, but somehow when the crafting process was completed i did not recive the crafted item, could someone help me what was wrong?
Thank You..
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.