Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool Combat::canUseWeapon(Player* player, Item* weapon)
- {
- if (player->hasFlag(PlayerFlag_IgnoreWeaponCheck)) {
- return true;
- }
- if (player->getLevel() < weapon->getMinimumLevel()) {
- return false;
- }
- if (!player->hasFlag(PlayerFlag_HasInfiniteMana) && player->getMana() < weapon->getManaConsumption()) {
- return false;
- }
- const ItemType& itemType = Item::items[weapon->getID()];
- if (hasBitSet(WIELDINFO_VOCREQ, itemType.wieldInfo)) {
- if (!hasBitSet(player->getVocationFlagId(), itemType.vocations)) {
- return false;
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement