• 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 teleport tfs1.3

Nokturno

Not a human
Joined
Aug 7, 2009
Messages
558
Solutions
2
Reaction score
400
Hello ppl i was wondering if someone had a script for summon reposition into master pos.

The clasic summons tp scripts but working in tfs 1.3
 
Solution
Hello ppl i was wondering if someone had a script for summon reposition into master pos.

The clasic summons tp scripts but working in tfs 1.3
Did you mean like the script where it follow the master when he goes on higher floors or walks too far away?
If so when the summon is created you can register a creaturescript event to it like this:
XML:
<event type="think" name="SummonThink" script="custom/summon_think.lua" />
Lua:
summon:registerEvent('SummonThink')
Lua:
function onThink(creature, interval)
    local master = creature:getMaster()
    if not master then return true end

    local pos = creature:getPosition()
    local master_pos = master:getPosition()
    if getDistanceBetween(pos, master_pos) > 7 or master_pos.z ~=...
There was some scripts around this forum, not sure if thats what you need. I believe someone released a system aswell on some BR site for pokemon servers, I guess its basically the same...
 
Hello ppl i was wondering if someone had a script for summon reposition into master pos.

The clasic summons tp scripts but working in tfs 1.3
Did you mean like the script where it follow the master when he goes on higher floors or walks too far away?
If so when the summon is created you can register a creaturescript event to it like this:
XML:
<event type="think" name="SummonThink" script="custom/summon_think.lua" />
Lua:
summon:registerEvent('SummonThink')
Lua:
function onThink(creature, interval)
    local master = creature:getMaster()
    if not master then return true end

    local pos = creature:getPosition()
    local master_pos = master:getPosition()
    if getDistanceBetween(pos, master_pos) > 7 or master_pos.z ~= pos.z then
        if creature:teleportTo(master_pos) then
            pos:sendMagicEffect(CONST_ME_POFF)
        end
    end
    return true
end
 
Solution
on
Code:
spells/scripts/support/summon_creature.lua
View attachment 37054

ohh...

I'm using an action script to summon the monster:

Lua:
local tempo = 120

local function removeMonster(cid)
    local monster = Monster(cid)
    if monster then
        doCreatureSay(monster, "Good Bye!", TALKTYPE_ORANGE_1)
        monster:getPosition():sendMagicEffect(CONST_ME_POFF)
        monster:remove()
    end
end


function onUse(player, item, fromPosition, target, toPosition, isHotkey)
  if player:getExhaustion(84309) <= 0 then

    local position = player:getPosition()
    local monster = Game.createMonster("Barbarian Bloodwalker", position)
    if monster then
        player:addSummon(monster)
        position:sendMagicEffect(CONST_ME_MAGIC_RED)
        monster:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
        doCreatureSay(monster, "Praise the sun!", TALKTYPE_ORANGE_1)
        addEvent(removeMonster, tempo*1000, monster:getId())
        player:setExhaustion(84309, tempo)
       
        --    item:remove()
    else
        player:sendCancelMessage("There is not enough room.")
        position:sendMagicEffect(CONST_ME_POFF)
    end
    else          
   player:sendCancelMessage('You need to wait to use this item again.')
   player:getPosition():sendMagicEffect(CONST_ME_POFF)
   return true
   end
    return false
end


Is there any chance it works here?
 
i get it!

i have put it:

Lua:
summon:registerEvent('SummonThink')

insite my lib:
Lua:
function Creature:addSummon(monster)
    local summon = Monster(monster)
    if not summon then
        return false
    end

    summon:setTarget(nil)
    summon:setFollowCreature(nil)
    summon:setDropLoot(false)
    summon:setSkillLoss(false)
    summon:setMaster(self)
    summon:registerEvent('SummonThink')

    return true
end

thank you guys rep+
 
Did you mean like the script where it follow the master when he goes on higher floors or walks too far away?
If so when the summon is created you can register a creaturescript event to it like this:
XML:
<event type="think" name="SummonThink" script="custom/summon_think.lua" />
Lua:
summon:registerEvent('SummonThink')
Lua:
function onThink(creature, interval)
    local master = creature:getMaster()
    if not master then return true end

    local pos = creature:getPosition()
    local master_pos = master:getPosition()
    if getDistanceBetween(pos, master_pos) > 7 or master_pos.z ~= pos.z then
        if creature:teleportTo(master_pos) then
            pos:sendMagicEffect(CONST_ME_POFF)
        end
    end
    return true
end

for people whos using it

Lua:
local tile = master:getTile()
local ground = tile:hasFlag(TILESTATE_PROTECTIONZONE) and tile:getGround()
if ground then
return true
end

add this to avoid summon following you in protection zone
 
Back
Top