- script Ganja Runes -1,{ mes .npc$; mes "I can attach or remove your Ganja Runes to/from your equipment. But I can't do it for weapons."; next; switch(select("> Attach Ganja Runes:> Remove Ganja Runes:> Buy Ganja Runes")) { case 1: mes .npc$; mes "I can do this for a small fee of ^0000FF"+.pric+"z^000000."; emotion e_no1,0; next; emotion e_swt,0; mes .npc$; mes "I must ^FF0000warn^000000 you that if this"; mes "process fails, I don't refund money and your Ganja Runes will be consumed."; mes " "; mes "Would you still like to continue?"; next; if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; } if(Zeny<.pric) { mes .npc$; mes "I'm sorry you don't have enough Zeny, please come back later."; close; } mes .npc$; mes "Please select an equipment from the menu."; next; while(set(.@a,.@a+1)<=.e_len) { if(getequipid(.@a)>-1) { if(getiteminfo(getequipid(.@a),2)!=4) { set .@menu$, .@menu$+.eqp$[.@a-1]+"- [^0000FF"+getitemname(getequipid(.@a))+"^000000]:"; set(.@menu[getarraysize(.@menu)],.@a); } } } if(.@menu$==""){ mes .npc$; mes "You don't have anything equipped!"; close; } select(.@menu$); set .@eq_loc, .@menu[@menu-1]; set .@eq_itm, getequipid(.@eq_loc); if(countitem(.@eq_itm)>1) { mes .npc$; mes "You have more than one ^009900"+getitemname(.@eq_itm)+"^000000"; mes "in your inventory! Please put them"; mes "to your storage first to avoid"; mes "^FF0000misattachment^000000!"; close; } if(.@eq_itm<0){ mes .npc$; mes "Hmm, I don't think you have anything equipped there."; close; } set .@menu$, ""; set .@a, .en_orb[0]; while((set(.@a,.@a+1)-1)<=.en_orb[1]) if(getiteminfo(.@a-1,2)>-1) if(set(.@c,countitem(.@a-1))) { set .@menu$, .@menu$+getitemname(.@a-1)+" x"+.@c+":"; set .@b,.@b+1; set .@item[.@b], .@a-1; } if(.@menu$==""){ mes .npc$; mes "Hmm, you don't seem to have any Ganja Runes."; close; } mes .npc$; mes "Please select a rune from the menu."; next; select(.@menu$); set .@itm, .@item[@menu]; set .@menu$, ""; set .@a, 0; while((set(.@a,.@a+1))<4) { if(getequipcardid(.@eq_loc,.@a)) set .@menu$, .@menu$+(.@a+1)+.crd_c$[.@a]+" Slot- [^a92435"+getitemname(getequipcardid(.@eq_loc,.@a))+"^000000]:"; else set .@menu$, .@menu$+(.@a+1)+.crd_c$[.@a]+" Slot- [^30ad25Empty^000000]:"; } setarray .@card, getequipcardid(.@eq_loc,0), getequipcardid(.@eq_loc,1), getequipcardid(.@eq_loc,2), getequipcardid(.@eq_loc,3); mes .npc$; mes "Select a slot."; next; set .@men, select(.@menu$); set .@eqrf, getequiprefinerycnt(.@eq_loc); if(getequipcardid(.@eq_loc,@menu)) { mes .npc$; mes "It looks like that item slot has already attachment on it."; mes "Please remove it and talk to me again."; close; } mes .npc$; mes "Succes Rate: ^FF0000"+.perc[.@men]+"^000000 percent."; mes " "; mes "Are you sure you want to do this?"; next; if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; } if(rand(100)>.perc[.@men]) { mes .npc$; mes "I'm sorry but I've failed you!"; misceffect 155; emotion e_sob,0; set Zeny,Zeny-.pric; delitem(.@itm,1); close; } set Zeny,Zeny-.pric; delitem .@itm,1; delitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@card[0], .@card[1], .@card[2], .@card[3]; set .@card[.@men], .@itm; getitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@card[0], .@card[1], .@card[2], .@card[3]; misceffect .efet; emotion e_no1,0; equip .@eq_itm; mes .npc$; mes "Rune successfully attached!"; close; case 2: mes .npc$; mes "To perform it, I will need these:"; mes "> ^0000FF"+getitemname(.remv)+"^000000"; mes "> ^0000FF"+.pric2+"z^000000"; emotion e_no1,0; next; mes .npc$; mes "Please select an equipment from the menu."; next; while(set(.@a,.@a+1)<=.e_len) { if(getequipid(.@a)>-1) { if(getiteminfo(getequipid(.@a),2)!=4) { set .@menu$, .@menu$+.eqp$[.@a-1]+"- [^0000FF"+getitemname(getequipid(.@a))+"^000000]:"; set(.@menu[getarraysize(.@menu)],.@a); } } } if(.@menu$==""){ mes .npc$; mes "You don't have anything equipped!"; close; } select(.@menu$); set .@eq_loc, .@menu[@menu-1]; set .@eq_itm, getequipid(.@eq_loc); if(.@eq_itm<0){ mes .npc$; mes "Hmm, I don't think you have anything equipped there."; close; } set .@menu$, ""; set .@a, 0; while((set(.@a,.@a+1))<4) { if(getequipcardid(.@eq_loc,.@a)) set .@menu$, .@menu$+(.@a+1)+.crd_c$[.@a]+" Slot- [^a92435"+getitemname(getequipcardid(.@eq_loc,.@a))+"^000000]:"; else set .@menu$, .@menu$+(.@a+1)+.crd_c$[.@a]+" Slot- [^30ad25Empty^000000]:"; } setarray .@card, getequipcardid(.@eq_loc,0), getequipcardid(.@eq_loc,1), getequipcardid(.@eq_loc,2), getequipcardid(.@eq_loc,3); mes .npc$; mes "Select a slot."; next; set .@men, select(.@menu$); set .@eqrf, getequiprefinerycnt(.@eq_loc); if(getequipcardid(.@eq_loc,@menu)) { if(Zeny<.pric2) { mes .npc$; mes "I'm sorry you don't have enough Zeny, please come back later."; close; } if(!countitem(.remv)) { mes .npc$; mes "I'm sorry but you don't have any "+getitemname(.remv)+". Please come back when you do!"; close; } mes .npc$; mes "Are you sure you want to do this?"; next; if(select("Yes:No")&2) { mes .npc$; mes "Alright, thanks anyways!"; close; } if(rand(100)>.rper) { mes .npc$; mes "I failed to remove the rune"; mes "I'm sorry please try again!"; misceffect 155; emotion e_sob,0; delitem(.remv,1); set Zeny,Zeny-.pric2; close; } set Zeny,Zeny-.pric2; delitem(.remv,1); getitem getequipcardid(.@eq_loc,.@men),1; unequip(.@eq_loc); delitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@card[0], .@card[1], .@card[2], .@card[3]; set .@card[.@men], 0; getitem2 .@eq_itm, 1, 1, .@eqrf, 0, .@card[0], .@card[1], .@card[2], .@card[3]; misceffect .efet; emotion e_no1,0; mes .npc$; mes "Rune successfully removed!"; close; } else { mes .npc$; mes "Nothing is there for me to remove."; close; } case 3: mes .npc$; mes "Please choose a rune class from the menu."; callfunc "gruneshop"; end; } // end of switch OnInit: set .npc$,"^009900[ Ganja Runes ]^000000"; // NPC Name set .pric,1000000; // Enchanting Price set .pric2,1000000; // Removing Price set .remv,2267; // Item required to de-enchant set .efet,154; // Effect Number set .rper,50; // Remove Percent setarray .perc,0,70,50,30; // Enchant Percent by Slot setarray .crd_c$, "st", "nd", "rd", "th"; // Count setarray .en_orb, 4700, 4862; // Range of IDs selected for enchanting. setarray .eqp$, "Upper Headgear", "Armor", "Left Hand", "Right Hand", "Garment", "Shoes", "Accessory1", "Accessory2", "Mid Headgear", "Low Headgear"; set .e_len , getarraysize(.eqp$); } //============================================================ - script ganja_runes_shop -1,{ function Add; function Chk; function Slot; function A_An; OnInit: freeloop(1); // ----------------------------------------------------------- // Basic shop settings. // ----------------------------------------------------------- set .Announce,0; // Announce quest completion? (1: yes / 0: no) set .ShowSlot,1; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) set .ShowID,0; // Show item IDs? (1: yes / 0: no) set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no) set .MaxStack,100; // Max number of quest items purchased at one time. // ----------------------------------------------------------- // Points variable -- optional quest requirement. // setarray .Points$[0],"",""; // ----------------------------------------------------------- setarray .Points$[0],"#CASHPOINTS","Cash Points"; // ----------------------------------------------------------- // Shop IDs -- to add shops, copy dummy data at bottom of file. // setarray .Shops$[1],"",""{,...}; // ----------------------------------------------------------- setarray .Shops$[1],"D Class","C Class","B Class","A Class","S Class"; // ----------------------------------------------------------- // Quest items -- do NOT use a reward item more than once! // Add(,,, // ,, // ,{,...}); // ----------------------------------------------------------- //=================( D Class Ganja Runes )==================== Add(1,4700,1,0,0,25538,1); //=================( C Class Ganja Runes )==================== Add(2,4701,1,0,0,25538,1); //=================( B Class Ganja Runes )==================== Add(3,4702,1,0,0,25538,1); //=================( A Class Ganja Runes )==================== Add(4,4703,1,0,0,25538,1); //=================( S Class Ganja Runes )==================== Add(5,4704,1,0,0,25538,1); //============================================================ // ----------------------------------------------------------- freeloop(0); set .menu$,""; for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) { set .menu$, .menu$+.Shops$[.@i]+":"; npcshopdelitem "gruneshop"+.@i,909; } end; OnMenu: set .@size, getarraysize(@i); if (!.@size) set .@i, select(.menu$); else if (.@size == 1) set .@i, @i[0]; else { for(set .@j,0; .@j<.@size; set .@j,.@j+1) set .@menu$, .@menu$+.Shops$[@i[.@j]]+":"; set .@i, @i[select(.@menu$)-1]; } deletearray @i[0],getarraysize(@i); if (.Shops$[.@i] == "") { message strcharinfo(0),"An error has occurred."; end; } dispbottom "Select one item at a time."; callshop "gruneshop"+.@i,1; npcshopattach "gruneshop"+.@i; end; OnBuyItem: // .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... } setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]); copyarray .@q[3],getd(".q_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+.@q[0])); set .@q[2],.@q[1]*.@q[3]; if (!.@q[2] || .@q[2] > 30000) { message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+"."; end; } mes .npc$; mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000"; mes "Requirements:"; disable_items; if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000"; if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000"; if (.@q[6]) for(set .@i,6; .@i "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000"; next; setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11); if (@qe[2] > 0 && ((@qe[1] & 1) || (@qe[1] & 256) || (@qe[1] & 512) || (@qe[1] & 1024) || (@qe[1] & 2048) || (@qe[1] & 4096) || (@qe[1] & 4) || (@qe[1] & 8192))) set .@preview,1; addtimer 1000, strnpcinfo(0)+"::OnEnd"; while(1) { switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { case 1: if (@qe[0]) { mes .npc$; mes "You're missing one or more quest requirements."; close; } if (!checkweight(.@q[0],.@q[2])) { mes .npc$; mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; close; } if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]); if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]); if (.@q[6]) for(set .@i,6; .@i 1)?.@q[2]+"x "+getitemname(.@q[0]):A_An(getitemname(.@q[0])))+"!",0; specialeffect2 EF_FLOWERLEAF; close; case 2: setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1; if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2]; else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2]; else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2]; else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2]; break; case 3: close; } } OnEnd: if (@qe[7]) { changelook LOOK_HEAD_BOTTOM, @qe[3]; changelook LOOK_HEAD_TOP, @qe[4]; changelook LOOK_HEAD_MID, @qe[5]; changelook LOOK_ROBE, @qe[6]; } deletearray @qe[0],8; end; function Add { if (getitemname(getarg(1)) == "null") { debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } setarray .@j[0],getarg(2),getarg(3),getarg(4); for(set .@i,5; .@i