yuhsing

Untitled

Apr 18th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1.  
  2.  
  3.  
  4. - script Sample -1,{
  5. OnTalk:
  6. mes "I can add or deduct skill points from you.";
  7. mes "What do you want it to be?...";
  8. next;
  9. switch( select( "Add Skill Points","Remove Skill Points" ) ){
  10. Case 1:
  11. mes "Each Points Required:";
  12. for( set .@i,0; .@i < .item_size; set .@i,.@i + 1 )
  13. mes " > ^0055FF"+.item_amount[.@i]+" x "+getitemname( .item_list[.@i] )+"^000000";
  14. next;
  15. input .@point_amount,0,100;
  16. if( .@point_amount ){
  17. mes "You need ... ";
  18. for( set .@i,0; .@i < .item_size; set .@i,.@i + 1 ){
  19. mes " > ^0055FF"+( .item_amount[.@i] * .@point_amount )+" x "+getitemname( .item_list[.@i] )+"^000000";
  20. if( countitem( .item_list[.@i] ) < ( .item_amount[.@i] * .@point_amount ) )
  21. set .@failed,1;
  22. }
  23. if( !.@failed ){
  24. if( select( "Confirm","Cancel" ) == 1 ){
  25. mes "Done, gained "+.@point_amount+" Points.";
  26. for( set .@i,0; .@i < .item_size; set .@i,.@i + 1 )
  27. delitem .item_list[.@i],( .item_amount[.@i] * .@point_amount );
  28. set SkillPoint,SkillPoint + .@point_amount;
  29. }
  30. }
  31. }
  32. break;
  33. Case 2:
  34. if( !SkillPoint ){
  35. mes "You dont have any skill points.";
  36. }else{
  37. mes "Each point = "+.zeny_gain+" Zeny.";
  38. mes "Sell how many points ?";
  39. input .@point_amount,0,SkillPoint;
  40. if( .@point_amount ){
  41. mes "Done, gained "+( .@point_amount * .zeny_gain )+" Zeny.";
  42. set Zeny,Zeny + ( .@point_amount * .zeny_gain );
  43. }
  44. }
  45. default: break;
  46. }
  47. close;
  48.  
  49. OnInit:
  50. // Item + Amount per Skill Points.
  51. setarray .item_list,512;
  52. // setarray .item_list,7298,1040,1098,7121;
  53. setarray .item_amount,1;
  54. set .item_size,getarraysize( .item_list );
  55.  
  56. // Zeny per Skill Points sold to NPC
  57. set .zeny_gain,1000;
  58. end;
  59. }
  60.  
  61. // main NPC used to duplicate other NPC.
  62. prontera,155,181,5 script Sample#1 757,{
  63. doevent "Sample::OnTalk";
  64. }
  65.  
  66. turbo_room,129,97,3 duplicate(Sample#1) Sample#2 834
  67. prontera,187,179,5 duplicate(Sample#1) Sample#3 834
Advertisement
Add Comment
Please, Sign In to add comment