-
-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This works directly with: opentibiabr/otservbr-global#471
- Loading branch information
Showing
34 changed files
with
586 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ Storage = { | |
} | ||
|
||
GlobalStorage = { | ||
XpDisplayMode = 65006, | ||
ExampleQuest = { | ||
Example = 60000 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
local config = { | ||
heal = true, | ||
save = true, | ||
effect = false | ||
} | ||
|
||
local advanceSave = CreatureEvent("AdvanceSave") | ||
|
||
function advanceSave.onAdvance(player, skill, oldLevel, newLevel) | ||
if skill ~= SKILL_LEVEL or newLevel <= oldLevel then | ||
return true | ||
end | ||
|
||
if config.effect then | ||
player:getPosition():sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE)) | ||
player:say('LEVEL UP!', TALKTYPE_MONSTER_SAY) | ||
end | ||
|
||
if config.heal then | ||
player:addHealth(player:getMaxHealth()) | ||
end | ||
|
||
if config.save then | ||
player:save() | ||
end | ||
|
||
if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then | ||
local baseRate = getRateFromTable(experienceStages, player:getLevel(), configManager.getNumber(configKeys.RATE_EXPERIENCE)) | ||
-- Event scheduler | ||
if SCHEDULE_EXP_RATE ~= 100 then | ||
baseRate = math.max(0, (baseRate * SCHEDULE_EXP_RATE)/100) | ||
end | ||
player:setBaseXpGain(baseRate * 100) | ||
end | ||
|
||
return true | ||
end | ||
|
||
advanceSave:register() |
Oops, something went wrong.