📄 msgaction.cpp
字号:
CMsgAction msg;
MYASSERT (msg.Create(g_objHero.GetID(), 0, 0, 0, actionGetMagicSet));
msg.Send();
}
break;
case actionGetMagicSet:
{
CMsgAction msg;
MYASSERT (msg.Create(g_objHero.GetID(), 0, 0, 0, actionGetSynAttr));
msg.Send();
g_objHero.SetPhysicalForce(100);
::PostCmd(CMD_PPCHANGE);
}
break;
case actionGetSynAttr: //接受帮派信息
{
g_objHero.SetQuerySchoolMember(false);
g_objHero.QuerySchoolMember();
}
break;
case actionQuerySchoolMember:
{
g_objHero.SetQuerySchoolMember(true);
}
break;
case actionChgMap:
{
}
break;
case actionChgWeather:
break;
case actionEquip:
{
pPlayer->SetRWeapon(m_pInfo->dwData);
}
break;
case actionUnequip:
{
pPlayer->SetRWeapon(ID_NONE);
}
break;
case actionUplev:
{
if (pPlayer->IsMyPet())
{
char szMsg[128] = "";
sprintf(szMsg, g_objGameDataSet.GetStr(100178), pPlayer->GetName() ); //100178=恭喜你的幻兽%s升了一级,幻兽能力得到增强
g_objGameMsg.AddMsg(szMsg);
}
pPlayer->DoLevelUp();
}
break;
case actionSetPkMode:
{
g_objHero.SetPkMode(m_pInfo->iData, false);
}
break;
case actionChangeFace:
{
pPlayer->SetFace(m_pInfo->dwData);
if (g_objHero.GetID() == m_pInfo->idUser)
::PostCmd(CMD_FLASH_HERO_FACE);
}
break;
case actionAbortMagic:
{
if(pPlayer->GetID() == g_objHero.GetID())
{
g_objHero.EndMagicBusy();
g_objHero.StopChargeUp();
}
//pPlayer->m_objEffect.Add("BodyDisapear");
}
break;
case actionCreateBooth:
{
if(pPlayer->GetID() == g_objHero.GetID())
g_objHero.m_objBoothManager.Open(m_pInfo->idTarget);
}
break;
case actionResumeBooth:
{
if(pPlayer->GetID() == g_objHero.GetID())
g_objHero.m_objBoothManager.Open(m_pInfo->idTarget);
}
break;
case actionCombineSubSyn:
{
g_objHero.UniteSyn(m_pInfo->idUser, m_pInfo->idTarget);
}
break;
case actionGetMoney:
{
if(pPlayer)
pPlayer->AddMoneyEffect(m_pInfo->dwData);
}
break;
case actionKickBack:
{
if(pPlayer->GetID() == g_objHero.GetID())
{
CMyPos posCell;
g_objHero.GetPos(posCell);
//if(m_pInfo->unPosX == posCell.x && m_pInfo->unPosY == posCell.y)
// return;
posCell.x = m_pInfo->unPosX;
posCell.y = m_pInfo->unPosY;
g_objHero.ResetActionData();
g_objHero.ResetStepDir();
g_objHero.SetPos(posCell);
g_objHero.SetAlignPos(posCell.x, posCell.y);
CMsgAction msg;
if(msg.Create(g_objHero.GetID(), 0, 0, g_objHero.GetDir(), actionSynchro, posCell.x, posCell.y))
msg.Send();
}
if(pPlayer->IsMyPet())
{
CMyPos posCell;
pPlayer->GetPos(posCell);
//if(m_pInfo->unPosX == posCell.x && m_pInfo->unPosY == posCell.y)
// return;
posCell.x = m_pInfo->unPosX;
posCell.y = m_pInfo->unPosY;
pPlayer->ResetActionData();
pPlayer->ResetStepDir();
pPlayer->SetPos(posCell);
CPet* pPet = (CPet*)pPlayer;
//pPet->SetAlignPos(posCell.x, posCell.y);
CMsgAction msg;
if(msg.Create(pPlayer->GetID(), 0, 0, pPlayer->GetDir(), actionSynchro, posCell.x, posCell.y))
msg.Send();
}
}
break;
case actionOpenDialog:
{
switch(m_pInfo->dwData)
{
case 1: // shop
{
::PostCmd(CMD_ACTION_OPENSHOP);
}
break;
/* case 2: // IMPORVE
{
::PostCmd(CMD_ACTION_OPENIMPORVE);
}
break;*/
case 3: // DEPOT
{
::PostCmd(CMD_ACTION_OPENDEPOT);
}
break;
case 4: // EMBED
{
::PostCmd(CMD_ACTION_OPENEMBED);
}
break;
case 5:
{
::PostCmd(CMD_ACTION_PLAYERTASKUP);
}
break;
case 6:
{
::PostCmd(CMD_ACTION_UNACCEPTEDTASKLIST);
}
break;
case 7: //
{
::PostCmd(CMD_ACTION_ACCEPTEDTASKLIST);
}
break;
case 8:
{
::PostCmd(CMD_ACTION_MYTASKLIST);
}
break;
case 10: // up my announce
{
::PostCmd(CMD_ACTION_OPENUPANNOUNCE);
}
break;
case 11: // annnounce list
{
::PostCmd(CMD_ACTION_OPENANNOUNCELIST);
}
break;
case 12: // my announce
{
::PostCmd(CMD_ACTION_OPENMYANNOUNCE);
}
break;
case 13:
{
::PostCmd(CMD_ACTION_OPENMONSTERHATCH);
}
break;
case 14:
{
::PostCmd(CMD_ACTION_OPENMONSTERALIVE);
}
break;
case 15:
{
::PostCmd(CMD_ACTION_OPENMONSTERIMPROVE);
}
break;
case 16:
{
::PostCmd(CMD_ACTION_OPENMONSTERDEPOT);
}
break;
case 17: //头像改变npc dialog
{
::PostCmd(CMD_ACTION_OPENNPCFACE);
}
break;
case 18:
{
::PostCmd(CMD_ACTION_OPENBOOTH);
}
break;
case 19:
{
::PostCmd(CMD_ACTION_OPENBOOTHFLAG);
}
break;
case 20:
{
::PostCmd(CMD_ACTION_OPENDICECFM);
}
break;
case 21: //加进拍卖物品
{
::PostCmd(CMD_ACTION_OPENADDAUCTION);
}
break;
case 22: //拍卖叫价界面
{
::PostCmd(CMD_ACTION_OPENAUCTIONBID);
}
break;
case 23: //品质锻造
{
::PostCmd(CMD_ACTION_OPENIMPROVE);
}
break;
case 24: //魔魂锻造
{
::PostCmd(CMD_ACTION_OPENIMPROVESOUL);
}
break;
case 25: //武器升级
{
::PostCmd(CMD_ACTION_OPENIMPROVELEVEL);
}
break;
case 26: //宝石注入
{
::PostCmd(CMD_ACTION_OPENIMPROVEGEM);
}
break;
case 27: //拍卖仓库
{
::PostCmd(CMD_ACTION_OPENAUCPACKAGE);
}
break;
case 28: //鉴定
{
::PostCmd(CMD_ACTION_IDENTBOX);
}
break;
case 29: //幻兽一次进化 -圣兽
{
::PostCmd(CMD_ACTION_EVOMONSTERG);
}
break;
case 30: //幻兽一次进化-魔兽
{
::PostCmd(CMD_ACTION_EVOMONSTERS);
}
break;
case 31: //幻兽2次进化 生命之神
{
::PostCmd(CMD_ACTION_EVOMONSTER1);
}
break;
case 32: //幻兽2次进化 公正之神
{
::PostCmd(CMD_ACTION_EVOMONSTER2);
}
break;
case 33: //幻兽2次进化 智慧之神
{
::PostCmd(CMD_ACTION_EVOMONSTER3);
}
break;
case 34: //幻兽2次进化 锻造之神
{
::PostCmd(CMD_ACTION_EVOMONSTER4);
}
break;
case 35: //幻兽2次进化 混沌死神
{
::PostCmd(CMD_ACTION_EVOMONSTER5);
}
break;
case 36: //幻兽2次进化 阴谋之神
{
::PostCmd(CMD_ACTION_EVOMONSTER6);
}
break;
case 37: //幻兽2次进化 战争之神
{
::PostCmd(CMD_ACTION_EVOMONSTER7);
}
break;
case 38: //幻兽2次进化 腐败之神
{
::PostCmd(CMD_ACTION_EVOMONSTER8);
}
break;
}
}
break;
case actionAgreeStudentApply:
break;
case actionAgreeTeacherApply:
break;
case actionStudentApply:
{
g_objHero.SetLastStudentApply(m_pInfo->idUser);
}
break;
case actionTeacherApply:
{
g_objHero.SetLastTeacherApply(m_pInfo->idUser);
}
break;
case actionDismissStudent:
break;
case actionLeaveTeacher:
break;
case actionLockUser:
{
if(m_pInfo->idUser == g_objHero.GetID())
{
g_objHero.MagicLock();
g_objHero.SetAlignPos(m_pInfo->unPosX, m_pInfo->unPosY);
}
pPlayer->ResetStepDir();
pPlayer->ResetActionData();
CMyPos posCell = {m_pInfo->unPosX, m_pInfo->unPosY};
CMyPos posWorld;
g_objGameMap.Cell2World(posCell.x, posCell.y,posWorld.x, posWorld.y);
pPlayer->SetDir(m_pInfo->unDir);
pPlayer->SetPos(posCell);
pPlayer->SetWorldPos(posWorld);
}
break;
case actionUnLockUser:
{
if(m_pInfo->idUser == g_objHero.GetID())
{
g_objHero.UnMagicLock();
g_objHero.SetAlignPos(m_pInfo->unPosX, m_pInfo->unPosY);
}
/*pPlayer->ResetStepDir();
pPlayer->ResetActionData();
pPlayer->SetDir(m_pInfo->unDir);
CMyPos posCell = {m_pInfo->unPosX, m_pInfo->unPosY};
CMyPos posWorld;
g_objGameMap.Cell2World(posCell.x, posCell.y,posWorld.x, posWorld.y);
pPlayer->SetPos(posCell);
pPlayer->SetWorldPos(posWorld);*/
}
break;
case actionSoundEffect:
{
EffectIndex* pIndex = g_obj3DRoleData.GetEffectIndexInfo(m_pInfo->dwData);
if(pIndex)
{
CPlayer* pPlayer = g_objPlayerSet.GetPlayer(m_pInfo->idUser, true);
if(pPlayer)
{
pPlayer->m_objEffect.Add((char*)pIndex->strEffect.c_str(),false,0,pPlayer->GetLook());
pPlayer->Disappear(pIndex->dwData);
}
CMyPos posWorld;
g_objGameMap.Cell2World(m_pInfo->unPosX, m_pInfo->unPosY, posWorld.x, posWorld.y);
::DXPlaySound((char*)pIndex->strWave.c_str(), posWorld.x, posWorld.y, 1000);
}
}
break;
case actionMagicTrack:
{
if(m_pInfo->idUser == g_objHero.GetID())
{
g_objHero.SetAlignPos(m_pInfo->unPosX, m_pInfo->unPosY);
}
pPlayer->ResetStepDir();
CMyPos posWorld, posCell;
pPlayer->GetActionEndPos(posWorld.x, posWorld.y);
pPlayer->SetWorldPos(posWorld);
g_objGameMap.World2Cell(posWorld.x, posWorld.y, posCell.x, posCell.y);
pPlayer->SetPos(posCell);
pPlayer->ResetActionData();
pPlayer->SetDir(m_pInfo->unDir);
CCommand cmd;
cmd.iType = _COMMAND_INTONE;
cmd.iStatus = _CMDSTATUS_BEGIN;
//cmd.nData = m_pInfo->dwData%1000;
cmd.nDir = m_pInfo->unDir;
cmd.bData = false;
cmd.bAddUp = true;
cmd.dwData = 2;
cmd.posTarget.x = m_pInfo->unPosX;
cmd.posTarget.y = m_pInfo->unPosY;
//cmd.nTargetZ = m_pInfo->dwData/1000;
TrackInfo* pInfo = g_obj3DRoleData.GetTrackInfo(m_pInfo->dwData);
if(pInfo)
{
cmd.nTargetZ = pInfo->nHeight;
cmd.nData = pInfo->nAction;
strcpy(cmd.szString0, pInfo->strEffect.c_str());
strcpy(cmd.szString1, pInfo->strWave.c_str());
cmd.nFrameInterval = pInfo->nFrameInterval;
cmd.nFrameStart = pInfo->nStartFrame;
cmd.nFrameEnd = pInfo->nEndFrame;
}
else
{
cmd.nData = _ACTION_STANDBY;
}
CCommand* pCmd = new CCommand;
memcpy(pCmd, &cmd, sizeof(CCommand));
pPlayer->m_setCmd.push_back(pCmd);
}
break;
case actionBurstXp:
g_objHero.ReplaceStatus(USERSTATUS_XPFULL);
break;
case actionChangeToRandomPos: //随机移动
if (m_pInfo->idUser == g_objHero.GetID())
{
g_objHero.SetPos(m_pInfo->unPosX, m_pInfo->unPosY);
g_objHero.SetAlignPos(m_pInfo->unPosX, m_pInfo->unPosY);
int nAmount = g_objPlayerSet.GetPlayerAmount();
for(int i = 0; i < nAmount; i ++)
{
CPlayer* pPlayer = g_objPlayerSet.GetPlayerByIndex(i);
if(pPlayer && pPlayer->IsMyPet())
{
pPlayer->ResetActionData();
pPlayer->ResetStepDir();
pPlayer->SetPos(m_pInfo->unPosX, m_pInfo->unPosY);
// CPet* pPet = (CPet*)pPlayer;
// pPet->SetAlignPos(m_pInfo->unPosX, m_pInfo->unPosY);
}
}
g_objHero.ResetActionData();
}
else
{
int nAmount = g_objPlayerSet.GetPlayerAmount();
for(int i = 0; i < nAmount; i ++)
{
CPlayer* pPlayer = g_objPlayerSet.GetPlayerByIndex(i);
if(pPlayer && pPlayer->GetID() == m_pInfo->idUser)
{
pPlayer->ResetActionData();
pPlayer->ResetStepDir();
pPlayer->SetPos(m_pInfo->unPosX, m_pInfo->unPosY);
}
}
}
break;
case actionDisappear:
{
}
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -