Summon teleport tfs1.3

nokturno

Not a human
Joined
Aug 7, 2009
Messages
322
Reaction score
122
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
 

BahamutxD

Jack of all trades, master of none
Joined
Jun 8, 2009
Messages
568
Reaction score
180
Location
Spain
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...
 
OP
nokturno

nokturno

Not a human
Joined
Aug 7, 2009
Messages
322
Reaction score
122
Already tried those, i dont get errors in console, but the script just wont do anything
 

Apollos

Dude who does stuff
Joined
Apr 22, 2009
Messages
735
Reaction score
449
Location
United States
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
 
OP
nokturno

nokturno

Not a human
Joined
Aug 7, 2009
Messages
322
Reaction score
122
Ill try this after work, are u using tfs 1.3 aswell?
 

enemyy

New Member
Joined
Aug 11, 2017
Messages
22
Reaction score
3
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?
 

enemyy

New Member
Joined
Aug 11, 2017
Messages
22
Reaction score
3
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+
 
Top