当前位置:首页>>魔兽单机>>正文
单机中一个VIP物品控制系统
2013-05-10 13:18:15 作者:网络 来源: 浏览次数:0
摘要:单机中一个VIP物品控制系统
魔兽单机中一个VIP物品控制系统
1、这个是让GM可以设置多少会员GM等级的玩家可以装备使用物品

2、可以作为变态来使用,可以提高装备销售的方式。

3、总体说,就是你可以设置某个物品的使用需求GM等级

首先是SQL:


ALTER TABLE `item_template` ADD COLUMN `vipLevel` INT NOT NULL DEFAULT '0' AFTER `WDBVerified`;


然后是代码

diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h

index 5fc49c9..e44e87a 100644

--- a/src/server/game/Entities/Item/ItemPrototype.h

+++ b/src/server/game/Entities/Item/ItemPrototype.h

@@ -662,6 +662,7 @@ struct ItemTemplate

     uint32 MinMoneyLoot;

     uint32 MaxMoneyLoot;

     uint32 FlagsCu;

+    uint32 vipLevel;

 

     // helpers

     bool CanChangeEquipStateInCombat() const

diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp

index 2b39045..d23ee8d 100644

--- a/src/server/game/Entities/Player/Player.cpp

+++ b/src/server/game/Entities/Player/Player.cpp

@@ -11507,6 +11511,10 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool

         ItemTemplate const* pProto = pItem->GetTemplate();

         if (pProto)

         {

+        uint32 IvipLevel = pProto->vipLevel;

+        uint32 PvipLevel = GetSession()->GetSecurity()

+        if(IvipLevel  > PvipLevel)

+        {

+            // can't equip item if vip level higher than your GM rank

+            return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;

+         }

             // item used

             if (pItem->m_lootGenerated)

                 return EQUIP_ERR_ALREADY_LOOTED;

diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp

index 1191bc4..c6dda00 100644

--- a/src/server/game/Globals/ObjectMgr.cpp

+++ b/src/server/game/Globals/ObjectMgr.cpp

@@ -2152,7 +2152,7 @@ void ObjectMgr::LoadItemTemplates()

     //                                            126                 127                     128            129            130            131         132         133

                                              "GemProperties, RequiredDisenchantSkill, ArmorDamageModifier, duration, ItemLimitCategory, HolidayId, ScriptName, DisenchantID, "

     //                                           134        135            136

-                                             "FoodType, minMoneyLoot, maxMoneyLoot, flagsCustom FROM item_template");

+                                             "FoodType, minMoneyLoot, maxMoneyLoot, flagsCustom, vipLevel FROM item_template");

 

     if (!result)

     {

@@ -2277,6 +2277,7 @@ void ObjectMgr::LoadItemTemplates()

         itemTemplate.MinMoneyLoot            = fields[135].GetUInt32();

         itemTemplate.MaxMoneyLoot            = fields[136].GetUInt32();

         itemTemplate.FlagsCu                 = fields[137].GetUInt32();

+        itemTemplate.vipLevel                = fields[138].GetUInt32();

 

         // Checks



完整代码下载(不含SQL):点击下载完整代码



相关报道:

[关闭] [返回顶部]


  返回首页 | 最新资讯 | 资源下载 | 魔兽图片 | 单机文档 | 技术攻略 | 玩家视频
备案号:蜀ICP备2024062380号-1
免责声明:本网站为热爱怀旧WOW的玩家们建立的魔兽世界资料网站,仅供交流和学习使用,非盈利和商用.如有侵权之处,请联系我们,我们会在24小时内确认删除侵权内容,谢谢合作。
Copyright © 2024 - 2024 WOWAII.COM Corporation, All Rights Reserved

机器人国度