Restles
fallen human nature
Hello, I have a request, can I be able to keep tracking on tfs 1.1 by someone? I would be very grateful
Lua:
local protection = {}
local monster = "Demon"
function onEquip (cid, item, slot)
if protection[cid] then
protection[cid] = nil
return true
end
protection[cid] = true
local mid = 0
if type(doSummonMonster) then
local func_ret = doSummonMonster(cid, monster)
if func_ret == 0 then
return doPlayerSendCancel(cid, "There is not enough room to summon your monster.")
end
local s = getCreatureSummons(cid)
mid = s[#s]
else
mid = doCreateMonster(monster, getThingPos(cid), false)
if mid == true then
return doPlayerSendCancel(cid, "There is not enough room to summon your monster.")
end
doConvinceCreature(cid, mid)
end
if not isCreature(mid) then return true end
if getCreatureMaster(mid) ~= cid then
doRemoveCreature(mid)
else
doTeleportThing(mid, getThingPos(cid))
doSendMagicEffect(getThingPos(mid), CONST_ME_TELEPORT)
local function regenerateMana(mid, percents)
local cid = (isCreature(mid) and getCreatureMaster(mid) or 0)
if(not isCreature(cid)) then return end
doCreatureAddMana(cid, getCreatureMaxMana(cid)/percents)
addEvent(regenerateMana, 7000, mid, 10)
end
addEvent(regenerateMana, 7000, mid, 10)
end
return true
end
function onDeEquip(cid, item, slot)
local monster = "Gamakichi"
if #getCreatureSummons(cid) >= 1 then
for _, summon in ipairs(getCreatureSummons(cid)) do
if getCreatureName(summon) == monster then
doSendMagicEffect(getPlayerPosition(summon), 10)
doRemoveCreature(summon)
break
end
end
end
return true
end