L
LordVissie
Guest
Lmfao.@whitevo tits or gtfo, don't be a twat.
Lmfao.@whitevo tits or gtfo, don't be a twat.
Just a misplacement of the second part
this
should be after thisCode: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
I didn't realize that last line there existed elsewhere, it's just not working because it's calling the code only for first login.Code: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)
@whitevo tits or gtfo, don't be a twat.
There is a reason for complaining and i did help with complain too.. Although maybe only few understood where i was pointing at..Really @whitevo if you're going to complain on people trying to help this person please make a better script yourself, right now you're not helping anyone at all just posting useless messages.
Ps. I do understand that this post is useless aswell
Regards Alw
--[[ config guide table
[STR] = { STR = vocationName in lower letters!
[STR] = INT STR = Param, INT = value for param
params: CONDITION_PARAM_STAT_MAGICPOINTS
CONDITION_PARAM_SKILL_DISTANCE
CONDITION_PARAM_SKILL_SHIELD
CONDITION_PARAM_SKILL_DISTANCE
CONDITION_PARAM_SKILL_FIST
CONDITION_PARAM_SKILL_CLUB
CONDITION_PARAM_SKILL_SWORD
CONDITION_PARAM_SKILL_AXE
]]
local SUBID = 300 --give your won sub id for attributes if 1 is in use already.
local config = {
["druid"] = {
CONDITION_PARAM_STAT_MAGICPOINTS = 3,
},
["paladin"] = {
CONDITION_PARAM_SKILL_DISTANCE = 4,
},
["knight"] = {
CONDITION_PARAM_SKILL_CLUB = 1,
CONDITION_PARAM_SKILL_SWORD = 1,
CONDITION_PARAM_SKILL_AXE = 1,
CONDITION_PARAM_SKILL_SHIELD = 2,
},
["mage"] = {
CONDITION_PARAM_STAT_MAGICPOINTS = 5,
},
}
-- "system" what you don't have to understand...
local boostConditions = {}
for vocation, boostT in pairs(config) do
boostConditions[vocation] = Condition(CONDITION_ATTRIBUTES, SUBID)
boostConditions[vocation]:setTicks(-1)
for param, v in pairs(boostT) do
boostConditions[vocation]:setParameter(_G[param], v)
end
end
--- ALL above goes OUTSIDE the functions
--- ALL below goes INSIDE the onLogin() function
local vocationNameLow = player:getVocation():getName():lower()
if config[vocationNameLow] then player:addCondition(boostConditions[vocationNameLow]) end
There is a reason for complaining and i did help with complain too.. Although maybe only few understood where i was pointing at..
So fine here is what I would do if someone asked me this script..
Code:--[[ config guide table [STR] = { STR = vocationName in lower letters! [STR] = INT STR = Param, INT = value for param params: CONDITION_PARAM_STAT_MAGICPOINTS CONDITION_PARAM_SKILL_DISTANCE CONDITION_PARAM_SKILL_SHIELD CONDITION_PARAM_SKILL_DISTANCE CONDITION_PARAM_SKILL_FIST CONDITION_PARAM_SKILL_CLUB CONDITION_PARAM_SKILL_SWORD CONDITION_PARAM_SKILL_AXE ]] local SUBID = 300 --give your won sub id for attributes if 1 is in use already. local config = { ["druid"] = { CONDITION_PARAM_STAT_MAGICPOINTS = 3, }, ["paladin"] = { CONDITION_PARAM_SKILL_DISTANCE = 4, }, ["knight"] = { CONDITION_PARAM_SKILL_CLUB = 1, CONDITION_PARAM_SKILL_SWORD = 1, CONDITION_PARAM_SKILL_AXE = 1, CONDITION_PARAM_SKILL_SHIELD = 2, }, ["mage"] = { CONDITION_PARAM_STAT_MAGICPOINTS = 5, }, } -- "system" what you don't have to understand... local boostConditions = {} for vocation, boostT in pairs(config) do boostConditions[vocation] = Condition(CONDITION_ATTRIBUTES, SUBID) boostConditions[vocation]:setTicks(-1) for param, v in pairs(boostT) do boostConditions[vocation]:setParameter(_G[param], v) end end --- ALL above goes OUTSIDE the functions --- ALL below goes INSIDE the onLogin() function local vocationNameLow = player:getVocation():getName():lower() if config[vocationNameLow] then player:addCondition(boostConditions[vocationNameLow]) end
local SUBID = 300 --give your won sub id for attributes if 1 is in use already.
local config = {
["druid"] = {
CONDITION_PARAM_STAT_MAGICPOINTS = 3,
},
["paladin"] = {
CONDITION_PARAM_SKILL_DISTANCE = 4,
},
["knight"] = {
CONDITION_PARAM_SKILL_CLUB = 1,
CONDITION_PARAM_SKILL_SWORD = 1,
CONDITION_PARAM_SKILL_AXE = 1,
CONDITION_PARAM_SKILL_SHIELD = 2,
},
["mage"] = {
CONDITION_PARAM_STAT_MAGICPOINTS = 5,
},
}
-- "system" what you don't have to understand...
local boostConditions = {}
for vocation, boostT in pairs(config) do
boostConditions[vocation] = Condition(CONDITION_ATTRIBUTES, SUBID)
boostConditions[vocation]:setTicks(-1)
for param, v in pairs(boostT) do
boostConditions[vocation]:setParameter(_G[param], v)
end
end
Uprint(boostConditions)
--- ALL above goes OUTSIDE the functions
--- ALL below goes INSIDE the onLogin() function
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
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)
local vocationNameLow = player:getVocation():getName():lower()
if config[vocationNameLow] then player:addCondition(boostConditions[vocationNameLow]) end
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
any errors?
for i = 1, #b do
for i = 1, #b.bonus do
CONDITION_PARAM_OWNER
CONDITION_PARAM_TICKS
CONDITION_PARAM_HEALTHGAIN
CONDITION_PARAM_HEALTHTICKS
CONDITION_PARAM_MANAGAIN
CONDITION_PARAM_MANATICKS
CONDITION_PARAM_DELAYED
CONDITION_PARAM_SPEED
CONDITION_PARAM_LIGHT_LEVEL
CONDITION_PARAM_LIGHT_COLOR
CONDITION_PARAM_SOULGAIN
CONDITION_PARAM_SOULTICKS
CONDITION_PARAM_MINVALUE
CONDITION_PARAM_MAXVALUE
CONDITION_PARAM_STARTVALUE
CONDITION_PARAM_TICKINTERVAL
CONDITION_PARAM_FORCEUPDATE
CONDITION_PARAM_SKILL_MELEE
CONDITION_PARAM_SKILL_FIST
CONDITION_PARAM_SKILL_CLUB
CONDITION_PARAM_SKILL_SWORD
CONDITION_PARAM_SKILL_AXE
CONDITION_PARAM_SKILL_DISTANCE
CONDITION_PARAM_SKILL_SHIELD
CONDITION_PARAM_SKILL_FISHING
CONDITION_PARAM_STAT_MAXHITPOINTS
CONDITION_PARAM_STAT_MAXMANAPOINTS
CONDITION_PARAM_STAT_SOULPOINTS
CONDITION_PARAM_STAT_MAGICPOINTS
CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT
CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT
CONDITION_PARAM_STAT_SOULPOINTSPERCENT
CONDITION_PARAM_STAT_MAGICPOINTSPERCENT
CONDITION_PARAM_PERIODICDAMAGE
CONDITION_PARAM_SKILL_MELEEPERCENT
CONDITION_PARAM_SKILL_FISTPERCENT
CONDITION_PARAM_SKILL_CLUBPERCENT
CONDITION_PARAM_SKILL_SWORDPERCENT
CONDITION_PARAM_SKILL_AXEPERCENT
CONDITION_PARAM_SKILL_DISTANCEPERCENT
CONDITION_PARAM_SKILL_SHIELDPERCENT
CONDITION_PARAM_SKILL_FISHINGPERCENT
CONDITION_PARAM_BUFF_SPELL
CONDITION_PARAM_SUBID
CONDITION_PARAM_FIELD
condition:setParameter(CONDITION_PARAM_SUBID, 200)
condition:setParameter(CONDITION_PARAM_SUBID, 200 + i)
Ah, right. subid conflict :3
quickest fix would be changing
toCode:condition:setParameter(CONDITION_PARAM_SUBID, 200)
Code:condition:setParameter(CONDITION_PARAM_SUBID, 200 + i)
Just pay it forwardOhh.. I'll see what happends..
Thank you so much everyone!
This is been so helpful, not only for the script, i also learn some scripting things!
I hope someday i be able to payback all your help![]()
Oh, also, in regards to haste, it's still haste even if it's an infinite condition, so it'll be overwritten by paralyze and I don't think it would re-engage until after relogging, so I wouldn't recommend using it for this type of thing.Ohh.. I'll see what happends..
Thank you so much everyone!
This is been so helpful, not only for the script, i also learn some scripting things!
I hope someday i be able to payback all your help![]()
Oh, also, in regards to haste, it's still haste even if it's an infinite condition, so it'll be overwritten by paralyze and I don't think it would re-engage until after relogging, so I wouldn't recommend using it for this type of thing.