local function f(pos, b)
local j = getTileItemById(pos, b).uid
if j ~= 0 then
doAddContainerItem(j, 1234)
end
end
function onKill(cid, target, damage, flags)
if math.random(100) == 1 and (damage == true or flags == 3) and isMonster(target) then
local a = getCreatureMaster(target)
if not a or a == target then
local b = getMonsterInfo(getCreatureName(target))
if b and b.lookCorpse ~= 0 then
local c = getItemInfo(b.lookCorpse)
if c and c.type == ITEM_TYPE_CONTAINER then
addEvent(f, 0, getThingPos(target), b.lookCorpse)
end
end
end
end
return true
end
sorry mr. cykotitanuse os.date('%d')
Man create a mod file for activate only on saturday?
<event type="death" name="SaturdayLoot" event="script" value="SaturdayLoot.lua"/>
registerCreatureEvent(cid, "SaturdayLoot")
local function f(pos, b)
local j = getTileItemById(pos, b).uid
if j ~= 0 then
doAddContainerItem(j, 1234)
end
end
local function isSaturday
local Saturday = Saturday
end
function onKill(cid, target, damage, flags)
if isSaturday then
if math.random(100) == 1 and (damage == true or flags == 3) and isMonster(target) then
local a = getCreatureMaster(target)
if not a or a == target then
local b = getMonsterInfo(getCreatureName(target))
if b and b.lookCorpse ~= 0 then
local c = getItemInfo(b.lookCorpse)
if c and c.type == ITEM_TYPE_CONTAINER then
addEvent(f, 0, getThingPos(target), b.lookCorpse)
end
end
end
end
return true
end
end
local function f(pos, b)
local j = getTileItemById(pos, b).uid
if j ~= 0 then
doAddContainerItem(j, 1234)
end
end
local function isSaturday()
return os.date("%w") == 6 and true or false
end
function onKill(cid, target, damage, flags)
if isSaturday() then
if math.random(100) == 1 and (damage == true or flags == 3) and isMonster(target) then
local a = getCreatureMaster(target)
if not a or a == target then
local b = getMonsterInfo(getCreatureName(target))
if b and b.lookCorpse ~= 0 then
local c = getItemInfo(b.lookCorpse)
if c and c.type == ITEM_TYPE_CONTAINER then
addEvent(f, 0, getThingPos(target), b.lookCorpse)
end
end
end
end
end
return true
end
LUA:local function f(pos, b) local j = getTileItemById(pos, b).uid if j ~= 0 then doAddContainerItem(j, 1234) end end local function isSaturday() return os.date("%w") == 6 and true or false end function onKill(cid, target, damage, flags) if isSaturday() then if math.random(100) == 1 and (damage == true or flags == 3) and isMonster(target) then local a = getCreatureMaster(target) if not a or a == target then local b = getMonsterInfo(getCreatureName(target)) if b and b.lookCorpse ~= 0 then local c = getItemInfo(b.lookCorpse) if c and c.type == ITEM_TYPE_CONTAINER then addEvent(f, 0, getThingPos(target), b.lookCorpse) end end end end end return true end
and true or false isn't requiredLUA:local function isSaturday() return os.date("%w") == 6 and true or false end
local function f(pos, b)
local j = getTileItemById(pos, b).uid
if j ~= 0 then
doAddContainerItem(j, 1234)
end
end
local function isSaturday()
return os.date("%w") == 6
end
local HardMonter = {"dragon", "dragon lord", "grin rapper", "frost dragon"}
function onKill(cid, target, damage, flags)
if isSaturday() then
if math.random(100) == 1 and (damage == true or flags == 3) and isMonster(target) and getCreatureName(getCreatureTarget(cid)) == HardMonter then
local a = getCreatureMaster(target)
if not a or a == target then
local b = getMonsterInfo(getCreatureName(target))
if b and b.lookCorpse ~= 0 then
local c = getItemInfo(b.lookCorpse)
if c and c.type == ITEM_TYPE_CONTAINER then
addEvent(f, 0, getThingPos(target), b.lookCorpse)
end
end
end
end
end
return true
end
LUA:local function f(pos, b) local j = getTileItemById(pos, b).uid if j ~= 0 then doAddContainerItem(j, 1234) end end local function isSaturday() return os.date("%w") == 6 end function onKill(cid, target, damage, flags) local HardMonter = {'dragon', 'dragon lord', 'grin rapper', 'frost dragon'} if isSaturday() then if math.random(100) == 1 and (damage == true or flags == 3) and isMonster(target) then local a = getCreatureMaster(target) if not a or a == target then local b = getMonsterInfo(getCreatureName(target)) if b and b.lookCorpse ~= 0 then local c = getItemInfo(b.lookCorpse) if c and c.type == ITEM_TYPE_CONTAINER then addEvent(f, 0, getThingPos(target), b.lookCorpse) end end end end end return true end
add if monster is hard for life or other
or chose monsters {dragon, dragon lord, demon}
just check the maxhealth?LUA:local function f(pos, b) local j = getTileItemById(pos, b).uid if j ~= 0 then doAddContainerItem(j, 1234) end end local function isSaturday() return os.date("%w") == 6 end function onKill(cid, target, damage, flags) local HardMonter = {'dragon', 'dragon lord', 'grin rapper', 'frost dragon'} if isSaturday() then if math.random(100) == 1 and (damage == true or flags == 3) and isMonster(target) then local a = getCreatureMaster(target) if not a or a == target then local b = getMonsterInfo(getCreatureName(target)) if b and b.lookCorpse ~= 0 then local c = getItemInfo(b.lookCorpse) if c and c.type == ITEM_TYPE_CONTAINER then addEvent(f, 0, getThingPos(target), b.lookCorpse) end end end end end return true end
I need help so that only the monsters on the list have the chance to drop loot.
Or everyone will run to cave of rat because it is very easy to kill.
<event type="kill" name="SaturdayLoot" event="script" value="SaturdayLoot.lua"/>
registerCreatureEvent(cid, "SaturdayLoot")
local function f(pos, b)
local j = getTileItemById(pos, b).uid
if j ~= 0 then
doAddContainerItem(j, 1234)
end
end
local function isSaturday()
return os.date("%w") == 6
end
function onKill(cid, target, damage, flags)
if isSaturday() then
if math.random(100) == 1 and (damage == true or flags == 3) and isMonster(target) then
local a = getCreatureMaster(target)
if not a or a == target then
local b = getMonsterInfo(getCreatureName(target))
local e = getMonsterInfo(getCreatureMaxHealth(target))
if b and b.lookCorpse ~= 0 and e >= 1000 then
local c = getItemInfo(b.lookCorpse)
if c and c.type == ITEM_TYPE_CONTAINER then
addEvent(f, 0, getThingPos(target), b.lookCorpse)
end
end
end
end
end
return true
end