int MonsterAddAndSpawn(WORD Monster,BYTE Speed,BYTE Map,BYTE X, BYTE Y) { int MobCount = *(DWORD *)(MonsterCount); if((MobCount + 1) < MonsterCount) { MobCount++; *(DWORD *)(MonsterCount) = MobCount; *(WORD *)(12 * MobCount + MonsterReads) = Monster; *(BYTE *)(12 * MobCount + MonsterReads+2) = Map; *(BYTE *)(12 * MobCount + MonsterReads+3) = Speed; *(BYTE *)(12 * MobCount + MonsterReads+4) = X; *(BYTE *)(12 * MobCount + MonsterReads+5) = Y; *(BYTE *)(12 * MobCount + MonsterReads+6) = 2; *(BYTE *)(12 * MobCount + MonsterReads+7) = X; *(BYTE *)(12 * MobCount + MonsterReads+8) = Y; int MobID = gObjAddMonster(*(BYTE *)(12 * MobCount + (MonsterReads+2))); if(MobID>=0) { int MobNr = *(WORD *)(12 * MobCount + MonsterReads); gObjSetPosMonster(MobID, MobCount); gObjSetMonster(MobID, MobNr); } return MobID; }else { MessageBox(NULL,"Monster attribute max over!!", "Monsters overflow", 0); return -1; } }
void CCrywolf::CreateCrywolfCommonMonster() { for ( int n=0;n<gMSetBase.m_Count;n++) { if ( CHECK_CLASS(gMSetBase.m_Mp[n].m_MapNumber, MAP_INDEX_CRYWOLF_FIRSTZONE) ) { if ( gMSetBase.m_Mp[n].m_Type >= 204 && gMSetBase.m_Mp[n].m_Type <= 257 ) continue; int iIndex = gObjAddMonster(gMSetBase.m_Mp[n].m_MapNumber); if ( iIndex >= 0 ) { if ( gObjSetPosMonster(iIndex, n) == FALSE ) { gObjDel(iIndex); continue; } if ( gObjSetMonster(iIndex, gMSetBase.m_Mp[n].m_Type) == FALSE ) { gObjDel(iIndex); continue; } if ( gObj[iIndex].Type == OBJ_MONSTER ) { g_Crywolf.m_ObjCommonMonster.AddObj(iIndex); } } } } }
void CDevilSquare::SetMonster() { int result; for ( int n=0; n<OBJ_MAXMONSTER; n++) { if ( DS_MAP_RANGE(gMSetBase.m_Mp[n].m_MapNumber) != FALSE ) { WORD wMonIndex = gMSetBase.m_Mp[n].m_Type; BYTE btDSIndex = -1; if ( gMSetBase.m_Mp[n].m_X == 119 ) { btDSIndex = DEVIL_SQUARE_GROUND_1; } else if ( gMSetBase.m_Mp[n].m_X == 121 ) { btDSIndex = DEVIL_SQUARE_GROUND_2; } else if ( gMSetBase.m_Mp[n].m_X == 49 ) { btDSIndex = DEVIL_SQUARE_GROUND_3; } else if ( gMSetBase.m_Mp[n].m_X == 53 ) { btDSIndex = DEVIL_SQUARE_GROUND_4; } else if ( gMSetBase.m_Mp[n].m_X == 120 ) { btDSIndex = DEVIL_SQUARE_GROUND_5; } else if ( gMSetBase.m_Mp[n].m_X == 122 ) { btDSIndex = DEVIL_SQUARE_GROUND_6; } else if ( gMSetBase.m_Mp[n].m_X == 50 ) { btDSIndex = DEVIL_SQUARE_GROUND_7; } if ( btDSIndex == 0xFF ) { LogAddTD("[DevilSquare] [%d] Invalid MonterType", wMonIndex); continue; } result = gObjAddMonster(gMSetBase.m_Mp[n].m_MapNumber); if ( result >= 0 ) { gObjSetPosMonster(result, n); gObjSetMonster(result, wMonIndex); gObj[result].MaxRegenTime = 1000; // Rgeneration in 1 second gObj[result].m_bDevilSquareIndex = btDSIndex; } } } }
BOOL CRaklionSelupan::CreateSelupan() { int m_Type = -1; for ( int n=0;n<gMSetBase.m_Count;n++) { if( gMSetBase.m_Mp[n].m_Type == 459 ) { m_Type = n; } } LPOBJ lpObj = NULL; int result = 0; result = gObjAddMonster(MAP_INDEX_RAKLION_BOSS); if ( result < 0 ) { LogAddTD("[RAKLION] CreateSelupan error"); return FALSE; } lpObj = &gObj[result]; gObjSetPosMonster(result, m_Type); gObjSetMonster(result, 459); LogAddTD("[RAKLION] Create Selupan : X (%d) / Y(%d)",lpObj->X,lpObj->Y); LPOBJ lpTargetObj = NULL; for(int n=0;n<OBJMAX;n++){ lpTargetObj = &gObj[n]; if(lpTargetObj->MapNumber == MAP_INDEX_RAKLION_BOSS){ gObjStateSetCreate(n); gObjViewportListDestroy(n); gObjViewportListCreate(n); gObjViewportListProtocol(n); } } gObjSetState(); this->m_iBossAttackMin = lpObj->m_AttackDamageMin; this->m_iBossAttackMax = lpObj->m_AttackDamageMax; 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; } } }
void cSummerEvent::SetMonsters() { if(this->Enabled == 1 && this->Start == 1) { for(int i=0; i<this->MonsterCount; i++) { int MobID = gObjAddMonster(gMSetBase.m_Mp[this->Monster[i].Pos].m_MapNumber); if(MobID >= 0) { this->Monster[i].ID = MobID; gObjSetPosMonster(MobID, this->Monster[i].Pos); gObjSetMonster(MobID, gMSetBase.m_Mp[this->Monster[i].Pos].m_Type,"cSummerEvent::SetMonsters"); } } } }