da ich die SUFU schon genutz habe aber trotzdem nichts richtiges gefunden habe frage ich hier mal. Ich benutze die Koridev files
Ich will die Segenschriftrolle als Alternativ drop droppen lassen. Nun habe ich es auf 2 wegen probiert.
Erster Weg:
mit der common_drop_item
PHP Code:
1 120 100 25040 40000
Zweiter Weg:
Eine Quest eingefügt.
Die Quest:
PHP Code:
quest alterdrop begin
state start begin
when kill with npc.get_level_dif() <= 15 begin
if not ALTERNATIVE_DROP then return end
for _,item in ipairs(ALTERNATIVE_DROP) do
if math.chance(item.chance) then
game.drop_item_with_ownership(item.vnum, item.count)
end
end
end
end
end
PHP Code:
function math.chance(i)
return math.random() <= (i/100)
end
local NPC_INFO = {}
local NPC_QUERY_RESULT = mysql_query("SELECT vnum, level FROM player.mob_proto;")
if type(NPC_QUERY_RESULT) == "table" then
for i,mob in ipairs(NPC_QUERY_RESULT) do
NPC_INFO[tonumber(mob[1])] = {level = tonumber(mob[2])}
end
end
function npc.get_level()
local npcvnum = npc.get_race()
local npcinfo = NPC_INFO[npcvnum]
if not npcinfo then
return nil
end
return npcinfo.level
end
function npc.get_level_dif()
local pclevel = pc.get_level()
local npclevel = npc.get_level()
if not pclevel or not npclevel then
return nil
end
return math.max(pclevel, npclevel) - math.min(pclevel, npclevel)
end
ALTERNATIVE_DROP = {
--neues item: {chance = CHANCE_IN_PROZENT, vnum = VNUM_DES_ITEM, count = ANZAHL_NUR_BEI_STAPELBAREN_ITEMS},
{chance = 100, vnum = 25040, count = 1},
Kann mir wer da helfen wieso es nicht geht?