diff --git a/common/tasks.h b/common/tasks.h index e88d0603d..612aca1f0 100644 --- a/common/tasks.h +++ b/common/tasks.h @@ -49,20 +49,6 @@ enum class TaskTimerType Request }; -// live alt currency types, may not match current server alternate currency ids -enum class AltCurrencyType -{ - RadiantCrystal = 4, - EbonCrystal = 5, - MarkOfValor = 31, - CommemorativeCoin = 33, - PieceOfEight = 37, - RemnantOfTranquility = 38, - SathirTradeGem = 41, - BathezidTradeGem = 43, - FroststoneDucat = 48, -}; - struct ActivityInformation { int req_activity_id; int step; @@ -216,7 +202,7 @@ struct TaskInformation { int faction_amount{}; // faction hit value TaskMethodType reward_method; int reward_points; - AltCurrencyType reward_point_type; + int32_t reward_point_type; int activity_count{}; uint8_t min_level{}; uint8_t max_level{}; diff --git a/zone/task_client_state.cpp b/zone/task_client_state.cpp index 039d582f2..339fc7e8b 100644 --- a/zone/task_client_state.cpp +++ b/zone/task_client_state.cpp @@ -15,6 +15,9 @@ #include "dynamic_zone.h" #include "string_ids.h" +#define EBON_CRYSTAL 40902 +#define RADIANT_CRYSTAL 40903 + extern WorldServer worldserver; extern QueryServ *QServ; @@ -1031,11 +1034,11 @@ void ClientTaskState::RewardTask(Client *c, const TaskInformation *ti, ClientTas c->CashReward(copper, silver, gold, platinum); } - int32 experience_reward = ti->experience_reward; + + auto experience_reward = ti->experience_reward; if (experience_reward > 0) { c->AddEXP(experience_reward); - } - if (experience_reward < 0) { + } else if (experience_reward < 0) { uint32 pos_reward = experience_reward * -1; // Minimal Level Based Exp reward Setting is 101 (1% exp at level 1) if (pos_reward > 100 && pos_reward < 25700) { @@ -1045,14 +1048,10 @@ void ClientTaskState::RewardTask(Client *c, const TaskInformation *ti, ClientTas } } - if (ti->reward_points > 0) - { - if (ti->reward_point_type == AltCurrencyType::RadiantCrystal) - { + if (ti->reward_points > 0) { + if (ti->reward_point_type == static_cast(zone->GetCurrencyID(RADIANT_CRYSTAL))) { c->AddCrystals(ti->reward_points, 0); - } - else if (ti->reward_point_type == AltCurrencyType::EbonCrystal) - { + } else if (ti->reward_point_type == static_cast(zone->GetCurrencyID(EBON_CRYSTAL))) { c->AddCrystals(0, ti->reward_points); } } diff --git a/zone/task_manager.cpp b/zone/task_manager.cpp index e7694ad79..932de46bb 100644 --- a/zone/task_manager.cpp +++ b/zone/task_manager.cpp @@ -79,7 +79,7 @@ bool TaskManager::LoadTasks(int single_task) ti.experience_reward = task.exp_reward; ti.reward_method = (TaskMethodType) task.reward_method; ti.reward_points = task.reward_points; - ti.reward_point_type = static_cast(task.reward_point_type); + ti.reward_point_type = task.reward_point_type; ti.faction_reward = task.faction_reward; ti.faction_amount = task.faction_amount; ti.min_level = task.min_level; @@ -1159,7 +1159,7 @@ void TaskManager::SendActiveTaskDescription( task_description_header->open_window = bring_up_task_journal; task_description_header->task_type = static_cast(t->type); - task_description_header->reward_type = static_cast(t->reward_point_type); + task_description_header->reward_type = t->reward_point_type; Ptr = (char *) task_description_header + sizeof(TaskDescriptionHeader_Struct);