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

AAC Kill Assistance

adrenyslopez

Member
Joined
Dec 22, 2015
Messages
129
Reaction score
10
Does anyone know where I configure the player's death on the page so that it appears for all the people who killed him, this is how it is on my page

DEADS.png

And this is how I want it to turn out

XD.png

i used gesior acc and otbr tfs 1.3
 
Solution
It was a feature in TFS 0.3 where it saved all killers.

In TFS 1.3 it saves only two, mostdamage player and lasthit player.

So it can't be changed so easily without changing the engine.

Correct me anyone if I'm wrong.

slaw

Developer
Joined
Aug 27, 2007
Messages
3,220
Solutions
93
Reaction score
691
Location
Germany
GitHub
slawkens
It was a feature in TFS 0.3 where it saved all killers.

In TFS 1.3 it saves only two, mostdamage player and lasthit player.

So it can't be changed so easily without changing the engine.

Correct me anyone if I'm wrong.
 
Solution
OP
A

adrenyslopez

Member
Joined
Dec 22, 2015
Messages
129
Reaction score
10
It was a feature in TFS 0.3 where it saved all killers.

In TFS 1.3 it saves only two, mostdamage player and lasthit player.

So it can't be changed so easily without changing the engine.

Correct me anyone if I'm wrong.
I already understand thank you very much for helping me
 

Kooda

Member
Joined
May 7, 2021
Messages
20
Solutions
4
Reaction score
12
Actually, using the function
Lua:
player:getDamageMap()
you can get all the players involved in the fight, with a table with total damage, ticks since last damage and (obviously) the damage dealer.

So with tfs 1.3 it is possible to show all the monsters/players involved.
 
OP
A

adrenyslopez

Member
Joined
Dec 22, 2015
Messages
129
Reaction score
10
Actually, using the function
Lua:
player:getDamageMap()
you can get all the players involved in the fight, with a table with total damage, ticks since last damage and (obviously) the damage dealer.

So with tfs 1.3 it is possible to show all the monsters/players involved.
How can I add that function?
 

Kooda

Member
Joined
May 7, 2021
Messages
20
Solutions
4
Reaction score
12
In scripts\creaturescripts\others\player_death.lua
Lua:
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) .. ')')
This code handles the death string player as you can see (db.escapeString(mostDamageName)), and the player:getDamageMap() is a function integrated already
 
OP
A

adrenyslopez

Member
Joined
Dec 22, 2015
Messages
129
Reaction score
10
In scripts\creaturescripts\others\player_death.lua
Lua:
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) .. ')')
This code handles the death string player as you can see (db.escapeString(mostDamageName)), and the player:getDamageMap() is a function integrated already
What do I have to modify in this line so that it appears like this?
 

Leesne

Advanced OT User
Joined
Dec 4, 2017
Messages
319
Solutions
33
Reaction score
164
Location
UK
GitHub
Leesneaks
Lua:
local dmap = player:getDamageMap()
local tArray = {}

for pid, _ in pairs(dmap) do
local aPlayer = Creature(pid)
    if (aPlayer) then
        if aPlayer:isPlayer() then
            table.insert(tArray, {aPlayer:getGuid()})
        end
    end
end
that will turn tArray into a table with all guid's of all the players.
I use json.encode to then encode it into a table that myAAC can then read.
My full codes different to this.
It gets player/creature damage, orders by most damage etc.
But you should get the idea of it from this.
 

Mjmackan

Mapper ~ Writer
Joined
Jul 18, 2009
Messages
1,115
Solutions
2
Reaction score
68
Location
Sweden
damageMap is a very buggy feature if you ask me, sometimes it count players that werent involved, sometimes it doesnt count ”anyone” beside the most dmg.
Its better by configuring a new dmgMap with storages but my guess would be that it might affect the optimization of the server having 300+ online.
 
Top