sdat/mapsets.txt
Code: Select all
54,55,56,57,58,59,60,61
175,176,177,178,179,180
67,68,69,70
230,231,232,233,234,235,236
63,64,65,66
182,183,184,185,186
136,137
120,121,122,123,124,125,126,127,128
198,199,200
260,261,262
Moderator: EUO Moderators
Code: Select all
54,55,56,57,58,59,60,61
175,176,177,178,179,180
67,68,69,70
230,231,232,233,234,235,236
63,64,65,66
182,183,184,185,186
136,137
120,121,122,123,124,125,126,127,128
198,199,200
260,261,262
Code: Select all
local prev_func = mob_hits
function mob_hits(id, target_id)
prev_func(id, target_id)
writelog2("GOT HIT")
end
local prev_func2 = mob_hits
function mob_hits(id, target_id)
prev_func2(id, target_id)
writelog2("GOT HIT 2")
end
local prev_func3 = mob_hits
function mob_hits(id, target_id)
prev_func3(id, target_id)
writelog2("GOT HIT 3")
end
Code: Select all
-- Table for mob_hits callback functions
mob_hits_callbacks = {}
function mob_hits(mob_id, target_id)
local m=get_monster_ptr(mob_id)
local tgt=get_sent_ptr(target_id)
if m==nil or tgt==nil then return end
-- Call associated functions
for func, v in pairs(mob_hits_callbacks) do
func(mob_id, target_id)
end
end
-- Associate a function to mob_hits (mob hitting you)
function addcallback_mob_hits(func)
if mob_hits_callbacks[func] == nil then
mob_hits_callbacks[func] = true
end
end
Code: Select all
function test1(id, tgt_id)
writelog2("This works.")
end
addcallback_mob_hits(test1)
Code: Select all
function test2(id, tgt_id)
writelog2("This also works.")
end
addcallback_mob_hits(test2)
Code: Select all
package.path = package.path .. ';scripts/?.lua'
package.path = package.path .. ';scripts.weekly/?.lua'