// This packet actually contains the char name after the opcode void CUser::GameStart(char *pBuf) { int index = 0; BYTE opcode = GetByte(pBuf, index); if (opcode == 1) { SendMyInfo(); m_pMain->UserInOutForMe(this); m_pMain->NpcInOutForMe(this); SendNotice(); SendTimeStatus(); // SendHackToolList(); char send_buff[] = { WIZ_GAMESTART }; Send(send_buff, sizeof(send_buff)); } else if (opcode == 2) { m_State = STATE_GAMESTART; UserInOut(USER_REGENE); if (!m_pUserData->m_bCity && m_pUserData->m_sHp <= 0) m_pUserData->m_bCity = -1; if (m_pUserData->m_bCity > 0) { int level = m_pUserData->m_bLevel; if (m_pUserData->m_bCity <= 100) level--; // make sure we don't exceed bounds if (level > MAX_LEVEL) level = MAX_LEVEL; else if (level < 1) level = 1; m_iLostExp = (m_pMain->GetExpByLevel(level) * (m_pUserData->m_bCity % 10) / 100); if (((m_pUserData->m_bCity % 10) / 100) == 1) m_iLostExp /= 2; } else { m_iLostExp = 0; } BlinkStart(); SetUserAbility(); // rental // ItemMallMagicRecast(); } }
// This packet actually contains the char name after the opcode void CUser::GameStart(Packet & pkt) { if (isInGame()) return; uint8 opcode = pkt.read<uint8>(); if (opcode == 1) { SendMyInfo(); g_pMain->UserInOutForMe(this); g_pMain->MerchantUserInOutForMe(this); g_pMain->NpcInOutForMe(this); SendNotice(); SendTimeStatus(); // SendHackToolList(); Packet result(WIZ_GAMESTART); Send(&result); } else if (opcode == 2) { m_state = GAME_STATE_INGAME; UserInOut(INOUT_RESPAWN); if (!m_pUserData->m_bCity && m_pUserData->m_sHp <= 0) m_pUserData->m_bCity = -1; if (m_pUserData->m_bCity > 0) { int level = GetLevel(); if (m_pUserData->m_bCity <= 100) level--; // make sure we don't exceed bounds if (level > MAX_LEVEL) level = MAX_LEVEL; else if (level < 1) level = 1; m_iLostExp = (g_pMain->GetExpByLevel(level) * (m_pUserData->m_bCity % 10) / 100); if (((m_pUserData->m_bCity % 10) / 100) == 1) m_iLostExp /= 2; } else { m_iLostExp = 0; } BlinkStart(); SetUserAbility(); // rental // ItemMallMagicRecast(); // If we've relogged while dead, we need to make sure the client // is still given the option to revive. if (isDead()) SendDeathAnimation(); } }