Source: Cancelation

All Helbreath Server Source Discussion here.
Post Reply
Daxation
Regular
Posts: 56
Joined: Mon Apr 26, 2004 1:45 am

Post by Daxation »

i was looking through the forums on www.acid-x.com and i noticed acid's cancelation code wasnt working propperly, it must have been pasted wrong or somthing lol coz it had a few errors.

all i did here was fix a few minor errors, full credit to acid-x on this 1.

Code: Select all

// Cancellation Magic , Also Inhabitation Casting 
            case DEF_MAGICTYPE_CANCELLATION: 
               m_pMapList[m_pClientList[iClientH]->m_cMapIndex]->GetOwner(&sOwnerH, 

&cOwnerType, dX, dY); 
               if ( (cOwnerType == DEF_OWNERTYPE_PLAYER) && (m_pClientList[sOwnerH] != NULL) 

&& (m_pClientList[sOwnerH]->m_iHP > 0) && (m_pClientList[iClientH]->m_iAdminUserLevel < 1) ) { 

                  // Removes Invisibility Flag 0x0010 
                  SetInvisibilityFlag(sOwnerH, cOwnerType, FALSE); 

                  // Removes Illusion Flag 0x01000000 
                  SetIllusionFlag(sOwnerH, cOwnerType, FALSE); 

                  // Removes Defense Shield Flag 0x02000000 
                  // Removes Great Defense Shield Flag 0x02000000 
                  SetDefenseShieldFlag(sOwnerH, cOwnerType, FALSE); 

                  // Removes Absolute Magic Protection Flag 0x04000000    
                  // Removes Protection From Magic Flag 0x04000000 
                  SetMagicProtectionFlag(sOwnerH, cOwnerType, FALSE); 

                  // Removes Protection From Arrow Flag 0x08000000 
                  SetProtectionFromArrowFlag(sOwnerH, cOwnerType, FALSE); 

                  // Removes Illusion Movement Flag 0x00200000 
                  SetIllusionMovementFlag(sOwnerH, cOwnerType, FALSE); 

                  // Removes Berserk Flag 0x0020 
                  SetBerserkFlag(sOwnerH, cOwnerType, FALSE); 

                  // Removes Inhibition Casting Flag 
                  //            SetInhibitionCastingFlag(sOwnerH,cOwnerType, FALSE); 

                  /*            if (m_pClientList[iClientH]- 

    	>m_iStatus & 0x0040) 
                  bRemoveFromDelayEventList(sOwnerH, DEF_OWNERTYPE_PLAYER, 

    	DEF_MAGICTYPE_INHIBITCASTING); 
                  bRegisterDelayEvent(DEF_DELAYEVENTTYPE_MAGICRELEASE, 

    	DEF_MAGICTYPE_INHIBITCASTING, dwTime + (m_pMagicConfigList[sType]->m_dwLastTime), 
                  sOwnerH, cOwnerType, NULL, NULL, NULL, m_pMagicConfigList[sType]- 

    	>m_sValue4, NULL, NULL);*/ 

                  if (m_pClientList[iClientH]->m_iStatus & 0x0010) 
                     bRemoveFromDelayEventList(sOwnerH, 

      DEF_OWNERTYPE_PLAYER, DEF_MAGICTYPE_INVISIBILITY); 
                  bRegisterDelayEvent(DEF_DELAYEVENTTYPE_MAGICRELEASE, 

      DEF_MAGICTYPE_INVISIBILITY, dwTime + (m_pMagicConfigList[sType]->m_dwLastTime), 
                     sOwnerH, cOwnerType, NULL, NULL, NULL, m_pMagicConfigList[sType]->m_sValue4, NULL, NULL); 

                  if (m_pClientList[iClientH]->m_iStatus & 0x0020) 
                     bRemoveFromDelayEventList(sOwnerH, 

    DEF_OWNERTYPE_PLAYER, DEF_MAGICTYPE_BERSERK); 
                  bRegisterDelayEvent(DEF_DELAYEVENTTYPE_MAGICRELEASE, 

    DEF_MAGICTYPE_BERSERK, dwTime + (m_pMagicConfigList[sType]->m_dwLastTime), 
                     sOwnerH, cOwnerType, NULL, NULL, NULL, m_pMagicConfigList[sType]->m_sValue4, NULL, NULL); 

                  if ( (m_pClientList[iClientH]->m_iStatus & 0x08000000) || (m_pClientList[iClientH]->m_iStatus & 0x04000000) || (m_pClientList[iClientH]->m_iStatus & 0x02000000)) 
                     bRemoveFromDelayEventList(sOwnerH, 

DEF_OWNERTYPE_PLAYER, DEF_MAGICTYPE_PROTECT); 
                  bRegisterDelayEvent(DEF_DELAYEVENTTYPE_MAGICRELEASE, 

DEF_MAGICTYPE_PROTECT, dwTime + (m_pMagicConfigList[sType]->m_dwLastTime), 
                     sOwnerH, cOwnerType, NULL, NULL, NULL, m_pMagicConfigList[sType]->m_sValue4, NULL, NULL); 

                  if ((m_pClientList[iClientH]->m_iStatus & 0x01000000) || (m_pClientList[iClientH]->m_iStatus & 0x00200000)) 
                     bRemoveFromDelayEventList(sOwnerH, 

DEF_OWNERTYPE_PLAYER, DEF_MAGICTYPE_CONFUSE); 
                  bRegisterDelayEvent(DEF_DELAYEVENTTYPE_MAGICRELEASE, 

DEF_MAGICTYPE_CONFUSE, dwTime + (m_pMagicConfigList[sType]->m_dwLastTime), 
                     sOwnerH, cOwnerType, NULL, NULL, NULL, m_pMagicConfigList[sType]->m_sValue4, NULL, NULL); 

                  // Update Client 
                  SendEventToNearClient_TypeA(sOwnerH, DEF_OWNERTYPE_PLAYER, 

MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL); 
               } 
               break;
well that should compile/work perfectly
binarydata
DBfiller
Posts: 3816
Joined: Fri Oct 31, 2003 5:30 am
Location: San Diego CA, USA
Contact:

Post by binarydata »

umm, it was already fixed
<img src='http://img88.exs.cx/img88/2290/7666.jpg' border='0' alt='user posted image' />
Daxation
Regular
Posts: 56
Joined: Mon Apr 26, 2004 1:45 am

Post by Daxation »

well acid's didnt work so i fixed it. and i dont see any1 else posting code snippets around here
binarydata
DBfiller
Posts: 3816
Joined: Fri Oct 31, 2003 5:30 am
Location: San Diego CA, USA
Contact:

Post by binarydata »

it worked in like, 2.16 or sumthin
it was fixed a long time ago
<img src='http://img88.exs.cx/img88/2290/7666.jpg' border='0' alt='user posted image' />
Daxation
Regular
Posts: 56
Joined: Mon Apr 26, 2004 1:45 am

Post by Daxation »

are you retarded? this is for 2.14 source. it dont work in that so im posting it coz acid's had some errors too and some people might be too retarded to fix it. this is for 2.14 source, so people can add it in if they wanted to add thier own features to thier hgserver
Post Reply