| 768 | } |
| 769 | |
| 770 | void Player::setSpellCooldownTurns(SpellType spellType, uint32_t cooldown) |
| 771 | { |
| 772 | uint32_t spellIndex = static_cast<uint32_t>(spellType); |
| 773 | if(spellIndex >= mSpellsCooldown.size()) |
| 774 | { |
| 775 | OD_LOG_ERR("seatId=" + Helper::toString(getId()) + ", spellType=" + SpellManager::getSpellNameFromSpellType(spellType)); |
| 776 | return; |
| 777 | } |
| 778 | |
| 779 | mSpellsCooldown[spellIndex] = PlayerSpellData(cooldown, 1.0f / ODApplication::turnsPerSecond); |
| 780 | |
| 781 | if(mGameMap->isServerGameMap() && getIsHuman()) |
| 782 | { |
| 783 | ServerNotification *serverNotification = new ServerNotification( |
| 784 | ServerNotificationType::setSpellCooldown, this); |
| 785 | serverNotification->mPacket << spellType << cooldown; |
| 786 | ODServer::getSingleton().queueServerNotification(serverNotification); |
| 787 | } |
| 788 | } |
| 789 | |
| 790 | void Player::notifyWorkerAction(Creature& worker, CreatureActionType actionType) |
| 791 | { |
no test coverage detected