当前位置:首页>>魔兽单机>>正文
模拟器头衔等级差距掉落系统代码
2013-07-05 17:48:47 作者:网络 来源: 浏览次数:0
摘要:头衔等级差距掉落系统
 Index: Player.cpp
===================================================================
--- Player.cpp (revision 431)
+++ Player.cpp (working copy)
@@ -19584,6 +19584,23 @@
 }
 //--------------------------清理个人副本系统-------------------------//
 
+//----------------头衔等级差距掉落系统----------------------//
+uint32 Player::GetTitleNumber()//头衔等级差距掉落系统
+{
+   uint32 titles = GetUInt32Value(PLAYER_CHOSEN_TITLE);
+   uint32 titles_value;
+   if (titles == 0)
+       titles_value = 0; 
+   else if (titles < 15)
+       titles_value = titles;
+   else if (titles < 29)
+       titles_value = titles - 14;
+   else
+       titles_value = 0; 
+   return titles_value;
+}
+//----------------头衔等级差距掉落系统----------------------//
+
 void Player::AutoUnequipOffhandIfNeed()
 {
     Item *offItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND );
Index: Player.h
===================================================================
--- Player.h (revision 431)
+++ Player.h (working copy)
@@ -1118,6 +1118,8 @@
  void PSendWorldCnCenterMessage(int32 entry, ...);//全世界信息,屏幕中间entry对应mangos_string //PvP 杀人系统
 //--------------------------清理个人副本系统-------------------------//
  void CleanSiglePlayerIntance(Player* player);//清理个人副本系统
+//----------------头衔等级差距掉落系统----------------------//
+ uint32 GetTitleNumber();//头衔等级差距掉落系统
 //-----------------------------个性化结束-------------------------
  void GiveXP(uint32 xp, Unit* victim);
         void GiveLevel(uint32 level);
Index: Unit.cpp
===================================================================
--- Unit.cpp (revision 431)
+++ Unit.cpp (working copy)
@@ -598,7 +598,27 @@
    uint32 killeritemid = objmgr.PlayerLootKillerItemid(entry);
    if (itemID==0)
    break;
-                               ItemPosCountVec dest;
+
+   if (sConfig.GetIntDefault("PvP.Title.On.Off", 0) == 1 && NEWPASSSYSTEM==sConfig.GetIntDefault("NewPassSystem", 0))//头衔掉落开始
+   {
+   uint32 playertitle = player->GetTitleNumber();
+       uint32 pVictimtitle = ((Player*)pVictim)->GetTitleNumber();
+       int32 titlediff1 = playertitle - pVictimtitle;
+   int32 titlediff2 = pVictimtitle - playertitle;
+       if ( titlediff1 > sConfig.GetIntDefault("PlayerLoot.Title.Diff", 2) || titlediff2 > sConfig.GetIntDefault("PlayerLoot.Title.Diff", 2) )
+   {
+   player->PSendSysCnMessage(15031,titlediff1);//屏幕左下角信息
+   ((Player*)pVictim)->PSendSysCnMessage(15031,titlediff1);//屏幕左下角信息
+       break;
+   }
+   else if (titlediff1 < 0)
+   {
+   uint32 itemCountAdd = titlediff2 * sConfig.GetIntDefault("PlayerLoot.Title.Additem", 2);
+   itemCount += itemCountAdd;
+   }
+   }////头衔掉落结束
+
+   ItemPosCountVec dest;
        //player->GetSession()->SendAreaTriggerMessage("item id is %u,count is %u, chance is %u ",itemID,itemCount,chance);
                                uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemID, itemCount);
                                if( msg != EQUIP_ERR_OK )
@@ -608,7 +628,7 @@
                                }
        else
                {
-      if (((Player*)pVictim)->HasItemCount(itemID, 1)) 
+      if (((Player*)pVictim)->HasItemCount(itemID, itemCount)) 
       {
                                       Item* item_1 = player->StoreNewItem( dest, itemID, true, Item::GenerateItemRandomPropertyId(itemID));
   //if (chance ==0)break;
 


相关报道:

[关闭] [返回顶部]


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

机器人国度