Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local firstItems = {
- ---------------------------------------
- -- Configure your vocations here.
- ---------------------------------------
- vocations = {
- [1] = "sorcerer",
- [2] = "druid",
- [3] = "paladin",
- [4] = "knight",
- },
- ---------------------------------------
- -- Sorcerer First Items
- ---------------------------------------
- ["sorcerer"] = {
- [1] = {type = "item", item = 2160, count = 1},
- [2] = {type = "experience", amount = 20000},
- [3] = {type = "outfit", name = "assassin", femaleId = 156, maleId = 152},
- [4] = {type = "addon", outfit = "nobleman", addonNumber = 1, femaleId = 140, maleId = 132},
- [5] = {type = "mount", mountName = "Orc", mountId = 20},
- [6] = {type = "money", amount = 1000},
- },
- ---------------------------------------
- -- Druid First Items
- ---------------------------------------
- ["druid"] = {
- [1] = {type = "item", item = 2160, count = 1},
- [2] = {type = "experience", amount = 20000},
- [3] = {type = "outfit", name = "assassin", femaleId = 156, maleId = 152},
- [4] = {type = "addon", outfit = "nobleman", addonNumber = 1, femaleId = 140, maleId = 132},
- [5] = {type = "mount", mountName = "Orc", mountId = 20},
- [6] = {type = "money", amount = 1000},
- },
- ---------------------------------------
- -- Paladin First Items
- ---------------------------------------
- ["paladin"] = {
- [1] = {type = "item", item = 2160, count = 1},
- [2] = {type = "experience", amount = 20000},
- [3] = {type = "outfit", name = "assassin", femaleId = 156, maleId = 152},
- [4] = {type = "addon", outfit = "nobleman", addonNumber = 1, femaleId = 140, maleId = 132},
- [5] = {type = "mount", mountName = "Orc", mountId = 20},
- [6] = {type = "money", amount = 1000},
- },
- ---------------------------------------
- -- Knight First Items
- ---------------------------------------
- ["knight"] = {
- [1] = {type = "item", item = 2160, count = 1},
- [2] = {type = "experience", amount = 20000},
- [3] = {type = "outfit", name = "assassin", femaleId = 156, maleId = 152},
- [4] = {type = "addon", outfit = "nobleman", addonNumber = 1, femaleId = 140, maleId = 132},
- [5] = {type = "mount", mountName = "Orc", mountId = 20},
- [6] = {type = "money", amount = 1000},
- },
- ---------------------------------------
- -- End system config
- ---------------------------------------
- }
- function onLogin(player)
- if player:getLastLoginSaved() == 0 then
- local playerVoc = firstItems.vocations[player:getVocation():getId()]
- local vocTable = firstItems[playerVoc]
- for i = 1, #vocTable do
- local rewardType = vocTable[i].type
- -----------------------------------------------------------------------------------
- -- Item Type Reward --
- -----------------------------------------------------------------------------------
- if rewardType == "item" then
- local item = vocTable[i].item
- local count = vocTable[i].count
- player:addItem(item, count)
- player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You earned ["..count.."x] "..capAll(getItemName(item)))
- end
- -----------------------------------------------------------------------------------
- -- Experience Type Reward --
- -----------------------------------------------------------------------------------
- if rewardType == "experience" then
- local amount = vocTable[i].amount
- player:addExperience(amount)
- player:say(amount.." EXP gained!", TALKTYPE_MONSTER_SAY)
- player:getPosition():sendMagicEffect(CONST_ME_STUN)
- player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You gained "..amount.." experience points.")
- end
- -----------------------------------------------------------------------------------
- -- Outfit Type Reward --
- -----------------------------------------------------------------------------------
- if rewardType == "outfit" then
- local outfitName = vocTable[i].name
- local maleOutfit = vocTable[i].maleId
- local femaleOutfit = vocTable[i].femaleId
- if player:getSex() == 0 then
- player:addOutfit(femaleOutfit)
- else
- player:addOutfit(maleOutfit)
- end
- player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You gained the "..outfitName.." outfit.")
- end
- -----------------------------------------------------------------------------------
- -- Addon Type Reward --
- -----------------------------------------------------------------------------------
- if rewardType == "addon" then
- local outfitName = vocTable[i].outfit
- local addon = vocTable[i].addonNumber
- local maleAddon = vocTable[i].maleId
- local femaleAddon = vocTable[i].femaleId
- if player:getSex() == 0 then
- player:addOutfitAddon(femaleAddon, addon)
- else
- player:addOutfitAddon(maleAddon, addon)
- end
- if addon == 1 then
- player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You gained the first "..outfitName.." outfit addon.")
- elseif addon == 2 then
- player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You gained the second "..outfitName.." outfit addon.")
- elseif addon == 3 then
- player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You gained the third "..outfitName.." outfit addon.")
- end
- end
- -----------------------------------------------------------------------------------
- -- Mount Type Reward --
- -----------------------------------------------------------------------------------
- if rewardType == "mount" then
- local mountName = vocTable[i].mountName
- local mountId = vocTable[i].mountId
- player:addMount(mount)
- player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have unlocked the "..mountName.." mount.")
- end
- -----------------------------------------------------------------------------------
- -- Mount Type Reward --
- -----------------------------------------------------------------------------------
- if rewardType == "money" then
- local amount = vocTable[i].amount
- player:setBankBalance(player:getBankBalance() + amount)
- player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You are rewarded "..amount.."gp.")
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement