Jump to content
  • 0

Speak in the script.


hardelite

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  44
  • Reputation:   2
  • Joined:  01/09/18
  • Last Seen:  

Can someone add the speech at the beginning of the script to me? plz.

    mes "[Quest Shop]";
    mes "Seja bem-vind"+ (Sex?"o":"a") +" "+strcharinfo(0)+"!";
    mes "O qual quest deseja fazer  ?";
Spoiler
  1. prontera,164,203,6 script Quest Shop#1 4_M_MOCASS2,{ callfunc "qshop"; }
  2.  
  3.  
  4. // Script Core
  5. //============================================================
  6. - script quest_shop -1,{
  7. function Add; function Chk; function Slot; function A_An;
  8. OnInit:
  9. freeloop(1);
  10.  
  11. // -----------------------------------------------------------
  12. // Basic shop settings.
  13. // -----------------------------------------------------------
  14.  
  15. set .Announce,1; // Announce quest completion? (1: yes / 0: no)
  16. set .ShowSlot,0; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
  17. set .ShowID,0; // Show item IDs? (1: yes / 0: no)
  18. set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no)
  19. set .MaxStack,100; // Max number of quest items purchased at one time.
  20.  
  21. // -----------------------------------------------------------
  22. // Points variable -- optional quest requirement.
  23. // setarray .Points$[0],"<variable name>","<display name>";
  24. // -----------------------------------------------------------
  25.  
  26. setarray .Points$[0],"#CASHPOINTS","Cash Points";
  27.  
  28. // -----------------------------------------------------------
  29. // Shop IDs -- to add shops, copy dummy data at bottom of file.
  30. // setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...};
  31. // -----------------------------------------------------------
  32.  
  33. setarray .Shops$[1],"- Elmos","- Asas","- Middle","- Set's";
  34.  
  35. // -----------------------------------------------------------
  36. // Quest items -- do NOT use a reward item more than once!
  37. // Add(<shop ID>,<reward ID>,<reward amount>,
  38. // <Zeny cost>,<point cost>,
  39. // <required item ID>,<required item amount>{,...});
  40. // -----------------------------------------------------------
  41.  
  42. Add(1,18230,1,10000000,0,5005,10,7082,20,2287,30,4047,1);
  43. Add(1,5032,1,0,0,1059,250,2221,1,2227,1,7063,600);
  44. Add(1,5027,1,0,0,2252,1,1036,400,7001,50,4052,1);
  45. Add(1,5045,1,0,0,2252,1,1054,450,943,1200);
  46.  
  47. Add(2,1224,1,0,0,7297,30,969,10,999,50,714,10);
  48. Add(2,1225,1,0,0,7292,30,969,10,999,50,714,10);
  49.  
  50. Add(3,531,1,3,0,512,1,713,1);
  51. Add(3,532,1,3,0,513,1,713,1);
  52. Add(3,533,1,3,0,514,1,713,1);
  53. Add(3,534,1,3,0,515,1,713,1);
  54.  
  55. Add(4,531,1,3,0,512,1,713,1);
  56. Add(4,532,1,3,0,513,1,713,1);
  57. Add(4,533,1,3,0,514,1,713,1);
  58. Add(4,534,1,3,0,515,1,713,1);
  59.  
  60. Add(5,531,1,3,0,512,1,713,1);
  61. Add(5,532,1,3,0,513,1,713,1);
  62. Add(5,533,1,3,0,514,1,713,1);
  63. Add(5,534,1,3,0,515,1,713,1);
  64.  
  65. // -----------------------------------------------------------
  66.  
  67. freeloop(0);
  68. set .menu$,"";
  69. for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) {
  70. set .menu$, .menu$+.Shops$[.@i]+":";
  71. npcshopdelitem "qshop"+.@i,909;
  72. }
  73. end;
  74.  
  75. OnMenu:
  76. set .@size, getarraysize(@i);
  77. if (!.@size) set .@i, select(.menu$);
  78. else if (.@size == 1) set .@i, @i[0];
  79. else {
  80. for(set .@j,0; .@j<.@size; set .@j,.@j+1)
  81. set .@menu$, .@menu$+.Shops$[@i[.@j]]+":";
  82. set .@i, @i[select(.@menu$)-1];
  83. }
  84. deletearray @i[0],getarraysize(@i);
  85. if (.Shops$[.@i] == "") {
  86. message strcharinfo(0),"An error has occurred.";
  87. end;
  88. }
  89. dispbottom "[Quest Shop]: Atenção "+strcharinfo(0)+"! Selecione apenas uma Quest por vez.";
  90. callshop "qshop"+.@i,1;
  91. npcshopattach "qshop"+.@i;
  92. end;
  93.  
  94. OnBuyItem:
  95. // .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... }
  96. setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]);
  97. copyarray .@q[3],getd(".q_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+.@q[0]));
  98. set .@q[2],.@q[1]*.@q[3];
  99. if (!.@q[2] || .@q[2] > 30000) {
  100. message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+".";
  101. end;
  102. }
  103. mes "[Quest Shop]";
  104. mes "Para fazer a quest do ^336633["+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"]^000000 precisarei dos seguintes itens:";
  105. if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zenys^000000";
  106. 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";
  107. if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
  108. mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000";
  109. next;
  110. setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11);
  111. 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)))
  112. set .@preview,1;
  113. addtimer 1000, strnpcinfo(0)+"::OnEnd";
  114. while(1) {
  115. switch(select(" - Faça, tenho todos os itens necessários.:"+((.@preview && !@qe[7])?" - Provar item...":"")+": - ^777777Cancelar^000000")) {
  116. case 1:
  117. if (@qe[0]) {
  118. mes "[Quest Shop]";
  119. mes "Desculpe, você não tem todos os itens necessários.";
  120. close;
  121. }
  122. if (!checkweight(.@q[0],.@q[2])) {
  123. mes "[Quest Shop]";
  124. mes "Desculpe, você está carregando muito peso. Livre-se de ^FF0000"+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+"^000000 de peso adicional para completar a troca.";
  125. close;
  126. }
  127. if (.@q[4]) Zeny -= (.@q[4]*.@q[1]);
  128. if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]);
  129. if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
  130. delitem .@q[.@i],.@q[.@i+1]*.@q[1];
  131. getitem .@q[0],.@q[2];
  132. if (.Announce) announce strcharinfo(0)+" completou a quest "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):A_An(getitemname(.@q[0])))+"!",0;
  133. specialeffect2 EF_FLOWERLEAF;
  134. close;
  135. case 2:
  136. setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1;
  137. if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2];
  138. else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2];
  139. else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2];
  140. else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2];
  141. break;
  142. case 3:
  143. close;
  144. }
  145. }
  146.  
  147. OnEnd:
  148. if (@qe[7]) {
  149. changelook LOOK_HEAD_BOTTOM, @qe[3];
  150. changelook LOOK_HEAD_TOP, @qe[4];
  151. changelook LOOK_HEAD_MID, @qe[5];
  152. changelook LOOK_ROBE, @qe[6];
  153. }
  154. deletearray @qe[0],8;
  155. end;
  156.  
  157. function Add {
  158. if (getitemname(getarg(1)) == "null") {
  159. debugmes "Quest reward #"+getarg(1)+" invalid (skipped).";
  160. return;
  161. }
  162. setarray .@j[0],getarg(2),getarg(3),getarg(4);
  163. for(set .@i,5; .@i<getargcount(); set .@i,.@i+2) {
  164. if (getitemname(getarg(.@i)) == "null") {
  165. debugmes "Quest requirement #"+getarg(.@i)+" invalid (skipped).";
  166. return;
  167. } else
  168. setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1);
  169. }
  170. copyarray getd(".q_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j);
  171. npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3?0);
  172. return;
  173. }
  174.  
  175. function Chk {
  176. if (getarg(0) < getarg(1)) {
  177. set @qe[0],1;
  178. return "^FF0000";
  179. } else
  180. return "^336633";
  181. }
  182.  
  183. function Slot {
  184. set .@s$,getitemname(getarg(0));
  185. switch(.ShowSlot) {
  186. case 1: if (!getitemslots(getarg(0))) return .@s$;
  187. case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return .@s$+" ["+getitemslots(getarg(0))+"]";
  188. default: return .@s$;
  189. }
  190. }
  191.  
  192. function A_An {
  193. setarray .@A$[0],"a","e","i","o","u";
  194. set .@B$, "_"+getarg(0);
  195. for(set .@i,0; .@i<5; set .@i,.@i+1)
  196. if (compare(.@B$,"_"+.@A$[.@i])) return "an "+getarg(0);
  197. return "a "+getarg(0);
  198. }
  199. }
  200.  
  201. function script qshop {
  202. deletearray @i[0],getarraysize(@i);
  203. for(set .@i,0; .@i<getargcount(); set .@i,.@i+1)
  204. set @i[.@i],getarg(.@i);
  205. doevent "quest_shop::OnMenu";
  206. end;
  207. }
  208.  
  209.  
  210. // Dummy shop data -- copy as needed.
  211. //============================================================
  212. - shop qshop1 -1,909:-1
  213. - shop qshop2 -1,909:-1
  214. - shop qshop3 -1,909:-1
  215. - shop qshop4 -1,909:-1
  216. - shop qshop5 -1,909:-1

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  130
  • Reputation:   71
  • Joined:  09/03/14
  • Last Seen:  

After

OnMenu:

insert you code.

OnMenu:
    mes "[Quest Shop]";
    mes "Seja bem-vind"+ (Sex?"o":"a") +" "+strcharinfo(0)+"!";
    mes "O qual quest deseja fazer  ?";

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...