diff --git a/app/Game/Battle/Handlers/BattleEventHandler.php b/app/Game/Battle/Handlers/BattleEventHandler.php index aa206c1de..5f68b4633 100755 --- a/app/Game/Battle/Handlers/BattleEventHandler.php +++ b/app/Game/Battle/Handlers/BattleEventHandler.php @@ -50,11 +50,12 @@ public function processDeadCharacter(Character $character, ?Monster $monster = n * @param integer $characterId * @param integer $monsterId * @param boolean $includeXp + * @param boolean $includeEventReward * @return void */ - public function processMonsterDeath(int $characterId, int $monsterId, bool $includeXp = true): void + public function processMonsterDeath(int $characterId, int $monsterId, bool $includeXp = true, $includeEventReward = true): void { - $this->battleRewardService->setUp($characterId, $monsterId)->handleBaseRewards($includeXp); + $this->battleRewardService->setUp($characterId, $monsterId)->handleBaseRewards($includeXp, $includeEventReward); } /** diff --git a/app/Game/BattleRewardProcessing/Services/BattleRewardService.php b/app/Game/BattleRewardProcessing/Services/BattleRewardService.php index 829990c70..c8d7698ca 100644 --- a/app/Game/BattleRewardProcessing/Services/BattleRewardService.php +++ b/app/Game/BattleRewardProcessing/Services/BattleRewardService.php @@ -41,13 +41,17 @@ public function setUp(int $characterId, int $monsterId): BattleRewardService return $this; } - public function handleBaseRewards($includeXp = true) + public function handleBaseRewards($includeXp = true, $includeEventRewards = true) { if ($includeXp) { BattleXpHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_xp')->delay(now()->addSeconds(2)); } + if ($includeEventRewards) { + WinterEventChristmasGiftHandler::dispatch($this->characterId)->onQueue('event_battle_reward')->delay(now()->addSeconds(2)); + } + BattleSecondaryRewardHandler::dispatch($this->characterId)->onQueue('battle_secondary_reward')->delay(now()->addSeconds(2)); BattleCurrenciesHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_currencies')->delay(now()->addSeconds(2)); BattleFactionHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_factions')->delay(now()->addSeconds(2)); @@ -55,8 +59,5 @@ public function handleBaseRewards($includeXp = true) BattleLocationHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_location_handlers')->delay(now()->addSeconds(2)); BattleWeeklyFightHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_weekly_fights')->delay(now()->addSeconds(2)); BattleItemHandler::dispatch($this->characterId, $this->monsterId)->onQueue('battle_reward_item_handler')->delay(now()->addSeconds(2)); - - // For special Events: - WinterEventChristmasGiftHandler::dispatch($this->characterId)->onQueue('event_battle_reward')->delay(now()->addSeconds(2)); } } diff --git a/app/Game/Core/Handlers/AnnouncementHandler.php b/app/Game/Core/Handlers/AnnouncementHandler.php index 5299f32b2..9b007f36c 100755 --- a/app/Game/Core/Handlers/AnnouncementHandler.php +++ b/app/Game/Core/Handlers/AnnouncementHandler.php @@ -90,7 +90,7 @@ private function buildTheGoldMinesMessage(): void } $message = 'From now until: ' . $event->ends_at->format('l, j \of F \a\t h:ia \G\M\TP') . ' ' . - 'Players who are in The Gold Mines will have double chance to get MEDIUM uniques gear. ' . + 'Players who are in The Gold Mines will have double chance to get unique gear. ' . 'Players will also get 2x the amount of Gold Dust, Shards and Gold from critters.'; $announcement = Announcement::create([ @@ -111,7 +111,7 @@ private function buildTheOldChurchMessage(): void } $message = 'From now until: ' . $event->ends_at->format('l, j \of F \a\t h:ia \G\M\TP') . ' ' . - 'Players who are in The Old Church will have double chance to get MEDIUM uniques Corrupted Ice gear. ' . + 'Players who are in The Old Church will have double chance to get a unique Corrupted Ice gear. ' . 'Players will also get 2x the amount of Gold Dust, Shards and Gold from critters.'; $announcement = Announcement::create([ diff --git a/app/Game/Exploration/Jobs/Exploration.php b/app/Game/Exploration/Jobs/Exploration.php index e804d5747..8d2dbff36 100755 --- a/app/Game/Exploration/Jobs/Exploration.php +++ b/app/Game/Exploration/Jobs/Exploration.php @@ -16,6 +16,7 @@ use App\Flare\Values\MaxCurrenciesValue; use App\Game\Battle\Events\UpdateCharacterStatus; use App\Game\Battle\Handlers\BattleEventHandler; +use App\Game\BattleRewardProcessing\Jobs\Events\WinterEventChristmasGiftHandler; use App\Game\BattleRewardProcessing\Jobs\ExplorationSkillXpHandler; use App\Game\BattleRewardProcessing\Jobs\ExplorationXpHandler; use App\Game\Character\Builders\AttackBuilders\CharacterCacheData; @@ -136,7 +137,7 @@ private function encounter(MonsterPlayerFight $response, CharacterAutomation $au $characterSkillService = $this->skillService->setSkillInTraining($this->character); for ($i = 1; $i <= $enemies; $i++) { - $battleEventHandler->processMonsterDeath($this->character->id, $params['selected_monster_id'], false); + $battleEventHandler->processMonsterDeath($this->character->id, $params['selected_monster_id'], false, false); $totalXpToReward += $characterRewardService->fetchXpForMonster($monster); $totalSkillXpToReward += $characterSkillService->getXpForSkillIntraining($this->character, $monster->xp); @@ -144,6 +145,7 @@ private function encounter(MonsterPlayerFight $response, CharacterAutomation $au ExplorationXpHandler::dispatch($this->character->id, $enemies, $totalXpToReward)->onQueue('exploration_battle_xp_reward')->delay(now()->addSeconds(2)); ExplorationSkillXpHandler::dispatch($this->character->id, $totalSkillXpToReward)->onQueue('exploration_battle_skill_xp_reward')->delay(now()->addSeconds(2)); + WinterEventChristmasGiftHandler::dispatch($this->character->id)->onQueue('event_battle_reward')->delay(now()->addSeconds(2)); $this->sendOutEventLogUpdate('The last of the enemies fall. Covered in blood, exhausted, you look around for any signs of more of their friends. The area is silent. "Another day, another battle. We managed to survive." The Guide states as he walks from the shadows. The pair of you set off in search of the next adventure ... @@ -182,6 +184,7 @@ private function canSurviveFight(MonsterPlayerFight $response, CharacterAutomati ExplorationXpHandler::dispatch($this->character->id, 10, $totalXpToReward)->onQueue('exploration_battle_xp_reward')->delay(now()->addSeconds(2)); ExplorationSkillXpHandler::dispatch($this->character->id, $totalSkillXpToReward)->onQueue('exploration_battle_skill_xp_reward')->delay(now()->addSeconds(2)); + WinterEventChristmasGiftHandler::dispatch($this->character->id)->onQueue('event_battle_reward')->delay(now()->addSeconds(2)); Cache::put('can-character-survive-' . $this->character->id, true); @@ -208,7 +211,7 @@ private function fightAutomationMonster(MonsterPlayerFight $response, CharacterA $response->resetBattleMessages(); - $battleEventHandler->processMonsterDeath($this->character->id, $params['selected_monster_id'], false); + $battleEventHandler->processMonsterDeath($this->character->id, $params['selected_monster_id'], false, false); return true; } diff --git a/app/Game/Skills/Handlers/UpdateCraftingTasksForFactionLoyalty.php b/app/Game/Skills/Handlers/UpdateCraftingTasksForFactionLoyalty.php index 5680d34c6..92273cb9b 100644 --- a/app/Game/Skills/Handlers/UpdateCraftingTasksForFactionLoyalty.php +++ b/app/Game/Skills/Handlers/UpdateCraftingTasksForFactionLoyalty.php @@ -205,7 +205,7 @@ protected function rewardTheUniqueItem(Character $character) 'item_id' => $newItem->id, ]); - event(new ServerMessageEvent($character->user, 'You found something of MEDIUM value child. A simple reward: ' . $item->affix_name, $slot->id)); + event(new ServerMessageEvent($character->user, 'You found something Unique in value child. A simple reward: ' . $item->affix_name, $slot->id)); } /**