Fix- Armor Break

Ir abajo

Fix- Armor Break

Mensaje por MrKrhiz el Lun Oct 17, 2011 10:48 pm

En el Hg server >> game.cpp

void CGame::ArmorLifeDecrement(int iAttackerH, int iTargetH, char cOwnerType, int iValue)
{
int iTemp;

if (m_pClientList[iAttackerH] == NULL) return;
switch (cOwnerType) {
case DEF_OWNERTYPE_PLAYER:
if (m_pClientList[iTargetH] == NULL) return;
break;

case DEF_OWNERTYPE_NPC: return;
default: return;
}

if (m_pClientList[iAttackerH]->m_cSide == m_pClientList[iTargetH]->m_cSide) return;

if (m_pClientList[iTargetH]->m_cMagicEffectStatus[ DEF_MAGICTYPE_PROTECT ] != 0) return;

switch (iDice(1,13)) {

case 1: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_BODY];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {
if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 50) m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}

break;
}
case 2: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_PANTS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {


if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)){
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 3:{
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_LEGGINGS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {

if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 4:{
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_ARMS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {

if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 5: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_HEAD];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {

if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 6: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_HEAD];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {

if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}

iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_LEGGINGS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {

if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 7: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_LEGGINGS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {

if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}

iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_PANTS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {


if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 8: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_PANTS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {


if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}

iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_ARMS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {

if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 9: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_ARMS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {

if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 10: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_ARMS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {

if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}

iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_BODY];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {
if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 11: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_BODY];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {
if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}

iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_LEGGINGS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {

if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 12: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_BODY];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {
if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
case 13: {
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_BODY];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {
if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
iTemp = m_pClientList[iTargetH]->m_sItemEquipmentStatus[DEF_EQUIPPOS_PANTS];
if ((iTemp != -1) && (m_pClientList[iTargetH]->m_pItemList[iTemp] != NULL)) {


if ((m_pClientList[iTargetH]->m_cSide != 0) && (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan > 0)) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan -= 50;
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250){
ReleaseItemHandler(iTargetH, iTemp, TRUE);
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMRELEASED, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
}
}
if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 0) {
m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan = 0;
SendNotifyMsg(NULL, iTargetH, DEF_NOTIFY_ITEMLIFESPANEND, m_pClientList[iTargetH]->m_pItemList[iTemp]->m_cEquipPos, iTemp, NULL, NULL);
ReleaseItemHandler(iTargetH, iTemp, TRUE);
}
}
break;
}
}
}





case DEF_MAGICTYPE_DAMAGE_AREA_ARMOR_BREAK:
for (iy = dY - m_pMagicConfigList[sType]->m_sValue3; iy <= dY + m_pMagicConfigList[sType]->m_sValue3; iy++)
for (ix = dX - m_pMagicConfigList[sType]->m_sValue2; ix <= dX + m_pMagicConfigList[sType]->m_sValue2; ix++) {
m_pMapList[m_pClientList[iClientH]->m_cMapIndex]->GetOwner(&sOwnerH, &cOwnerType, ix, iy);
if (bCheckResistingMagicSuccess(m_pClientList[iClientH]->m_cDir, sOwnerH, cOwnerType, iResult) == FALSE) {
Effect_Damage_Spot_DamageMove(iClientH, DEF_OWNERTYPE_PLAYER, sOwnerH, cOwnerType, dX, dY, m_pMagicConfigList[sType]->m_sValue7, m_pMagicConfigList[sType]->m_sValue8, m_pMagicConfigList[sType]->m_sValue9 + iWhetherBonus, FALSE, iMagicAttr);
ArmorLifeDecrement(iClientH,sOwnerH, cOwnerType, m_pMagicConfigList[sType]->m_sValue10);
}

m_pMapList[m_pClientList[iClientH]->m_cMapIndex]->GetDeadOwner(&sOwnerH, &cOwnerType, ix, iy);
if ( (cOwnerType == DEF_OWNERTYPE_PLAYER) && (m_pClientList[sOwnerH] != NULL) &&
(m_pClientList[sOwnerH]->m_iHP > 0) ) {

if (bCheckResistingMagicSuccess(m_pClientList[iClientH]->m_cDir, sOwnerH, cOwnerType, iResult) == FALSE) {
Effect_Damage_Spot_DamageMove(iClientH, DEF_OWNERTYPE_PLAYER, sOwnerH, cOwnerType, dX, dY, m_pMagicConfigList[sType]->m_sValue7, m_pMagicConfigList[sType]->m_sValue8, m_pMagicConfigList[sType]->m_sValue9 + iWhetherBonus, FALSE, iMagicAttr);
ArmorLifeDecrement(iClientH,sOwnerH, cOwnerType, m_pMagicConfigList[sType]->m_sValue10);
}
}
}
break;



Baja endu hasta que el item llega a 250, recien ahi empieza a stripear.



if (m_pClientList[iTargetH]->m_pItemList[iTemp]->m_wCurLifeSpan <= 250)
avatar
MrKrhiz
Hellbreath HellOfAngel
Hellbreath HellOfAngel

Mensajes : 29
Reputacion : 1
Fecha de inscripción : 17/10/2011

Ver perfil de usuario http://helbreathymas.activo.mx

Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.