void CCrywolfAltar::ResetAltar(int iClass) { int iAltarNumber = this->GetAlatarNumber(iClass); CCrywolfAltarInfo * AltarInfo = &this->m_AltarInfo[iAltarNumber]; if ( AltarInfo->m_iAltarIndex == -1 ) { return; } gObjClearBuffEffect(&gObj[AltarInfo->m_iAltarIndex], CLEAR_TYPE_LOGOUT); AltarInfo->Reset(); }
BOOL TMonsterSkillElement::ApplyElementSummon(int iIndex, int iTargetIndex) { LPOBJ lpObj = &gObj[iIndex]; LPOBJ lpTargetObj = &gObj[iTargetIndex]; if( lpObj->Class == 459 && lpObj->Connected == PLAYER_PLAYING && lpObj->MapNumber == MAP_INDEX_RAKLIONBOSS && iIndex == iTargetIndex) { LogAddTD("[TMonsterSkillElement][ApplyElementSummon] Selupan use summon."); return FALSE; } if ( lpTargetObj->Connected < PLAYER_PLAYING || lpTargetObj->Type != OBJ_MONSTER ) return FALSE; lpTargetObj->Life = lpTargetObj->MaxLife + lpTargetObj->AddLife; lpTargetObj->Mana = lpTargetObj->MaxMana + lpTargetObj->AddMana; lpTargetObj->Live = TRUE; gObjRemoveBuffEffect(lpTargetObj,BUFF_POISON); gObjRemoveBuffEffect(lpTargetObj,BUFF_ICE); gObjRemoveBuffEffect(lpTargetObj,BUFF_ICEARROW); lpTargetObj->m_ViewState = 0; lpTargetObj->Teleport = 0; gObjClearBuffEffect(lpTargetObj,CLEAR_TYPE_LOGOUT); for ( int i=0;i<MAX_SELF_DEFENSE;i++) lpTargetObj->SelfDefenseTime[i] = 0; gObjTimeCheckSelfDefense(lpTargetObj); gObjViewportListProtocolDestroy(lpTargetObj); gObjViewportClose(lpTargetObj); lpTargetObj->m_ActState.Attack = 0; lpTargetObj->m_ActState.EmotionCount = 0; lpTargetObj->m_ActState.Escape = 0; lpTargetObj->m_ActState.Move = 0; lpTargetObj->m_ActState.Rest = 0; lpTargetObj->m_ActState.Emotion = 0; lpTargetObj->TargetNumber = -1; lpTargetObj->NextActionTime = 5000; if ( this->m_iIncAndDecValue < 0 ) this->m_iIncAndDecValue = 10; BYTE cX; BYTE cY; BOOL bGetPosition = FALSE; int iCount = 100; while ( iCount-- != 0 ) { cX = ( rand() % (this->m_iIncAndDecValue+1) ) * (((rand()%2==0)?-1:1)) + lpObj->X; cY = ( rand() % (this->m_iIncAndDecValue+1) ) * (((rand()%2==0)?-1:1)) + lpObj->Y; BYTE btMapAttr = MapC[lpObj->MapNumber].GetAttr(cX, cY); if ( btMapAttr == 0 ) { bGetPosition = TRUE; break; } } if ( bGetPosition == FALSE ) { lpObj->Live = FALSE; lpObj->m_State = 4; lpObj->RegenTime = GetTickCount(); lpObj->DieRegen = 1; return FALSE; } lpTargetObj->X = cX; lpTargetObj->Y = cY; lpTargetObj->MTX = lpTargetObj->X; lpTargetObj->MTY = lpTargetObj->Y; lpTargetObj->TX = lpTargetObj->X; lpTargetObj->TY = lpTargetObj->Y; lpTargetObj->StartX = lpTargetObj->X; lpTargetObj->StartY = lpTargetObj->Y; gObjMonsterHitDamageInit(lpTargetObj); CreateFrustrum(lpTargetObj->X, lpTargetObj->Y, lpTargetObj->m_Index); lpTargetObj->DieRegen = 0; lpTargetObj->m_State = 1; lpTargetObj->m_Agro.ResetAll(); gObjViewportListCreate(lpTargetObj->m_Index); return FALSE; }
void CEledoradoEvent::RegenKantur() { int n=0; int MapNumber; for (n=0;n<OBJ_MAXMONSTER;n++) { if ( gObj[n].Class == 82 ) // Gold Tantalos { gObj[n].Live = TRUE; MapNumber = 8; gObj[n].MapNumber = MapNumber; while ( gMSetBase.GetBoxPosition(MapNumber, 50, 50, 200, 200, gObj[n].X, gObj[n].Y) == 0 ) { } this->m_BossKanturMapNumber = gObj[n].MapNumber; this->m_BossKanturMapX = gObj[n].X; this->m_BossKanturMapY = gObj[n].Y; gObj[n].Life = gObj[n].MaxLife; //LogAddTD("GoldenDebug %d HP: %d", gObj[n].Class, gObj[n].Life); gObj[n].TX = gObj[n].X; gObj[n].TY = gObj[n].Y; gObj[n].MTX = gObj[n].X; gObj[n].MTY = gObj[n].Y; gObj[n].StartX = gObj[n].X; gObj[n].StartY = gObj[n].Y; gObjClearBuffEffect(&gObj[n], CLEAR_TYPE_DIEREGEN); gObj[n].m_ViewState = 0; gObj[n].Teleport = 0; gObj[n].m_State = 1; gObj[n].PathCount = 0; LogAddTD("Make GoldTantarus : %d, %d,%d", MapNumber, gObj[n].X, gObj[n].Y); } else if ( gObj[n].Class == 83 ) // Gold Iron Wheel { gObj[n].Live = TRUE; MapNumber = this->m_BossKanturMapNumber; gObj[n].MapNumber = MapNumber; gMSetBase.GetBoxPosition(MapNumber, this->m_BossKanturMapX-10, this->m_BossKanturMapY-10, this->m_BossKanturMapX+10, this->m_BossKanturMapY+10, gObj[n].X, gObj[n].Y); gObj[n].Life = gObj[n].MaxLife; /*LogAddTD("GoldenDebug %d HP: %d", gObj[n].Class, gObj[n].Life); gObj[n].TX = gObj[n].X; gObj[n].TY = gObj[n].Y; gObj[n].MTX = gObj[n].X; gObj[n].MTY = gObj[n].Y; gObj[n].StartX = gObj[n].X; gObj[n].StartY = gObj[n].Y; gObj[n].m_State = 1; gObj[n].PathCount = 0;*/ } } }