• 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!

Access after killing boss

matik

New Member
Joined
Oct 20, 2012
Messages
10
Reaction score
1
Is possible to create script for access to hmm teleport or door after kills monster(boss)?
I want to do something like inq on rl tibia ( if u kill boss u can use short to room )
TFS 0.3.6
 
on data\creaturescripts\scripts add this to a Lua script and change Monster1/Monster2 to bosses name.
Lua:
function onKill(cid, target, damage, flags)
    local Monster = {"Monster1", "Monster2"}
    if(bit.band(flags, 1) == 1 and isMonster(target)) then 
        if isInArray(Monster, getCreatureName(target)) then
        setPlayerStorageValue(cid,57684, 1)
        end 
    end
    return true
end
then in data\creaturescripts\scripts\login.lua add this
Lua:
registerCreatureEvent(cid, "BossKill")
and in data\creaturescripts\creaturescripts.xml add this
XML:
<event type="kill" name="BossKill" event="script" value="BossKill.lua"/>
now go to \data\movements\scripts and create a Lua script and paste this to it and change this to the destination you want your portal to lead to {x=xxxx, y=xxxx, z=7}
Lua:
function onStepIn(cid, item, position, fromPosition)
if getPlayerStorageValue(cid, 57684) >= 1 then
local place = {x=xxxx, y=xxxx, z=7}
doTeleportThing(cid, place)
doSendMagicEffect(getCreaturePosition(cid),10)
else
doTeleportThing(cid, fromPosition)
doSendMagicEffect(getCreaturePosition(cid),10)
doCreatureSay(cid, 'You don\'t have enough energy to enter this portal', TALKTYPE_ORANGE_1)
end
return true
end
then in data\movements\movements.xml add this
XML:
<movevent type="StepIn" actionid="youractionid" event="script" value="bossteleport.lua"/>
change youractionid to any action id you want and set it to the teleport with map editor then it should work.
 
Hmm i do all things and i can go teleport without kill boss ;/ but when i enter i see
You don\'t have enough energy to enter this portal
 
Hmm i do all things and i can go teleport without kill boss ;/ but when i enter i see
You don\'t have enough energy to enter this portal
The above script works like this.

Step 1) Teleport does not work. (You don't have enough energy to enter this portal)
Step 2) Kill boss.
Step 3) Teleport works.
 
function onKill(cid, target, damage, flags)
local Monster = {"Zugurosh", "Zugurosh"}
if(bit.band(flags, 1) == 1 and isMonster(target)) then
if isInArray(Monster, getCreatureName(target)) then
setPlayerStorageValue(cid,57684, 1)
end
end
return true
end

I have zugurosh on boss name when I try to enter without kill i can;t go to my position from tp but if i kill zugurosh same problem ;/ Why ?
 
Back
Top