Mi is ez?
Egy új drop rendszer, amivel lua-ban lehet meghatározni hogy mi, mit dobjon, és egészen pontosan hanyas szintől, hanyas szintig dobja, hány százalékban, és hány darabot
Beüzemelés
/usr/home/game/share/locale/hungary/droplist.lua <--(hozd létre)
ezt ird bele:
dropList = {
-- vnum des mobs
[101] = {
typ = "drop", -- type
dropps = {
--{ID, MENYISÉG, ESÉLY},
{19, 1, 100},
{29, 1, 100},
}
},
[102] = {
typ = "limit", -- tipus
min_level = 18, -- minszint
max_level = 25, -- maxszint
dropps = {
{19, 1, 100},
{29, 1, 100},
}
},
}
Itt irhatod hozzá a továbbiakat.
Ha csak dropot szeretnél akkor:
typ = "drop"
igy nem kell szintet hozzáadnod.
ha szinthez szeretnéd kötni a dropot, akkor
typ = "limit"
és igy megkell adnod a szintet, amik között dobja:
min_level = 18, -- minszint
max_level = 25, -- maxszint
questlib.luadofile("/usr/home/game/share/locale/hungary/droplist.lua")
function drop(self)
if dropList[self].typ == "limit" then
if dropList[self].min_level == nil or dropList[self].max_level == nil then return end
if dropList[self].min_level > pc.level or dropList[self].max_level < pc.level then return end
local chance,count
table.foreach(dropList[self].dropps, function(i)
if dropList[self].dropps[i][3] ~= nil then
chance = dropList[self].dropps[i][3]
else
chance = 100
end
if dropList[self].dropps[i][2] ~= nil then
count = dropList[self].dropps[i][2]
else
count = 1
end
if math.random(1, 100) < chance then
game.drop_item_with_ownership(dropList[self].dropps[i][1], count)
end
end)
elseif dropList[self].typ == "drop" then
local chance,count
table.foreach(dropList[self].dropps, function(i)
if dropList[self].dropps[i][3] ~= nil then
chance = dropList[self].dropps[i][3]
else
chance = 100
end
if dropList[self].dropps[i][2] ~= nil then
count = dropList[self].dropps[i][2]
else
count = 1
end
if math.random(1, 100) < chance then
game.drop_item_with_ownership(dropList[self].dropps[i][1], count)
end
end)
else
return
end
end
Questfunctionsdrop
quest hozzá:
quest lua_drop begin
state start begin
when kill with not npc.is_pc() begin
drop(npc.get_race())
end
end
end
Ezen ne állits semmit csak így tedd be.
droplist.lua-ban tudsz hozzáadni dropot, vagy elvenni.