Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Creature::dropCorpse(DeathList deathList)
- {
- if (random_range(1, 100) < 100) {
- Item* soulItem = Item::CreateItem(1506, 1);
- if (soulItem) {
- Tile* tile = getTile();
- if (tile) {
- soulItem->setActionId(2160);
- g_game.addAnimatedText(getPosition(), random_range(1, 256), "EXTRA EXP!");
- g_game.internalAddItem(NULL, tile, soulItem, INDEX_WHEREEVER, FLAG_NOLIMIT);
- return;
- }
- delete soulItem;
- }
- }
- Item* corpse = createCorpse(deathList);
- if(corpse)
- corpse->setParent(VirtualCylinder::virtualCylinder);
- bool deny = false;
- CreatureEventList deathEvents = getCreatureEvents(CREATURE_EVENT_DEATH);
- for(CreatureEventList::iterator it = deathEvents.begin(); it != deathEvents.end(); ++it)
- {
- if(!(*it)->executeDeath(this, corpse, deathList) && !deny)
- deny = true;
- }
- if(!corpse)
- return;
- corpse->setParent(NULL);
- if(deny)
- return;
- Tile* tile = getTile();
- if(!tile)
- return;
- Item* splash = NULL;
- 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;
- }
- if(splash)
- {
- g_game.internalAddItem(NULL, tile, splash, INDEX_WHEREEVER, FLAG_NOLIMIT);
- g_game.startDecay(splash);
- }
- g_game.internalAddItem(NULL, tile, corpse, INDEX_WHEREEVER, FLAG_NOLIMIT);
- dropLoot(corpse->getContainer());
- g_game.startDecay(corpse);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement