void Functions::MonsterDieGiveItem(LPOBJ lpObj, LPOBJ lpTarget)
{
int Type;
int Level;
int X1 = rand() % 3;
int X2 = rand() % 3;
int Y1 = rand() % 3;
int Y2 = rand() % 3;
if (lpObj->Life <= 0 && lpTarget->Live != 0)
{
if (lpObj->Type == MONSTER)
{
if (lpObj->Class == 78)
{
Func.AllServerAnnounce("[%s] Derroto un Goblin Dorado.", lpTarget->Name);
int MaxHitUser = gObjMonsterTopHitDamageUser(lpObj);
Level = 8;
Type = ItemGetNumberMake(14, 11);
if (Setting.EnableGoldenDrop == 1)
{
if (Setting.ItemCountGoblin > 0)
{
for (int i = 0; i < Setting.ItemCountGoblin; i++)
{
ItemSerialCreateSend(lpObj->m_Index, lpObj->MapNumber, lpObj->X + X1 - X2, lpObj->Y + Y1 - Y2, Type, Level, 0, 0, 0, 0, MaxHitUser, 0);
}
}
}
return;
}
else if (lpObj->Class == 53)
{
Func.AllServerAnnounce("[%s] Derroto un Titan Dorado.", lpTarget->Name);
int MaxHitUser = gObjMonsterTopHitDamageUser(lpObj);
Level = 9;
Type = ItemGetNumberMake(14, 11);
if (Setting.EnableGoldenDrop == 1)
{
if (Setting.ItemCountTitan > 0)
{
for (int i = 0; i < Setting.ItemCountTitan; i++)
{
ItemSerialCreateSend(lpObj->m_Index, lpObj->MapNumber, lpObj->X + X1 - X2, lpObj->Y + Y1 - Y2, Type, Level, 0, 0, 0, 0, MaxHitUser, 0);
}
}
}
return;
}
else if (lpObj->Class == 79)
{
Func.AllServerAnnounce("[%s] Derroto un Dragon Dorado.", lpTarget->Name);
int MaxHitUser = gObjMonsterTopHitDamageUser(lpObj);
Level = 10;
Type = ItemGetNumberMake(14, 11);
if (Setting.EnableGoldenDrop == 1)
{
if (Setting.ItemCountDragon > 0)
{
for (int i = 0; i < Setting.ItemCountDragon; i++)
{
ItemSerialCreateSend(lpObj->m_Index, lpObj->MapNumber, lpObj->X + X1 - X2, lpObj->Y + Y1 - Y2, Type, Level, 0, 0, 0, 0, MaxHitUser, 0);
}
}
}
return;
}
else if (lpObj->Class == 80)
{
Func.AllServerAnnounce("[%s] Derroto un Lizard King Dorado.", lpTarget->Name);
int MaxHitUser = gObjMonsterTopHitDamageUser(lpObj);
Level = 11;
Type = ItemGetNumberMake(14, 11);
if (Setting.EnableGoldenDrop == 1)
{
if (Setting.ItemCountLizard > 0)
{
for (int i = 0; i < Setting.ItemCountLizard; i++)
{
ItemSerialCreateSend(lpObj->m_Index, lpObj->MapNumber, lpObj->X + X1 - X2, lpObj->Y + Y1 - Y2, Type, Level, 0, 0, 0, 0, MaxHitUser, 0);
}
}
}
return;
}
else if (lpObj->Class == 82)
{
Func.AllServerAnnounce("[%s] Derroto un Tantallo Dorado.", lpTarget->Name);
int MaxHitUser = gObjMonsterTopHitDamageUser(lpObj);
Level = 12;
Type = ItemGetNumberMake(14, 11);
if (Setting.EnableGoldenDrop == 1)
{
if (Setting.ItemCountTantalos > 0)
{
for (int i = 0; i < Setting.ItemCountTantalos; i++)
{
ItemSerialCreateSend(lpObj->m_Index, lpObj->MapNumber, lpObj->X + X1 - X2, lpObj->Y + Y1 - Y2, Type, Level, 0, 0, 0, 0, MaxHitUser, 0);
}
}
}
return;
}
}
}
gObjMonsterDieGiveItem(lpObj, lpTarget);
}