Alternativdrop Koridev

12/11/2016 23:41 Oreoo.#1
Hallo,

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 
Geht nicht.

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.chancethen
                    game
.drop_item_with_ownership(item.vnumitem.count)
                
end
            end
        end
    end
end 
Questlib.lua:

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(pclevelnpclevel) - math.min(pclevelnpclevel)
end
 
ALTERNATIVE_DROP 
= {
    --
neues item: {chance CHANCE_IN_PROZENTvnum VNUM_DES_ITEMcount ANZAHL_NUR_BEI_STAPELBAREN_ITEMS},
    {
chance 100vnum 25040count 1}, 

Kann mir wer da helfen wieso es nicht geht?
12/12/2016 13:41 Chritation#2
PHP Code:
PAWN                        S_PAWN                        KNIGHT                        S_KNIGHT                    
Socke    1    39    2    50010    1    Socke    1    39    2    50010    1    Socke    1    39    2    50010    1    Socke    1    39    2    50010    1
Schoko    40    64    2    50025    1    Schoko    40    64    2    50025    1    Schoko    40    64    2    50025    1    Schoko    40    64    2    50025    1
Rose    65    89    1    50024    1    Rose    65    89    1    50024    1    Rose    65    89    1    50024    1    Rose    65    89    1    50024    1 
Das ist meine common_drop_item.txt

In dem Format solltest du es beibehalten.