BOOL TMonsterSkillElement::ApplyElementPush(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 ) { return false; } if ( this->m_iNullifiedSkill == -1 ) this->m_iNullifiedSkill = 0; if ( this->m_iIncAndDecValue < 1 ) this->m_iIncAndDecValue = 3; if ( this->m_iNullifiedSkill == 0 ) { gObjBackSpring2(lpTargetObj, lpObj,this->m_iIncAndDecValue); } else { gObjAddMsgSendDelay(lpObj, 57, iTargetIndex, this->m_iNullifiedSkill, this->m_iIncAndDecValue); } return FALSE; }
void CCrywolf::SetState_START() { UTIL.SendMapServerGroupMsg("The army of Balgass is marching towards Crywolf Fortress"); LogAdd( "[ Crywolf ] State (%d) -> START", this->m_iCrywolfState); this->SetCrywolfState(CRYWOLF_STATE_START); this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_START); if ( g_CrywolfNPC_Altar.GetContractedAltarCount() == 0 ) { UTIL.SendCrywolfUserAnyMsg(2, "Without the protection of the Muses, the statue of holy wolf will be stolen"); this->SetOccupationState(1); this->SetState(CRYWOLF_STATE_END); return; } for ( int n=0;n<this->m_iMonsterGroupNumberCount;n++) { int iLeaderIndex = TMonsterAIGroup::FindGroupLeader(this->m_iMonsterGroupNumberArray[n]); if ( !CHECK_LIMIT(iLeaderIndex, OBJ_MAXMONSTER) ) continue; if ( gObj[iLeaderIndex].Class != 340 ) continue; LPOBJ lpObj = &gObj[iLeaderIndex]; for ( int i=0;i<MAX_VIEWPORT_MONSTER;i++) { if ( lpObj->VpPlayer2[i].state ) { int number = lpObj->VpPlayer2[i].number; if ( OBJMAX_RANGE(number) != FALSE ) { if ( gObj[number].Type == OBJ_USER ) { gObjBackSpring2(&gObj[number], lpObj, 3); } } } } } this->ChangeAI(1); this->m_dwCrywolfStartProcTick = GetTickCount(); this->m_bTurnUpBoss = FALSE; this->m_bChangeAI = FALSE; }
void CCrywolf::SetState_START() { UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 231))); LogAddC(4, "[ Crywolf ] State (%d) -> START", this->m_iCrywolfState); this->SetCrywolfState(CRYWOLF_STATE_START); this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_START); if ( g_CrywolfNPC_Altar.GetContractedAltarCount() == 0 ) { UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 232))); this->SetOccupationState(1); this->SetState(CRYWOLF_STATE_END); return; } for ( int n=0;n<this->m_iMonsterGroupNumberCount;n++) { int iLeaderIndex = TMonsterAIGroup::FindGroupLeader(this->m_iMonsterGroupNumberArray[n]); if ( !CHECK_LIMIT(iLeaderIndex, OBJ_MAXMONSTER) ) continue; if ( gObj[iLeaderIndex].Class != 340 ) continue; LPOBJ lpObj = &gObj[iLeaderIndex]; for ( int i=0;i<MAX_VIEWPORT_MONSTER;i++) { if ( lpObj->VpPlayer2[i].state ) { int number = lpObj->VpPlayer2[i].number; if ( OBJMAX_RANGE(number) != FALSE ) { if ( gObj[number].Type == OBJ_USER ) { gObjBackSpring2(&gObj[number], lpObj, 3); } } } } } this->ChangeAI(1); this->m_dwCrywolfStartProcTick = GetTickCount(); this->m_bTurnUpBoss = FALSE; this->m_bChangeAI = FALSE; }
BOOL TMonsterSkillElement::ApplyElementPush(int iIndex, int iTargetIndex) { LPOBJ lpObj = &gObj[iIndex]; LPOBJ lpTargetObj = &gObj[iTargetIndex]; if ( this->m_iNullifiedSkill == -1 ) this->m_iNullifiedSkill = 0; if ( this->m_iIncAndDecValue < 1 ) this->m_iIncAndDecValue = 3; if ( this->m_iNullifiedSkill == 0 ) { gObjBackSpring2(lpTargetObj, lpObj,this->m_iIncAndDecValue); } else { gObjAddMsgSendDelay(lpObj, 57, iTargetIndex, this->m_iNullifiedSkill, this->m_iIncAndDecValue); } return FALSE; }
BOOL CObjBaseAttack::ResistanceCheck(LPOBJ lpObj, LPOBJ lpTargetObj, int skill) { //missing objects? maybe from _CS side or deleted in 1.01.00 if( lpTargetObj->Type != OBJ_USER) { if(lpTargetObj->Class == 277 || lpTargetObj->Class == 283 || lpTargetObj->Class == 288 || lpTargetObj->Class == 278 || lpTargetObj->Class == 215 || lpTargetObj->Class == 216 || lpTargetObj->Class == 217 || lpTargetObj->Class == 218 || lpTargetObj->Class == 219) { return FALSE; } } if( lpTargetObj->Type != OBJ_USER) { if( CRYWOLF_ALTAR_CLASS_RANGE(lpTargetObj->Class) != FALSE || CRYWOLF_STATUE_CHECK(lpTargetObj->Class) != FALSE ) //HermeX Fix @28/01/2010 { return FALSE; } } if ( skill == 62 ) { gObjBackSpring2(lpTargetObj, lpObj, 3); } if(g_MasterSkillSystem.GetBaseMasterLevelSkill(skill) == 512) //Earth Quake Master { gObjBackSpring2(lpTargetObj, lpObj, 3); } if( skill == 516) { gObjBackSpring2(lpTargetObj, lpObj, 3); } if ( skill == 19 || skill == 20 || skill == 21 || skill == 22 || skill == 23 || skill == 260 || skill == 261 || skill == 262 || skill == 270 || skill == 326 || skill == 327 || skill == 328 || skill == 329 || skill == 479 ) { gObjAddMsgSendDelay(lpTargetObj, 2, lpObj->m_Index, 150, 0); } else if ( skill == 3 || skill == 379 || skill == 480 ) // Poison { if ( retResistance(lpTargetObj, 2) == 0 ) { gObjAddMsgSendDelay(lpTargetObj, 2, lpObj->m_Index, 150, 0); return TRUE; } return FALSE; } else if ( skill == 1 || skill == 384 ) { if(gObjCheckUsedBuffEffect(lpObj, AT_POISON) == 0) { if ( retResistance(lpTargetObj, 1) == 0 ) { lpTargetObj->lpAttackObj = lpObj; gObjAddBuffEffect(lpTargetObj, AT_POISON, 19, 3, 0, 0, 20); return TRUE; } else { return FALSE; } } else { return FALSE; } } else if ( skill == 38 || skill == 387 ) // Death Poison { if(gObjCheckUsedBuffEffect(lpTargetObj, AT_POISON) == 0) { if ( retResistance(lpTargetObj, 1) == 0 ) { lpTargetObj->lpAttackObj = lpObj; gObjAddBuffEffect(lpTargetObj, AT_POISON, 19, 3, 0, 0, 10); return TRUE; } else { return FALSE; } } else { return FALSE; } return TRUE; } else if ( skill == 7 || skill == 39 || g_MasterSkillSystem.GetBaseMasterLevelSkill(skill) == 450 || skill == 389 || skill == 489 ) //Season4 add-on { if(gObjCheckUsedBuffEffect(lpTargetObj, AT_ICE) == 0) { if ( retResistance(lpTargetObj, 0) == 0 ) { lpTargetObj->lpAttackObj = lpObj; lpTargetObj->DelayActionTime = 800; lpTargetObj->DelayLevel = 1; gObjAddBuffEffect(lpTargetObj, AT_ICE, 20, 0, 0, 0, 10); } else { return FALSE; } } else { return FALSE; } } else if ( skill == 51 || skill == 424 ) // Ice Arrow { if(gObjCheckUsedBuffEffect(lpTargetObj, AT_ICE_ARROW) == 0) { if ( retResistance(lpTargetObj, 0) == 0 ) { gObjAddBuffEffect(lpTargetObj, AT_ICE_ARROW, 0, 0, 0, 0, 7); lpTargetObj->PathCount = 0; lpTargetObj->PathStartEnd = 0; //Season3 add-on gObjSetPosition(lpTargetObj->m_Index, lpTargetObj->X, lpTargetObj->Y); } else { return FALSE; } } else { return FALSE; } } return TRUE; }
void TMonsterAI::ProcessStateMsg(LPOBJ lpObj, int iMsgCode, int iIndex, int aMsgSubCode) { switch ( iMsgCode ) { case 1: gObjMonsterDieGiveItem(lpObj, &gObj[iIndex]); break; case 2: if ( gObj[iIndex].Live != FALSE ) { gObjBackSpring(lpObj, &gObj[iIndex]); } break; case 3: if ( lpObj->TargetNumber != -1 ) { lpObj->m_Agro.DelAgro(lpObj->TargetNumber); } lpObj->TargetNumber = -1; lpObj->LastAttackerID = -1; lpObj->m_ActState.Emotion = 0; lpObj->m_ActState.Attack = 0; lpObj->m_ActState.Move = 0; lpObj->NextActionTime = 1000; break; case 4: lpObj->m_ActState.Emotion = 3; lpObj->m_ActState.EmotionCount = 1; break; case 55: gObjAttack(lpObj, &gObj[iIndex], NULL, FALSE, FALSE, 0, FALSE, 0, 0); break; case 56: { LPOBJ lpTargetObj = &gObj[iIndex]; if(gObjCheckUsedBuffEffect(lpTargetObj, AT_POISON) == 0) { if ( retResistance(lpTargetObj, 1) == FALSE ) { lpTargetObj->lpAttackObj = lpObj; gObjAddBuffEffect(lpTargetObj, AT_POISON, 19, 3, 0, 0, aMsgSubCode); } } } break; case 57: { LPOBJ lpTargetObj = &gObj[iIndex]; gObjBackSpring2(lpTargetObj, lpObj, aMsgSubCode); } break; } }
void TMonsterAI::ProcessStateMsg(LPOBJ lpObj, int iMsgCode, int iIndex, int aMsgSubCode) { switch ( iMsgCode ) { case 1: gObjMonsterDieGiveItem(lpObj, &gObj[iIndex]); break; case 2: if ( gObj[iIndex].Live != FALSE ) { gObjBackSpring(lpObj, &gObj[iIndex]); } break; case 3: if ( lpObj->TargetNumber != -1 ) { lpObj->m_Agro.DelAgro(lpObj->TargetNumber); } lpObj->TargetNumber = -1; lpObj->LastAttackerID = -1; lpObj->m_ActState.Emotion = 0; lpObj->m_ActState.Attack = 0; lpObj->m_ActState.Move = 0; lpObj->NextActionTime = 1000; break; case 4: lpObj->m_ActState.Emotion = 3; lpObj->m_ActState.EmotionCount = 1; break; case 55: gObjAttack(lpObj, &gObj[iIndex], NULL, FALSE, FALSE, 0, FALSE); break; case 56: { LPOBJ lpTargetObj = &gObj[iIndex]; if ( lpTargetObj->m_PoisonType == 0 ) { if ( retResistance(lpTargetObj, R_POISON) == FALSE ) { lpTargetObj->m_PoisonType = 1; lpTargetObj->m_PoisonBeattackCount = aMsgSubCode; lpTargetObj->lpAttackObj = lpObj; lpTargetObj->m_ViewSkillState |= 1; GCSkillInfoSend(lpTargetObj, 1, 0x37); } } } break; case 57: { LPOBJ lpTargetObj = &gObj[iIndex]; gObjBackSpring2(lpTargetObj, lpObj, aMsgSubCode); } break; } }
bool CObjBaseAttack::ResistanceCheck(LPOBJ lpObj, LPOBJ lpTargetObj, int skill) { bool bResult = true; // ---- switch ( skill ) { // ---- Poison case 1: if ( lpTargetObj->m_PoisonType == 0 ) { if ( retResistance(lpTargetObj, 1) == 0 ) { lpTargetObj->m_PoisonType = 1; lpTargetObj->m_PoisonBeattackCount = 20; lpTargetObj->lpAttackObj = lpObj; lpTargetObj->m_ViewSkillState[eVS_POISON] = 1; } else { bResult = false; } } else { bResult = false; } break; // ---- Lightning case 3: if ( retResistance(lpTargetObj, 2) == 0 ) { gObjAddMsgSendDelay(lpTargetObj, 2, lpObj->m_Index, 150, 0); } else { bResult = false; } break; // ---- Decay case 38: if ( lpTargetObj->m_PoisonType == 0 || lpTargetObj->m_PoisonType == 1 ) { if ( retResistance(lpTargetObj, 1) == 0 ) { lpTargetObj->m_PoisonType = 38; lpTargetObj->m_PoisonBeattackCount = 10; lpTargetObj->lpAttackObj = lpObj; lpTargetObj->m_ViewSkillState[eVS_POISON] = 1; GCStateInfoSend(lpTargetObj, 1, eVS_POISON); } else { bResult = false; } } else { bResult = false; } break; // ---- Earthquake case 62: gObjBackSpring2(lpTargetObj, lpObj, 3); break; // ---- Ice, Ice Storm, Chain Drive case 7: case 39: case 262: if (lpTargetObj->m_ColdBeattackCount == 0 ) { if ( retResistance(lpTargetObj, 0) == 0 ) { lpTargetObj->m_ColdBeattackCount = 10; lpTargetObj->lpAttackObj = lpObj; lpTargetObj->DelayActionTime = 800; lpTargetObj->DelayLevel = 1; lpTargetObj->m_IceType = skill; GCStateInfoSend(lpTargetObj, 1, eVS_ICE); } else { bResult = false; } } else { bResult = false; } break; // ---- Weapon Skills case 19: case 20: case 21: case 22: case 23: case 260: case 261: gObjAddMsgSendDelay(lpTargetObj, 2, lpObj->m_Index, 150, 0); break; // ---- Ice Arrow case 51: bResult = false; break; } // ---- return bResult; }