禁止飞行地区的魔兽私服模拟器代码
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
|