[CODE] Pits MiniMap

#1
En la función

Code: Select all

CGame::DrawDialogBox_GuideMap 
Buscamos

Code: Select all

    if( (m_dwCurTime - m_dwMonsterEventTime) < 30000 )
     { if( (m_dwCurTime%500)< 370 )
     { if( m_sEventX >= shX && m_sEventX <= shX+128 && m_sEventY >= shY && m_sEventY <= shY+128 )
     m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + m_sEventX - shX, sY + m_sEventY -shY, m_sMonsterID, m_dwCurTime);
     }
     }else
     { m_dwMonsterEventTime = 0;
     m_sMonsterID = 0;
     }
     
Y abajo agregamos

Code: Select all

if( m_cMapIndex == 11 ) { // Aresden
 // Slime
 if ( 141 >= shX && 141 <= shX+128 && 240 >= shY && 240 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 141 - shX, sY + 240 - shY, 10, m_dwCurTime);
 if ( 253 >= shX && 253 <= shX+128 && 203 >= shY && 203 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 253 - shX, sY + 203 - shY, 10, m_dwCurTime);
 if ( 43 >= shX && 43 <= shX+128 && 182 >= shY && 182 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 43 - shX, sY + 182 - shY, 10, m_dwCurTime);
 if ( 122 >= shX && 122 <= shX+128 && 50 >= shY && 50 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 122 - shX, sY + 50 - shY, 10, m_dwCurTime);
 // Snake
 if ( 203 >= shX && 203 <= shX+128 && 236 >= shY && 236 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 203 - shX, sY + 236 - shY, 22, m_dwCurTime);
 // Scorpion
 if ( 102 >= shX && 102 <= shX+128 && 36 >= shY && 36 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 102 - shX, sY + 36 - shY, 17, m_dwCurTime);
 }
 else if( m_cMapIndex == 3 ) { // Elvine
 // Slime
 if ( 154 >= shX && 154 <= shX+128 && 38 >= shY && 38 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 154 - shX, sY + 38 - shY, 10, m_dwCurTime);
 if ( 54 >= shX && 54 <= shX+128 && 65 >= shY && 65 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 54 - shX, sY + 65 - shY, 10, m_dwCurTime);
 if ( 135 >= shX && 135 <= shX+128 && 248 >= shY && 248 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 135 - shX, sY + 248 - shY, 10, m_dwCurTime);
 if ( 240 >= shX && 240 <= shX+128 && 214 >= shY && 214 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 240 - shX, sY + 214 - shY, 10, m_dwCurTime);
 if ( 260 >= shX && 260 <= shX+128 && 184 >= shY && 184 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 260 - shX, sY + 184 - shY, 10, m_dwCurTime);
 // Snake
 if ( 48 >= shX && 48 <= shX+128 && 202 >= shY && 202 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 48 - shX, sY + 202 - shY, 22, m_dwCurTime);
 // Scorpion
 if ( 127 >= shX && 127 <= shX+128 && 34 >= shY && 34 <= shY+128 )
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + 127 - shX, sY + 34 - shY, 17, m_dwCurTime);
 }
 
Más abajo buscamos

Code: Select all

    if( (G_dwGlobalTime - m_dwMonsterEventTime) < 30000 )
     { if( (m_dwCurTime%500)< 370 )
     { shX = (m_sEventX*128)/(m_pMapData->m_sMapSizeX);
     shY = (m_sEventY*128)/(m_pMapData->m_sMapSizeX);
     m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + shX, sY + shY, m_sMonsterID, m_dwCurTime);
     }
     }else
     { m_dwMonsterEventTime = 0;
     m_sMonsterID = 0;
     }
     
Y abajo de eso agregamos

Code: Select all

if( m_cMapIndex == 11 ) { // Aresden
 // Slime
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((141*128)/m_pMapData->m_sMapSizeX), sY + ((240*128)/m_pMapData->m_sMapSizeX), 10, m_dwCurTime);
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((253*128)/m_pMapData->m_sMapSizeX), sY + ((203*128)/m_pMapData->m_sMapSizeX), 10, m_dwCurTime);
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((43*128)/m_pMapData->m_sMapSizeX), sY + ((182*128)/m_pMapData->m_sMapSizeX), 10, m_dwCurTime);
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((122*128)/m_pMapData->m_sMapSizeX), sY + ((50*128)/m_pMapData->m_sMapSizeX), 10, m_dwCurTime);
 // Snake
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((203*128)/m_pMapData->m_sMapSizeX), sY + ((236*128)/m_pMapData->m_sMapSizeX), 22, m_dwCurTime);
 // Scorpion
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((102*128)/m_pMapData->m_sMapSizeX), sY + ((36*128)/m_pMapData->m_sMapSizeX), 17, m_dwCurTime);
 }
 else if( m_cMapIndex == 3 ) { // Elvine
 // Slime
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((154*128)/m_pMapData->m_sMapSizeX), sY + ((38*128)/m_pMapData->m_sMapSizeX), 10, m_dwCurTime);
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((54*128)/m_pMapData->m_sMapSizeX), sY + ((65*128)/m_pMapData->m_sMapSizeX), 10, m_dwCurTime);
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((135*128)/m_pMapData->m_sMapSizeX), sY + ((248*128)/m_pMapData->m_sMapSizeX), 10, m_dwCurTime);
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((240*128)/m_pMapData->m_sMapSizeX), sY + ((214*128)/m_pMapData->m_sMapSizeX), 10, m_dwCurTime);
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((260*128)/m_pMapData->m_sMapSizeX), sY + ((184*128)/m_pMapData->m_sMapSizeX), 10, m_dwCurTime);
 // Snake
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((48*128)/m_pMapData->m_sMapSizeX), sY + ((202*128)/m_pMapData->m_sMapSizeX), 22, m_dwCurTime);
 // Scorpion
 m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((127*128)/m_pMapData->m_sMapSizeX), sY + ((34*128)/m_pMapData->m_sMapSizeX), 17, m_dwCurTime);
 }
 
Tanto minimizado como maximizado se verían los pits en el mini mapa
Image

Paso a explicar detalladamente:

Code: Select all

m_pSprite[DEF_SPRID_INTERFACE_MONSTER]->PutSpriteFast(sX + ((141*128)/m_pMapData->m_sMapSizeX), sY + ((240*128)/m_pMapData->m_sMapSizeX), 10, m_dwCurTime);

141 = coordenada X
240 = coordenada Y
10 = ID npc
Para cambiar el tipo de NPC para mostrar cambian el ID (ver NPC.cfg)

Las coordenadas (X, Y) son las del mapa en general, por ejemplo, en la imagen estoy parado en (100, 48), sería exactamente donde se mostraría el Pit en el mapa.

Para agregar más mapas solo tienen que mirar el 'm_cMapIndex'

Code: Select all

11 = Aresden
3 = Elvine
etc...
De esta función sacan el valor numérico de los mapas

Code: Select all

CGame::GetOfficialMapName
Bueno, espero que les sirva.

Saludos.
Centuu.-

Sol Lucet Omnibus.-

Who is online

Users browsing this forum: No registered users and 1 guest