Código:
//-----------------------------------
int iModel = MonsterID + MAX_MONSTER_MODEL;
if (MonsterID == 893 || MonsterID == 894 || MonsterID == 895 || MonsterID == 896 || MonsterID == 897)
{
iModel = 1163;
}
//-----------------------------------
DWORD ObjectStruct = pViewObject(a4, iModel, a2, a3, 0.0);
ObjectPreview* gPreview = &*(ObjectPreview*)ObjectStruct;
if (gPreview == nullptr){
return pShowMonster(MonsterID, a2, a3, a4);
}
memcpy(gPreview->Name, lpInfo->Name, sizeof(lpInfo->Name));
NPCNAME_DATA* NpcName = gNPCName.GetNPCName(MonsterID, pMapNumber, gPreview->RespawnPosX, gPreview->RespawnPosY);
if (NpcName != 0){
sprintf(gPreview->Name, NpcName->Name);
}
printf("[%s] gCustomMonster.m_CustomMonsterInfo.ID: %d\n", __FUNCTION__, lpInfo->ID);
switch (lpInfo->Type){
case 0:
*(BYTE*)(ObjectStruct + 893) = emNPC;
break;
case 1:
*(BYTE*)(ObjectStruct + 893) = emMonster;
break;
default:
*(BYTE*)(ObjectStruct + 893) = emNone;
break;
}
*(float *)(ObjectStruct + 872) = lpInfo->Size;
gPreview->ID = MonsterID;
*(BYTE*)(ObjectStruct + 798) = 0;
//Class BK
if (MonsterID == 893)
{
gPreview->HelmSlot = ITEM2(7, 29);
gPreview->ArmorSlot = ITEM2(8, 29);
gPreview->PantsSlot = ITEM2(9, 29);
gPreview->GlovesSlot = ITEM2(10, 29);
gPreview->BootsSlot = ITEM2(11, 29);
gPreview->WeaponFirstSlot = ITEM2(0, 22);
gPreview->WeaponSecondSlot = ITEM2(0, 22);
gPreview->WingsSlot = ITEM2(12, 36);
gPreview->HelmLevel = 15;
gPreview->ArmorLevel = 15;
gPreview->PantsLevel = 15;
gPreview->GlovesLevel = 15;
gPreview->BootsLevel = 15;
gPreview->WeaponFirstLevel = 15;
gPreview->WeaponSecondLevel = 15;
//
gPreview->HelmExcellent = 63;
gPreview->ArmorExcellent = 63;
gPreview->PantsExcellent = 63;
gPreview->GlovesExcellent = 63;
gPreview->BootsExcellent = 63;
gPreview->WeaponFirstExcellent = 63;
gPreview->WeaponSecondExcellent = 63;
}
//Class SM
if (MonsterID == 894)
{
gPreview->HelmSlot = ITEM2(7, 30);
gPreview->ArmorSlot = ITEM2(8, 30);
gPreview->PantsSlot = ITEM2(9, 30);
gPreview->GlovesSlot = ITEM2(10, 30);
gPreview->BootsSlot = ITEM2(11, 30);
gPreview->WeaponFirstSlot = ITEM2(5, 12);
gPreview->WeaponSecondSlot = ITEM2(6, 15);
gPreview->WingsSlot = ITEM2(12, 37);
gPreview->HelmLevel = 15;
gPreview->ArmorLevel = 15;
gPreview->PantsLevel = 15;
gPreview->GlovesLevel = 15;
gPreview->BootsLevel = 15;
gPreview->WeaponFirstLevel = 15;
gPreview->WeaponSecondLevel = 15;
//
gPreview->HelmExcellent = 63;
gPreview->ArmorExcellent = 63;
gPreview->PantsExcellent = 63;
gPreview->GlovesExcellent = 63;
gPreview->BootsExcellent = 63;
gPreview->WeaponFirstExcellent = 63;
gPreview->WeaponSecondExcellent = 63;
}
//Class ELF
if (MonsterID == 895)
{
gPreview->HelmSlot = ITEM2(7, 31);
gPreview->ArmorSlot = ITEM2(8, 31);
gPreview->PantsSlot = ITEM2(9, 31);
gPreview->GlovesSlot = ITEM2(10, 31);
gPreview->BootsSlot = ITEM2(11, 31);
gPreview->WeaponFirstSlot = ITEM2(4, 22);
gPreview->WeaponSecondSlot = ITEM2(4, 7);
gPreview->WingsSlot = ITEM2(12, 38);
gPreview->HelmLevel = 15;
gPreview->ArmorLevel = 15;
gPreview->PantsLevel = 15;
gPreview->GlovesLevel = 15;
gPreview->BootsLevel = 15;
gPreview->WeaponFirstLevel = 15;
gPreview->WeaponSecondLevel = 15;
//
gPreview->HelmExcellent = 63;
gPreview->ArmorExcellent = 63;
gPreview->PantsExcellent = 63;
gPreview->GlovesExcellent = 63;
gPreview->BootsExcellent = 63;
gPreview->WeaponFirstExcellent = 63;
gPreview->WeaponSecondExcellent = 63;
}
//Class MG
if (MonsterID == 896)
{
//gPreview->HelmSlot = ITEM2(7, 32);
gPreview->ArmorSlot = ITEM2(8, 32);
gPreview->PantsSlot = ITEM2(9, 32);
gPreview->GlovesSlot = ITEM2(10, 32);
gPreview->BootsSlot = ITEM2(11, 32);
gPreview->WeaponFirstSlot = ITEM2(0, 23);
gPreview->WeaponSecondSlot = ITEM2(0, 23);
gPreview->WingsSlot = ITEM2(12, 39);
gPreview->HelmLevel = 15;
gPreview->ArmorLevel = 15;
gPreview->PantsLevel = 15;
gPreview->GlovesLevel = 15;
gPreview->BootsLevel = 15;
gPreview->WeaponFirstLevel = 15;
gPreview->WeaponSecondLevel = 15;
//
gPreview->HelmExcellent = 63;
gPreview->ArmorExcellent = 63;
gPreview->PantsExcellent = 63;
gPreview->GlovesExcellent = 63;
gPreview->BootsExcellent = 63;
gPreview->WeaponFirstExcellent = 63;
gPreview->WeaponSecondExcellent = 63;
}
//Class DL
if (MonsterID == 897)
{
gPreview->HelmSlot = ITEM2(7, 33);
gPreview->ArmorSlot = ITEM2(8, 33);
gPreview->PantsSlot = ITEM2(9, 33);
gPreview->GlovesSlot = ITEM2(10, 33);
gPreview->BootsSlot = ITEM2(11, 33);
gPreview->WeaponFirstSlot = ITEM2(2, 15);
gPreview->WeaponSecondSlot = ITEM2(6, 20);
gPreview->WingsSlot = ITEM2(12, 40);
gPreview->PetSlot = ITEM2(13, 4);
gPreview->HelmLevel = 15;
gPreview->ArmorLevel = 15;
gPreview->PantsLevel = 15;
gPreview->GlovesLevel = 15;
gPreview->BootsLevel = 15;
gPreview->WeaponFirstLevel = 15;
gPreview->WeaponSecondLevel = 15;
gPreview->PetLevel = 0;
gPreview->HelmExcellent = 63;
gPreview->ArmorExcellent = 63;
gPreview->PantsExcellent = 63;
gPreview->GlovesExcellent = 63;
gPreview->BootsExcellent = 63;
gPreview->WeaponFirstExcellent = 63;
gPreview->WeaponSecondExcellent = 63;
gPreview->PetExcellent = 0;
}
gPreview->Unknown128 = *(DWORD*)0x879343C;
pMonsterAttribute(ObjectStruct, MonsterID);
return gPreview;
return pShowMonster(MonsterID, a2, a3, a4);
}