What creaturescript are you wanting? Pm me the details and tfs version
You don't need to pay anyone anything, just go to resources > requests and ask for someone to make the script for you in there.. people do it all the time.
Is this a permanent gain or just a boost while online? Do they gain it again each login or does it only happen on first login?
local bonuses = {
[1] = {bonus = {CONDITION_PARAM_STAT_MAGICPOINTS}, value = {1}}, -- sorcerer
[2] = {bonus = {CONDITION_PARAM_STAT_MAGICPOINTS}, value = {1}}, -- druid
[3] = {bonus = {CONDITION_PARAM_SKILL_DISTANCE}, value = {1}}, -- paladin
[4] = {bonus = {CONDITION_PARAM_SKILL_MELEE}, value = {10}}, -- knight
[5] = {bonus = {CONDITION_PARAM_SKILL_SHIELD}, value = {20}}, -- master sorcerer
[6] = {bonus = {CONDITION_PARAM_SKILL_SHIELD}, value = {20}}, -- elder druid
[7] = {bonus = {CONDITION_PARAM_SKILL_DISTANCE}, value = {2}}, -- royal paladin
[8] = {bonus = {CONDITION_PARAM_SKILL_MELEE, CONDITION_PARAM_SKILL_SHIELD}, value = {2, 2}}, -- elite knight
}
local b = bonuses[player:getVocation():getId()]
for i = 1, #b do
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(b.bonus[i], b.value[i])
condition:setParameter(CONDITION_PARAM_TICKS, -1)
condition:setParameter(CONDITION_PARAM_SUBID, 200)
player:addCondition(condition)
end
Sooo, perhaps something like this:
put this section at the top of login.lua, above the function declaration:
add this within login.lua, below the first login section (after player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr))Code:local bonuses = { [1] = {bonus = {CONDITION_PARAM_STAT_MAGICPOINTS}, value = {1}}, -- sorcerer [2] = {bonus = {CONDITION_PARAM_STAT_MAGICPOINTS}, value = {1}}, -- druid [3] = {bonus = {CONDITION_PARAM_SKILL_DISTANCE}, value = {1}}, -- paladin [4] = {bonus = {CONDITION_PARAM_SKILL_MELEE}, value = {10}}, -- knight [5] = {bonus = {CONDITION_PARAM_SKILL_SHIELD}, value = {20}}, -- master sorcerer [6] = {bonus = {CONDITION_PARAM_SKILL_SHIELD}, value = {20}}, -- elder druid [7] = {bonus = {CONDITION_PARAM_SKILL_DISTANCE}, value = {2}}, -- royal paladin [8] = {bonus = {CONDITION_PARAM_SKILL_MELEE, CONDITION_PARAM_SKILL_SHIELD}, value = {2, 2}}, -- elite knight }
I believe this should work, but I didn't test itCode:local b = bonuses[player:getVocation():getId()] for i = 1, #b do local condition = Condition(CONDITION_ATTRIBUTES) condition:setParameter(b.bonus[i], b.value[i]) condition:setParameter(CONDITION_PARAM_TICKS, -1) condition:setParameter(CONDITION_PARAM_SUBID, 200) player:addCondition(condition) end![]()
wth is that? >.>Sooo, perhaps something like this:
put this section at the top of login.lua, above the function declaration:
add this within login.lua, below the first login section (after player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr))Code:local bonuses = { [1] = {bonus = {CONDITION_PARAM_STAT_MAGICPOINTS}, value = {1}}, -- sorcerer [2] = {bonus = {CONDITION_PARAM_STAT_MAGICPOINTS}, value = {1}}, -- druid [3] = {bonus = {CONDITION_PARAM_SKILL_DISTANCE}, value = {1}}, -- paladin [4] = {bonus = {CONDITION_PARAM_SKILL_MELEE}, value = {10}}, -- knight [5] = {bonus = {CONDITION_PARAM_SKILL_SHIELD}, value = {20}}, -- master sorcerer [6] = {bonus = {CONDITION_PARAM_SKILL_SHIELD}, value = {20}}, -- elder druid [7] = {bonus = {CONDITION_PARAM_SKILL_DISTANCE}, value = {2}}, -- royal paladin [8] = {bonus = {CONDITION_PARAM_SKILL_MELEE, CONDITION_PARAM_SKILL_SHIELD}, value = {2, 2}}, -- elite knight }
I believe this should work, but I didn't test itCode:local b = bonuses[player:getVocation():getId()] for i = 1, #b do local condition = Condition(CONDITION_ATTRIBUTES) condition:setParameter(b.bonus[i], b.value[i]) condition:setParameter(CONDITION_PARAM_TICKS, -1) condition:setParameter(CONDITION_PARAM_SUBID, 200) player:addCondition(condition) end![]()
Post the error(s) if you had some.
probably either nil on player or error on creating condition inside a function.Post the error(s) if you had some.
Post the error(s) if you had some.
local bonuses = {
[1] = {bonus = {CONDITION_PARAM_STAT_MAGICPOINTS}, value = {1}}, -- sorcerer
[2] = {bonus = {CONDITION_PARAM_STAT_MAGICPOINTS}, value = {1}}, -- druid
[3] = {bonus = {CONDITION_PARAM_SKILL_DISTANCE}, value = {1}}, -- paladin
[4] = {bonus = {CONDITION_PARAM_SKILL_MELEE}, value = {10}}, -- knight
[5] = {bonus = {CONDITION_PARAM_SKILL_SHIELD}, value = {20}}, -- master sorcerer
[6] = {bonus = {CONDITION_PARAM_SKILL_SHIELD}, value = {20}}, -- elder druid
[7] = {bonus = {CONDITION_PARAM_SKILL_DISTANCE}, value = {2}}, -- royal paladin
[8] = {bonus = {CONDITION_PARAM_SKILL_MELEE, CONDITION_PARAM_SKILL_SHIELD}, value = {2, 2}}, -- elite knight
}
function onLogin(player)
-- Free bless
freeBless = {
level = 200,
blesses = {1, 2, 3, 4, 5}
}
local loginStr = "Welcome to " .. configManager.getString(configKeys.SERVER_NAME) .. "!"
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. " Please choose your outfit."
player:sendOutfitWindow()
else
if loginStr ~= "" then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
end
local b = bonuses[player:getVocation():getId()]
for i = 1, #b do
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(b.bonus[i], b.value[i])
condition:setParameter(CONDITION_PARAM_TICKS, -1)
condition:setParameter(CONDITION_PARAM_SUBID, 200)
player:addCondition(condition)
end
loginStr = string.format("Your last visit was on %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
end
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
if player:getLevel() <= freeBless.level then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received the free blessings available untill level 200.")
for i=1,#freeBless.blesses do
player:addBlessing(freeBless.blesses[i])
end
end
-- Stamina
nextUseStaminaTime[player.uid] = 0
-- Promotion
local vocation = player:getVocation()
local promotion = vocation:getPromotion()
if player:isPremium() then
local value = player:getStorageValue(STORAGEVALUE_PROMOTION)
if not promotion and value ~= 1 then
player:setStorageValue(STORAGEVALUE_PROMOTION, 1)
elseif value == 1 then
player:setVocation(promotion)
end
elseif not promotion then
player:setVocation(vocation:getDemotion())
end
-- Events
player:registerEvent("PlayerDeath")
player:registerEvent("DropLoot")
return true
end
local b = bonuses[player:getVocation():getId()]
for i = 1, #b do
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(b.bonus[i], b.value[i])
condition:setParameter(CONDITION_PARAM_TICKS, -1)
condition:setParameter(CONDITION_PARAM_SUBID, 200)
player:addCondition(condition)
end
loginStr = string.format("Your last visit was on %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
end
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)