Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void t_Class_Commands::ChatAddStats(DWORD aIndex,LPCSTR lpBuffer,DWORD tipo)
- {
- OBJECTSTRUCT * lpObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
- int points = atoi(lpBuffer);
- enum
- {
- STAT_FRUIT_STR = 3,
- STAT_FRUIT_DEX = 2,
- STAT_FRUIT_VIT = 1,
- STAT_FRUIT_ENE = 0,
- STAT_FRUIT_CMD = 4
- };
- int MaxPoints;
- if(FxsStc.StattusMaxPluss == 0)
- {
- MaxPoints = 32767;
- }
- else
- {
- MaxPoints = 65535;
- }
- if (CmdStruct.IsAddStatCMD == 0)
- {
- GCServerMsgStringSend(StgStc.EnabledADDMSG, aIndex, 1);
- return;
- }
- if(lpObj->LevelUpPoint < points || points < 0 || points == 0)
- {
- GCServerMsgStringSend(StgStc.PointErrorADDMSG, aIndex, 1);
- return;
- }
- if(points > MaxPoints)
- {
- char MaxPointMsg[200];
- sprintf(MaxPointMsg,StgStc.LimitPointADDMSG, MaxPoints);
- GCServerMsgStringSend(MaxPointMsg, aIndex,1);
- return;
- }
- PMSG_USE_STAT_FRUIT pMsg;
- PHeadSetB((LPBYTE)&pMsg,0x2C,sizeof(PMSG_USE_STAT_FRUIT));
- pMsg.result = 0;
- pMsg.btStatValue = points;
- switch(tipo)
- {
- case 0:
- if(lpObj->Strength+points > MaxPoints) GCServerMsgStringSend(StgStc.MaxPointADDMSG,aIndex,1); return; break;
- case 1:
- if(lpObj->Dexterity+points > MaxPoints) GCServerMsgStringSend(StgStc.MaxPointADDMSG,aIndex,1); return; break;
- case 2:
- if(lpObj->Vitality+points > MaxPoints) GCServerMsgStringSend(StgStc.MaxPointADDMSG,aIndex,1); return; break;
- case 3:
- if(lpObj->Energy+points > MaxPoints) GCServerMsgStringSend(StgStc.MaxPointADDMSG,aIndex,1); return; break;
- case 4:
- if(lpObj->Leadership+points > MaxPoints) GCServerMsgStringSend(StgStc.MaxPointADDMSG,aIndex,1); return; break;
- }
- switch(tipo)
- {
- case 0:
- pMsg.btFruitType = STAT_FRUIT_STR;
- lpObj->Strength += points;
- break;
- case 1:
- pMsg.btFruitType = STAT_FRUIT_DEX;
- lpObj->Dexterity += points;
- break;
- case 2:
- pMsg.btFruitType = STAT_FRUIT_VIT;
- lpObj->Vitality += points;
- break;
- case 3:
- pMsg.btFruitType = STAT_FRUIT_ENE;
- lpObj->Energy += points;
- break;
- case 4:
- pMsg.btFruitType = STAT_FRUIT_CMD;
- lpObj->Leadership += points;
- break;
- }
- lpObj->LevelUpPoint -= points;
- DataSend(lpObj->m_Index,(LPBYTE)&pMsg,pMsg.h.size);
- gObjCalCharacter(aIndex);
- GCReFillSend(lpObj->m_Index,lpObj->MaxLife + lpObj->AddLife,0xFE,0,lpObj->iMaxShield + lpObj->iAddShield);
- gObjSetBP(aIndex);
- GCManaSend(lpObj->m_Index,lpObj->MaxMana + lpObj->AddMana,0xFE,0,lpObj->MaxBP+ lpObj->AddBP);
- GCLevelUpMsgSend(lpObj->m_Index,0);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement