Skip to content

Commit

Permalink
Fix some things about critical and look items
Browse files Browse the repository at this point in the history
Co-Authored-By: nekiro <[email protected]>
Co-Authored-By: OTCv8 <[email protected]>
Co-Authored-By: Mark Samman <[email protected]>
  • Loading branch information
4 people committed Nov 6, 2021
1 parent 22aff0f commit 393b919
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 189 deletions.
63 changes: 0 additions & 63 deletions src/auras.cpp

This file was deleted.

33 changes: 0 additions & 33 deletions src/auras.h

This file was deleted.

3 changes: 0 additions & 3 deletions src/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,6 @@ void Combat::doTargetCombat(Creature* caster, Creature* target, CombatDamage& da
damage.primary.value /= 2;
damage.secondary.value /= 2;
}

Combat::checkCriticalHit(casterPlayer, damage);
Combat::checkLeech(casterPlayer, damage);
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/combat.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ class Combat
static void doTargetCombat(Creature* caster, Creature* target, CombatDamage& damage, const CombatParams& params);
static void doAreaCombat(Creature* caster, const Position& position, const AreaCombat* area, CombatDamage& damage, const CombatParams& params);

static void checkCriticalHit(Player* caster, CombatDamage& damage);
static void checkLeech(Player* caster, CombatDamage& damage);

bool setCallback(CallBackParam_t key);
CallBack* getCallback(CallBackParam_t key);
Expand Down
85 changes: 0 additions & 85 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2808,91 +2808,6 @@ void Game::internalCloseTrade(Player* player)
}
}

void Game::playerPurchaseItem(uint32_t playerId, uint16_t spriteId, uint8_t count, uint8_t amount,
bool ignoreCap/* = false*/, bool inBackpacks/* = false*/)
{
if (amount == 0 || amount > 100) {
return;
}

Player* player = getPlayerByID(playerId);
if (!player) {
return;
}

const ItemType& it = Item::items.getItemIdByClientId(spriteId);
if (it.id == 0) {
return;
}

uint8_t subType;
if (it.isSplash() || it.isFluidContainer()) {
subType = clientFluidToServer(count);
} else {
subType = count;
}
}

void Game::playerSellItem(uint32_t playerId, uint16_t spriteId, uint8_t count, uint8_t amount, bool ignoreEquipped)
{
if (amount == 0 || amount > 100) {
return;
}

Player* player = getPlayerByID(playerId);
if (!player) {
return;
}

int32_t onBuy, onSell;


const ItemType& it = Item::items.getItemIdByClientId(spriteId);
if (it.id == 0) {
return;
}

uint8_t subType;
if (it.isSplash() || it.isFluidContainer()) {
subType = clientFluidToServer(count);
} else {
subType = count;
}

}

void Game::playerLookInShop(uint32_t playerId, uint16_t spriteId, uint8_t count)
{
Player* player = getPlayerByID(playerId);
if (!player) {
return;
}

int32_t onBuy, onSell;


const ItemType& it = Item::items.getItemIdByClientId(spriteId);
if (it.id == 0) {
return;
}

int32_t subType;
if (it.isFluidContainer() || it.isSplash()) {
subType = clientFluidToServer(count);
} else {
subType = count;
}


if (!g_events->eventPlayerOnLookInShop(player, &it, subType)) {
return;
}

std::ostringstream ss;
ss << "You see " << Item::getDescription(it, 1, nullptr, subType);
player->sendTextMessage(MESSAGE_INFO_DESCR, ss.str());
}

void Game::playerLookAt(uint32_t playerId, const Position& pos, uint8_t stackPos)
{
Player* player = getPlayerByID(playerId);
Expand Down
2 changes: 1 addition & 1 deletion src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3412,7 +3412,7 @@ bool Player::canWear(uint32_t lookType) const
}

if (outfit->premium && !isPremium()) {
return false; //have lookType on list and addons don't match
return false;
}
return false;
}
Expand Down
2 changes: 0 additions & 2 deletions vc14/theforgottenserver.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\actions.cpp" />
<ClCompile Include="..\src\auras.cpp" />
<ClCompile Include="..\src\ban.cpp" />
<ClCompile Include="..\src\baseevents.cpp" />
<ClCompile Include="..\src\bed.cpp" />
Expand Down Expand Up @@ -244,7 +243,6 @@
<ItemGroup>
<ClInclude Include="..\src\account.h" />
<ClInclude Include="..\src\actions.h" />
<ClInclude Include="..\src\auras.h" />
<ClInclude Include="..\src\ban.h" />
<ClInclude Include="..\src\baseevents.h" />
<ClInclude Include="..\src\bed.h" />
Expand Down

0 comments on commit 393b919

Please sign in to comment.