Skip to content

Commit

Permalink
fix: transcendence not apply correct status
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipePaluco committed Apr 21, 2024
1 parent 955fdde commit 5c800f0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6688,7 +6688,7 @@ void Player::triggerTranscendance() {
outfit.lookType = getVocation()->getAvatarLookType();
outfitCondition->setOutfit(outfit);
addCondition(outfitCondition);
wheel()->setOnThinkTimer(WheelOnThink_t::AVATAR, OTSYS_TIME() + duration);
wheel()->setOnThinkTimer(WheelOnThink_t::AVATAR_FORGE, OTSYS_TIME() + duration);
g_game().addMagicEffect(getPosition(), CONST_ME_AVATAR_APPEAR);
sendTextMessage(MESSAGE_ATTENTION, "Transcendance was triggered.");
sendSkills();
Expand Down
24 changes: 14 additions & 10 deletions src/creatures/players/wheel/player_wheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2410,21 +2410,25 @@ int32_t PlayerWheel::checkBattleHealingAmount() const {
}

int32_t PlayerWheel::checkAvatarSkill(WheelAvatarSkill_t skill) const {
if (skill == WheelAvatarSkill_t::NONE || getOnThinkTimer(WheelOnThink_t::AVATAR) <= OTSYS_TIME()) {
if (skill == WheelAvatarSkill_t::NONE || (getOnThinkTimer(WheelOnThink_t::AVATAR_SPELL) <= OTSYS_TIME() && getOnThinkTimer(WheelOnThink_t::AVATAR_FORGE) <= OTSYS_TIME())) {
return 0;
}

uint8_t stage = 0;
if (getInstant("Avatar of Light")) {
stage = getStage(WheelStage_t::AVATAR_OF_LIGHT);
} else if (getInstant("Avatar of Steel")) {
stage = getStage(WheelStage_t::AVATAR_OF_STEEL);
} else if (getInstant("Avatar of Nature")) {
stage = getStage(WheelStage_t::AVATAR_OF_NATURE);
} else if (getInstant("Avatar of Storm")) {
stage = getStage(WheelStage_t::AVATAR_OF_STORM);
if (getOnThinkTimer(WheelOnThink_t::AVATAR_SPELL) > OTSYS_TIME()) {
if (getInstant("Avatar of Light")) {
stage = getStage(WheelStage_t::AVATAR_OF_LIGHT);
} else if (getInstant("Avatar of Steel")) {
stage = getStage(WheelStage_t::AVATAR_OF_STEEL);
} else if (getInstant("Avatar of Nature")) {
stage = getStage(WheelStage_t::AVATAR_OF_NATURE);
} else if (getInstant("Avatar of Storm")) {
stage = getStage(WheelStage_t::AVATAR_OF_STORM);
} else {
return 0;
}
} else {
return 0;
stage = 3;
}

if (skill == WheelAvatarSkill_t::DAMAGE_REDUCTION) {
Expand Down
5 changes: 3 additions & 2 deletions src/creatures/players/wheel/wheel_definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ enum class WheelOnThink_t : uint8_t {
FOCUS_MASTERY = 4,
GIFT_OF_LIFE = 5,
DIVINE_EMPOWERMENT = 6,
AVATAR = 7,
AVATAR_SPELL = 7,
AVATAR_FORGE = 8,

TOTAL_COUNT = 8
TOTAL_COUNT = 9
};

enum class WheelStat_t : uint8_t {
Expand Down
4 changes: 2 additions & 2 deletions src/lua/functions/creatures/player/player_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3997,9 +3997,9 @@ int PlayerFunctions::luaPlayerAvatarTimer(lua_State* L) {
}

if (lua_gettop(L) == 1) {
lua_pushnumber(L, (lua_Number)player->wheel()->getOnThinkTimer(WheelOnThink_t::AVATAR));
lua_pushnumber(L, (lua_Number)player->wheel()->getOnThinkTimer(WheelOnThink_t::AVATAR_SPELL));
} else {
player->wheel()->setOnThinkTimer(WheelOnThink_t::AVATAR, getNumber<int64_t>(L, 2));
player->wheel()->setOnThinkTimer(WheelOnThink_t::AVATAR_SPELL, getNumber<int64_t>(L, 2));
pushBoolean(L, true);
}
return 1;
Expand Down

0 comments on commit 5c800f0

Please sign in to comment.