魔兽世界私服| 新开魔兽私服文章 | 历史已开私服 | 私服家族联盟 | 私服游戏攻略 | 魔兽相关下载 | 最新版本研究 | 家族发布 | 魔兽经验交流 | 各大魔兽家族排行榜
  当前位置:返回首页>>返回私服文章首页>>技术文章内容
[最新版本研究]修复恐惧和变形术
魔兽私服网   发布时间:2008-4-30 16:30:34
Index: src/game/AIInterface.cpp
================================================== =================
--- src/game/AIInterface.cpp (revision 624)
+++ src/game/AIInterface.cpp (working copy)
@@ -307,6 +307,7 @@
case EVENT_UNFEAR:
{
// update speed
+ m_AIState = SATTE_UNFEAR_OR_UNCONFUSE;
m_Unit->m_runSpeed *= 2;
getMoveFlags();
}break;
@@ -339,6 +340,7 @@
case EVENT_UNWANDER:
{
// update speed
+ m_AIState = SATTE_UNFEAR_OR_UNCONFUSE;
m_Unit->m_runSpeed *= 2;
getMoveFlags();
}break;
@@ -2422,50 +2424,36 @@
}

//Fear Code
- if(m_AIState == STATE_FEAR && UnitToFear != NULL && m_creatureState == STOPPED)
+ if(m_AIState == STATE_FEAR && m_creatureState == STOPPED)
{
- if(getMSTime() > m_FearTimer) // Wait at point for x ms
+ if(getMSTime() > m_FearTimer)
{
- float Fx;
- float Fy;
- float Fz;
- // Calculate new angle to target.
- float Fo = m_Unit->calcRadAngle(UnitToFear->GetPositionX(), UnitToFear->GetPositionY(), m_Unit->GetPositionX(), m_Unit->GetPositionY());
-
- Fx = m_Unit->GetPositionX() + 10*cosf(Fo);
- Fy = m_Unit->GetPositionY() + 10*sinf(Fo);
-
- // Check if this point is in water.
- float wl = m_Unit->GetMapMgr()->GetWaterHeight(Fx, Fy);
-// uint8 wt = m_Unit->GetMapMgr()->GetWaterType(Fx, Fy);
-
- Fz = m_Unit->GetMapMgr()->GetLandHeight(Fx, Fy);
- if(!(fabs(m_Unit->GetPositionZ() - Fz) > 4 || Fz < (wl-2))/* && wt & 0x1*/)
- {
- MoveTo(Fx, Fy, Fz, Fo);
- }
- m_FearTimer = m_totalMoveTime + getMSTime() + 200;
+ float X = m_Unit->GetPositionX();
+ float Y = m_Unit->GetPositionY();
+ float Z = m_Unit->GetPositionZ();
+ float randr = float(rand()%327)/327*10;
+ float randa = float(rand()%327)/327*2*M_PI;
+ float X1 = X+randr*cos(randa);
+ float Y1 = Y+randr*sin(randa);
+ m_Unit->GetAIInterface()->SendMoveToPacket(X1,Y1,Z,0,1000,0x100);
+ m_FearTimer = getMSTime() + 1000;
}
}

if(m_AIState == STATE_WANDER && m_creatureState == STOPPED)
{
- float wanderO = sRand.randInt(6);
- float wanderX = m_Unit->GetPositionX() + cosf(wanderO);
- float wanderY = m_Unit->GetPositionY() + sinf(wanderO);
- float wanderZ;
-
-
-
- // Check if this point is in water.
- float wl = m_Unit->GetMapMgr()->GetWaterHeight(wanderX, wanderY);
-// uint8 wt = m_Unit->GetMapMgr()->GetWaterType(wanderX, wanderY);
-
- wanderZ = m_Unit->GetMapMgr()->GetLandHeight(wanderX, wanderY);
- if(!(fabs(m_Unit->GetPositionZ() - wanderZ) > 4 || wanderZ < (wl-2))/* && wt & 0x1*/)
+ if(getMSTime() > m_FearTimer)
{
- MoveTo(wanderX,wanderY,wanderZ,wanderO);
- }
+ float X = m_Unit->GetPositionX();
+ float Y = m_Unit->GetPositionY();
+ float Z = m_Unit->GetPositionZ();
+ float randr = float(rand()%327)/327*6;
+ float randa = float(rand()%327)/327*2*M_PI;
+ float X1 = X+randr*cos(randa);
+ float Y1 = Y+randr*sin(randa);
+ m_Unit->GetAIInterface()->SendMoveToPacket(X1,Y1,Z,0,1500,0x000);
+ m_FearTimer = getMSTime() + 1500;
+ }
}

//Unit Follow Code
Index: src/game/AIInterface.h
================================================== =================
--- src/game/AIInterface.h (revision 624)
+++ src/game/AIInterface.h (working copy)
@@ -103,7 +103,8 @@
STATE_WANDER,
STATE_STOPPED,
STATE_SCRIPTMOVE,
- STATE_SCRIPTIDLE
+ STATE_SCRIPTIDLE,
+ SATTE_UNFEAR_OR_UNCONFUSE
};

enum MovementState
Index: src/game/SpellAuras.cpp
================================================== =================
--- src/game/SpellAuras.cpp (revision 624)
+++ src/game/SpellAuras.cpp (working copy)
@@ -1492,7 +1492,7 @@
if(m_caster->isAlive())
{
m_target->GetAIInterface()->AttackReaction(GetUnitCaster(), 1, 0);
- //m_target->GetAIInterface()->HandleEvent(EVENT_ENTERCOM*AT, GetUnitCaster(), 0);
+ m_target->GetAIInterface()->HandleEvent(EVENT_ENTERCOM*AT, GetUnitCaster(), 0);
}
}
}
上一篇魔兽私服文章:上一篇: 解决卡怪
下一篇魔兽私服文章:下一篇: 限制飞行坐骑状态不能使用传送员

Copyright 2008-2009 www.haoztw.Com All Rights Reserved(注:本站只投放九城官方授权魔兽世界私服)
品牌商标、文字、形象及内容归魔兽世界私服版权所有 任何组织或个人未经同意,不得使用和传播 网站备案登记号:渝ICP备02394311号
拒绝盗版魔兽世界私服游戏 注意自我保护 谨防受骗上当 适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活
*注释:本站所有魔兽私服游戏信息,均来自互联网,与本站无关。请玩家仔细辨认魔兽私服游戏信息的真实性,避免上当受骗!