effectmindcontrol.cpp
来自「天之炼狱1服务器端源文件游戏服务端不完整」· C++ 代码 · 共 131 行
CPP
131 行
//////////////////////////////////////////////////////////////////////////////// Filename : EffectMindControl.cpp// Written by : excel96// Description ://////////////////////////////////////////////////////////////////////////////#include "EffectMindControl.h"#include "Creature.h"#include "Slayer.h"#include "Vampire.h"#include "Monster.h"#include "Player.h"#include "Gpackets/GCModifyInformation.h"#include "Gpackets/GCStatusCurrentHP.h"#include "Gpackets/GCRemoveEffect.h"////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////EffectMindControl::EffectMindControl(Creature* pCreature) throw(Error){ __BEGIN_TRY Assert(pCreature != NULL); Assert(pCreature->isSlayer()); setTarget(pCreature); __END_CATCH}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////void EffectMindControl::affect(Creature* pCreature) throw(Error){ __BEGIN_TRY __END_CATCH}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////void EffectMindControl::affect(Zone* pZone , ZoneCoord_t x , ZoneCoord_t y , Object* pObject) throw(Error){ __BEGIN_TRY __END_CATCH}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////void EffectMindControl::unaffect() throw(Error){ __BEGIN_TRY //cout << "EffectMindControl" << "unaffect BEGIN" << endl; Creature* pCreature = dynamic_cast<Creature *>(m_pTarget); unaffect(pCreature); //cout << "EffectMindControl" << "unaffect END" << endl; __END_CATCH}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////void EffectMindControl::unaffect(Creature* pCreature) throw(Error){ __BEGIN_TRY //cout << "EffectMindControl" << "unaffect BEGIN" << endl; Assert(pCreature != NULL); Assert(pCreature->isSlayer()); // 浇饭捞绢富绊绰 吧府瘤 臼绰促. pCreature->removeFlag(Effect::EFFECT_CLASS_MIND_CONTROL); Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature); SLAYER_RECORD prev; pSlayer->getSlayerRecord(prev); pSlayer->initAllStat(); pSlayer->sendRealWearingInfo(); pSlayer->sendModifyInfo(prev); Zone* pZone = pCreature->getZone(); Assert(pZone != NULL); GCRemoveEffect gcRemoveEffect; gcRemoveEffect.setObjectID(pCreature->getObjectID()); gcRemoveEffect.addEffectList(Effect::EFFECT_CLASS_MIND_CONTROL); pZone->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcRemoveEffect); //cout << "EffectMindControl" << "unaffect END" << endl; __END_CATCH}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////void EffectMindControl::unaffect(Zone* pZone , ZoneCoord_t x , ZoneCoord_t y , Object* pObject) throw(Error){ __BEGIN_TRY __END_CATCH}////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////string EffectMindControl::toString() const throw(){ __BEGIN_TRY StringStream msg; msg << "EffectMindControl(" << "ObjectID:" << getObjectID() << ",ToHit:" << m_ToHitBonus << ",Defense:" << m_DefenseBonus << ")"; return msg.toString(); __END_CATCH}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?