All pastes #560534 Raw Edit

pathing.

public text v1 · immutable
·published 2007-06-12 03:35 UTC
rendered paste body
//
void RevealAutomapRoom2(DrlgRoom2 *room2)
{
	D2CLIENT_RevealAutomapRoom(room2->pRoom1, 1, D2CLIENT_pAutomapLayer);

	PresetUnit *unit = room2->pPresetUnits;
	while (unit) {
		int cellno = 0, xoffset = 0, yoffset = 0;
		switch (unit->nUnitType) {
			case UNITNO_MONSTER:
				if (unit->nTxtFileNo == 256) cellno = 300; //izual
				else if (unit->nTxtFileNo == 745) cellno = unit->nTxtFileNo; //Hephasto The Armorer at Hell Forge
				break;

			case UNITNO_OBJECT:
				cellno = GetPresetUnitObjCell(unit->nTxtFileNo, room2->pDrlgLevel->nLevelNo);
				break;

			case UNITNO_ROOMTILE:
				DrlgRoom2 *otherroom2 = GetRoomTileOtherRoom2(room2, unit->nTxtFileNo);
				if (otherroom2) {
					//change pos here because better for minimap
					cellno = -(int)(otherroom2->pDrlgLevel->nLevelNo);
					xoffset = +8;
					yoffset = -28;
				}
				break;
		}
		if (cellno) {
			AddAutomapRoomCell(unit->xPos, unit->yPos, cellno, room2, xoffset, yoffset);
		}
		unit = unit->pNext;
	}
}

//
DrlgRoom2 *GetRoomTileOtherRoom2(DrlgRoom2 *room2, DWORD roomtileno)
{
	RoomTile *roomtile = room2->pRoomTiles;
	while (roomtile) {
		if (*roomtile->nNum == roomtileno) {
			return roomtile->pRoom2;
		}
		roomtile = roomtile->pNext;
	}
	return 0;
}

      if ((int)level.nLevelNo == 101)//lvl2         
      {
         Worldstone_LVL2_ROOMS[((int)room.xPos - 3500)/12][((int)room.yPos - 1300)/12][0] = preset2._1[0]; // wslvl2rooms[xpos][ypos][0] = 
         Worldstone_LVL2_ROOMS[((int)room.xPos - 3500)/12][((int)room.yPos - 1300)/12][1] = preset2._1[1];	//wslvl2rooms[xpos][ypos[1] = 
      }   

struct PresetUnit {
	DWORD _1[2];
	DWORD yPos; //+08
	DWORD nTxtFileNo; //+0c
	DWORD _2[1];
	PresetUnit *pNext; //+1c
	DWORD xPos; //+20
	DWORD nUnitType; //+24
};

D2VARPTR(D2CLIENT, pAutomapLayerListHdr, AutomapLayer *, DLLBASE_D2CLIENT+0x11C150)
D2VARPTR(D2CLIENT, pAutomapCellListHdr, AutomapCell *, DLLBASE_D2CLIENT+0x11C144)

D2VARPTR(D2CLIENT, pAutomapLayer, AutomapLayer *, DLLBASE_D2CLIENT+0x11C154)