Como funcionaria esse SCRIPT? pois EXTRA LOOT é meio inutil tendo como ADICIONAR mais loots no XML dos monstros !
Ou ficaria UTIL se coloca-se apenas para VIP ganhar esse EXTRA LOOT !
Como funcionaria esse SCRIPT? pois EXTRA LOOT é meio inutil tendo como ADICIONAR mais loots no XML dos monstros !
Ou ficaria UTIL se coloca-se apenas para VIP ganhar esse EXTRA LOOT !
info
Grupo: Marquês
Registrado: 25/09/10
Posts: 1.3k
Reputação: +446
Gênero: Masculino

Como funcionaria esse SCRIPT? pois EXTRA LOOT é meio inutil tendo como ADICIONAR mais loots no XML dos monstros ! Ou ficaria UTIL se coloca-se apenas para VIP ganhar esse EXTRA LOOT !
Você pode usar do jeito que quiser...
pode fazer evento de double loot, premium ganha mais loot, potion para ganhar mais loot...
E também pode usar para não ter que entrar no XML de cada monstro e alterar cada loot, ao invés de mudar loot de 200 monstros, você muda 1 script...
info
Grupo: Conde
Registrado: 07/04/15
Posts: 962
Reputação: +258
Gênero: Masculino
events.xml
creature.lua event
em baixo de :
adicionar :
if not self then return true end if self:isPlayer() and target:isMonster() then target:registerEvent("extra_loot_d") endcreaturescripts.xml
extra_loot.lua creaturescript
local extra_loot = { {hasName = "dragon", items = { {id = 2152, count = 2, chance = 40000}, -- 40% {id = 2160, countMax = 4, chance = 10000} }}, {items = { {id = 2365, chance = 10000}, {id = 2392, chance = 1000} }}, } function Container:addExtraLoot(c, t) if t.hasName then local cn = c:getName():lower() local cm = t.hasName:lower() if not cn:match(cm) then return true end end for i = 1, #t.items do local count = 1 if t.items[i].count then if t.items[i].countMax then count = math.random(t.items[i].count, t.items[i].countMax) else count = t.items[i].count end else if t.items[i].countMax then count = math.random(1, t.items[i].countMax) end end if math.random(0, 100000) <= t.items[i].chance then self:addItem(t.items[i].id, count) end end end function onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified) if not creature:isMonster() then return true end if corpse and corpse:isContainer() then for i = 1, #extra_loot do corpse:addExtraLoot(creature, extra_loot[i]) end end return true endCréditos : zbizu