void ArenaTeam::NotifyStatsChanged() { // This is called after a rated match ended // Updates arena team stats for every member of the team (not only the ones who participated!) for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(itr->Guid)) SendStats(player->GetSession()); }
void SMOnlineStats::Update() { if (m_database.isConnected()) { m_database.Ping(); TransferDoneQueue(); SendStats(); ResendToSendQueue(); } else { m_database.Reconnect(); } }
void DesbugaFaceBM(int clientid,int cmd_addr) { int faceBM = 28; MOB *player = (MOB*)GetMobFromIndex(clientid); if(player->Equip[0].EFV2 = 2 && player->Equip[0].Index == 22 || player->Equip[0].Index == 23 || player->Equip[0].Index ==24 || player->Equip[0].Index == 25 || player->Equip[0].Index == 32) { MOB *playe = (MOB*)GetMobFromIndex(clientid); playe->Equip[0].Index = faceBM; Atualizar(clientid, _equip, 0); SendItens(clientid,0); GetCurrentScore(clientid); SendStats(clientid); SendScore(clientid); SendEquip(clientid); SendALL(clientid); SendClientMsg(clientid,"Sua face foi alterada."); return; } }
SMOnlineStats::~SMOnlineStats() { m_updateThread.Halt( true ); m_gameEdit = NULL; //Don't log incomplete games. map<unsigned int, GameStats*>::iterator it = m_gamesPending.begin(); while (it != m_gamesPending.end()) { SAFE_DELETE( it->second ); ++it; } m_gamesPending.clear(); //Try to send all the games that are complete. SendStats(); while(!m_gamesSend.empty()) { SAFE_DELETE(m_gamesSend.front()); m_gamesSend.pop(); } while(!m_gamesResend.empty()) { SAFE_DELETE(m_gamesResend.front()); m_gamesResend.pop(); } MLockPtr< queue<GameStats*> > gd(m_gamesDone, m_gamesDoneMUTEX); while(!gd->empty()) { SAFE_DELETE(gd->front()); gd->pop(); } }
void AddExp(int clientid) { MOB *player = (MOB*)GetMobFromIndex(clientid); int addr_bclient = clientid * 0x0410; int caos = PByte(clientid * 0x410 + 0x15c6c8e); FILE *fs = NULL; char name[100]; char Classe; char Level; Classe = player->Equip[0].EFV2; Level = player->bStatus.Level; PremioLv(clientid); if(player->Equip[0].EFV2 >= 3) { if(player->bStatus.Level >= 5) { if(player->Exp < exp_Cele_Sub[player->bStatus.Level - 2]) { player->Exp = exp_Cele_Sub[player->bStatus.Level - 1]; } } } if(player->Equip[0].EFV2 == 1) { if(player->bStatus.Level < 255) { if(player->Exp >= exp_Mortal_Arch[player->bStatus.Level]) { player->StatusPoint += 5; player->MasterPoint += 3; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 2; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; } } else if(player->bStatus.Level < 300) { if(player->Exp >= exp_Mortal_Arch[player->bStatus.Level]) { player->StatusPoint += 10; player->MasterPoint += 3; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 2; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; } } else if(player->bStatus.Level < 394) { if(player->Exp >= exp_Mortal_Arch[player->bStatus.Level]) { player->StatusPoint += 15; player->MasterPoint += 3; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 2; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; } } else if(player->bStatus.Level < 399) { if(player->Exp >= exp_Mortal_Arch[player->bStatus.Level]) { player->StatusPoint += 15; player->MasterPoint += 3; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 2; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; } } return; } else if(player->Equip[0].EFV2 == 2) { if(player->bStatus.Level == 350) { if(player->Exp >= exp_Mortal_Arch[player->bStatus.Level+4]) { player->StatusPoint += 10; player->MasterPoint += 3; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 2; player->bStatus.Defense += 3; PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; } } else if(player->bStatus.Level > 351 && player->bStatus.Level < 353) { player->StatusPoint += 13; player->MasterPoint += 3; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 2; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; } else if(player->bStatus.Level < 370) { if(player->Exp >= exp_Mortal_Arch[player->bStatus.Level]) { //if(player->QuestInfo == 1) { player->StatusPoint += 12; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 2; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; } } } else if(player->bStatus.Level < 399) { if(player->Exp >= exp_Mortal_Arch[player->bStatus.Level]) { //if(player->QuestInfo == 2) { player->StatusPoint += 12; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 2; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; } } } return; } else if(player->Equip[0].EFV2 == 3) { if(player->bStatus.Level < 40) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 5; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Attack += 1; player->bStatus.Defense += 3; player->bStatus.Level += 1; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; } } else if(player->bStatus.Level < 90) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { //if(player->QuestInfo == 1) //{ printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 10; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 3; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; //} } } else if(player->bStatus.Level < 399) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { //if(player->QuestInfo == 2) //{ printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 15; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 4; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; //} } } } else if(player->Equip[0].EFV2 == 4) { if(player->bStatus.Level < 40) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 5; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 3; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; } } else if(player->bStatus.Level < 90) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { //if(player->QuestInfo == 1) //{ printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 10; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 3; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; //} } } else if(player->bStatus.Level < 399) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { //if(player->QuestInfo == 2) //{ printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 15; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 4; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ // return; //} } } } else if(player->Equip[0].EFV2 == 5) { if(player->bStatus.Level < 40) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 5; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 3; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ // return; } } else if(player->bStatus.Level < 90) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { //if(player->QuestInfo == 1) //{ printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 10; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 3; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ // return; //} } } else if(player->bStatus.Level < 399) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { //if(player->QuestInfo == 2) //{ printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 15; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 4; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ // return; //} } } } else if(player->Equip[0].EFV2 == 6) { if(player->bStatus.Level < 40) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 7; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 3; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ // return; } } else if(player->bStatus.Level < 90) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { //if(player->QuestInfo == 1) //{ printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 10; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 4; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; //} } } else if(player->bStatus.Level < 399) { if(player->Exp >= exp_Cele_Sub[player->bStatus.Level]) { //if(player->QuestInfo == 2) //{ printf("\n %s evoluiu para level %d \n.",player->Name,player->bStatus.Level +2); player->StatusPoint += 15; player->MasterPoint += 4; player->SkillPoint += 3; player->bStatus.Level += 1; player->bStatus.Attack += 1; player->bStatus.Defense += 6; if(caos <= 148) { PByte(clientid * 0x410 + 0x15c6c8e) += 3; RespawCreatMob(clientid); SendCreateMob(clientid,clientid,1); } PInt(addr_bclient + 0x015C6A04) = PInt(addr_bclient + 0x015C6A00); player->bStatus.curHP = player->bStatus.maxMP; player->Status.curHP = player->bStatus.maxHP; player->Status.curMP = player->bStatus.maxMP; GetCurrentScore(clientid); SendScore(clientid); SendStats(clientid); SendSetHpMp(clientid); SendClientMsg(clientid, "+ + + LEVEL UP + + +"); SendEffect(3, 0xE, clientid); /*Ranking(clientid); DeletarPlayer1(clientid); DeletarPlayer2(clientid); DeletarPlayer3(clientid);*/ return; //} } } } }
QTSS_Error FilterRequest(QTSS_Filter_Params* inParams) { UInt8 sParamStopMask[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0-9 //stop unless a '\t', ' ', or '&' 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //10-19 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //20-29 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, //30-39 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //40-49 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //50-59 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //60-69 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //70-79 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //80-89 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //90-99 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //100-109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //110-119 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //120-129 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //130-139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //140-149 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //150-159 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //160-169 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //170-179 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //180-189 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //190-199 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //200-209 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //210-219 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //220-229 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //230-239 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //240-249 0, 0, 0, 0, 0, 1 //250-255 }; //check to see if we should handle this request. Invokation is triggered //by a "GET /" request QTSS_RTSPRequestObject theRequest = inParams->inRTSPRequest; StrPtrLen theFullRequest; (void)QTSS_GetValuePtr(theRequest, qtssRTSPReqFullRequest, 0, (void**)&theFullRequest.Ptr, &theFullRequest.Len); StringParser fullRequest(&theFullRequest); StrPtrLen strPtr; StrPtrLen paramName; StrPtrLen fieldsList; fullRequest.ConsumeWord(&strPtr); if ( strPtr.Equal(StrPtrLen("GET")) ) //it's a "Get" request { fullRequest.ConsumeWhitespace(); if ( fullRequest.Expect('/') ) { UInt32 refreshInterval = 0; Bool16 displayHelp = false; OSCharArrayDeleter theWebStatsURL(GetPrefAsString(sPrefs, sDefaultURLPrefName)); StrPtrLen theWebStatsURLPtr(theWebStatsURL.GetObject()); // If there isn't any web stats URL, we can just return at this point if (theWebStatsURLPtr.Len == 0) return QTSS_NoErr; fullRequest.ConsumeUntil(&strPtr, StringParser::sEOLWhitespaceQueryMask); if ( strPtr.Len != 0 && strPtr.Equal(theWebStatsURLPtr) ) //it's a "stats" request { if ( fullRequest.Expect('?') ) { do { fullRequest.ConsumeWord(¶mName); if( paramName.Len != 0) { if ( paramName.Equal(StrPtrLen("refresh",strlen("refresh"))) ) { if (fullRequest.Expect('=')) refreshInterval = fullRequest.ConsumeInteger(NULL); } else if ( paramName.Equal(StrPtrLen("help",strlen("help"))) ) { displayHelp = true; } else if ( paramName.Equal(StrPtrLen("fields",strlen("fields"))) ) { if (fullRequest.Expect('=')) fullRequest.ConsumeUntil(&fieldsList, (UInt8*)sParamStopMask); } } } while ( paramName.Len != 0 && fullRequest.Expect('&') ); } // Before sending a response, set keep alive to off for this connection (void)QTSS_SetValue(theRequest, qtssRTSPReqRespKeepAlive, 0, &sFalse, sizeof(sFalse)); SendStats(inParams->inRTSPRequest, refreshInterval, displayHelp, (fieldsList.Len != 0) ? &fieldsList : NULL); } } } return QTSS_NoErr; }
void FixUseSkill(BYTE *m_PacketBuffer, bool* pRetn) { p39D_754 *p = (p39D_754*)m_PacketBuffer; INT16 cId = p->Header.ClientId; p754_SendAffect *oldp = (p754_SendAffect*)m_PacketBuffer; INT16 oldcId = oldp->Header.ClientId; st_Mob *player = GetMobFromIndex(oldcId); if(p->m_SkillId == 103) // Skill Kefra sem ser mob { *pRetn = true; CloseUser(cId); return; } else if(!p->m_SkillId) // Se não for skill return; if(p->Header.PacketId == 0x36C && p->m_SkillId == 79) { OitavaHT(cId, p->m_Target.Index); *pRetn = true; return; } switch(p->m_SkillId) { case 27: case 29: *(DWORD*)&m_PacketBuffer[12] = 0x0; break; case 31: // Renascimento { *pRetn = true; if(cId == p->m_Target.Index) return; else if(p->m_Target.Index < 0 || p->m_Target.Index > 750) return; bool HasOnGroup = false; if(player->Leader <= 0) // Lider do grupo ou sem grupo { for(int i = 0; i < 12; i++) { if(player->PartyList[i] == p->m_Target.Index) { HasOnGroup = true; break; } } } else if(player->Leader != -1) { st_Mob *leader = GetMobFromIndex(player->Leader); for(int i = 0; i < 12; i++) { if(leader->PartyList[i] == p->m_Target.Index) { HasOnGroup = true; break; } } } if(!HasOnGroup) return; st_Mob *deadPerson = GetMobFromIndex(p->m_Target.Index); if(deadPerson->Status.curHP > 0) return; if(!player->Status.curHP || !player->Status.curMP) return; deadPerson->Status.curHP = deadPerson->Status.maxHP / 2; deadPerson->Status.curMP = deadPerson->Status.maxMP / 2; deadPerson->bStatus.curHP = deadPerson->bStatus.maxHP / 2; deadPerson->bStatus.curMP = deadPerson->bStatus.maxMP / 2; Users[p->m_Target.Index].Potion.CountMp = deadPerson->Status.curMP; Users[p->m_Target.Index].Potion.CountHp = deadPerson->Status.curHP; player->Status.curMP = 0; player->bStatus.curMP = 0; Users[cId].Potion.CountMp = player->Status.curMP; GetCurrentScore(p->m_Target.Index); BASE_GetHpMp(deadPerson); SendScore(p->m_Target.Index); SendCreateMob(p->m_Target.Index, p->m_Target.Index, 1); DoTeleport(p->m_Target.Index, deadPerson->PosX, deadPerson->PosY); break; } case 56: case 57: case 58: case 59: case 60: case 61: case 62: case 63: { *pRetn = true; UINT8 summonId = p->m_SkillId - 56; static const UINT8 MobDivisor[8] = {31, 36, 42, 51, 63, 85, 127, 255}; if(!player->Leader || player->Leader == -1) { for(int i = 0; i < 12; i++) { if(player->PartyList[i] <= 0) continue; st_Mob *tmpMob = GetMobFromIndex(player->PartyList[i]); for(int e = 0; e < 8; e++) { if(tmpMob->Equip[0].Index == MobFaces[e]) { if(tmpMob->Summoner != p->Header.ClientId) return; RemoveParty(player->PartyList[i]); SendRemoveParty(player->Leader, player->PartyList[i]); } } } } else // Não é o lider do grupo { st_Mob *Lider = GetMobFromIndex(player->Leader); for(int i = 0;i<12;i++) { if(Lider->PartyList[i] == cId) continue; if(Lider->PartyList[i] <= 0) continue; st_Mob *tmpMob = (st_Mob*)GetMobFromIndex(Lider->PartyList[i]); for(int e = 0; e < 8; e++) { if(tmpMob->Equip[0].Index == MobFaces[e]) { if(tmpMob->Summoner != p->Header.ClientId) return; RemoveParty(Lider->PartyList[i]); SendRemoveParty(Lider->Leader, Lider->PartyList[i]); } } } } // Essa conta pega o número de mobs que a skill deve criar INT16 numMob = player->Status.Mastery[2] / MobDivisor[summonId]; if(!numMob) numMob += 1; for(int i = 0; i < numMob; i++) GenerateSummon(cId, summonId, 0); break; } case 64: case 66: case 68: case 70: case 71: { if(player->Equip[13].Index > 4151 && player->Equip[13].Index < 4159) { // Está de traje SendClientMessage(cId, "Impossível utilizar esta skill enquanto trajado."); *pRetn = true; return; } break; } ////case 98: // Vinha - Skill sephira //// CreateMob("Vinha", oldp->PositionFinal.X, oldp->PositionFinal.Y, "npc"); //// break; case 99: // Ressureição - Skill sephira { *pRetn = true; INT16 Level = player->bStatus.Level + 1; if(player->Equip[0].EFV2 > ARCH) Level += 200; INT8 resChances = Level / 5; if(wdBuffer[cId].Ingame.hasFailed) return; srand(time(NULL) / 5 * (rand() % 500) * 5); if(rand() % 100 <= resChances) { player->Status.curHP = player->Status.maxHP / 2; player->Status.curMP = player->Status.maxMP / 2; player->bStatus.curHP = player->bStatus.maxHP / 2; player->bStatus.curMP = player->bStatus.maxMP / 2; GetCurrentScore(cId); BASE_GetHpMp(player); SendScore(cId); SendCreateMob(cId, cId, 1); } else if(!wdBuffer[cId].Ingame.hasFailed) wdBuffer[cId].Ingame.hasFailed = 200; break; } case 102: // Soul - Melhor buff ever { *pRetn = true; if(player->Equip[0].EFV2 == ARCH) return; bool hasSoulOn = false; for(int i = 0; i < 16; i++) if(mBuffer[cId].Affects[i].Index == 29) { hasSoulOn = true; mBuffer[cId].Affects[i].Master = wdBuffer[cId].Chars[wdBuffer[cId].Ingame.LoggedMob].SoulInfo; mBuffer[cId].Affects[i].Time = 139; mBuffer[cId].Affects[i].Value = 4; break; } if(!hasSoulOn) { for(int i = 0; i < 16; i++) if(!mBuffer[cId].Affects[i].Index) { mBuffer[cId].Affects[i].Index = 29; mBuffer[cId].Affects[i].Master = wdBuffer[cId].Chars[wdBuffer[cId].Ingame.LoggedMob].SoulInfo; mBuffer[cId].Affects[i].Time = 139; mBuffer[cId].Affects[i].Value = 4; break; } } GetCurrentScore(cId); SendStats(cId); SendScore(cId); break; } } }
void CheckQuarterByLevel(int ClientID, int earned) { MOB *player = (MOB*)GetMobFromIndex(ClientID); int exp = 0, next_exp = 0; if(player->Equip[0].EFV2 <= 2) exp = player->Exp, next_exp = exp_Mortal_Arch[player->bStatus.Level] - exp_Mortal_Arch[player->bStatus.Level-1]; else exp = player->Exp, next_exp = exp_Mortal_Arch[player->bStatus.Level] - exp_Mortal_Arch[player->bStatus.Level-1]; next_exp /= 4; if(player->Equip[0].EFV2 <= 2) { if((player->Exp < exp_Mortal_Arch[player->bStatus.Level-1]+next_exp)) { if(player->Exp + earned >= exp_Mortal_Arch[player->bStatus.Level-1]+next_exp) { SendClientMsg(ClientID, "Adquiriu 1/4 de bônus"); goto Level; } } else if((player->Exp < exp_Mortal_Arch[player->bStatus.Level-1]+next_exp)) { if(player->Exp + earned >= exp_Mortal_Arch[player->bStatus.Level - 1]+next_exp) { SendClientMsg(ClientID, "Adquiriu 2/4 de bônus"); goto Level; } } else if((player->Exp < exp_Mortal_Arch[player->bStatus.Level-1]+next_exp)) { if(player->Exp + earned >= exp_Mortal_Arch[player->bStatus.Level - 1]+next_exp) { SendClientMsg(ClientID, "Adquiriu 3/4 de bônus"); goto Level; } } } else { if((player->Exp < exp_Cele_Sub[player->bStatus.Level-1]+next_exp)) { if(player->Exp + earned >= exp_Cele_Sub[player->bStatus.Level-1]+next_exp) { SendClientMsg(ClientID, "Adquiriu 3/4 de bônus"); goto Level; } } else if((player->Exp < exp_Cele_Sub[player->bStatus.Level-1]+next_exp)) { if(player->Exp + earned >= exp_Cele_Sub[player->bStatus.Level - 1]+next_exp*1) { SendClientMsg(ClientID, "Adquiriu 2/4 de bônus"); goto Level; } } else if((player->Exp < exp_Cele_Sub[player->bStatus.Level-1]+next_exp)) { if(player->Exp + earned >= exp_Cele_Sub[player->bStatus.Level - 1]+next_exp) { SendClientMsg(ClientID, "Adquiriu 1/4 de bônus"); goto Level; } } } Level: player->Status.curHP = player->Status.maxHP; player->Status.curMP = player->Status.maxMP; SendScore(ClientID); SendStats(ClientID); GetCurrentScore(ClientID); }