Witam.
Pracuję nad własnym OTS. Mam jednak taki problem, że summony nie zostawiają po sobie corpse. Np. w przypadku Slime tylko matka zrzuca corpse, a jej summony znikaja. Oto mój plik creature.cpp
Prosiłbym o pomoc, bo długo z tym walczę i nie daję już rady. Pozdrawiam.
Myślę, że winna jest funkcja dropCorpse:
Pomoże ktoś?
Pracuję nad własnym OTS. Mam jednak taki problem, że summony nie zostawiają po sobie corpse. Np. w przypadku Slime tylko matka zrzuca corpse, a jej summony znikaja. Oto mój plik creature.cpp
Prosiłbym o pomoc, bo długo z tym walczę i nie daję już rady. Pozdrawiam.
Myślę, że winna jest funkcja dropCorpse:
Code:
bool Creature::dropCorpse()
{
if (!lootDrop && getMonster() && !(!g_config.getBoolean(ConfigManager::SUMMONS_DROP_CORPSE) && master && master->getPlayer())) {
if (master) {
//scripting event - onDeath
const CreatureEventList& deathEvents = getCreatureEvents(CREATURE_EVENT_DEATH);
for (CreatureEvent* deathEvent : deathEvents) {
deathEvent->executeOnDeath(this, nullptr, _lastHitCreature, _mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
}
}
g_game.addMagicEffect(getPosition(), NM_ME_POFF);
} else {
Item* splash = nullptr;
switch (getRace()) {
case RACE_VENOM:
splash = Item::CreateItem(ITEM_FULLSPLASH, FLUID_GREEN);
break;
case RACE_BLOOD:
splash = Item::CreateItem(ITEM_FULLSPLASH, FLUID_BLOOD);
break;
default:
break;
}
Tile* tile = getTile();
if (splash) {
g_game.internalAddItem(tile, splash, INDEX_WHEREEVER, FLAG_NOLIMIT);
g_game.startDecay(splash);
}
Item* corpse = getCorpse();
if (corpse) {
g_game.internalAddItem(tile, corpse, INDEX_WHEREEVER, FLAG_NOLIMIT);
g_game.startDecay(corpse);
}
//scripting event - onDeath
const CreatureEventList& deathEvents = getCreatureEvents(CREATURE_EVENT_DEATH);
for (CreatureEvent* deathEvent : deathEvents) {
deathEvent->executeOnDeath(this, corpse, _lastHitCreature, _mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
}
if (corpse) {
dropLoot(corpse->getContainer());
}
}
return true;
}
Pomoże ktoś?