Jump to content
Billy

Boss Respawn NPC

Recommended Posts

Usage: Just add an NPC with the BossRecordNpc as its function, and add the desired bosses to the BossRecord.Tracked table.

 

(before closing the server, use the &lua BossRecord.Clear() command to reset the times)

 

XFeUBFp.png

 

ReGNiMQ.png

 

uBdOosY.png

 

xrNlZLT.png

 

Script : http://pastebin.com/Vy19L2ky

  • Like 9

Share this post


Link to post
Share on other sites

Good work, @7n6! I will translate it and put to Russian section if you don't mind

  • Like 2

Share this post


Link to post
Share on other sites

exactly where this is going:

 

Quote

    MissionSdk.lua : ActionsProc :
    
        elseif actions.func == BossRecord.Reload then
            local ret = BossRecord.Reload(character)    

 

Share this post


Link to post
Share on other sites

@Billy Hello! I tried installing your extension but I got a problem. I put the ActionProc and added the lua to my extension folder, but whenever I start the gameserver, it just hangs loading the plugin. It loads all the others and then freezes on Boss Record NPC. Any ideas of what could be happening? 

Btw, great work! :)

Share this post


Link to post
Share on other sites
2 minutes ago, Faller said:

@Billy Hello! I tried installing your extension but I got a problem. I put the ActionProc and added the lua to my extension folder, but whenever I start the gameserver, it just hangs loading the plugin. It loads all the others and then freezes on Boss Record NPC. Any ideas of what could be happening? 

Btw, great work! :)

Did you make sure that the path to BossRecord.SavePath exists, but the file itself doesnt?

  • Like 1

Share this post


Link to post
Share on other sites
22 hours ago, Billy said:

Did you make sure that the path to BossRecord.SavePath exists, but the file itself doesnt?

@Billy

Oh wow, that was my problem lol

I didn't create the folder "logs" inside "Boss Timer".

Thanks so much for the fast answer ^^ 

Edited by Faller

Share this post


Link to post
Share on other sites
On 11/4/2016 at 3:29 PM, TheSamurai said:

Can you please update this @Billy ? It will be great if you can see the drops of the boss too :D Thank you

BossFolder = "script/extension/Boss Knowledge/BossLogs/"

print( "*	Loading Boss Knowledge" )

Characterinfo_path = "resource\\characterinfo.txt" -- scanned characterinfo path

-- ----------------
-- Table Index's
-- ----------------

MonsterKnowledge = {}
RespawnBoss = {}
BossToRecord = {}
MonstersToRecord = {}

-- ----------------
-- Bosses IDS
-- ----------------
MonstersToRecord[1] = 805
MonstersToRecord[2] = 789
MonstersToRecord[3] = 1302
MonstersToRecord[4] = 757
MonstersToRecord[5] = 1265
MonstersToRecord[6] = 1204
MonstersToRecord[7] = 1267
MonstersToRecord[8] = 1244




-- --------------------
-- Bosses Respawn Time
-- --------------------

-- MonsterID / Time in seconds

RespawnBoss[805] = 10800
RespawnBoss[789] = 86400
RespawnBoss[1302] = 604800
RespawnBoss[757] = 7200
RespawnBoss[1265] = 14400
RespawnBoss[1204] = 14400
RespawnBoss[1267] = 30000
RespawnBoss[1244] = 39600



-- ----------------------------
-- Record tables for monsters
-- ----------------------------
for i,v in pairs (MonstersToRecord) do
	BossToRecord[v] = true
end
function file_exists(name)
	   local f=io.open(name,"r")
	   if f~=nil then io.close(f ) return true else return false end
end


-- -------------------------
-- NPC SDK
-- -----------------
  --      elseif item.func == CheckMonsterSat then
    --        return CheckMonsterSat( character,item.p1)
-- ---------------------------
-- CUSTOM SPLIT FUNCTION
-- ---------------------------
function split(str, delim, maxNb)
		-- Eliminate bad cases...
		if string.find(str, delim) == nil then
			return { str }
		end
		if maxNb == nil or maxNb < 1 then
			maxNb = 0    -- No limit
		end
		local result = {}
		local pat = "(.-)" .. delim .. "()"
		local nb = 0
		local lastPos
		for part, pos in string.gfind(str, pat) do
			nb = nb + 1
			result[nb] = part
			lastPos = pos
			if nb == maxNb then break end
		end
		-- Handle the last field
		if nb ~= maxNb then
			result[nb + 1] = string.sub(str, lastPos)
		end
		return result
end

-- ---------------------------
-- SCAN CHARACTERINFO
-- ---------------------------
function ScanMonsterKnowledge(file)
	  local fp = assert(io.open (file))
	  for line in fp:lines() do
		local position = string.find(line, "[ \t]*//")
		if (position ~= 1) then
			local data = split(line,"\t")
			local c1 = tonumber(data[1])
			if c1 ~= nil then
				MonsterKnowledge[c1] = {Name = {tostring(data[2])},Skills = {data[45]},Drops = {data[47]},Lv = data[61],MaxHP=data[62],MaxSP=data[64],MinAtk=data[66],MaxAtk=data[67],Pr=data[68],Def=data[69],Hr=data[70],Dodge=data[71],Exp=data[91] }
			end
		end
	end
end

-- ----------------------------
-- Run characterinfo.txt scan
-- ----------------------------
ScanMonsterKnowledge(Characterinfo_path)

-- ---------------------------
-- CHECK STATUS
-- ---------------------------
function CheckBossRespawn(id)
	if file_exists(GetResPath(BossFolder..""..id..".txt")) == false then
		table.save({LastKilled = 0 , RecordRespawn = 0 },GetResPath(BossFolder..""..id..".txt"),"a")
	end
	local Boss = table.load(GetResPath(BossFolder..""..id..".txt"),"r")
	if Boss.RecordRespawn ~= 0 then
		local RemainingTime = Boss.RecordRespawn - os.time()
		if RemainingTime <= 1 then
			Boss.LastKilled = 0
			Boss.RecordRespawn = 0
			table.save(Boss,GetResPath(BossFolder..""..id..".txt"),"w")
		end
		local notice = "Dead"
		local notice1 = "Remaining Respawn time: "..GetTime(RemainingTime).."!"
			return notice,notice1
	end
	if Boss.RecordRespawn == 0 then
		local noticey = "Alive"
		local noticex = "Boss: "..MonsterKnowledge[id].Name[1].." is still alive!"
			return noticey,noticex
	end
end

-- ---------------------------
-- CHECK LAST KILLER
-- ---------------------------

function LastKillBossName(id)
	if file_exists(GetResPath(BossFolder..""..id..".txt")) == false then
		table.save({LastKilled = 0 , RecordRespawn = 0 },GetResPath(BossFolder..""..id..".txt"),"a")
	end
	local Boss = table.load(GetResPath(BossFolder..""..id..".txt"),"r")
	if Boss.LastKilled == 0 then
		killer = "Nobody"
	else
		killer = Boss.LastKilled
	end
	return killer
end		

-- ----------------------------
-- NPC Function
-- ----------------------------

function bossknowl()
Talk(1,"Graves: Hello, I can show you some information about bosses! Pick a boss already and check the information about it.")
	for i,v in pairs(MonstersToRecord) do
		Text(1,""..MonsterKnowledge[v].Name[1].."",CheckMonsterSat,v)
	end
end

-- ---------------------------
-- LOADING STATS
-- ---------------------------
function CheckMonsterSat(cha,id)
local MonsterName = MonsterKnowledge[id].Name[1]
local Lv = MonsterKnowledge[id].Lv
local Hp = MonsterKnowledge[id].MaxHP
local Sp = MonsterKnowledge[id].MaxSP
local mAtk = MonsterKnowledge[id].MinAtk
local mxAtk = MonsterKnowledge[id].MaxAtk
local Pr = MonsterKnowledge[id].Pr
local Def = MonsterKnowledge[id].Def
local Hr = MonsterKnowledge[id].Hr
local Dodge = MonsterKnowledge[id].Dodge
local Exp = MonsterKnowledge[id].Exp
local Drops = MonsterKnowledge[id].Drops
	for i,v in pairs(Drops)do
		
	end
local Stat,Notice = CheckBossRespawn(id)
local LastKill = LastKillBossName(id)
	HelpInfo(cha,0,"Boss:  "..MonsterName.." Information_ Lv:"..Lv.."  Hp: "..Hp.."   Sp: "..Sp.."_ Min Attack: "..mAtk.."   Max Attack: "..mxAtk.."_ Physical Resistance: "..Pr.."   Defense: "..Def.."_ Hit Rate: "..Hr.."   Dodge: "..Dodge.."   Exp: "..Exp.."_ Status: "..Stat.."   Last Killer: "..LastKill.." _ "..Notice.."")-- _ Drops : "..Dropsx.."")
end

-- ---------------------------
-- GET TIME IN SECOND
-- ---------------------------

function GetTime(Seconds)
if tonumber(Seconds) == 0 then
	return "00:00:00";
else
	Hours = string.format("%02.f", math.floor(tonumber(Seconds)/3600));
	Mins = string.format("%02.f", math.floor(tonumber(Seconds)/60 - (Hours*60)));
	Secs = string.format("%02.f", math.floor(tonumber(Seconds) - Hours*3600 - Mins *60));
		return Hours..":"..Mins..":"..Secs
	end
end
-- ---------------------------
-- PLAYER KILL BOSS HOOK
-- ---------------------------
function RecordKilledBosses(z,dead,atk)
local GetKillerName = GetChaDefaultName(atk)
local GetBossName = GetChaDefaultName(dead)
local GetBossID = GetChaID(dead)
local DisplayCurrentTime = ""..os.date("%H")..":"..os.date("%M")..":"..os.date("%S")..""
	if BossToRecord[GetBossID] == true then
		local Boss = table.load(GetResPath(BossFolder..""..GetBossID..".txt"),"r")
		Boss.RecordRespawn = os.time() + RespawnBoss[GetBossID]
		Boss.LastKilled = GetKillerName
		table.save(Boss,GetResPath(BossFolder..""..GetBossID..".txt"),"w")
		Notice("<BOSS>: "..GetBossName.." has been defeated by ["..GetKillerName.."] at ["..DisplayCurrentTime.."]!")
	end
end	
Hook:AddPostHook("GetExp_PKM",RecordKilledBosses)

This one has HP ,SP , DROPS etc.. about bosses
Add this script into a .lua file and create a folder " Boss Knowledge " like this: script/extension/Boss Knowledge/
Dont forget to make a folder name " Boss Logs " like this: script/extension/Boss Knowledge/BossLogs/

Edited by Rinor

Share this post


Link to post
Share on other sites
1 hour ago, Rinor said:

BossFolder = "script/extension/Boss Knowledge/BossLogs/"

print( "*	Loading Boss Knowledge" )

Characterinfo_path = "resource\\characterinfo.txt" -- scanned characterinfo path

-- ----------------
-- Table Index's
-- ----------------

MonsterKnowledge = {}
RespawnBoss = {}
BossToRecord = {}
MonstersToRecord = {}

-- ----------------
-- Bosses IDS
-- ----------------
MonstersToRecord[1] = 805
MonstersToRecord[2] = 789
MonstersToRecord[3] = 1302
MonstersToRecord[4] = 757
MonstersToRecord[5] = 1265
MonstersToRecord[6] = 1204
MonstersToRecord[7] = 1267
MonstersToRecord[8] = 1244




-- --------------------
-- Bosses Respawn Time
-- --------------------

-- MonsterID / Time in seconds

RespawnBoss[805] = 10800
RespawnBoss[789] = 86400
RespawnBoss[1302] = 604800
RespawnBoss[757] = 7200
RespawnBoss[1265] = 14400
RespawnBoss[1204] = 14400
RespawnBoss[1267] = 30000
RespawnBoss[1244] = 39600



-- ----------------------------
-- Record tables for monsters
-- ----------------------------
for i,v in pairs (MonstersToRecord) do
	BossToRecord[v] = true
end
function file_exists(name)
	   local f=io.open(name,"r")
	   if f~=nil then io.close(f ) return true else return false end
end


-- -------------------------
-- NPC SDK
-- -----------------
  --      elseif item.func == CheckMonsterSat then
    --        return CheckMonsterSat( character,item.p1)
-- ---------------------------
-- CUSTOM SPLIT FUNCTION
-- ---------------------------
function split(str, delim, maxNb)
		-- Eliminate bad cases...
		if string.find(str, delim) == nil then
			return { str }
		end
		if maxNb == nil or maxNb < 1 then
			maxNb = 0    -- No limit
		end
		local result = {}
		local pat = "(.-)" .. delim .. "()"
		local nb = 0
		local lastPos
		for part, pos in string.gfind(str, pat) do
			nb = nb + 1
			result[nb] = part
			lastPos = pos
			if nb == maxNb then break end
		end
		-- Handle the last field
		if nb ~= maxNb then
			result[nb + 1] = string.sub(str, lastPos)
		end
		return result
end

-- ---------------------------
-- SCAN CHARACTERINFO
-- ---------------------------
function ScanMonsterKnowledge(file)
	  local fp = assert(io.open (file))
	  for line in fp:lines() do
		local position = string.find(line, "[ \t]*//")
		if (position ~= 1) then
			local data = split(line,"\t")
			local c1 = tonumber(data[1])
			if c1 ~= nil then
				MonsterKnowledge[c1] = {Name = {tostring(data[2])},Skills = {data[45]},Drops = {data[47]},Lv = data[61],MaxHP=data[62],MaxSP=data[64],MinAtk=data[66],MaxAtk=data[67],Pr=data[68],Def=data[69],Hr=data[70],Dodge=data[71],Exp=data[91] }
			end
		end
	end
end

-- ----------------------------
-- Run characterinfo.txt scan
-- ----------------------------
ScanMonsterKnowledge(Characterinfo_path)

-- ---------------------------
-- CHECK STATUS
-- ---------------------------
function CheckBossRespawn(id)
	if file_exists(GetResPath(BossFolder..""..id..".txt")) == false then
		table.save({LastKilled = 0 , RecordRespawn = 0 },GetResPath(BossFolder..""..id..".txt"),"a")
	end
	local Boss = table.load(GetResPath(BossFolder..""..id..".txt"),"r")
	if Boss.RecordRespawn ~= 0 then
		local RemainingTime = Boss.RecordRespawn - os.time()
		if RemainingTime <= 1 then
			Boss.LastKilled = 0
			Boss.RecordRespawn = 0
			table.save(Boss,GetResPath(BossFolder..""..id..".txt"),"w")
		end
		local notice = "Dead"
		local notice1 = "Remaining Respawn time: "..GetTime(RemainingTime).."!"
			return notice,notice1
	end
	if Boss.RecordRespawn == 0 then
		local noticey = "Alive"
		local noticex = "Boss: "..MonsterKnowledge[id].Name[1].." is still alive!"
			return noticey,noticex
	end
end

-- ---------------------------
-- CHECK LAST KILLER
-- ---------------------------

function LastKillBossName(id)
	if file_exists(GetResPath(BossFolder..""..id..".txt")) == false then
		table.save({LastKilled = 0 , RecordRespawn = 0 },GetResPath(BossFolder..""..id..".txt"),"a")
	end
	local Boss = table.load(GetResPath(BossFolder..""..id..".txt"),"r")
	if Boss.LastKilled == 0 then
		killer = "Nobody"
	else
		killer = Boss.LastKilled
	end
	return killer
end		

-- ----------------------------
-- NPC Function
-- ----------------------------

function bossknowl()
Talk(1,"Graves: Hello, I can show you some information about bosses! Pick a boss already and check the information about it.")
	for i,v in pairs(MonstersToRecord) do
		Text(1,""..MonsterKnowledge[v].Name[1].."",CheckMonsterSat,v)
	end
end

-- ---------------------------
-- LOADING STATS
-- ---------------------------
function CheckMonsterSat(cha,id)
local MonsterName = MonsterKnowledge[id].Name[1]
local Lv = MonsterKnowledge[id].Lv
local Hp = MonsterKnowledge[id].MaxHP
local Sp = MonsterKnowledge[id].MaxSP
local mAtk = MonsterKnowledge[id].MinAtk
local mxAtk = MonsterKnowledge[id].MaxAtk
local Pr = MonsterKnowledge[id].Pr
local Def = MonsterKnowledge[id].Def
local Hr = MonsterKnowledge[id].Hr
local Dodge = MonsterKnowledge[id].Dodge
local Exp = MonsterKnowledge[id].Exp
local Drops = MonsterKnowledge[id].Drops
	for i,v in pairs(Drops)do
		
	end
local Stat,Notice = CheckBossRespawn(id)
local LastKill = LastKillBossName(id)
	HelpInfo(cha,0,"Boss:  "..MonsterName.." Information_ Lv:"..Lv.."  Hp: "..Hp.."   Sp: "..Sp.."_ Min Attack: "..mAtk.."   Max Attack: "..mxAtk.."_ Physical Resistance: "..Pr.."   Defense: "..Def.."_ Hit Rate: "..Hr.."   Dodge: "..Dodge.."   Exp: "..Exp.."_ Status: "..Stat.."   Last Killer: "..LastKill.." _ "..Notice.."")-- _ Drops : "..Dropsx.."")
end

-- ---------------------------
-- GET TIME IN SECOND
-- ---------------------------

function GetTime(Seconds)
if tonumber(Seconds) == 0 then
	return "00:00:00";
else
	Hours = string.format("%02.f", math.floor(tonumber(Seconds)/3600));
	Mins = string.format("%02.f", math.floor(tonumber(Seconds)/60 - (Hours*60)));
	Secs = string.format("%02.f", math.floor(tonumber(Seconds) - Hours*3600 - Mins *60));
		return Hours..":"..Mins..":"..Secs
	end
end
-- ---------------------------
-- PLAYER KILL BOSS HOOK
-- ---------------------------
function RecordKilledBosses(z,dead,atk)
local GetKillerName = GetChaDefaultName(atk)
local GetBossName = GetChaDefaultName(dead)
local GetBossID = GetChaID(dead)
local DisplayCurrentTime = ""..os.date("%H")..":"..os.date("%M")..":"..os.date("%S")..""
	if BossToRecord[GetBossID] == true then
		local Boss = table.load(GetResPath(BossFolder..""..GetBossID..".txt"),"r")
		Boss.RecordRespawn = os.time() + RespawnBoss[GetBossID]
		Boss.LastKilled = GetKillerName
		table.save(Boss,GetResPath(BossFolder..""..GetBossID..".txt"),"w")
		Notice("<BOSS>: "..GetBossName.." has been defeated by ["..GetKillerName.."] at ["..DisplayCurrentTime.."]!")
	end
end	
Hook:AddPostHook("GetExp_PKM",RecordKilledBosses)

This one has HP ,SP , DROPS etc.. about bosses
Add this script into a .lua file and create a folder " Boss Knowledge " like this: script/extension/Boss Knowledge/
Dont forget to make a folder name " Boss Logs " like this: script/extension/Boss Knowledge/BossLogs/

Did Saeed give you authorization to share his work? I guess it was been for sale.Atleast give him credit.

Share this post


Link to post
Share on other sites
11 minutes ago, Vasil said:

Did Saeed give you authorization to share his work? I guess it was been for sale.Atleast give him credit.

Well this has been shared in many server files which is at archive, such rainbow files soo

Share this post


Link to post
Share on other sites
8 hours ago, Rinor said:

BossFolder = "script/extension/Boss Knowledge/BossLogs/"

print( "*	Loading Boss Knowledge" )

Characterinfo_path = "resource\\characterinfo.txt" -- scanned characterinfo path

-- ----------------
-- Table Index's
-- ----------------

MonsterKnowledge = {}
RespawnBoss = {}
BossToRecord = {}
MonstersToRecord = {}

-- ----------------
-- Bosses IDS
-- ----------------
MonstersToRecord[1] = 805
MonstersToRecord[2] = 789
MonstersToRecord[3] = 1302
MonstersToRecord[4] = 757
MonstersToRecord[5] = 1265
MonstersToRecord[6] = 1204
MonstersToRecord[7] = 1267
MonstersToRecord[8] = 1244




-- --------------------
-- Bosses Respawn Time
-- --------------------

-- MonsterID / Time in seconds

RespawnBoss[805] = 10800
RespawnBoss[789] = 86400
RespawnBoss[1302] = 604800
RespawnBoss[757] = 7200
RespawnBoss[1265] = 14400
RespawnBoss[1204] = 14400
RespawnBoss[1267] = 30000
RespawnBoss[1244] = 39600



-- ----------------------------
-- Record tables for monsters
-- ----------------------------
for i,v in pairs (MonstersToRecord) do
	BossToRecord[v] = true
end
function file_exists(name)
	   local f=io.open(name,"r")
	   if f~=nil then io.close(f ) return true else return false end
end


-- -------------------------
-- NPC SDK
-- -----------------
  --      elseif item.func == CheckMonsterSat then
    --        return CheckMonsterSat( character,item.p1)
-- ---------------------------
-- CUSTOM SPLIT FUNCTION
-- ---------------------------
function split(str, delim, maxNb)
		-- Eliminate bad cases...
		if string.find(str, delim) == nil then
			return { str }
		end
		if maxNb == nil or maxNb < 1 then
			maxNb = 0    -- No limit
		end
		local result = {}
		local pat = "(.-)" .. delim .. "()"
		local nb = 0
		local lastPos
		for part, pos in string.gfind(str, pat) do
			nb = nb + 1
			result[nb] = part
			lastPos = pos
			if nb == maxNb then break end
		end
		-- Handle the last field
		if nb ~= maxNb then
			result[nb + 1] = string.sub(str, lastPos)
		end
		return result
end

-- ---------------------------
-- SCAN CHARACTERINFO
-- ---------------------------
function ScanMonsterKnowledge(file)
	  local fp = assert(io.open (file))
	  for line in fp:lines() do
		local position = string.find(line, "[ \t]*//")
		if (position ~= 1) then
			local data = split(line,"\t")
			local c1 = tonumber(data[1])
			if c1 ~= nil then
				MonsterKnowledge[c1] = {Name = {tostring(data[2])},Skills = {data[45]},Drops = {data[47]},Lv = data[61],MaxHP=data[62],MaxSP=data[64],MinAtk=data[66],MaxAtk=data[67],Pr=data[68],Def=data[69],Hr=data[70],Dodge=data[71],Exp=data[91] }
			end
		end
	end
end

-- ----------------------------
-- Run characterinfo.txt scan
-- ----------------------------
ScanMonsterKnowledge(Characterinfo_path)

-- ---------------------------
-- CHECK STATUS
-- ---------------------------
function CheckBossRespawn(id)
	if file_exists(GetResPath(BossFolder..""..id..".txt")) == false then
		table.save({LastKilled = 0 , RecordRespawn = 0 },GetResPath(BossFolder..""..id..".txt"),"a")
	end
	local Boss = table.load(GetResPath(BossFolder..""..id..".txt"),"r")
	if Boss.RecordRespawn ~= 0 then
		local RemainingTime = Boss.RecordRespawn - os.time()
		if RemainingTime <= 1 then
			Boss.LastKilled = 0
			Boss.RecordRespawn = 0
			table.save(Boss,GetResPath(BossFolder..""..id..".txt"),"w")
		end
		local notice = "Dead"
		local notice1 = "Remaining Respawn time: "..GetTime(RemainingTime).."!"
			return notice,notice1
	end
	if Boss.RecordRespawn == 0 then
		local noticey = "Alive"
		local noticex = "Boss: "..MonsterKnowledge[id].Name[1].." is still alive!"
			return noticey,noticex
	end
end

-- ---------------------------
-- CHECK LAST KILLER
-- ---------------------------

function LastKillBossName(id)
	if file_exists(GetResPath(BossFolder..""..id..".txt")) == false then
		table.save({LastKilled = 0 , RecordRespawn = 0 },GetResPath(BossFolder..""..id..".txt"),"a")
	end
	local Boss = table.load(GetResPath(BossFolder..""..id..".txt"),"r")
	if Boss.LastKilled == 0 then
		killer = "Nobody"
	else
		killer = Boss.LastKilled
	end
	return killer
end		

-- ----------------------------
-- NPC Function
-- ----------------------------

function bossknowl()
Talk(1,"Graves: Hello, I can show you some information about bosses! Pick a boss already and check the information about it.")
	for i,v in pairs(MonstersToRecord) do
		Text(1,""..MonsterKnowledge[v].Name[1].."",CheckMonsterSat,v)
	end
end

-- ---------------------------
-- LOADING STATS
-- ---------------------------
function CheckMonsterSat(cha,id)
local MonsterName = MonsterKnowledge[id].Name[1]
local Lv = MonsterKnowledge[id].Lv
local Hp = MonsterKnowledge[id].MaxHP
local Sp = MonsterKnowledge[id].MaxSP
local mAtk = MonsterKnowledge[id].MinAtk
local mxAtk = MonsterKnowledge[id].MaxAtk
local Pr = MonsterKnowledge[id].Pr
local Def = MonsterKnowledge[id].Def
local Hr = MonsterKnowledge[id].Hr
local Dodge = MonsterKnowledge[id].Dodge
local Exp = MonsterKnowledge[id].Exp
local Drops = MonsterKnowledge[id].Drops
	for i,v in pairs(Drops)do
		
	end
local Stat,Notice = CheckBossRespawn(id)
local LastKill = LastKillBossName(id)
	HelpInfo(cha,0,"Boss:  "..MonsterName.." Information_ Lv:"..Lv.."  Hp: "..Hp.."   Sp: "..Sp.."_ Min Attack: "..mAtk.."   Max Attack: "..mxAtk.."_ Physical Resistance: "..Pr.."   Defense: "..Def.."_ Hit Rate: "..Hr.."   Dodge: "..Dodge.."   Exp: "..Exp.."_ Status: "..Stat.."   Last Killer: "..LastKill.." _ "..Notice.."")-- _ Drops : "..Dropsx.."")
end

-- ---------------------------
-- GET TIME IN SECOND
-- ---------------------------

function GetTime(Seconds)
if tonumber(Seconds) == 0 then
	return "00:00:00";
else
	Hours = string.format("%02.f", math.floor(tonumber(Seconds)/3600));
	Mins = string.format("%02.f", math.floor(tonumber(Seconds)/60 - (Hours*60)));
	Secs = string.format("%02.f", math.floor(tonumber(Seconds) - Hours*3600 - Mins *60));
		return Hours..":"..Mins..":"..Secs
	end
end
-- ---------------------------
-- PLAYER KILL BOSS HOOK
-- ---------------------------
function RecordKilledBosses(z,dead,atk)
local GetKillerName = GetChaDefaultName(atk)
local GetBossName = GetChaDefaultName(dead)
local GetBossID = GetChaID(dead)
local DisplayCurrentTime = ""..os.date("%H")..":"..os.date("%M")..":"..os.date("%S")..""
	if BossToRecord[GetBossID] == true then
		local Boss = table.load(GetResPath(BossFolder..""..GetBossID..".txt"),"r")
		Boss.RecordRespawn = os.time() + RespawnBoss[GetBossID]
		Boss.LastKilled = GetKillerName
		table.save(Boss,GetResPath(BossFolder..""..GetBossID..".txt"),"w")
		Notice("<BOSS>: "..GetBossName.." has been defeated by ["..GetKillerName.."] at ["..DisplayCurrentTime.."]!")
	end
end	
Hook:AddPostHook("GetExp_PKM",RecordKilledBosses)

This one has HP ,SP , DROPS etc.. about bosses
Add this script into a .lua file and create a folder " Boss Knowledge " like this: script/extension/Boss Knowledge/
Dont forget to make a folder name " Boss Logs " like this: script/extension/Boss Knowledge/BossLogs/

Drop doesn't work. I already configure it properly along with the comment on the drop function. When i try to use the NPC and see the monster information system says this: npc[Boss Knowledge]script info manage function [NpcProc] transfer failed!  maybe there are missing scripts? I hope someone can do this :D

Share this post


Link to post
Share on other sites

woah, similar to a script i made <3

edit: noticed that my script was there lmao, i already have integrated the drop thingy idk why u guys dont have it.

Edited by Saeed

Share this post


Link to post
Share on other sites
12 hours ago, TheSamurai said:

Drop doesn't work. I already configure it properly along with the comment on the drop function. When i try to use the NPC and see the monster information system says this: npc[Boss Knowledge]script info manage function [NpcProc] transfer failed!  maybe there are missing scripts? I hope someone can do this :D

add this at npcsdk.lua:

   elseif item.func == CheckMonsterSat then
      return CheckMonsterSat( character,item.p1)

 

Share this post


Link to post
Share on other sites
2 hours ago, Danny said:

 

Ur probably missing Hook.lua file 

this is the line: Hook:AddPreHook("GetExp_PKM",BossRecord.CheckDead)
I have the GetExp_PKM already loaded.

Share this post


Link to post
Share on other sites
15 minutes ago, HILO said:

this is the line: Hook:AddPreHook("GetExp_PKM",BossRecord.CheckDead)
I have the GetExp_PKM already loaded.

 

what? Its saying Hook is not existent , you probably didn't load the Hook.lua file.

Share this post


Link to post
Share on other sites
Quote

what? Its saying Hook is not existent , you probably didn't load the Hook.lua file.

damn, that's why I asked which hook is needed first? and where may I get it In case I don't have?

Share this post


Link to post
Share on other sites
6 minutes ago, HILO said:

damn, that's why I asked which hook is needed first? and where may I get it In case I don't have?

 

https://ufile.io/28414

 

then you can load it with:

 

dofile(GetResPath("script/extension/hook.lua"))
 

or any path of your choice.

 

EDIT: ufile.io seems to rename the script. please rename it back to Hook.lua!

Edited by Shako

logo-big.png   logo.png

                                   Sunny Go! Online                                                                    pko.host                                                 

Share this post


Link to post
Share on other sites
5 hours ago, Rinor said:

add this at npcsdk.lua:


   elseif item.func == CheckMonsterSat then
      return CheckMonsterSat( character,item.p1)

 

Already add this bro :( btw did you already tried this? Does the drop status work to you?

Share this post


Link to post
Share on other sites
18 hours ago, TheSamurai said:

Already add this bro :( btw did you already tried this? Does the drop status work to you?

yeah it works fine.

Share this post


Link to post
Share on other sites
11 hours ago, crusadel said:

Hello Guys Please Help me i have problems i dont know how to fix it!

 

 

Bez názvu555.png

 

You're loading some scripts wrong, typed something wrong or forgot to properly close a function. Whatever that "getn" is trying to get was not I guess properly.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...