魔兽世界私服| 新开魔兽私服文章 | 历史已开私服 | 私服家族联盟 | 私服游戏攻略 | 魔兽相关下载 | 最新版本研究 | 家族发布 | 魔兽经验交流 | 各大魔兽家族排行榜
  当前位置:返回首页>>返回私服文章首页>>技术文章内容
[最新版本研究]防止玩家达不到要求而使用物品
魔兽私服网   发布时间:2008-4-30 16:30:34
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模型代码

Copyright 2008-2009 www.haoztw.Com All Rights Reserved(注:本站只投放九城官方授权魔兽世界私服)
品牌商标、文字、形象及内容归魔兽世界私服版权所有 任何组织或个人未经同意,不得使用和传播 网站备案登记号:渝ICP备02394311号
拒绝盗版魔兽世界私服游戏 注意自我保护 谨防受骗上当 适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活
*注释:本站所有魔兽私服游戏信息,均来自互联网,与本站无关。请玩家仔细辨认魔兽私服游戏信息的真实性,避免上当受骗!