• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Summon PZ {please help}

Zapdos

New Member
Joined
Sep 19, 2019
Messages
21
Reaction score
0
Hi, I have a problem with summon the creature walk inside pz but not summon inside pz

Code:
if(const Monster* monster = creature->getMonster())
        {
            if(monster->getMaster())
                return RET_NOERROR;

            if(hasFlag(TILESTATE_PROTECTIONZONE))
                return RET_NOTPOSSIBLE;

            if(floorChange() || positionChange())
                return RET_NOTPOSSIBLE;

            if(monster->canPushCreatures() && !monster->isSummon())
            {
                if(creatures)
                {
                    Creature* tmp = NULL;
                    for(uint32_t i = 0; i < creatures->size(); ++i)
                    {
                        tmp = creatures->at(i);
                        if(creature->canWalkthrough(tmp))
                            continue;

                        if(!tmp->getMonster() || !tmp->isPushable() ||
                            (tmp->getMonster()->isSummon() &&
                            tmp->getMonster()->isPlayerSummon()))
                            return RET_NOTPOSSIBLE;
                    }
                }
            }

if i change
Code:
if(hasFlag(TILESTATE_PROTECTIONZONE))
                return RET_NOTPOSSIBLE;
to RET_NOERROR;
it will summon inside pz but also all monsters can enter in pz zone
somebody has the clue for that? Thank you in advance
 
Change this
C++:
if(hasFlag(TILESTATE_PROTECTIONZONE))
to this and try
C++:
if(hasFlag(TILESTATE_PROTECTIONZONE) && !monster->isPlayerSummon())
 
In your data\spells\spells.xml find
XML:
<instant name="Summon Creature" words="utevo res"
and then add this
XML:
aggressive="0"
or if it is already added and written "1" then change it to "0"
 
What this thing means? I tried in normal servers and it worked properly in TFS 0.4
Post your summons spell if you have it in Lua
 
Sorry I was without computer. My server its TFS 0.3.6
Post automatically merged:

my goback.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
function getPokemonMaxLife(name)
        local file = io.open('data/monster/monsters.xml','r')
        local arquivo = file:read(-1):lower():match('<monster name="'..name:lower()..'" file="(.-)"/>')
        file:close()
        local data = io.open('data/monster/'..(arquivo or ''),'r')
        if not data then
            return 100
        end
        local maximo = data:read(-1):match('max%s*=%s*"(%d+)"')
        data:close()
        return maximo
end
----- Config -----
local MaximoSummon = 1
local nome = getItemName(item.uid)
local poke_name = nome:match('(.-) Pokeball')
local summons = getCreatureSummons(cid)
local action_id = getItemAttribute(item.uid, "aid")
----- Config -----
    if getItemAttribute(item.uid, "aid") == -1 then
    return doPlayerSendCancel(cid, "Seu pokemon está morto.")
    end   

    if getPlayerStorageValue(cid, 25000) == 5 then       
    return doPlayerSendCancel(cid, "Você está montando.")
    end
    if getPlayerStorageValue(cid, 23000) == 5 then
    return doPlayerSendCancel(cid, "Você está voando.")
    end
local summons = getCreatureSummons(cid)
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
doPlayerSendCancel(cid, "Para Soltar seus pokemons, coloque-os no slot da pokeball.")
return TRUE
end
if(table.maxn(summons) < MaximoSummon) then -- no summons
creature = doSummonCreature(poke_name, getCreaturePosition(cid))
doConvinceCreature(cid, creature)
registerCreatureEvent(creature, "DiePoke")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")
doPlayerSay(cid, "Go,"..poke_name.."!!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(creature), 188)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2531, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Pokeball")
        if action_id ~= 0 then
doCreatureAddHealth(creature, -(tonumber(getPokemonMaxLife(poke_name) - action_id)))
        else
        doCreatureAddHealth(creature, getPokemonMaxLife(poke_name))
        end
else
for _, pid in ipairs(summons) do
if (table.maxn(summons) >= 1) then
doItemSetAttribute(item.uid, "aid", getCreatureHealth(summons[1]))
doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), 188)
doPlayerSay(cid, "Back,"..poke_name..".", TALKTYPE_ORANGE_1)
doRemoveCreature(pid)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2532, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Pokeball")
end
end
end
return true
end

Error in distro
Code:
[04/01/2020 23:08:15] [Error - Action Interface]
[04/01/2020 23:08:15] data/actions/scripts/goback.lua:onUse
[04/01/2020 23:08:15] Description:
[04/01/2020 23:08:15] (luaDoConvinceCreature) Creature not found

[04/01/2020 23:08:15] [Error - Action Interface]
[04/01/2020 23:08:15] data/actions/scripts/goback.lua:onUse
[04/01/2020 23:08:15] Description:
[04/01/2020 23:08:15] (luaDoCreatureSetLookDir) Creature not found

[04/01/2020 23:08:16] [Error - Action Interface]
[04/01/2020 23:08:16] data/actions/scripts/goback.lua:onUse
[04/01/2020 23:08:16] Description:
[04/01/2020 23:08:16] (luaRegisterCreatureEvent) Creature not found

[04/01/2020 23:08:16] [Error - Action Interface]
[04/01/2020 23:08:16] data/actions/scripts/goback.lua:onUse
[04/01/2020 23:08:16] Description:
[04/01/2020 23:08:16] (luaGetThingPosition) Thing not found

[04/01/2020 23:08:16] [Error - Action Interface]
[04/01/2020 23:08:16] data/actions/scripts/goback.lua:onUse
[04/01/2020 23:08:16] Description:
[04/01/2020 23:08:16] (luaDoCreatureAddHealth) Creature not found
 
Last edited:
Back
Top