Advertisement
Skorm

RWC 2012 NPCS

Aug 9th, 2013
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 9.69 KB | None | 0 0
  1. prontera,147,59,5   script  Goldberg#0  878,{
  2. function ordinal_suffix;
  3. function f_itm_menu;
  4. set .npc$, "["+strnpcinfo(1)+"]"; //NPC Name
  5. set .mode, atoi(strnpcinfo(2));
  6.  
  7.     if(!.mode) {
  8.         mes .npc$;
  9.         mes "Hello there!";
  10.         mes "I can enchant or remove enchantments";
  11.         mes "from your 2012 RWC accessory items!"; next;
  12.     } else if(.mode<3) {
  13.         mes .npc$;
  14.         mes "Hello there!";
  15.         mes "I can add a slot to your RWC";
  16.         mes "2012 accessory items!";
  17.         mes "^FF0000Any enchantments over the first";
  18.         mes "slot will be lost in the process!^000000"; next;
  19.     } else {
  20.         mes .npc$;
  21.         mes "Hello there!";
  22.         mes "I can slot or enchant your RWC";
  23.         mes "2012 accessory items!";
  24.         mes "^FF0000Any enchantments over the first";
  25.         mes "slot will be lost in the process!^000000"; next;
  26.     }
  27.         switch(select(((.mode)?"Chamber Accessory"+((.mode>1)?":Enchant:Remove Enchantments":""):"Enchant:Remove Enchantments")+":Cancel")) {
  28.             case 1:
  29.                 if(!.mode) {
  30.                     mes .npc$;
  31.                     mes "Which RWC Accessory item would you like to enchant?"; next;
  32.                     f_itm_menu();
  33.                     goto L_Slots;
  34.                 } else {
  35.                     mes .npc$;
  36.                     mes "Which RWC Accessory do you want me to slot?"; next;
  37.                     f_itm_menu();
  38.                     break;
  39.                 }
  40.             case 2:
  41.                 if(!.mode) {
  42.                     mes .npc$;
  43.                     mes "Select the RWC Accessory you would like me to remove the enchantments from."; next;
  44.                     f_itm_menu();
  45.                     goto L_RMV;
  46.                 } else if (.mode>1) {
  47.                     mes .npc$;
  48.                     mes "Which RWC Accessory item would you like to enchant?"; next;
  49.                     f_itm_menu();
  50.                     goto L_Slots;
  51.                 }
  52.             case 3:
  53.                 if (.mode>1) {
  54.                     mes .npc$;
  55.                     mes "Select the RWC Accessory you would like me to remove the enchantments from."; next;
  56.                     f_itm_menu();
  57.                     goto L_RMV;
  58.                 }
  59.             case 4:
  60.                 goto L_Exit;
  61.         }
  62.    
  63.     if(!compare(.slot$,""+@eq_id)) {
  64.         mes .npc$;
  65.         mes "That item cannot be slotted.";
  66.         close;
  67.     }
  68.     while(.@i++<=4)
  69.         setd(".@o_crd"+.@i, getequipcardid(@eq_loc,.@i-1));
  70.     mes .npc$;
  71.     mes "Are you sure you wish to continue?";
  72.     mes "^FF0000There is a "+.pert+"% chance that";
  73.     mes "the slotting process will fail and";
  74.     mes "your item will break.^000000"; next;
  75.     if(select("Yes:No")&2) goto L_Exit;
  76.     if(rand(100)>=.pert) {
  77.         delitem2 @eq_id, 1, 1, @eq_rf, 0, .@o_crd1, .@o_crd2, .@o_crd3, .@o_crd4;
  78.         getitem2 @eq_id, 1, 1, @eq_rf, 0, 0, .@o_crd2, .@o_crd3, .@o_crd4;
  79.         misceffect 101;
  80.         sleep2 1300;
  81.         misceffect .efet;
  82.         mes .npc$;
  83.         mes "Perfection!!";
  84.         emotion e_no1,0;
  85.         equip @eq_id;
  86.     } else {
  87.         delitem2 @eq_id, 1, 1, @eq_rf, 0, .@o_crd1, .@o_crd2, .@o_crd3, .@o_crd4;
  88.         misceffect 101;
  89.         sleep2 1300;
  90.         misceffect .afet;
  91.         mes .npc$;
  92.         mes "The metal was too weak and the drill went right through... I'm Sorry!";
  93.         emotion e_sob,0;
  94.     }
  95.     close;
  96.    
  97. L_Slots:
  98.     set .@menu$, ""; set .@a, 0;
  99.     while(set(.@a,.@a+1)<=4) {
  100.         setd(".@o_crd"+.@a, getequipcardid(@eq_loc,.@a-1));
  101.         if(getequipcardid(@eq_loc,.@a-1))
  102.             set .@menu$, .@menu$+ ordinal_suffix(.@a)+" Slot - [^a92435"+getitemname(getequipcardid(@eq_loc,.@a-1))+"^000000]:";
  103.         else if(getitemslots(@eq_id)-.@a>=0)
  104.             set .@menu$, .@menu$+ ordinal_suffix(.@a)+" Slot - [Chambered]:";
  105.         else
  106.             set .@menu$, .@menu$+ ordinal_suffix(.@a)+" Slot - [^30ad25"+((getd(".@crd"+.@a))?"^800080"+getd(".@typ"+.@a+"$"):"Empty")+"^000000]:";
  107.     } set .@menu$, .@menu$+"[^0000FFEnchant!^000000]";
  108.  
  109.     mes .npc$;
  110.     mes "Select a slot.";
  111.     mes "Choose '^0000FFEnchant^000000' when you're done!"; next;
  112.     set .@menu, select(.@menu$)-1;
  113.     if(getequipcardid(@eq_loc,.@menu)&&getitemslots(@eq_id)-(.@menu+1)<0) {
  114.         if(.remv) {
  115.             mes .npc$;
  116.             mes "Would you like me to remove this enchantment?"; next;
  117.             if(select("Yes:No")&2) goto L_Exit;
  118.             delitem2 @eq_id, 1, 1, @eq_rf, 0, .@o_crd1, .@o_crd2, .@o_crd3, .@o_crd4;
  119.             setd(".@o_crd"+(.@menu+1), 0);
  120.             getitem2 @eq_id, 1, 1, @eq_rf, 0, .@o_crd1, .@o_crd2, .@o_crd3, .@o_crd4;
  121.             equip @eq_id;
  122.             goto L_Slots;
  123.         } else {
  124.             mes .npc$;
  125.             mes "Sorry I can't do anything with this slot without a "+getitemname(.cure)+"."; next;
  126.             goto L_Slots;
  127.         }
  128.     } else if(getitemslots(@eq_id)-(.@menu+1)>=0) {
  129.         mes .npc$;
  130.         mes "I cannot do anything with Chambered slots!"; next;
  131.         goto L_Slots;
  132.     }
  133.    
  134.     if((.@menu+1)>4) {
  135.         if(!(.@crd1+.@crd2+.@crd3+.@crd4)) {
  136.             mes .npc$;
  137.             mes "You haven't done anything!";
  138.             next;
  139.             goto L_Slots;
  140.         }
  141.         mes .npc$;
  142.         mes "Are you sure you wish to continue?";
  143.         mes "^FF0000There is a "+.perc+"% chance that";
  144.         mes "the enchantment will fail and";
  145.         mes "your item will break.^000000"; next;
  146.         if(select("Yes:No")&2) goto L_Exit;
  147.         if(rand(100)>=.perc) {
  148.             delitem2 @eq_id, 1, 1, @eq_rf, 0, .@o_crd1, .@o_crd2, .@o_crd3, .@o_crd4;
  149.             getitem2 @eq_id, 1, 1, @eq_rf, 0, .@crd1, .@crd2, .@crd3, .@crd4;
  150.             misceffect 101;
  151.             sleep2 1300;
  152.             misceffect .efet;
  153.             mes .npc$;
  154.             mes "Wow, that's one strong item!";
  155.             equip @eq_id;
  156.         } else {
  157.             delitem2 @eq_id, 1, 1, @eq_rf, 0, .@o_crd1, .@o_crd2, .@o_crd3, .@o_crd4;
  158.             misceffect 101;
  159.             sleep2 1300;
  160.             misceffect .afet;
  161.             mes .npc$;
  162.             mes "I'm sorry, the item wasn't able to support the enchantment and broke!";
  163.         }
  164.         close;
  165.     }
  166.    
  167.     set(.@g$,"");
  168.     if(@eq_id!=2966&&.@menu>1&&@eq_id!=2967) {
  169.         set(.@g$,"1");
  170.     } else if(.@menu>1) set(.@g$,"0");
  171.    
  172.     select(getd(".menu"+.@g$+(.@menu+1)+"$"));
  173.     set .itm,   ((.@menu<1&&@menu>.t_len)?.itm04[(getarraysize(.itm04)-1)]:4700+((.@menu*10)+rand(.limi)));
  174.     setd(".@crd"+(.@menu+1),getd(".itm"+.@g$+((.@menu>1)?@menu+"["+rand(getarraysize(getd(".itm"+.@g$+@menu)))+"]":"")));
  175.     setd(".@typ"+(.@menu+1)+"$",getd(".ary"+.@g$+(.@menu+1)+"$["+(@menu-1)+"]"));
  176.     goto L_Slots;
  177.    
  178. L_RMV:
  179.     if(!countitem(.cure)) {
  180.         mes .npc$;
  181.         mes "I'm sorry but you need at least one "+getitemname(.cure)+" before we may continue.";
  182.         close;
  183.     }
  184.     while(.@i++<=4)
  185.         setd(".@o_crd"+.@i, getequipcardid(@eq_loc,.@i-1));
  186.     if(!((getitemslots(@eq_id)?0:.@o_crd1)+.@o_crd2+.@o_crd3+.@o_crd4)) {
  187.         mes .npc$;
  188.         mes "There isn't anything I can remove on that accessory.";
  189.         close;
  190.     }
  191.     mes .npc$;
  192.     mes "Are you sure that you want to remove your enchantments?";
  193.     mes "^FF0000This option won't effect your chambered card slot.^000000"; next;
  194.     if(select("Yes:No")&2) goto L_Exit;
  195.     misceffect 103;
  196.     delitem(.cure,1);
  197.     delitem2 @eq_id, 1, 1, @eq_rf, 0, .@o_crd1, .@o_crd2, .@o_crd3, .@o_crd4;
  198.     getitem2 @eq_id, 1, 1, @eq_rf, 0, (getitemslots(@eq_id)?.@o_crd1:0), 0, 0, 0;
  199.     mes .npc$;
  200.     mes "Your enchantments where removed!";
  201.     close;
  202.    
  203. L_Exit:
  204.     mes .npc$;
  205.     mes .message$[rand(getarraysize(.message$))];
  206.     close;
  207.    
  208.     function    ordinal_suffix  {
  209.         set(.@i,getarg(0));
  210.         set(.@j,.@i%10);
  211.         if (.@j == 1 && .@i != 11)
  212.             return .@i + "st";
  213.         if (.@j == 2 && .@i != 12)
  214.             return .@i + "nd";
  215.         if (.@j == 3 && .@i != 13)
  216.             return .@i + "rd";
  217.         return .@i + "th";
  218.     }
  219.  
  220.     function    f_itm_menu  {  
  221.         while(set(.@a,.@a+1)<=.e_len) {
  222.             if(compare(.e_itl$[.@a-1],""+getequipid(.e_loc[.@a-1])))
  223.                 set .@menu$, .@menu$+.eqp$[.@a-1]+"- [^0000FF"+getitemname(getequipid(.e_loc[.@a-1]))+"^000000]:";
  224.             else set .@menu$, .@menu$+"^adb4be"+.eqp$[.@a-1]+"- [Empty]^000000:";
  225.         }
  226.         set @menu, select(.@menu$)-1;
  227.         set @eq_loc, .e_loc[@menu];
  228.         set @eq_id, getequipid(@eq_loc);
  229.         set @eq_rf, getequiprefinerycnt(@eq_loc);
  230.        
  231.         if(!compare(.e_itm$,""+@eq_id )) {
  232.             mes .npc$;
  233.             mes "Sorry I don't recoginze that equipment.";
  234.             close;
  235.         }
  236.     } return;
  237.    
  238. //NPC Constants
  239.     OnInit:
  240.         //=-=-=-=-=-=-=Configuration=-=-=-=-=-=-=
  241.         set      .perc  ,    25; //enchantment fail percent
  242.         set      .pert  ,    50; //slotting fail percent
  243.         set      .efet  ,    154; //Success Effect Number
  244.         set      .afet  ,    155; //Fail Effect Number
  245.         set      .remv  ,    0; //Allows the NPC to remove enchantments without Item. (1=On/0=Off)
  246.         set      .cure  ,    6665; //Item used to remove enchantments
  247.         set      .limi  ,    3; //Limit for status orb enchantments.
  248.         setarray .message$,     //List of random closing messages.
  249.             "Maybe next time then.",
  250.             "Alright, thanks anyways!",
  251.             "Alright maybe next time then.",
  252.             "Uhm, ok- See you around then.",
  253.             "Wise choice, although you'll probably"+
  254.             "never get anywhere with that attitude.";
  255.            
  256.         set .slot$, "2966|2968"; //Items that can be slotted.
  257.        
  258.         setarray .ary1$, "Strength(STR)", "Intelligence(INT)", "Dexterity(DEX)", "Agility(AGI)", "Vitality(VIT)", "Luck(LUK)";
  259.         copyarray .ary2$[0],.ary1$[0],128;
  260.         set .t_len, getarraysize(.ary2$);
  261.         set .ary2$[.t_len], "Health Points";
  262.  
  263.         setarray .ary03$, "Fighting Spirit", "Physical Attack Percent(ATK%)", "Maximum Health Points(MHP%)", "Health Points";
  264.         setarray .itm01  ,  4811, 4810, 4809; //Fighting Spirit
  265.         setarray .itm02  ,  4819, 4766, 4767; //ATK(%)
  266.         setarray .itm03  ,  4861, 4862, 4867; //MHP
  267.         setarray .itm04  ,  4795, 4796, 4797; //HP
  268.         copyarray .ary04$[0],.ary03$[0],128;
  269.  
  270.         setarray .ary13$, "Magic Attack Percent(MATK%)", "Casting Rate & Damage(Spell)", "Special Points(SP)";
  271.         setarray .itm11  ,  4760, 4761, 4806; //MATK(%)
  272.         setarray .itm12  ,  4815, 4814, 4813; //Spell
  273.         setarray .itm13  ,  4870, 4800, 4871; //SP
  274.         copyarray .ary14$[0],.ary13$[0],128;
  275.  
  276.         setarray .eqp$  ,    "Accessory1", "Accessory2"; //Menu3
  277.         set      .e_len ,    getarraysize(.eqp$);
  278.         setarray .e_itl$,    "2966|2967|2968|2969",
  279.                              "2966|2967|2968|2969"; //Equip Items
  280.         setarray .e_loc ,    7, 8; //Equip Locations
  281.         set      .e_itm$,    implode(.e_itl$,",");
  282.         set      .menu1$,    implode(.ary1$,":");
  283.         set      .menu2$,    .menu1$+":"+.ary03$[3];
  284.         set      .menu03$,   implode(.ary03$,":");
  285.         set      .menu04$,   .menu03$;
  286.         set      .menu13$,   implode(.ary13$,":");
  287.         set      .menu14$,   .menu13$;
  288.         //=-=-=-=-=-=-=-=-Skorm-=-=-=-=-=-=-=-=-=
  289. }
  290.  
  291. prontera,147,61,5   duplicate(Goldberg#0)   Driller#1   87
  292.  
  293. prontera,147,63,5   duplicate(Goldberg#0)   Goldentheifberg#3   87
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement