吾爱尚玩资源基地

标题: 生物设置是否让联盟或则部落单独可见(mangos代码) [打印本页]

作者: admin    时间: 2016-4-19 22:53
标题: 生物设置是否让联盟或则部落单独可见(mangos代码)
一个趣味魔兽私服的设置(生物设置是否让联盟或则部落单独可见)

diff --git a/src/game/Creature.cpp b/src/game/Creature.cppindex 3c09df9..a58ce8e 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -1502,6 +1502,13 @@ bool Creature::IsVisibleInGridForPlayer(Player* pl) const
     if (GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INVISIBLE)
         return false;

+    //控制联盟部落对于生物是否可见
+        if (GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_ALLIANCEVISIBLE && pl->GetTeam() == HORDE)//creaute_template->flags_extra = 768仅联盟可见
+        return false;
+   
+        if (GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_HORDEVISIBLE && pl->GetTeam() == ALLIANCE)//creaute_template->flags_extra = 1024仅部落可见
+        return false;
+
     // Live player (or with not release body see live creatures or death creatures with corpse disappearing time > 0
     if(pl->isAlive() || pl->GetDeathTimer() > 0)
     {
diff --git a/src/game/Creature.h b/src/game/Creature.h
index dfbcb77..dc2e761 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -48,6 +48,8 @@ enum CreatureFlagsExtra
     CREATURE_FLAG_EXTRA_NO_XP_AT_KILL   = 0x00000040,       // creature kill not provide XP
     CREATURE_FLAG_EXTRA_INVISIBLE       = 0x00000080,       // creature is always invisible for player (mostly trigger creatures)
     CREATURE_FLAG_EXTRA_NOT_TAUNTABLE   = 0x00000100,       // creature is immune to taunt auras and effect attack me
+    CREATURE_FLAG_EXTRA_ALLIANCEVISIBLE = 0x00000300,       // 生物仅联盟可见(creaute_template->flags_extra)值为768
+    CREATURE_FLAG_EXTRA_HORDEVISIBLE    = 0x00000400,       // 生物仅部落可见(creaute_template->flags_extra)值为1024
};

// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform






欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/) Powered by Discuz! X3.4