当前位置:首页>>魔兽单机>>正文
禁止飞行地区的单机代码mangos
2013-07-05 17:11:12 作者:网络 来源: 浏览次数:0
摘要:禁止飞行地区的模拟器代码mangos
禁止飞行地区的模拟器代码
 
Index: src/game/Player.cpp
===================================================================
--- src/game/Player.cpp (revision 268)
+++ src/game/Player.cpp (working copy)
@@ -6216,7 +6216,25 @@
     if(!zone)
         return;
 
-    if (sWorld.getConfig(CONFIG_WEATHER))
+ uint32 newpvpzone_1 = sConfig.GetIntDefault("PvP.Zone.1", 0);//全局PVP系统
+ uint32 newpvpzone_2 = sConfig.GetIntDefault("PvP.Zone.2", 0);
+ uint32 newpvpzone_3 = sConfig.GetIntDefault("PvP.Zone.3", 0);
+ uint32 newpvpzone_4 = sConfig.GetIntDefault("PvP.Zone.4", 0);
+ uint32 newpvpzone_5 = sConfig.GetIntDefault("PvP.Zone.5", 0);
+ //AreaTableEntry const* mpvpzone = GetAreaEntryByAreaID(newZone);
+ //if (!mpvpzone)
+ // return;
+ if (sConfig.GetIntDefault("PvP.Zone.On.Off", 0)==1)
+ {
+        if (zone->ID == newpvpzone_1 || zone->ID == newpvpzone_2 
+    || zone->ID == newpvpzone_3 || zone->ID == newpvpzone_4 || zone->ID == newpvpzone_5)
+        {
+            if(!isGameMaster())
+                SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
+        }
+ }
+
+ if (sWorld.getConfig(CONFIG_WEATHER))
     {
         Weather *wth = sWorld.FindWeather(zone->ID);
         if(wth)
@@ -19593,6 +19611,11 @@
         return true;
 
     uint32 v_map = GetVirtualMapForMapAndZone(GetMapId(), GetZoneId());
+ if (sConfig.GetIntDefault("Allow.FlyingMounts.All", 0)==1)//全局飞行系统
+ {
+    return v_map == 0 || v_map == 1 || v_map == 530 || v_map == 571 && HasSpell(54197);
+ }
+ else
     return v_map == 530 || v_map == 571 && HasSpell(54197);
 }
 
Index: src/game/Spell.cpp
===================================================================
--- src/game/Spell.cpp (revision 268)
+++ src/game/Spell.cpp (working copy)
@@ -42,6 +42,7 @@
 #include "SharedDefines.h"
 #include "LootMgr.h"
 #include "VMapFactory.h"
+#include "Config/ConfigEnv.h" //飞行系统配置参数
 #include "BattleGround.h"
 #include "Util.h"
 
@@ -4493,6 +4494,20 @@
                 // not allow cast fly spells at old maps by players (all spells is self target)
                 if(m_caster->GetTypeId() == TYPEID_PLAYER)
                 {
+                    uint32 v_zone = m_caster->GetZoneId();//飞行系统
+ uint32 v_zoneconf_1=sConfig.GetIntDefault("Disable.FlyingMounts.Zone.1", 0);
+ uint32 v_zoneconf_2=sConfig.GetIntDefault("Disable.FlyingMounts.Zone.2", 0);
+ uint32 v_zoneconf_3=sConfig.GetIntDefault("Disable.FlyingMounts.Zone.3", 0);
+ uint32 v_zoneconf_4=sConfig.GetIntDefault("Disable.FlyingMounts.Zone.4", 0);
+ uint32 v_zoneconf_5=sConfig.GetIntDefault("Disable.FlyingMounts.Zone.5", 0);
+ if (sConfig.GetIntDefault("Disable.FlyingMounts.On.Off", 0)==1)
+ {
+    if (v_zone==v_zoneconf_1 || v_zone==v_zoneconf_2 || v_zone==v_zoneconf_3
+ || v_zone==v_zoneconf_4 || v_zone==v_zoneconf_5)
+    {
+    return SPELL_FAILED_NOT_HERE;
+    }
+ }
                     if( !((Player*)m_caster)->IsAllowUseFlyMountsHere() )
                         return SPELL_FAILED_NOT_HERE;
                 }
Index: src/mangosd/mangosd.conf.dist.in
===================================================================
--- src/mangosd/mangosd.conf.dist.in (revision 268)
+++ src/mangosd/mangosd.conf.dist.in (working copy)
@@ -1300,3 +1300,48 @@
 Ra.Port = 3443
 Ra.MinLevel = 3
 Ra.Secure = 1
+
+
+Allow.FlyingMounts.All = 0
+Disable.FlyingMounts.On.Off = 0
+Disable.FlyingMounts.Zone.1 = 0
+Disable.FlyingMounts.Zone.2 = 0
+Disable.FlyingMounts.Zone.3 = 0
+Disable.FlyingMounts.Zone.4 = 0
+Disable.FlyingMounts.Zone.5 = 0
+PvP.Zone.On.Off = 0
+PvP.Zone.1 = 0
+PvP.Zone.2 = 0
+PvP.Zone.3 = 0
+PvP.Zone.4 = 0
+PvP.Zone.5 = 0
 


相关报道:

[关闭] [返回顶部]


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

机器人国度