Mjmackan
Mapper ~ Writer
Hey!
I'm fooling around with otclient and tried make a simple, basic talent tree but i cant get the serverside to answer, it feels like im missing something in sources or such. Is there any tutorial out there or specific source code addon i need for this to work?
And yes I have updated my server with .json file, but it seems that my server wont answer to networkMessages, if thats all i have no clue.
Using tfs 1.4.2

I'm fooling around with otclient and tried make a simple, basic talent tree but i cant get the serverside to answer, it feels like im missing something in sources or such. Is there any tutorial out there or specific source code addon i need for this to work?
And yes I have updated my server with .json file, but it seems that my server wont answer to networkMessages, if thats all i have no clue.
Using tfs 1.4.2
LUA:
local OPCODE = 105
print("[Talents System] Aggressive Registration Version Loaded")
local function sendRefresh(player)
local msg = NetworkMessage()
msg:addByte(OPCODE)
msg:addString(json.encode({
action = "refresh",
data = {
points = 75,
tokens = 15,
talentInfo = {
{name = "Life Boost", icon = "/images/game/talents/life", desc = "Increases maximum health", value = "30/100"},
{name = "Mana Boost", icon = "/images/game/talents/mana", desc = "Increases maximum mana", value = "20/100"},
{name = "Damage Boost", icon = "/images/game/talents/damage", desc = "Increases damage", value = "15/50"},
{name = "Speed Boost", icon = "/images/game/talents/speed", desc = "Increases speed", value = "25/40"}
}
}
}))
player:send(msg)
end
-- Try every possible way to register
local function registerOpcode()
-- Method 1
if type(Player) == "table" then
Player.onExtendedOpcode = function(player, opcode, buffer)
if opcode == OPCODE then
print("[Talents] Received via Player.onExtendedOpcode")
sendRefresh(player)
end
end
end
-- Method 2
_G.onExtendedOpcode = function(player, opcode, buffer)
if opcode == OPCODE then
print("[Talents] Received via _G.onExtendedOpcode")
sendRefresh(player)
end
end
print("[Talents System] All registration methods attempted")
end
registerOpcode()

Last edited: