|
防止玩家达不到要求而使用物品 Index: SpellHandler.cpp
=================================================================== --- SpellHandler.cpp (revision 557) +++ SpellHandler.cpp (working copy) @@ -43,7 +43,24 @@ if(_player->getDeathState()==CORPSE) return; + //防止玩家达不到要求而使用物品。(cache作弊或者客户端作弊) + if(itemProto->RequiredLevel > _player->getLevel()) + return; + if(!(itemProto->AllowableClass & (1<<(_player->getClass()-1)))) + return; + + if(itemProto->RequiredFaction) + { + Standing current_standing = Player::GetReputationRankFromStanding(_player->GetStanding(itemProto->RequiredFaction)); + if(current_standing < (Standing)itemProto->RequiredFactionStanding) + // 没有足够的需求等级 + return; + } + + if(!(itemProto->AllowableRace& (1<<_player->getRace()))) + return; + //防止玩家达不到要求而使用物品。(cache作弊或者客户端作弊) if(itemProto->*onding == ITEM_*IND_ON_USE) tmpItem->Soul*ind(); @@ -116,6 +133,18 @@ } } + if(!_player->m_itemcooldown.empty())//防止玩家达不到要求而使用物品。(cache作弊或者客户端作弊) + { + ItemCooldownSet::iterator itr2, it2; + for (itr2 = _player->m_itemcooldown.begin(); itr2 != _player->m_itemcooldown.end(); ) + { + ItemCooldown * tempid = (*itr2); + it2 = itr2++; + if(tempid && (tempid->SpellID == spellId || tempid->SpellCategory == spellInfo->Category)) + return; + } + } //防止玩家达不到要求而使用物品。(cache作弊或者客户端作弊) + if(itemProto->Spells[x].Cooldown || itemProto->Spells[x].CategoryCooldown) { if(!_player->CanCastItemDueToCooldown(itemProto, x)) // damn cheaters |
| 上一篇魔兽私服文章:上一篇: | 显示start的命令帮助提示玩家自杀 |
| 下一篇魔兽私服文章:下一篇: | 牛头人乐队L70ETC模型代码 |