1
[Actions] dp sqm Dom Jun 10, 2018 6:28 pm
Deget92

Miembro

[Tienes que estar registrado y conectado para ver este vínculo]
gracias;/
Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...
function getBottomPlayer(pos)
for i = 1, getTileInfo(pos).things do
pos.stackpos = getTileInfo(pos).things-i
local cid = getThingFromPos(pos).uid
if isPlayer(cid) then
return cid
end
end
return 0
end
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if not isPlayer(cid) then
return doTeleportThing(cid, fromPosition, false)
end
if isPlayer(getBottomPlayer(position)) and cid ~= getBottomPlayer(position) then
doPlayerSendCancel(cid, 'This tile only allows 1 player in it.')
return doTeleportThing(cid, fromPosition, false)
end
return true
end
<movevent type="StepIn" itemid="11059" event="script" value="tile.lua"/>
function onStepIn(cid, item, position, fromPosition)
if getTileInfo(position).creatures > 1 then
if fromPosition.x == 0 or (fromPosition.x == position.x and fromPosition.y == position.y) then
local p = getCreaturePosition(cid)
local pp = {
{x = p.x + 1, y = p.y, z = p.z, stackpos = 0},
{x = p.x - 1, y = p.y, z = p.z, stackpos = 0},
{x = p.x, y = p.y + 1, z = p.z, stackpos = 0},
{x = p.x, y = p.y - 1, z = p.z, stackpos = 0}
}
for x = 1, #pp do
local thing = getThingFromPos(pp[x], false).uid
if thing ~= 0 and not hasItemProperty(thing, CONST_PROP_BLOCKSOLID) then
fromPosition = pp[x]
end
end
end
doTeleportThing(cid, fromPosition, false)
end
end
function onStepIn(cid, item, position, fromPosition)
if getTileInfo(position).creatures > 1 then
if fromPosition.x == 0 or (fromPosition.x == position.x and fromPosition.y == position.y) then
local p = getCreaturePosition(cid)
local pp = {
{x = p.x + 1, y = p.y, z = p.z, stackpos = 0},
{x = p.x - 1, y = p.y, z = p.z, stackpos = 0},
{x = p.x, y = p.y + 1, z = p.z, stackpos = 0},
{x = p.x, y = p.y - 1, z = p.z, stackpos = 0}
}
for x = 1, #pp do
local thing = getThingFromPos(pp[x]).uid
if thing ~= 0 and not hasItemProperty(thing, CONST_PROP_BLOCKSOLID) then
fromPosition = pp[x]
end
end
end
doTeleportThing(cid, fromPosition, false)
end
end
bool Player::canWalkthrough(const Creature* creature) const
{
if(creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() ||
(creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
return true;
const Player* player = creature->getPlayer();
if(!player)
return false;
if((((g_game.getWorldType() == WORLDTYPE_OPTIONAL &&
#ifdef __WAR_SYSTEM__
!player->isEnemy(this, true) &&
#endif
player->getVocation()->isAttackable()) || (player->getVocation()->isAttackable() &&
player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground &&
Item::items[player->getTile()->ground->getID()].walkStack) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
|| player->getAccess() <= getAccess()))
return true;
return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
|| (isGhost() && getGhostAccess() > player->getGhostAccess());
}
bool Player::canWalkthrough(const Creature* creature) const
{
if(creature == this || creature->isWalkable() ||
(creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
return true;
const Player* player = creature->getPlayer();
if(!player)
return false;
if(
(
(
(
(
player->getVocation()->isAttackable() &&
player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL)
)
|| (
player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) &&
!player->getTile()->hasFlag(TILESTATE_HOUSE)
)
)
) && player->getTile()->ground &&
player->getTile()->ground->getID() != 11063
) && (
!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
|| player->getAccess() <= getAccess()
)
) return true;
return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
|| (isGhost() && getGhostAccess() > player->getGhostAccess());
}
Temas similares
Permisos de este foro:
No puedes responder a temas en este foro.
|
|