魔兽私服 经验交流 发布家族 高手进阶心得 软件下载 魔兽私服技术文章 家族联盟 广告合作

防止玩家达不到要求而使用物品

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模型代码
魔兽世界私服 魔兽世界下载 wow魔兽私服
五二我的wow魔兽私服网 www.52mysf.com 提供最新开魔兽世界私服发布 版权所有