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

Solved TFS 1.3x - How to appear animated message at player death? "Owned"?

muchppl1x

New Member
Joined
Apr 4, 2020
Messages
22
Reaction score
1
TFS 1.3x

How to appear animated message at player death? "Owned"?

OBS: Version is 12.64 - Probably other TFS scripts do not work in this version.

\data\scripts\creaturescripts\others\player_death.lua

player_death.lua

local deathListEnabled = true

local playerDeath = CreatureEvent("PlayerDeath")
function playerDeath.onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
local playerId = player:getId()
if nextUseStaminaTime[playerId] ~= nil then
nextUseStaminaTime[playerId] = nil
end

player:sendTextMessage(MESSAGE_BEYOND_LAST, 'You are dead.')
if player:getStorageValue(Storage.SvargrondArena.PitDoor) > 0 then
player:setStorageValue(Storage.SvargrondArena.PitDoor, 0)
end

if not deathListEnabled then
return
end

local byPlayer = 0
local killerName
if killer ~= nil then
if killer:isPlayer() then
byPlayer = 1
else
local master = killer:getMaster()
if master and master ~= killer and master:isPlayer() then
killer = master
byPlayer = 1
end
end
killerName = killer:isMonster() and killer:getType():getNameDescription() or killer:getName()
else
killerName = 'field item'
end

local byPlayerMostDamage = 0
local mostDamageKillerName
if mostDamageKiller ~= nil then
if mostDamageKiller:isPlayer() then
byPlayerMostDamage = 1
else
local master = mostDamageKiller:getMaster()
if master and master ~= mostDamageKiller and master:isPlayer() then
mostDamageKiller = master
byPlayerMostDamage = 1
end
end
mostDamageName = mostDamageKiller:isMonster() and mostDamageKiller:getType():getNameDescription() or mostDamageKiller:getName()
else
mostDamageName = 'field item'
end

local playerGuid = player:getGuid()
db.query('INSERT INTO player_deaths (player_id, time, level, killed_by, is_player, mostdamage_by, mostdamage_is_player, unjustified, mostdamage_unjustified) VALUES (' .. playerGuid .. ', ' .. os.time() .. ', ' .. player:getLevel() .. ', ' .. db.escapeString(killerName) .. ', ' .. byPlayer .. ', ' .. db.escapeString(mostDamageName) .. ', ' .. byPlayerMostDamage .. ', ' .. (unjustified and 1 or 0) .. ', ' .. (mostDamageUnjustified and 1 or 0) .. ')')
local resultId = db.storeQuery('SELECT player_id FROM player_deaths WHERE player_id = ' .. playerGuid)

local deathRecords = 0
local tmpResultId = resultId
while tmpResultId ~= false do
tmpResultId = result.next(resultId)
deathRecords = deathRecords + 1
end

if resultId ~= false then
result.free(resultId)
end

if byPlayer == 1 then
local targetGuild = player:getGuild()
targetGuild = targetGuild and targetGuild:getId() or 0
if targetGuild ~= 0 then
local killerGuild = killer:getGuild()
killerGuild = killerGuild and killerGuild:getId() or 0
if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer.uid) then
local warId = false
resultId = db.storeQuery('SELECT id FROM guild_wars WHERE status = 1 AND \z
((guild1 = ' .. killerGuild .. ' AND guild2 = ' .. targetGuild .. ') OR \z
(guild1 = ' .. targetGuild .. ' AND guild2 = ' .. killerGuild .. '))')
if resultId ~= false then
warId = result.getNumber(resultId, 'id')
result.free(resultId)
end

if warId ~= false then
db.asyncQuery('INSERT INTO guildwar_kills (killer, target, killerguild, targetguild, time, warid) \z
VALUES (' .. db.escapeString(killerName) .. ', ' .. db.escapeString(player:getName()) .. ', ' .. killerGuild .. ', \z
' .. targetGuild .. ', ' .. os.time() .. ', ' .. warId .. ')')
end
end
end
end
if killer:isPlayer() then
Game.broadcastMessage(player:getName().."["..player:getLevel().."] acabou de ser morto pelo jogador "..killer:getName().."["..killer:getLevel().."].", MESSAGE_EVENT_WARNING)
end
end
playerDeath:register()

\data\scripts\creaturescripts\others\login.lua

login.lua

local function onMovementRemoveProtection(cid, oldPos, time)
local player = Player(cid)
if not player then
return true
end

local playerPos = player:getPosition()
if (playerPos.x ~= oldPos.x or playerPos.y ~= oldPos.y or playerPos.z ~= oldPos.z) or player:getTarget() then
player:setStorageValue(Storage.combatProtectionStorage, 0)
return true
end

addEvent(onMovementRemoveProtection, 1000, cid, oldPos, time - 1)
end

local function protectionZoneCheck(playerName)
doRemoveCreature(playerName)
return true
end

local playerLogin = CreatureEvent("PlayerLogin")

function playerLogin.onLogin(player)
local items = {
{2120, 1},
{2148, 3}
}
if player:getLastLoginSaved() == 0 then
player:addOutfitAddon(136, 3)
player:addOutfitAddon(137, 3)
player:addOutfitAddon(138, 3)
player:addOutfitAddon(139, 3)
player:addOutfitAddon(140, 3)
player:addOutfitAddon(141, 3)
player:addOutfitAddon(142, 3)
player:addOutfitAddon(147, 3)
player:addOutfitAddon(148, 3)
player:addOutfitAddon(149, 3)
player:addOutfitAddon(150, 3)
player:addOutfitAddon(155, 3)
player:addOutfitAddon(156, 3)
player:addOutfitAddon(157, 3)
player:addOutfitAddon(158, 3)
player:addOutfitAddon(252, 3)
player:addOutfitAddon(269, 3)
player:addOutfitAddon(270, 3)
player:addOutfitAddon(279, 3)
player:addOutfitAddon(288, 3)
player:addOutfitAddon(324, 3)
player:addOutfitAddon(329, 3)
player:addOutfitAddon(336, 3)
player:addOutfitAddon(431, 3)
player:addOutfitAddon(433, 3)
player:addOutfitAddon(464, 3)
player:addOutfitAddon(466, 3)
player:addOutfitAddon(471, 3)
player:addOutfitAddon(513, 3)
player:addOutfitAddon(514, 3)
player:addOutfitAddon(542, 3)
player:addOutfitAddon(575, 3)
player:addOutfitAddon(578, 3)
player:addOutfitAddon(618, 3)
player:addOutfitAddon(620, 3)
player:addOutfitAddon(632, 3)
player:addOutfitAddon(635, 3)
player:addOutfitAddon(636, 3)
player:addOutfitAddon(664, 3)
player:addOutfitAddon(666, 3)
player:addOutfitAddon(683, 3)
player:addOutfitAddon(694, 3)
player:addOutfitAddon(696, 3)
player:addOutfitAddon(698, 3)
player:addOutfitAddon(724, 3)
player:addOutfitAddon(732, 3)
player:addOutfitAddon(745, 3)
player:addOutfitAddon(749, 3)
player:addOutfitAddon(759, 3)
player:addOutfitAddon(845, 3)
player:addOutfitAddon(852, 3)
player:addOutfitAddon(874, 3)
player:addOutfitAddon(885, 3)
player:addOutfitAddon(900, 3)
player:addOutfitAddon(909, 3)
player:addOutfitAddon(929, 3)
player:addOutfitAddon(956, 3)
player:addOutfitAddon(958, 3)
player:addOutfitAddon(963, 3)
player:addOutfitAddon(967, 3)
player:addOutfitAddon(971, 3)
player:addOutfitAddon(973, 3)
player:addOutfitAddon(975, 3)
player:addOutfitAddon(1020, 3)
player:addOutfitAddon(1024, 3)
player:addOutfitAddon(1043, 3)
player:addOutfitAddon(1050, 3)
player:addOutfitAddon(1057, 3)
player:addOutfitAddon(1070, 3)
player:addOutfitAddon(1095, 3)
player:addOutfitAddon(1103, 3)
player:addOutfitAddon(1128, 3)
player:addOutfitAddon(1147, 3)
player:addOutfitAddon(1162, 3)
player:addOutfitAddon(1174, 3)
player:addOutfitAddon(1187, 3)
player:addOutfitAddon(1203, 3)
player:addOutfitAddon(1205, 3)
player:addOutfitAddon(1207, 3)
player:addOutfitAddon(1211, 3)
player:addOutfitAddon(1244, 3)
player:addOutfitAddon(1252, 3)
player:addOutfitAddon(1271, 3)
player:addOutfitAddon(1280, 3)
player:addOutfitAddon(1283, 3)
player:addOutfitAddon(1289, 3)
player:addOutfitAddon(1293, 3)
player:addOutfitAddon(1323, 3)
player:addOutfitAddon(1332, 3)
player:addOutfitAddon(1339, 3)
player:addOutfitAddon(1372, 3)
player:addOutfitAddon(1383, 3)
player:addOutfitAddon(1385, 3)
player:addOutfitAddon(128, 3)
player:addOutfitAddon(129, 3)
player:addOutfitAddon(130, 3)
player:addOutfitAddon(131, 3)
player:addOutfitAddon(132, 3)
player:addOutfitAddon(133, 3)
player:addOutfitAddon(134, 3)
player:addOutfitAddon(143, 3)
player:addOutfitAddon(144, 3)
player:addOutfitAddon(145, 3)
player:addOutfitAddon(146, 3)
player:addOutfitAddon(151, 3)
player:addOutfitAddon(152, 3)
player:addOutfitAddon(153, 3)
player:addOutfitAddon(154, 3)
player:addOutfitAddon(251, 3)
player:addOutfitAddon(268, 3)
player:addOutfitAddon(273, 3)
player:addOutfitAddon(278, 3)
player:addOutfitAddon(289, 3)
player:addOutfitAddon(325, 3)
player:addOutfitAddon(328, 3)
player:addOutfitAddon(335, 3)
player:addOutfitAddon(367, 3)
player:addOutfitAddon(430, 3)
player:addOutfitAddon(432, 3)
player:addOutfitAddon(463, 3)
player:addOutfitAddon(465, 3)
player:addOutfitAddon(472, 3)
player:addOutfitAddon(512, 3)
player:addOutfitAddon(516, 3)
player:addOutfitAddon(541, 3)
player:addOutfitAddon(574, 3)
player:addOutfitAddon(577, 3)
player:addOutfitAddon(610, 3)
player:addOutfitAddon(619, 3)
player:addOutfitAddon(633, 3)
player:addOutfitAddon(634, 3)
player:addOutfitAddon(637, 3)
player:addOutfitAddon(665, 3)
player:addOutfitAddon(667, 3)
player:addOutfitAddon(684, 3)
player:addOutfitAddon(695, 3)
player:addOutfitAddon(697, 3)
player:addOutfitAddon(699, 3)
player:addOutfitAddon(725, 3)
player:addOutfitAddon(733, 3)
player:addOutfitAddon(746, 3)
player:addOutfitAddon(750, 3)
player:addOutfitAddon(760, 3)
player:addOutfitAddon(846, 3)
player:addOutfitAddon(853, 3)
player:addOutfitAddon(873, 3)
player:addOutfitAddon(884, 3)
player:addOutfitAddon(899, 3)
player:addOutfitAddon(908, 3)
player:addOutfitAddon(931, 3)
player:addOutfitAddon(955, 3)
player:addOutfitAddon(957, 3)
player:addOutfitAddon(962, 3)
player:addOutfitAddon(964, 3)
player:addOutfitAddon(966, 3)
player:addOutfitAddon(968, 3)
player:addOutfitAddon(970, 3)
player:addOutfitAddon(972, 3)
player:addOutfitAddon(974, 3)
player:addOutfitAddon(1021, 3)
player:addOutfitAddon(1023, 3)
player:addOutfitAddon(1042, 3)
player:addOutfitAddon(1051, 3)
player:addOutfitAddon(1056, 3)
player:addOutfitAddon(1069, 3)
player:addOutfitAddon(1094, 3)
player:addOutfitAddon(1102, 3)
player:addOutfitAddon(1127, 3)
player:addOutfitAddon(1146, 3)
player:addOutfitAddon(1161, 3)
player:addOutfitAddon(1173, 3)
player:addOutfitAddon(1186, 3)
player:addOutfitAddon(1202, 3)
player:addOutfitAddon(1204, 3)
player:addOutfitAddon(1206, 3)
player:addOutfitAddon(1210, 3)
player:addOutfitAddon(1243, 3)
player:addOutfitAddon(1245, 3)
player:addOutfitAddon(1251, 3)
player:addOutfitAddon(1270, 3)
player:addOutfitAddon(1279, 3)
player:addOutfitAddon(1282, 3)
player:addOutfitAddon(1288, 3)
player:addOutfitAddon(1292, 3)
player:addOutfitAddon(1322, 3)
player:addOutfitAddon(1331, 3)
player:addOutfitAddon(1338, 3)
player:addOutfitAddon(1371, 3)
player:addOutfitAddon(1382, 3)
player:addOutfitAddon(1384, 3)
player:addMount(1)
player:addMount(2)
player:addMount(3)
player:addMount(4)
player:addMount(5)
player:addMount(6)
player:addMount(7)
player:addMount(8)
player:addMount(9)
player:addMount(10)
player:addMount(11)
player:addMount(12)
player:addMount(13)
player:addMount(14)
player:addMount(15)
player:addMount(16)
player:addMount(17)
player:addMount(18)
player:addMount(19)
player:addMount(20)
player:addMount(21)
player:addMount(22)
player:addMount(23)
player:addMount(24)
player:addMount(25)
player:addMount(26)
player:addMount(27)
player:addMount(28)
player:addMount(29)
player:addMount(30)
player:addMount(31)
player:addMount(32)
player:addMount(33)
player:addMount(34)
player:addMount(35)
player:addMount(36)
player:addMount(37)
player:addMount(38)
player:addMount(39)
player:addMount(40)
player:addMount(41)
player:addMount(42)
player:addMount(43)
player:addMount(44)
player:addMount(45)
player:addMount(46)
player:addMount(47)
player:addMount(48)
player:addMount(49)
player:addMount(50)
player:addMount(51)
player:addMount(52)
player:addMount(53)
player:addMount(54)
player:addMount(55)
player:addMount(56)
player:addMount(57)
player:addMount(58)
player:addMount(59)
player:addMount(60)
player:addMount(61)
player:addMount(62)
player:addMount(63)
player:addMount(64)
player:addMount(65)
player:addMount(66)
player:addMount(67)
player:addMount(68)
player:addMount(69)
player:addMount(70)
player:addMount(71)
player:addMount(72)
player:addMount(73)
player:addMount(74)
player:addMount(75)
player:addMount(76)
player:addMount(77)
player:addMount(78)
player:addMount(79)
player:addMount(80)
player:addMount(81)
player:addMount(82)
player:addMount(83)
player:addMount(84)
player:addMount(85)
player:addMount(86)
player:addMount(87)
player:addMount(88)
player:addMount(89)
player:addMount(90)
player:addMount(91)
player:addMount(92)
player:addMount(93)
player:addMount(94)
player:addMount(95)
player:addMount(96)
player:addMount(97)
player:addMount(98)
player:addMount(99)
player:addMount(100)
player:addMount(101)
player:addMount(102)
player:addMount(103)
player:addMount(104)
player:addMount(105)
player:addMount(106)
player:addMount(107)
player:addMount(108)
player:addMount(109)
player:addMount(110)
player:addMount(111)
player:addMount(112)
player:addMount(113)
player:addMount(114)
player:addMount(115)
player:addMount(116)
player:addMount(117)
player:addMount(118)
player:addMount(119)
player:addMount(120)
player:addMount(121)
player:addMount(122)
player:addMount(123)
player:addMount(124)
player:addMount(125)
player:addMount(126)
player:addMount(127)
player:addMount(128)
player:addMount(129)
player:addMount(130)
player:addMount(131)
player:addMount(132)
player:addMount(133)
player:addMount(134)
player:addMount(135)
player:addMount(136)
player:addMount(137)
player:addMount(138)
player:addMount(139)
player:addMount(140)
player:addMount(141)
player:addMount(142)
player:addMount(143)
player:addMount(144)
player:addMount(145)
player:addMount(146)
player:addMount(147)
player:addMount(148)
player:addMount(149)
player:addMount(150)
player:addMount(151)
player:addMount(152)
player:addMount(153)
player:addMount(154)
player:addMount(155)
player:addMount(156)
player:addMount(157)
player:addMount(158)
player:addMount(159)
player:addMount(160)
player:addMount(161)
player:addMount(162)
player:addMount(163)
player:addMount(164)
player:addMount(165)
player:addMount(166)
player:addMount(167)
player:addMount(168)
player:addMount(169)
player:addMount(170)
player:addMount(171)
player:addMount(172)
player:addMount(173)
player:addMount(174)
player:addMount(175)
player:addMount(176)
player:addMount(177)
player:addMount(178)
player:addMount(179)
player:addMount(180)
player:addMount(181)
player:sendOutfitWindow()
local backpack = player:addItem(1988)
if backpack then
for i = 1, #items do
backpack:addItem(items[1], items[2])
end
end
player:addItem(2050, 1, true, 1, CONST_SLOT_AMMO)
db.query('UPDATE players SET istutorial = 0 where id='..player:getGuid())
else
player:sendTextMessage(MESSAGE_STATUS, "Welcome to " .. SERVER_NAME .. "!")
player:sendTextMessage(MESSAGE_LOGIN, string.format("Your last visit in ".. SERVER_NAME ..": %s.", os.date("%d. %b %Y %X", player:getLastLoginSaved())))
end

if isPremium(player) then
player:setStorageValue(Storage.PremiumAccount, 1)
end
-- Premium Ends Teleport to Temple, change addon (citizen) houseless
local defaultTown = "Thais" -- default town where player is teleported if his home town is in premium area
local freeTowns = {"Ab'Dendriel", "Carlin", "Kazordoon", "Thais", "Venore", "Rookgaard", "Dawnport", "Dawnport Tutorial", "Island of Destiny"} -- towns in free account area

if isPremium(player) == false and isInArray(freeTowns, player:getTown():getName()) == false then
local town = player:getTown()
local sex = player:getSex()
local home = getHouseByPlayerGUID(getPlayerGUID(player))
town = isInArray(freeTowns, town:getName()) and town or Town(defaultTown)
player:teleportTo(town:getTemplePosition())
player:setTown(town)
player:sendTextMessage(MESSAGE_FAILURE, "Your premium time has expired.")
player:setStorageValue(Storage.PremiumAccount, 0)
if sex == 1 then
player:setOutfit({lookType = 128, lookFeet = 114, lookLegs = 134, lookHead = 114,lookAddons = 0})
elseif sex == 0 then
player:setOutfit({lookType = 136, lookFeet = 114, lookLegs = 134, lookHead = 114, lookAddons = 0})
end
if home ~= nil and not isPremium(player) then
setHouseOwner(home, 0)
player:sendTextMessage(MESSAGE_GAME_HIGHLIGHT, 'You\'ve lost your house because you are not premium anymore.')
player:sendTextMessage(MESSAGE_GAME_HIGHLIGHT, 'Your items from house are send to your inbox.')
end
end
-- End 'Premium Ends Teleport to Temple'

-- Recruiter system
local resultId = db.storeQuery('SELECT recruiter from accounts where id='..getAccountNumberByPlayerName(getPlayerName(player)))
local recruiterStatus = result.getNumber(resultId, 'recruiter')
local sex = player:getSex()
if recruiterStatus >= 1 then
if sex == 1 then
local outfit = player:hasOutfit(746)
if outfit == false then
player:addOutfit(746)
end
else
local outfit = player:hasOutfit(745)
if outfit == false then
player:addOutfit(745)
end
end
end
if recruiterStatus >= 3 then
if sex == 1 then
local outfit = player:hasOutfit(746,1)
if outfit == false then
player:addOutfitAddon(746,1)
end
else
local outfit = player:hasOutfit(745,1)
if outfit == false then
player:addOutfit(745,1)
end
end
end
if recruiterStatus >= 10 then
if sex == 1 then
local outfit = player:hasOutfit(746,2)
if outfit == false then
player:addOutfitAddon(746,2)
end
else
local outfit = player:hasOutfit(745,2)
if outfit == false then
player:addOutfit(745,2)
end
end
end
-- End recruiter system

local playerId = player:getId()
DailyReward.init(playerId)

player:loadSpecialStorage()

if player:getGroup():getId() >= GROUP_TYPE_GAMEMASTER then
player:setGhostMode(true)
end
-- Boosted creature
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Today's boosted creature: " .. Game.getBoostedCreature() .. " \
Boosted creatures yield more experience points, carry more loot than usual and respawn at a faster rate.")

-- Stamina
nextUseStaminaTime[playerId] = 1

-- EXP Stamina
nextUseXpStamina[playerId] = 1

-- Prey Small Window
for slot = CONST_PREY_SLOT_FIRST, CONST_PREY_SLOT_THIRD do
player:sendPreyData(slot)
end

-- New prey
nextPreyTime[playerId] = {
[CONST_PREY_SLOT_FIRST] = 1,
[CONST_PREY_SLOT_SECOND] = 1,
[CONST_PREY_SLOT_THIRD] = 1
}

if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then
local msg = [[:: Tutor Rules
1 *> 3 Warnings you lose the job.
2 *> Without parallel conversations with players in Help, if the player starts offending, you simply mute it.
3 *> Be educated with the players in Help and especially in the Private, try to help as much as possible.
4 *> Always be on time, if you do not have a justification you will be removed from the staff.
5 *> Help is only allowed to ask questions related to tibia.
6 *> It is not allowed to divulge time up or to help in quest.
7 *> You are not allowed to sell items in the Help.
8 *> If the player encounters a bug, ask to go to the website to send a ticket and explain in detail.
9 *> Always keep the Tutors Chat open. (required).
10 *> You have finished your schedule, you have no tutor online, you communicate with some CM in-game
or ts and stay in the help until someone logs in, if you can.
11 *> Always keep a good Portuguese in the Help, we want tutors who support, not that they speak a satanic ritual.
12 *> If you see a tutor doing something that violates the rules, take a print and send it to your superiors. "
- Commands -
Mute Player: /mute nick, 90 (90 seconds)
Unmute Player: /unmute nick.
- Commands -]]
player:popupFYI(msg)
end

-- Open channels
if table.contains({TOWNS_LIST.DAWNPORT, TOWNS_LIST.DAWNPORT_TUTORIAL}, player:getTown():getId())then
player:eek:penChannel(3) -- World chat
else
player:eek:penChannel(3) -- World chat
player:eek:penChannel(5) -- Advertsing main
end

-- Rewards
local rewards = #player:getRewardList()
if(rewards > 0) then
player:sendTextMessage(MESSAGE_LOGIN, string.format("You have %d %s in your reward chest.",
rewards, rewards > 1 and "rewards" or "reward"))
end

-- Update player id
local stats = player:inBossFight()
if stats then
stats.playerId = player:getId()
end

if player:getStorageValue(Storage.combatProtectionStorage) < 1 then
player:setStorageValue(Storage.combatProtectionStorage, 1)
onMovementRemoveProtection(playerId, player:getPosition(), 10)
end
-- Set Client XP Gain Rate
local baseExp = 100
if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then
baseExp = getRateFromTable(experienceStages, player:getLevel(), configManager.getNumber(configKeys.RATE_EXP))
end

local staminaMinutes = player:getStamina()
local doubleExp = false --Can change to true if you have double exp on the server
local staminaBonus = (staminaMinutes > 2340) and 150 or ((staminaMinutes < 840) and 50 or 100)
if doubleExp then
baseExp = baseExp * 2
end
player:setStaminaXpBoost(staminaBonus)
player:setBaseXpGain(baseExp)

if player:getStorageValue(Storage.isTraining) == 1 then --Reset exercise weapon storage
player:setStorageValue(Storage.isTraining,0)
end
return
true
end
playerLogin:register()

THANK ALL
 
Top