Skip to content

Commit

Permalink
Updated to quest items, locations and quests, location detail changes…
Browse files Browse the repository at this point in the history
… as well
  • Loading branch information
AdamKyle committed Dec 2, 2024
1 parent 3f31e2c commit fdbc05c
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 60 deletions.
3 changes: 2 additions & 1 deletion app/Admin/Services/ItemsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function formInputs(): array
ItemEffectsValue::MERCENARY_SLOT_BONUS,
ItemEffectsValue::TWISTED_TREE_BRANCH,
ItemEffectsValue::TWISTED_DUNGEONS,
ItemEffectsValue::THE_OLD_CHURCH,
],
'specialtyTypes' => [
ItemSpecialtyType::HELL_FORGED,
Expand Down Expand Up @@ -177,6 +178,6 @@ public function deleteItem(Item $item)

$item->delete();

return $this->successResult(['message' => 'success', $name.' was deleted successfully.']);
return $this->successResult(['message' => 'success', $name . ' was deleted successfully.']);
}
}
13 changes: 5 additions & 8 deletions app/Flare/GameImporter/Console/Commands/MassImportCustomData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace App\Flare\GameImporter\Console\Commands;

use Artisan;
use Illuminate\Console\Command;
use Illuminate\Http\File;
use Illuminate\Support\Facades\Storage;
use App\Flare\Models\GameMap;
use App\Flare\Models\InfoPage;
use App\Flare\Models\Survey;
use App\Flare\Values\MapNameValue;
use Artisan;

class MassImportCustomData extends Command
{
Expand All @@ -32,13 +32,10 @@ class MassImportCustomData extends Command
*/
public function handle()
{

Artisan::call('rebalance:trinkets');
Artisan::call('rebalance:skill-reducing-affixes');
Artisan::call('rebalance:stat-based-affixes');
Artisan::call('rebalance:stat-reducing-affixes');
Artisan::call('rebalance:irresistable-damage-based-affixes');
Artisan::call('rebalance:base-modifier-affixes');
Artisan::call('import:game-data Items');
Artisan::call('import:game-data Locations');
Artisan::call('import:game-data Quests');
Artisan::call('create:quest-cache');

$this->importInformationSection();

Expand Down
5 changes: 2 additions & 3 deletions app/Game/Battle/Controllers/Api/BattleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public function index(Character $character): JsonResponse
if (! is_null($locationWithType)) {
$monstersForLocation = Cache::get('special-location-monsters');

if (isset($monstersForLocation['location-type-'.$locationWithType->type])) {
$monsters = $monstersForLocation['location-type-'.$locationWithType->type];
if (isset($monstersForLocation['location-type-' . $locationWithType->type])) {
$monsters = $monstersForLocation['location-type-' . $locationWithType->type];
}
}

Expand Down Expand Up @@ -129,7 +129,6 @@ public function setupMonster(AttackTypeRequest $attackTypeRequest, Character $ch

public function fightMonster(AttackTypeRequest $attackTypeRequest, Character $character): JsonResponse
{

$result = $this->monsterFightService->fightMonster($character, $attackTypeRequest->attack_type);

$status = $result['status'];
Expand Down
6 changes: 3 additions & 3 deletions app/Game/Battle/Handlers/BattleEventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function processMonsterDeath(int $characterId, int $monsterId): void
$character = Character::find($characterId);

if (is_null($monster)) {
Log::error('Missing Monster for id: '.$monsterId);
Log::error('Missing Monster for id: ' . $monsterId);

return;
}
Expand Down Expand Up @@ -96,12 +96,12 @@ public function processRevive(Character $character): Character
]);
}

$monsterFightCache = Cache::get('monster-fight-'.$character->id);
$monsterFightCache = Cache::get('monster-fight-' . $character->id);

if (! is_null($monsterFightCache)) {
$monsterFightCache['health']['current_character_health'] = $characterHealth;

Cache::put('monster-fight-'.$character->id, $monsterFightCache, 900);
Cache::put('monster-fight-' . $character->id, $monsterFightCache, 900);
}

event(new CharacterRevive($character->user, $characterHealth));
Expand Down
16 changes: 8 additions & 8 deletions app/Game/Battle/Services/MonsterFightService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public function __construct(MonsterPlayerFight $monsterPlayerFight, BattleEventH
public function setupMonster(Character $character, array $params): array
{

Cache::delete('monster-fight-'.$character->id);
Cache::delete('character-sheet-'.$character->id);
Cache::delete('monster-fight-' . $character->id);
Cache::delete('character-sheet-' . $character->id);

$data = $this->monsterPlayerFight->setUpFight($character, $params);

Expand All @@ -58,14 +58,14 @@ public function setupMonster(Character $character, array $params): array
$this->battleEventHandler->processDeadCharacter($character, $monster);
}

Cache::put('monster-fight-'.$character->id, $data, 900);
Cache::put('monster-fight-' . $character->id, $data, 900);

return $this->successResult($data);
}

public function fightMonster(Character $character, string $attackType): array
{
$cache = Cache::get('monster-fight-'.$character->id);
$cache = Cache::get('monster-fight-' . $character->id);

if (! $this->isAtMonstersLocation($character, $cache['monster']['id'])) {
return $this->errorResult('You are too far away from the monster. Move back to it\'s location');
Expand Down Expand Up @@ -100,10 +100,9 @@ public function fightMonster(Character $character, string $attackType): array
$cache['messages'] = $this->monsterPlayerFight->getBattleMessages();

if ($monsterHealth >= 0) {
Cache::put('monster-fight-'.$character->id, $cache, 900);
Cache::put('monster-fight-' . $character->id, $cache, 900);
} else {
Cache::delete('monster-fight-'.$character->id);

Cache::delete('monster-fight-' . $character->id);
BattleAttackHandler::dispatch($character->id, $this->monsterPlayerFight->getMonster()['id'])->onQueue('default_long')->delay(now()->addSeconds(2));
}

Expand All @@ -118,7 +117,8 @@ public function isAtMonstersLocation(Character $character, int $monsterId): bool
if (! is_null($monster->only_for_location_type)) {

$location = Location::where('type', $monster->only_for_location_type)->where(
'game_map_id', $character->map->game_map_id
'game_map_id',
$character->map->game_map_id
)->where('x', $character->map->character_position_x)->where('y', $character->map->character_position_y)->first();

if (is_null($location)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function handleFightingAtTheOldChurch(Character $character, Monster $mons
/**
* is the monster at least halfway down the list?
*/
protected function isMonsterAtLeastHalfWayOrMore(Location $location, Monster $monster): bool
private function isMonsterAtLeastHalfWayOrMore(Location $location, Monster $monster): bool
{

$monsters = Cache::get('monsters')[$location->name];
Expand All @@ -92,12 +92,12 @@ protected function isMonsterAtLeastHalfWayOrMore(Location $location, Monster $mo
*/
public function currencyReward(Character $character, ?Event $event = null): Character
{
$maximumAmount = 1000;
$maximumGold = 20000;
$maximumAmount = 1_000;
$maximumGold = 20_000;

if (! is_null($event)) {
$maximumAmount = 3000;
$maximumGold = 40000;
$maximumAmount = 5_000;
$maximumGold = 40_000;
}

$goldDust = RandomNumberGenerator::generateRandomNumber(1, $maximumAmount);
Expand Down Expand Up @@ -136,7 +136,7 @@ public function currencyReward(Character $character, ?Event $event = null): Char
*
* @throws Exception
*/
protected function handleItemReward(Character $character, ?Event $event = null): Character
private function handleItemReward(Character $character, ?Event $event = null): Character
{
$lootingChance = $character->skills->where('baseSkill.name', 'Looting')->first()->skill_bonus;
$maxRoll = 1_000;
Expand Down Expand Up @@ -168,7 +168,7 @@ protected function handleItemReward(Character $character, ?Event $event = null):
*
* @throws Exception
*/
protected function rewardForCharacter(Character $character)
private function rewardForCharacter(Character $character)
{
$item = Item::where('specialty_type', ItemSpecialtyType::CORRUPTED_ICE)
->whereNull('item_prefix_id')
Expand Down Expand Up @@ -204,7 +204,7 @@ protected function rewardForCharacter(Character $character)
*
* @return void
*/
protected function createPossibleEvent()
private function createPossibleEvent()
{

if (Event::where('type', EventType::THE_OLD_CHURCH)->exists()) {
Expand Down
Binary file modified resources/data-imports/Items/quest-items.xlsx
Binary file not shown.
Binary file modified resources/data-imports/Items/trinkets.xlsx
Binary file not shown.
Binary file modified resources/data-imports/Locations/locations.xlsx
Binary file not shown.
Binary file modified resources/data-imports/Quests/quests.xlsx
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -113,41 +113,38 @@ export default class LocationDetails extends React.Component<
true power of their character! Come now child, death
awaits!
</p>
<ul className="list-disc">
<li className="ml-4">
Characters can get 1-20,000 Gold from fighting
monsters. This can be increased to 40,000 if an
event is triggered at this area.
</li>
<ul className="list-disc my-4">
<li className="ml-4">
Characters can get 1-1000 Gold Dust from fighting
monsters. This can be increased to 2,000 if an event
monsters. This can be increased to 5,000 if an event
is triggered at this area.
</li>
<li className="ml-4">
Characters can get 1-1000 Shards from fighting
monsters. This can be increased to 2,000 if an event
monsters. This can be increased to 5,000 if an event
is triggered at this area.
</li>
<li className="ml-4">
There is a 1/1,000,000 (+15% Looting) chance to get
a random{" "}
<a
href="/information/random-enchants"
target="_blank"
>
Medium Unique{" "}
Characters can get 1-20,000 Gold from fighting
monsters. This can be increased to 40,000 if an
event is triggered at this area.
</li>
<li className="ml-4">
There is a 1/1,000 chance (+15% of your looting) to
get a{" "}
<a href="/information/unique-items" target="_blank">
Unique{" "}
<i className="fas fa-external-link-alt"></i>
</a>{" "}
from Monsters half way down the list of more. This
can be reduced to 1/500,000 (+30% Looting) chance if
an event is triggered at this area.
Corrupted Ice from Monsters halfway down the list of
more. This can be reduced to 1/500 (+30% Looting)
chance if an event is triggered at this area.
</li>
<li className="ml-4">
There is a 1/1,000,000 chance to trigger an event
while fighting here to reduce the chances and
increase the currencies (the above "if an event is
triggered") for 1 hour at this location only.
There is a 1/1,000 chance to trigger an event while
fighting here to reduce the chances and increase the
currencies (the above "if an event is triggered")
for 1 hour at this location only.
</li>
</ul>
</Fragment>
Expand Down
13 changes: 6 additions & 7 deletions resources/views/admin/locations/partials/location.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
<li class="ml-4">Characters can get 1-1000 Gold Dust from fighting monsters. This can be increased to 5,000 if an event is triggered at this area.</li>
<li class="ml-4">Characters can get 1-1000 Shards from fighting monsters. This can be increased to 5,000 if an event is triggered at this area.</li>
<li class="ml-4">Characters can get 1-1000 Copper Coins<sup>*</sup> from fighting monsters. This can be increased to 5,000 if an event is triggered at this area.</li>
<li class="ml-4">There is a 1/1,000,000 chance to get a Purgatory Chain Legendary Unique from Monsters half way down the list of more. This can be reduced to 1/500,000 chance if an event is triggered at this area.</li>
<li class="ml-4">There is a 1/10,000,000 chance to get a Purgatory Chain Mythic from the last monster in the list. This can be reduced to 1/5,000,000 chance if an event is triggered at this area.</li>
<li class="ml-4">There is a 1/1,000,000 chance to trigger an event while fighting here to reduce the chances and increase the currencies (the above "if an event is triggered") for 1 hour at this location only.</li>
<li class="ml-4">There is a 1/1,000 chance to get a Purgatory Chain Unique from Monsters half way down the list of more. This can be reduced to 1/500 chance if an event is triggered at this area.</li>
<li class="ml-4">There is a 1/1,000 chance to get a Purgatory Chain Mythic from the last monster in the list. This can be reduced to 1/00 chance if an event is triggered at this area.</li>
<li class="ml-4">There is a 1/1,000 chance to trigger an event while fighting here to reduce the chances and increase the currencies (the above "if an event is triggered") for 1 hour at this location only.</li>
</ul>
<p class="mt-4 mb-4 italic"><sup>*</sup> Provided characters have the required quest item to obtain copper coins.</p>
@endif
Expand All @@ -81,11 +81,10 @@
<ul class="list-disc my-4">
<li class="ml-4">Characters can get 1-1000 Gold Dust from fighting monsters. This can be increased to 5,000 if an event is triggered at this area.</li>
<li class="ml-4">Characters can get 1-1000 Shards from fighting monsters. This can be increased to 5,000 if an event is triggered at this area.</li>
<li class="ml-4">Characters can get 1-20,000 Gold<sup>*</sup> from fighting monsters. This can be increased to 40,000 if an event is triggered at this area.</li>
<li class="ml-4">There is a 1/1,000,000 chance (+15% of your looting) to get a Medium Corrupted Ice <a href="/information/random-enchants" target="_blank">Medium Unique <i className="fas fa-external-link-alt"></i></a> from Monsters halfway down the list of more. This can be reduced to 1/500,000 (+30% Looting) chance if an event is triggered at this area.</li>
<li class="ml-4">There is a 1/1,000,000 chance to trigger an event while fighting here to reduce the chances and increase the currencies (the above "if an event is triggered") for 1 hour at this location only.</li>
<li class="ml-4">Characters can get 1-20,000 Gold from fighting monsters. This can be increased to 40,000 if an event is triggered at this area.</li>
<li class="ml-4">There is a 1/1,000 chance (+15% of your looting) to get a <a href="/information/unique-items" target="_blank">Unique <i className="fas fa-external-link-alt"></i></a> Corrupted Ice from Monsters halfway down the list of more. This can be reduced to 1/500 (+30% Looting) chance if an event is triggered at this area.</li>
<li class="ml-4">There is a 1/1,000 chance to trigger an event while fighting here to reduce the chances and increase the currencies (the above "if an event is triggered") for 1 hour at this location only.</li>
</ul>
<p class="mt-4 mb-4 italic"><sup>*</sup> Provided characters have the required quest item to obtain copper coins.</p>
@endif
@endif

Expand Down

0 comments on commit fdbc05c

Please sign in to comment.