ralke
(҂ ͠❛ ෴ ͡❛)ᕤ
Hi again! I need to ask the following script for 1.4 (8.6 nekiro). I have a working dodge/critical script, and based on this, @Xikini already helped me to do a script that increases critical and dodge skill by making quests here Lua - Register 100 chests with different storage for the same reward. (https://otland.net/threads/register-100-chests-with-different-storage-for-the-same-reward.275784/#post-2654544)
I would like to have the same thing, with onAdvance event. I'll post the script that Xikini made here so you don't have to switch from threads:
In summary, I need that this get triggered by onAdvance (with dodge too):
With this I also would like to:
a) Increase +1 critical level on level 10, another on level 20, on level 30, and so on.
b) Increase +1 dodge level on level 10, another on level 20, on level 30, and so on.
c) Have onLogin function to automatically fix the critical/dodge level according to player level.
d) Subtract critical/dodge level if the player dies and downgrade his level (---so that the player has the crit / dodge that corresponds to his level, in case the player, for example, downgrade from level 30 to level 29 or from level 40 to 39, etc.).
e) Send onLogin message event if the criti/dodge level has been reduced because of dying (when player logs in after dead).
f) Send onAdvance message event when player level up and raise his crit/dodge skill (on level 10, 20, 30, etc).
For the moment, this are all the situations I can imagine where a player can take advantage of a bug, I think the idea is understood, player must always have the corresponding critical/dodge level based on it's level. For example, if he's level 300, he will have +30 dodge/critical, if he's 240, will have +24 dodge/crit, and so on.
In advance, thanks so much for reading. Hope someone can help me doing this ^^
Regards!
I would like to have the same thing, with onAdvance event. I'll post the script that Xikini made here so you don't have to switch from threads:
Lua:
local chests = {
[27101] = "critical", -- [uniqueId] = "type"
[27102] = "critical",
[27103] = "critical",
[27104] = "dodge",
[27105] = "dodge",
[27106] = "dodge"
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local uniqueId = item:getUniqueId()
local chestSelected = chests[uniqueId]
if chestSelected then
if player:getStorageValue(uniqueId) ~= -1 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE,"The chest is empty!")
return true
end
-- critical
if chestSelected == "critical" then
if player:getCriticalLevel() >= CRITICAL.LEVEL_MAX then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Unable to use chest. You have already reached the maximum critical skill.")
return false
end
local newCriticalLevel = player:getCriticalLevel() + 1
player:setCriticalLevel(newCriticalLevel)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have increased your critical skill to [" .. newCriticalLevel .. "/" .. CRITICAL.LEVEL_MAX .. "].")
player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
-- dodge
elseif chestSelected == "dodge" then
if player:getDodgeLevel() >= DODGE.LEVEL_MAX then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Unable to use chest. You have already reached the maximum dodge skill.")
return false
end
local newDodgeLevel = player:getDodgeLevel() + 1
player:setDodgeLevel(newDodgeLevel)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have increased your dodge skill to [" .. newDodgeLevel .. "/" .. DODGE.LEVEL_MAX .. "].")
player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
-- give dodge stuff..
else
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Error in table. Please contact gamemaster.") -- dodge or critical is mispelled in your table.
return true
end
-- gives chest storage, so can't be used again
player:setStorageValue(uniqueId, 1)
end
return true
end
In summary, I need that this get triggered by onAdvance (with dodge too):
Lua:
local newCriticalLevel = player:getCriticalLevel() + 1
player:setCriticalLevel(newCriticalLevel)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have increased your critical skill to [" .. newCriticalLevel .. "/" .. CRITICAL.LEVEL_MAX .. "].")
player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
With this I also would like to:
a) Increase +1 critical level on level 10, another on level 20, on level 30, and so on.
b) Increase +1 dodge level on level 10, another on level 20, on level 30, and so on.
c) Have onLogin function to automatically fix the critical/dodge level according to player level.
d) Subtract critical/dodge level if the player dies and downgrade his level (---so that the player has the crit / dodge that corresponds to his level, in case the player, for example, downgrade from level 30 to level 29 or from level 40 to 39, etc.).
e) Send onLogin message event if the criti/dodge level has been reduced because of dying (when player logs in after dead).
f) Send onAdvance message event when player level up and raise his crit/dodge skill (on level 10, 20, 30, etc).
For the moment, this are all the situations I can imagine where a player can take advantage of a bug, I think the idea is understood, player must always have the corresponding critical/dodge level based on it's level. For example, if he's level 300, he will have +30 dodge/critical, if he's 240, will have +24 dodge/crit, and so on.
In advance, thanks so much for reading. Hope someone can help me doing this ^^
Regards!
Last edited: