alexxxxxxx
Active Member
- Joined
- Aug 16, 2015
- Messages
- 22
- Reaction score
- 35
- Location
- Brasil
- GitHub
- l3k0t
- YouTube
- UCMP25Br519j7dD1FF
The name already says it all: anyone who throws items into the teleporter of your OTServ, it will be removed, like those trash cans, however, this system is implemented in the source code, excluding .LUA scripts. TFS 0.4
In teleport.cpp, find
Change it all to:
Now just compile in rebuild mode and start the server, credits to me, alexxxxxxx ~ L3K0T, for the changes.
In teleport.cpp, find
LUA:
void Teleport::__addThing(Creature* actor, int32_t, Thing* thing)
{
if(!thing || thing->isRemoved())
return;
Tile* destTile = g_game.getTile(destination);
if(!destTile)
return;
if(Creature* creature = thing->getCreature())
{
g_game.addMagicEffect(creature->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost());
creature->getTile()->moveCreature(actor, creature, destTile);
g_game.addMagicEffect(destTile->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost());
}
else if(Item* item = thing->getItem())
{
g_game.addMagicEffect(item->getPosition(), MAGIC_EFFECT_TELEPORT);
g_game.internalMoveItem(actor, item->getTile(), destTile, INDEX_WHEREEVER, item, item->getItemCount(), NULL);
g_game.addMagicEffect(destTile->getPosition(), MAGIC_EFFECT_TELEPORT);
}
}
Change it all to:
LUA:
void Teleport::__addThing(Creature* actor, int32_t, Thing* thing)
{
if (!thing || thing->isRemoved())
return;
Tile* destTile = g_game.getTile(destination);
if (!destTile)
return;
if (Creature* creature = thing->getCreature())
{
g_game.addMagicEffect(creature->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost());
creature->getTile()->moveCreature(actor, creature, destTile);
g_game.addMagicEffect(destTile->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost());
}
else
{
Player* player = dynamic_cast<Player*>(actor);
if (player)
{
player->sendTextMessage(MSG_STATUS_SMALL, "You cannot teleport items.");
// Remover o item
Item* item = dynamic_cast<Item*>(thing);
if (item) {
g_game.internalRemoveItem(actor, item);
}
}
return;
}
}
Now just compile in rebuild mode and start the server, credits to me, alexxxxxxx ~ L3K0T, for the changes.