Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. -- Square Skill Trainer made by Arthur aka artofwork
  2. -- This script will train all of a players skills indefintely
  3. -- It has a small configuration setup where you can set the number of tries per skill
  4. -- The time internveral in between each skill try added
  5. -- A storage value to help prevent abuse
  6. -- This is truely my first script, it comes without support since lua is new to me
  7. -- You can assign any tile you wish to this script that a player can walk on with action id 900
  8.  
  9.  
  10. -- Config --
  11. local storage = 18010 -- Storage value for the player when he steps on and off the tile
  12.  
  13. local skilltries = 1 -- Number of tries per skill
  14. local t = 4 * 1000 -- Set the time before try is added to skills
  15.  
  16.  
  17. -------------------------------------------------------------------------
  18. function trainerthree(p)
  19. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  20. if p.item.actionid == 900 then
  21. doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 30 seconds")
  22. addEvent(trainertwo, 10 * 1000, p)
  23. end
  24. end
  25. return FALSE
  26. end
  27. function trainertwo(p)
  28. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  29. if p.item.actionid == 900 then
  30. doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 20 seconds")
  31. addEvent(trainerone, 10 * 1000, p)
  32. end
  33. end
  34. return FALSE
  35. end
  36. function trainerone(p)
  37. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  38. if p.item.actionid == 900 then
  39. doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 10 seconds")
  40. addEvent(readyToTrain, 10 * 1000, p)
  41. end
  42. end
  43. return FALSE
  44. end
  45.  
  46.  
  47.  
  48. function readyToTrain(p)
  49. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  50. if p.item.actionid == 900 then
  51. doPlayerSendTextMessage(p.cid,22,"Your training session will now begin")
  52. addEvent(trainMeA, t, p)
  53. end
  54. end
  55. return FALSE
  56. end
  57.  
  58.  
  59. function trainMeA(p)
  60. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  61. if p.item.actionid == 900 then
  62.  
  63. for a = 1, t do
  64. if(a == t) then
  65. doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
  66. doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
  67. doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
  68. doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
  69. doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
  70. doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)
  71. end
  72. end
  73. end
  74. addEvent(trainMeB, t, p)
  75. end
  76. return FALSE
  77. end
  78.  
  79. function trainMeB(p)
  80. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  81. if p.item.actionid == 900 then
  82. for b = 1, t do
  83. if(b == t) then
  84. doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
  85. doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
  86. doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
  87. doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
  88. doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
  89. doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)
  90.  
  91. doCreatureAddMana(p.cid, 500)
  92. local n = getCreatureMana(p.cid)
  93. if n == getCreatureMaxMana(p.cid) then
  94. doCreatureAddMana(p.cid, -n)
  95. doPlayerAddSpentMana(p.cid, n)
  96. doSendMagicEffect(getThingPosition(p.cid), CONST_ME_MAGIC_BLUE)
  97. doCreatureSay(p.cid, 'Mana Burn', TALKTYPE_MONSTER)
  98. end
  99.  
  100. end
  101. end
  102. end
  103. addEvent(trainMeA, t, p)
  104. end
  105. return FALSE
  106. end
  107.  
  108.  
  109.  
  110. function onStepIn(cid, item)
  111. local p = {cid = cid, item = item, pos = pos}
  112. setPlayerStorageValue(p.cid, 18010, 1)
  113. if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
  114. if p.item.actionid == 900 then
  115. addEvent(trainerthree, 1 * 1000, p)
  116. end
  117. end
  118. return FALSE
  119. end
  120.  
  121.  
  122. function onStepOut(cid, item)
  123. getPlayerStorageValue(cid, 18010)
  124. setPlayerStorageValue(cid, 18010, 0)
  125. doPlayerSendTextMessage(cid,22,"Your training session has now ended")
  126. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement