//004163C0 - identical BOOL CKalimaGate::DeleteKalimaGate(int iKalimaGateIndex, int iCallOwnerIndex) { EnterCriticalSection(&this->m_critKalimaGate); __try { if ( OBJMAX_RANGE(iKalimaGateIndex )== false || OBJMAX_RANGE(iCallOwnerIndex ) == false) { LogAddTD("[Kalima] DeleteKalimaGate() - out of Index (iKalimaGateIndex:%d, iCallOwnerIndex:%d)", iKalimaGateIndex, iCallOwnerIndex); return 0; } GCDiePlayerSend( &gObj[iKalimaGateIndex], iKalimaGateIndex, 0 , 0); gObj[iCallOwnerIndex].m_cKalimaGateExist = FALSE; gObj[iCallOwnerIndex].m_iKalimaGateIndex = -1; gObjDel(iKalimaGateIndex); gObjCharZeroSet(iKalimaGateIndex); } __finally { LeaveCriticalSection(&this->m_critKalimaGate); } return true; }
void CRaklionSelupan::CreateSummonMonster() { LPOBJ lpObj = NULL;//loc2 int loc3 = -1; int loc4 = -1; for (int i = 0; i < OBJ_MAXMONSTER; ++i ) { lpObj = &gObj[i]; if ( lpObj->MapNumber != MAP_INDEX_RAKLIONBOSS ) { continue; } if(lpObj->Class == 457 || lpObj->Class == 458) { if(lpObj->Connected == 3 && lpObj->DieRegen == 0 && lpObj->Live == 1) { continue; } loc4 = lpObj->Class; loc3 = lpObj->m_PosNum; gObjCharZeroSet(i); gObjDel(lpObj->m_Index); lpObj->Class = 0; int iMonsterIndex = gObjAddMonster(MAP_INDEX_RAKLIONBOSS); lpObj = &gObj[iMonsterIndex]; if (iMonsterIndex >= 0) { gObjSetPosMonster(iMonsterIndex, loc3); gObjSetMonster(iMonsterIndex, loc4); lpObj->Live = 1; lpObj->DieRegen = 0; LogAddTD("[RAKLION] Summoned Monster : %s => X-(%d) Y-(%d)",lpObj->Name,lpObj->X,lpObj->Y); return; } LogAddTD("[RAKLION] CreateSelupan error"); return; } } }
//00416F70 - identical void CKalimaGate::KalimaGateAct2(int iIndex) { LPOBJ lpObj = NULL; LPOBJ lpObjCallOwner = NULL; if ( OBJMAX_RANGE(iIndex) == FALSE ) return; if ( gObj[iIndex].Live == 0 ) return; if ( !gObjIsConnected(gObj[iIndex].m_RecallMon ) ) { LogAddTD("[Kalima] Kalima Gate Vanished (NextMap) - Summoner Vanished (SummonIndex:%d, EnterCount:%d)", iIndex, gObj[iIndex].m_cKalimaGateEnterCount); GCDiePlayerSend(&gObj[iIndex], iIndex, 0, 0); gObjDel(iIndex); gObjCharZeroSet(iIndex); return; } lpObj = &gObj[iIndex]; lpObjCallOwner = &gObj[lpObj->m_RecallMon]; if ( gObj[iIndex].m_cKalimaGateEnterCount >= MAX_KALIMA_ENTER ) { lpObjCallOwner->AccountID[MAX_ACCOUNT_LEN]=0; lpObjCallOwner->Name[MAX_ACCOUNT_LEN]=0; LogAddTD("[Kalima] [%s][%s] Kalima Gate Vanished - Enter Count Over (SummonIndex:%d, EnterCount:%d)", lpObjCallOwner->AccountID, lpObjCallOwner->Name, iIndex, gObj[iIndex].m_cKalimaGateEnterCount); this->DeleteKalimaGate(iIndex, gObj[iIndex].m_RecallMon); return; } DWORD dwTickCount = GetTickCount(); if ( dwTickCount > (lpObj->RegenTime+60000) ) { lpObjCallOwner->AccountID[MAX_ACCOUNT_LEN]=0; lpObjCallOwner->Name[MAX_ACCOUNT_LEN]=0; LogAddTD("[Kalima] [%s][%s] Kalima Gate Vanished (NextMap) - Time Out (SummonIndex:%d, EnterCount:%d)", lpObjCallOwner->AccountID, lpObjCallOwner->Name, iIndex, gObj[iIndex].m_cKalimaGateEnterCount); this->DeleteKalimaGate(lpObj->m_Index, lpObjCallOwner->m_Index); return; } if ( lpObj->VPCount < 1 ) return; if ( lpObj->MapNumber < MAP_INDEX_KALIMA1 || lpObj->MapNumber > MAP_INDEX_KALIMA6-1 ) return; int tObjNum = -1; for ( int i=0;i<MAX_VIEWPORT_MONSTER;i++) { tObjNum = lpObj->VpPlayer[i].number; if ( tObjNum >= 0 ) { if ( gObj[tObjNum].Type == OBJ_USER ) { if ( gObj[tObjNum].Live ) { if ( abs(lpObj->Y - gObj[tObjNum].Y) < 2 ) { if ( abs(lpObj->X - gObj[tObjNum].X) < 2 ) { if ( lpObj->m_RecallMon == tObjNum || (gObj[tObjNum].PartyNumber != -1 && lpObjCallOwner->PartyNumber == gObj[tObjNum].PartyNumber )) { int iMoveMapLevel = lpObj->MapNumber - MAP_INDEX_KALIMA1+1; // #error "Deatwway - remove the -1 int iGateNumber = g_iKalimaGateGateIndex[iMoveMapLevel]; if ( !gObjMoveGate(tObjNum, iGateNumber)) { LogAddTD("[Kalima] [%s][%s] - [%s][%s] move fail (MapNumber:%d)", lpObjCallOwner->AccountID, lpObjCallOwner->Name, gObj[tObjNum].AccountID, gObj[tObjNum].Name, lpObj->MapNumber); } else { LogAddTD("[Kalima] [%s][%s] - [%s][%s] Transported by Kalima Gate (NextMap) (SummonIndex:%d, GateNo.:%d, MapNumber:%d)", lpObjCallOwner->AccountID, lpObjCallOwner->Name, gObj[tObjNum].AccountID, gObj[tObjNum].Name, iIndex, iMoveMapLevel+1, lpObj->MapNumber); gObj[iIndex].m_cKalimaGateEnterCount++; if ( gObj[iIndex].m_cKalimaGateEnterCount >= MAX_KALIMA_ENTER ) break; } } } } } } } } }
//00415910 - identical void CKalimaGate::KalimaGateAct(int iIndex) { LPOBJ lpObj=NULL; LPOBJ lpObjCallOwner=NULL; if ( OBJMAX_RANGE(iIndex ) == FALSE) { return; } if ( gObj[iIndex].Live == FALSE ) { return; } if ( gObjIsConnected( gObj[iIndex].m_RecallMon ) == PLAYER_EMPTY ) { LogAddTD("[Kalima] Kalima Gate Vanished - Summoner Vanished (SummonIndex:%d, EnterCount:%d)", iIndex, gObj[iIndex].m_cKalimaGateEnterCount ); GCDiePlayerSend( &gObj[iIndex], iIndex, 0, 0); gObjDel(iIndex); gObjCharZeroSet(iIndex); return; } lpObj = &gObj[iIndex]; lpObjCallOwner = &gObj[lpObj->m_RecallMon]; if ( gObj[gObj[iIndex].m_RecallMon].DieRegen > 0 ) { lpObjCallOwner->AccountID[MAX_ACCOUNT_LEN]=0; lpObjCallOwner->Name[MAX_ACCOUNT_LEN]=0; LogAddTD("[Kalima] [%s][%s] Kalima Gate Vanished - Summoner Died (SummonIndex:%d, EnterCount:%d)", lpObjCallOwner->AccountID, lpObjCallOwner->Name, iIndex, gObj[iIndex].m_cKalimaGateEnterCount ); this->DeleteKalimaGate(iIndex, gObj[iIndex].m_RecallMon); return; } if ( gObj[iIndex].m_cKalimaGateEnterCount >= MAX_KALIMA_ENTER ) { lpObjCallOwner->AccountID[MAX_ACCOUNT_LEN]=0; lpObjCallOwner->Name[MAX_ACCOUNT_LEN]=0; LogAddTD("[Kalima] [%s][%s] Kalima Gate Vanished - Enter Count Over (SummonIndex:%d, EnterCount:%d)", lpObjCallOwner->AccountID, lpObjCallOwner->Name, iIndex, gObj[iIndex].m_cKalimaGateEnterCount ); this->DeleteKalimaGate(iIndex, gObj[iIndex].m_RecallMon); return; } DWORD dwTickCount = GetTickCount(); if ( dwTickCount > lpObj->RegenTime + KALIMA_GATE_TIMEOUT ) { lpObjCallOwner->AccountID[MAX_ACCOUNT_LEN]=0; lpObjCallOwner->Name[MAX_ACCOUNT_LEN]=0; LogAddTD("[Kalima] [%s][%s] Kalima Gate Vanished - Time Out (SummonIndex:%d, EnterCount:%d)", lpObjCallOwner->AccountID, lpObjCallOwner->Name, iIndex, gObj[iIndex].m_cKalimaGateEnterCount ); this->DeleteKalimaGate(lpObj->m_Index, lpObjCallOwner->m_Index); return; } if ( lpObj->VPCount < 1 ) { return; } int tObjNum=-1; for ( int i=0;i<MAX_VIEWPORT_MONSTER;i++) { tObjNum = lpObj->VpPlayer[i].number; if ( tObjNum >= 0 ) { if ( gObj[tObjNum].Type == OBJ_USER ) { if ( gObj[tObjNum].Live != FALSE ) { if ( abs(lpObj->Y - gObj[tObjNum].Y) < 2 ) { if ( abs(lpObj->X - gObj[tObjNum].X) < 2 ) { if ( lpObj->m_RecallMon == tObjNum || (gObj[tObjNum].PartyNumber != -1 && lpObjCallOwner->PartyNumber == gObj[tObjNum].PartyNumber )) { int iMoveMapLevel = lpObj->m_Attribute -51; int iMapNumber = iMoveMapLevel + 24; int iGateNumber = g_iKalimaGateGateIndex[iMoveMapLevel]; int iOverLevel = this->GetKalimaGateLevel(tObjNum); if ( iOverLevel >= iMoveMapLevel ) { if ( gObjMoveGate(tObjNum, iGateNumber) == FALSE ) { LogAddTD("[Kalima] [%s][%s] - [%s][%s] move fail (MapNumber:%d)", lpObjCallOwner->AccountID, lpObjCallOwner->Name, gObj[tObjNum].AccountID, gObj[tObjNum].Name, iMapNumber); } else { LogAddTD("[Kalima] [%s][%s] - [%s][%s] Transported by Kalima Gate (SummonIndex:%d, GateNo.:%d, MapNumber:%d)", lpObjCallOwner->AccountID, lpObjCallOwner->Name, gObj[tObjNum].AccountID, gObj[tObjNum].Name, iIndex, iMoveMapLevel + 1, iMapNumber); gObj[iIndex].m_cKalimaGateEnterCount ++; if ( gObj[iIndex].m_cKalimaGateEnterCount >= MAX_KALIMA_ENTER ) { return; } } } } } } } } } } }