void Teleport::__addThing(int32_t index, Thing* thing) { Tile* destTile = g_game.getTile(getDestPos().x, getDestPos().y, getDestPos().z); if(destTile){ if(Creature* creature = thing->getCreature()){ getTile()->moveCreature(creature, destTile, true); g_game.AddMagicEffectAt(creature->getPosition(), NM_ME_ENERGY_AREA); } else if(Item* item = thing->getItem()){ g_game.internalMoveItem(getTile(), destTile, 0, item, item->getItemCount()); } } }
void Teleport::__addThing(Creature* actor, int32_t index, Thing* thing) { Tile* destTile = g_game.getParentTile(getDestPos().x, getDestPos().y, getDestPos().z); if(destTile){ if(Creature* creature = thing->getCreature()){ getParentTile()->moveCreature(actor, creature, destTile, true); g_game.addMagicEffect(destTile->getPosition(), MAGIC_EFFECT_BLUE_BUBBLE); } else if(Item* item = thing->getItem()){ g_game.internalMoveItem(actor, getParentTile(), destTile, INDEX_WHEREEVER, item, item->getItemCount(), NULL); } } }