Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Update Log
- // - Removing Long menu string in script, increase readability
- // - Moving or merged first check on Enchantment function
- // - Recoded Enchantment function from looping entire inventory to 8 item intended
- // - Changing @menu variable generated from select or promt script command to npc variable
- prontera,192,168,5 script Khawl'El#spec 619,{
- mes "^0000FF[Khawl'El]^000000";
- mes "Greetings and salutations!";
- mes "How may I help you?";
- .@menu$[0] = "^777777-^000000 Trade ^0000FFSpectral Fragments^000000";
- .@menu$[1] = "^777777-^000000 Forge ^0000FFEnchantment Gems^000000";
- .@menu$[2] = "^777777-^000000 Purify ^0000FFEmperium^000000";
- .@idx = select(implode(.@menu$, ":"));
- switch(.@idx){
- case 1:
- mes "Very well.";
- close2;
- callshop "SpecShop",1;
- break;
- case 2:
- clear;
- mes "^0000FF[Khawl'El]^000000";
- mes "Which ^0000FFGem^000000 you wish to forge?";
- .@menu2$[0] = "^777777-^000000 Forge ^7e9466Dragon Gem";
- .@menu2$[1] = "^777777-^000000 Forge ^8a77acOx Gem";
- .@menu2$[2] = "^777777-^000000 Forge ^cb6266Phoenix Gem";
- .@menu2$[3] = "^777777-^000000 Forge ^8088a0Tiger Gem";
- .@idx2 = select(implode(.@menu2$, ":"));
- next;
- mes "^0000FF[Khawl'El]^000000";
- mes "To forge a " + getitemname(.Gems[.@idx2]) + " you'll need 5 ^0000FFSpectral Fragment^000000 and 100 of ^0000FF" + getitemname(.Forge[.@idx2]) + "^000000.";
- if (countitem(.Forge[.@idx2]) < 100 || countitem(42108) < 5){
- mes "I'll be waiting you to gather all required items.";
- close;
- }
- select( "^777777-^000000 Forge " + .Colors$[.@idx2] + getitemname(.Gems[.@idx2]) );
- delitem .Forge[.@idx2], 100;
- delitem 42108, 5;
- specialeffect2 154;
- getitem .Gems[.@idx2], 1;
- announce "[ Khawl'El ] : " + strcharinfo(0) + " just forged a " + replacestr(getitemname(.Gems[.@idx2]), " Enchantment", " Gem") + " !",bc_all,0x9cbedc;
- mes "Come anytime";
- close;
- case 3:
- clear;
- mes "^0000FF[Khawl'El]^000000";
- mes "For this proccess, you'll need at least 10 ^0000FFEmperiums^000000 and, there's only ^0000FF20^000000% chance of actually find any ^0000FFSpectral Fragment^000000.";
- if (countitem(714) < 10){
- mes "I'll be waiting you to gather all required items.";
- close;
- }
- while (countitem(714) >= 10){
- select( "^777777-^000000 Purify ^0000FFEmperium^000000 (^0000FF" + countitem(714) + "^000000)" );
- delitem 714, 10;
- if (rand(1,5) == 1){
- specialeffect2 154;
- mes "Nice luck, young one!";
- getitem 42108,1;
- set .@frag, .@frag + 1;
- } else {
- specialeffect2 155;
- mes "Better luck next time!";
- }
- }
- if (.@frag) announce "[ Khawl'El ] : " + strcharinfo(0) + " had success on purifying " + .@frag + " Spectral Fragments from Emperiums !",bc_all,0x9cbedc;
- close;
- }
- end;
- OnInit:
- setarray .Gems[1], 42201, 42202, 42203, 42204;
- setarray .Colors$[1], "^7e9466", "^8a77ac", "^cb6266", "^8088a0";
- setarray .Forge[1], 996, 997, 994, 995;
- end;
- }
- - itemshop SpecShop -1,42108,42105:40,42106:35,42107:30,42101:25,42104:25,42102:20,42103:20
- function script SpectralGem {
- getinventorylist;
- .@menu$ = "";
- for (.@i = 42101; .@i < 42108; .@i++) {
- .@idx = inarray(@inventorylist_id, .@i);
- if (.@idx == -1) continue;
- if (.@i != @inventorylist_id[.@idx]) {
- message strcharinfo(0), "Error!! Someting went wrong, notify Administrator. E0!";
- end;
- }
- .@j++;
- .@it_id[.@j] = .@i;
- .@it_ref[.@j] = @inventorylist_refine[.@idx];
- .@it_iden[.@j] = @inventorylist_identify[.@idx];
- .@it_attr[.@j] = @inventorylist_attribute[.@idx];
- .@it_card1[.@j] = @inventorylist_card1[.@idx];
- .@it_card2[.@j] = @inventorylist_card2[.@idx];
- .@it_card3[.@j] = @inventorylist_card3[.@idx];
- .@it_card4[.@j] = @inventorylist_card4[.@idx];
- .@string$ = "^999999-^000000 Enchant ^0000FF";
- .@string$ = .@string$ + ((.@it_ref[.@j]) ? "+"+ .@it_ref[.@j] : "");
- .@string$ = .@string$ + ((.@it_card4[.@j])? "["+ getitemname(.@it_card4[.@j]) +"] " : "");
- .@string$ = .@string$ + getitemname(.@it_id[.@j]);
- if (.@it_card1[.@j])
- .@string$ = .@string$ + " ["+ replacestr(getitemname(.@it_card1[.@j]), " Card", "") +"]";
- else if (getitemslots(.@it_id[.@j]))
- .@string$ = .@string$ + " [" + getitemslots(.@it_id[.@j]) + "]";
- .@menu$ = .@menu$ + .@string$ + ":";
- }
- if (!.@j) {
- dispbottom "You have no Spectral Set piece to Enchant!",0xFF0000;
- end;
- }
- .@idx = select(.@menu$);
- .@way = getarg(0, 1) * 10;
- delitem 42200 + (.@way/10), 1;
- specialeffect2 getarg(1, 593);
- delitem2 .@it_id[.@idx2], 1, .@it_iden[.@idx2], .@it_ref[.@idx2], 0, .@it_card1[.@idx2],0,0,.@it_card4[.@idx2];
- getitem2 (.@it_id[.@idx2] + .@way), 1, 1, .@it_ref[.@idx2], 0, .@it_card1[@menu], 0, 0, 42108 + .@way;
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement