📄 summonmonsters.cpp
字号:
//////////////////////////////////////////////////////////////////////////////// Filename : SummonMonsters.cpp// Written by : elca@ewestsoft.com// Description : //////////////////////////////////////////////////////////////////////////////#include "SummonMonsters.h"#include "MonsterSummonInfo.h"#include "ZoneUtil.h"#include "MasterLairManager.h"#include "MasterLairInfoManager.h"#include "Gpackets/GCSkillToTileOK5.h"#include "Gpackets/GCSay.h"//////////////////////////////////////////////////////////////////////////////// 积己磊// 付胶农甫 檬扁拳茄促.//////////////////////////////////////////////////////////////////////////////SummonMonsters::SummonMonsters() throw(){ __BEGIN_TRY __END_CATCH}//////////////////////////////////////////////////////////////////////////////// 轨颇捞绢 伎橇 勤甸矾///////////////////////////////////////////////////////////////////////////////*void SummonMonsters::execute(Vampire* pVampire, VampireSkillSlot* pSkillSlot, CEffectID_t CEffectID) throw(Error){ __BEGIN_TRY //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin" << endl; Assert(pVampire != NULL); Assert(pSkillSlot != NULL); try { Player* pPlayer = pVampire->getPlayer(); Zone* pZone = pVampire->getZone(); Assert(pPlayer != NULL); Assert(pZone != NULL); GCSkillToSelfOK1 _GCSkillToSelfOK1; GCSkillToSelfOK2 _GCSkillToSelfOK2; SkillType_t SkillType = pSkillSlot->getSkillType(); SkillInfo* pSkillInfo = g_pSkillInfoManager->getSkillInfo(SkillType); ZoneCoord_t x = pVampire->getX(); ZoneCoord_t y = pVampire->getY(); int RequiredMP = decreaseConsumeMP(pVampire, pSkillInfo); bool bManaCheck = hasEnoughMana(pVampire, RequiredMP); bool bTimeCheck = verifyRunTime(pSkillSlot); bool bRangeCheck = checkZoneLevelToUseSkill(pVampire); bool bHitRoll = HitRoll::isSuccessMagic(pVampire, pSkillInfo, pSkillSlot); bool bTileCheck = canBurrow(pZone, x, y); bool bMoveModeCheck = pVampire->isWalking(); bool bEffected = pVampire->isFlag(Effect::EFFECT_CLASS_HIDE); if (bManaCheck && bTimeCheck && bRangeCheck && bHitRoll && bTileCheck && bMoveModeCheck && !bEffected) { decreaseMana(pVampire, RequiredMP, _GCSkillToSelfOK1); // 轨颇捞绢甫 顶 困俊辑 昏力窍扁 捞傈俊 扁贱 菩哦甸阑 朝赴促. _GCSkillToSelfOK1.setSkillType(SkillType); _GCSkillToSelfOK1.setCEffectID(CEffectID); _GCSkillToSelfOK1.setDuration(0); _GCSkillToSelfOK2.setXY(x, y); _GCSkillToSelfOK2.setSkillType(SkillType); _GCSkillToSelfOK2.setDuration(0); pPlayer->sendPacket(&_GCSkillToSelfOK1); pZone->broadcastPacket(x, y, &_GCSkillToSelfOK2, pVampire); // 顶 困俊 唱客乐绰 轨颇捞绢 昏力窍扼绊 舅赴促. GCDeleteObject gcDO; gcDO.setObjectID(pVampire->getObjectID()); pZone->broadcastPacket(x, y, &gcDO, pVampire); // 顶 加俊促啊 轨颇捞绢甫 眠啊茄促. addBurrowingCreature(pZone, pVampire, x, y); pSkillSlot->setRunTime(); } else { executeSkillFailNormal(pVampire, getSkillType(), NULL); } } catch(Throwable & t) { executeSkillFailException(pVampire, getSkillType()); } //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl; __END_CATCH}*///////////////////////////////////////////////////////////////////////////////// 阁胶磐 伎橇 勤甸矾//////////////////////////////////////////////////////////////////////////////void SummonMonsters::execute(Monster* pMonster) throw(Error){ __BEGIN_TRY //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " Begin" << endl; //cout << "SummonMonsters" << endl; Assert(pMonster != NULL); Zone* pZone = pMonster->getZone(); Assert(pZone != NULL); try { if (pMonster->isFlag(Effect::EFFECT_CLASS_HIDE)) { //cout << "SummonMonsters: hide" << endl; return; } if (pMonster->isFlag(Effect::EFFECT_CLASS_INVISIBILITY)) { addVisibleCreature(pZone, pMonster, true); } //GCSkillToSelfOK2 _GCSkillToSelfOK2; ZoneCoord_t x = pMonster->getX(); ZoneCoord_t y = pMonster->getY(); bool bRangeCheck = checkZoneLevelToUseSkill(pMonster); //bool bMoveModeCheck = pMonster->isWalking(); if (bRangeCheck)// && bMoveModeCheck) { //-------------------------------------------------------- // 林困俊 knockback登绰嘎绰 局甸阑 眉农秦霖促. //-------------------------------------------------------- //SkillInput input(pMonster); //SkillOutput output; //computeOutput(input, output); SUMMON_INFO2 summonInfo; bool hasInfo = pMonster->getMonsterSummonInfo( summonInfo ); if (!hasInfo || summonInfo.pMonsters==NULL) { //cout << "TID[" << Thread::self() << "]" << getSkillHandlerName() << " End" << endl; // 家券且 各捞 绝绰 版快促. -_-; executeSkillFailNormal(pMonster, getSkillType(), NULL); // 付胶磐 饭绢俊辑 付胶磐啊 各阑 家券且妨绊 茄 版快 if (pZone->isMasterLair() && pMonster->isMaster()) { MasterLairManager* pMasterLairManager = pZone->getMasterLairManager(); Assert(pMasterLairManager!=NULL); // 歹 捞惑 家券且霸 绝促搁.. // 付胶磐啊 流立 唱辑辑 轿况具摆瘤.. pMasterLairManager->setMasterReady(); //cout << "no more SummonMonsters: set MasterReady" << endl; } } if (pMonster->isMaster() && pZone->isMasterLair()) { MasterLairManager* pMasterLairManager = pZone->getMasterLairManager(); Assert(pMasterLairManager!=NULL); // minion combat俊辑绰 瘤沥等 谅钎俊 家券茄促. MasterLairInfo* pInfo = g_pMasterLairInfoManager->getMasterLairInfo( pZone->getZoneID() ); Assert(pInfo!=NULL); if (!pMasterLairManager->isMasterReady()) { x = pInfo->getSummonX(); y = pInfo->getSummonY(); GCSay gcSay; gcSay.setObjectID( pMonster->getObjectID() ); gcSay.setColor( MASTER_SAY_COLOR ); gcSay.setMessage( pInfo->getRandomMasterSummonSay() ); if (!gcSay.getMessage().empty()) pZone->broadcastPacket(pMonster->getX(), pMonster->getY(), &gcSay); } // 付胶磐 饭绢俊辑绰 家券等 阁胶磐甸捞 酒袍 救 霖促. // by sigi. 2002.11.21 summonInfo.hasItem = false; } summonInfo.scanEnemy = true; summonInfo.clanType = SUMMON_INFO::CLAN_TYPE_GROUP; summonInfo.clanID = pMonster->getClanType(); // 林牢狼 clan阑 蝶弗促. summonInfo.X = x; summonInfo.Y = y; summonInfo.regenType = REGENTYPE_PORTAL; // 阁胶磐甫 粮俊 眠啊茄促. addMonstersToZone( pZone, summonInfo ); //cout << "SummonMonsters OK" << endl; GCSkillToTileOK5 _GCSkillToTileOK5; _GCSkillToTileOK5.setObjectID(pMonster->getObjectID()); _GCSkillToTileOK5.setSkillType(getSkillType()); _GCSkillToTileOK5.setX(x); _GCSkillToTileOK5.setY(y); _GCSkillToTileOK5.setDuration( 0); pZone->broadcastPacket(x, y, &_GCSkillToTileOK5); } else { executeSkillFailNormal(pMonster, getSkillType(), NULL); } } catch(Throwable & t) { executeSkillFailException(pMonster, getSkillType()); } __END_CATCH}SummonMonsters g_SummonMonsters;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -