Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.98 KB | None | 0 0
  1. local firstItems = {
  2.  
  3. ---------------------------------------
  4. -- Configure your vocations here.
  5. ---------------------------------------
  6. vocations = {
  7. [1] = "sorcerer",
  8. [2] = "druid",
  9. [3] = "paladin",
  10. [4] = "knight",
  11. },
  12. ---------------------------------------
  13. -- Sorcerer First Items
  14. ---------------------------------------
  15. ["sorcerer"] = {
  16. [1] = {type = "item", item = 2160, count = 1},
  17. [2] = {type = "experience", amount = 20000},
  18. [3] = {type = "outfit", name = "assassin", femaleId = 156, maleId = 152},
  19. [4] = {type = "addon", outfit = "nobleman", addonNumber = 1, femaleId = 140, maleId = 132},
  20. [5] = {type = "mount", mountName = "Orc", mountId = 20},
  21. [6] = {type = "money", amount = 1000},
  22. },
  23. ---------------------------------------
  24. -- Druid First Items
  25. ---------------------------------------
  26. ["druid"] = {
  27. [1] = {type = "item", item = 2160, count = 1},
  28. [2] = {type = "experience", amount = 20000},
  29. [3] = {type = "outfit", name = "assassin", femaleId = 156, maleId = 152},
  30. [4] = {type = "addon", outfit = "nobleman", addonNumber = 1, femaleId = 140, maleId = 132},
  31. [5] = {type = "mount", mountName = "Orc", mountId = 20},
  32. [6] = {type = "money", amount = 1000},
  33. },
  34. ---------------------------------------
  35. -- Paladin First Items
  36. ---------------------------------------
  37. ["paladin"] = {
  38. [1] = {type = "item", item = 2160, count = 1},
  39. [2] = {type = "experience", amount = 20000},
  40. [3] = {type = "outfit", name = "assassin", femaleId = 156, maleId = 152},
  41. [4] = {type = "addon", outfit = "nobleman", addonNumber = 1, femaleId = 140, maleId = 132},
  42. [5] = {type = "mount", mountName = "Orc", mountId = 20},
  43. [6] = {type = "money", amount = 1000},
  44. },
  45. ---------------------------------------
  46. -- Knight First Items
  47. ---------------------------------------
  48. ["knight"] = {
  49. [1] = {type = "item", item = 2160, count = 1},
  50. [2] = {type = "experience", amount = 20000},
  51. [3] = {type = "outfit", name = "assassin", femaleId = 156, maleId = 152},
  52. [4] = {type = "addon", outfit = "nobleman", addonNumber = 1, femaleId = 140, maleId = 132},
  53. [5] = {type = "mount", mountName = "Orc", mountId = 20},
  54. [6] = {type = "money", amount = 1000},
  55. },
  56.  
  57. ---------------------------------------
  58. -- End system config
  59. ---------------------------------------
  60. }
  61.  
  62. function onLogin(player)
  63. if player:getLastLoginSaved() == 0 then
  64. local playerVoc = firstItems.vocations[player:getVocation():getId()]
  65. local vocTable = firstItems[playerVoc]
  66.  
  67. for i = 1, #vocTable do
  68. local rewardType = vocTable[i].type
  69. -----------------------------------------------------------------------------------
  70. -- Item Type Reward --
  71. -----------------------------------------------------------------------------------
  72. if rewardType == "item" then
  73. local item = vocTable[i].item
  74. local count = vocTable[i].count
  75. player:addItem(item, count)
  76. player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You earned ["..count.."x] "..capAll(getItemName(item)))
  77. end
  78. -----------------------------------------------------------------------------------
  79. -- Experience Type Reward --
  80. -----------------------------------------------------------------------------------
  81. if rewardType == "experience" then
  82. local amount = vocTable[i].amount
  83. player:addExperience(amount)
  84. player:say(amount.." EXP gained!", TALKTYPE_MONSTER_SAY)
  85. player:getPosition():sendMagicEffect(CONST_ME_STUN)
  86. player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You gained "..amount.." experience points.")
  87. end
  88. -----------------------------------------------------------------------------------
  89. -- Outfit Type Reward --
  90. -----------------------------------------------------------------------------------
  91. if rewardType == "outfit" then
  92. local outfitName = vocTable[i].name
  93. local maleOutfit = vocTable[i].maleId
  94. local femaleOutfit = vocTable[i].femaleId
  95. if player:getSex() == 0 then
  96. player:addOutfit(femaleOutfit)
  97. else
  98. player:addOutfit(maleOutfit)
  99. end
  100. player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You gained the "..outfitName.." outfit.")
  101. end
  102. -----------------------------------------------------------------------------------
  103. -- Addon Type Reward --
  104. -----------------------------------------------------------------------------------
  105. if rewardType == "addon" then
  106. local outfitName = vocTable[i].outfit
  107. local addon = vocTable[i].addonNumber
  108. local maleAddon = vocTable[i].maleId
  109. local femaleAddon = vocTable[i].femaleId
  110. if player:getSex() == 0 then
  111. player:addOutfitAddon(femaleAddon, addon)
  112. else
  113. player:addOutfitAddon(maleAddon, addon)
  114. end
  115. if addon == 1 then
  116. player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You gained the first "..outfitName.." outfit addon.")
  117. elseif addon == 2 then
  118. player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You gained the second "..outfitName.." outfit addon.")
  119. elseif addon == 3 then
  120. player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You gained the third "..outfitName.." outfit addon.")
  121. end
  122. end
  123. -----------------------------------------------------------------------------------
  124. -- Mount Type Reward --
  125. -----------------------------------------------------------------------------------
  126. if rewardType == "mount" then
  127. local mountName = vocTable[i].mountName
  128. local mountId = vocTable[i].mountId
  129. player:addMount(mount)
  130. player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have unlocked the "..mountName.." mount.")
  131. end
  132. -----------------------------------------------------------------------------------
  133. -- Mount Type Reward --
  134. -----------------------------------------------------------------------------------
  135. if rewardType == "money" then
  136. local amount = vocTable[i].amount
  137. player:setBankBalance(player:getBankBalance() + amount)
  138. player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You are rewarded "..amount.."gp.")
  139. end
  140. end
  141.  
  142. return true
  143. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement