yuhsing

Untitled

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