• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Kill Monster & Create Portal

Status
Not open for further replies.

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Solutions
2
Reaction score
115
The Forgotten Server 0.3.5

Credits:
JDB

data/creaturescripts/scripts/login.lua
Lua:
registerCreatureEvent(cid, "monsterPortals")

data/creaturescripts/creaturescripts.xml
Lua:
<event type="kill" name="monsterPortals" event="script" value="script.lua"/>

data/creaturescripts/scripts/script.lua
Lua:
local bosses = { -- Teleport Takes Player -- Teleport Is Created --
        ["Ushuriel"] = { x=1173, y=1141, z=12 }, { x=1097, y=1214, z=12 },
        ["Zugurosh"] = { x=1126, y=1151, z=12 }, { x=1149, y=1231, z=12 },
        ["Madareth"] = { x=1045, y=1206, z=13 }, { x=1112, y=1240, z=12 },
        ["Latrivan"] = { x=1154, y=1195, z=13 }, { x=1147, y=1244, z=12 },
        ["Annihilon"] = { x=1244, y=1297, z=12 }, { x=1187, y=1198, z=12 },
        ["Hellgorak"] = { x=1067, y=1307, z=13 }, { x=1192, y=1240, z=12 }                      
}

local time = 30 -- Seconds
function onKill(cid, target, lastHit)
        for name, pos in pairs(bosses) do
                if (name == getCreatureName(target):lower()) then
                        doCreateTeleport(1387, pos[1], pos[2])
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. time .." seconds until the portal will disapear.")
                        addEvent(doRemoveItem, tpTime * 1000, getTileItemById(pos[2], 1387).uid, 1)
                end
        end
        return true
end
 
Last edited:
I do beleive this was already released but gj anyways :thumbup:
 
Something similar was released for the Inquisition Quest, but this is just for one monster.
 
Code:
function removeTeleport()

Should be defined as local function :thumbup:
 
I think that first is going to be on your kill.lua, not in your login.lua :s, also i got this error, help please:

[04/08/2009 21:24:33] Lua Script Error: [CreatureScript Interface]
[04/08/2009 21:24:33] data/creaturescripts/scripts/kill.lua

[04/08/2009 21:24:33] luaRegisterCreatureEvent(). Creature not found
 
Last edited:
Code:
function removeTeleport()

Should be defined as local function :thumbup:

@Choj,
It works.

@Up,
You have to register the event at login.lua and it should work.
 
Great script as always, but what TFS 0.3 is it for? I did everything and tested it on 0.3.2 but it only causes my monsters to "never die", when they run out of hp they stay there standing and still attacking, they never die but when I bring down the selected monster's hp to 0 the teleport does appear, but it lasts like 0.1 second.

No errors in console either. I guess its not compatible with 0.3.2 ;/
 
I did not test this script myself, but someone else did.
 
Last edited:
Updated First Post

PHP:
<script> 
<event name="monsterTele"/> 
</script>

Sorry for me not testing it first, my comp. is broke.
 
[07/08/2009 13:51:09] Lua Script Error: [CreatureScript Interface]
[07/08/2009 13:51:09] data/creaturescripts/scripts/script.lua:eek:nKill

[07/08/2009 13:51:09] luaAddEvent(). callback parameter should be a function.
my monster don't die Oo
 
Are you using TFS 0.3.5?
 
[07/08/2009 13:51:09] Lua Script Error: [CreatureScript Interface]
[07/08/2009 13:51:09] data/creaturescripts/scripts/script.lua:eek:nKill

[07/08/2009 13:51:09] luaAddEvent(). callback parameter should be a function.
my monster don't die Oo

Try:
Code:
addEvent(removeTeleport, timeToPass * 1000, {})
 
I don't know if all have this problem but on 0.3.5 when u use this script the monster dont die and teleport create and disappear in one moment, i know only solution for monster if they die, you need change
Lua:
    if creatureName == "Morgorath" then
        doCreateTeleport(1387, tele_pos, new_pos)
        doSendMagicEffect(tele_pos, CONST_ME_TELEPORT)
        doCreatureSay(cid, "You have ".. timeToPass .." seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
        addEvent(removeTeleport, timeToPass * 1000)
    end
end
to
Lua:
    if creatureName == "Morgorath" then
        doCreateTeleport(1387, tele_pos, new_pos)
        doSendMagicEffect(tele_pos, CONST_ME_TELEPORT)
        doCreatureSay(cid, "You have ".. timeToPass .." seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
        addEvent(removeTeleport, timeToPass * 1000)
    end
	return TRUE
end

Now I only see that Error
Code:
[08/08/2009 17:13:59] Lua Script Error: [CreatureScript Interface] 
[08/08/2009 17:13:59] data/creaturescripts/scripts/inq/teleport_ushuriel.lua:onKill

[08/08/2009 17:13:59] luaAddEvent(). Callback parameter should be a function.
Maybe someone can repair it?
@Down
It work only for monster that dont die... Someone need to reapir thing with teleport that show and disappear in one moment
 
Last edited:
@Up,
This works?

@Topic,
It works as written for 0.3.4
I don't think it works on 0.3.5
 
it work on tfs for 8.5 TFS 0.2.4 ??

I tested and not work but maybe i'm doing something wrong
 
Script updated, although I did not test it.
 
What happened to your Forever Aol (and redskull amulet) script? :< plax make one for me (TFS 0.3.4PL2)
 
Status
Not open for further replies.
Back
Top