[25/2/2014 15:4:3] [Warning - Monster::Monster] Unknown event name - Azerus
[25/2/2014 15:10:3] [Warning - Monster::Monster] Unknown event name - Azerus
[25/2/2014 15:17:13] [Warning - Monster::Monster] Unknown event name - Azerus
[25/2/2014 15:17:13] [Error - Action Interface]
[25/2/2014 15:17:13] In a timer event called from:
[25/2/2014 15:17:14] data/actions/scripts/quests/azerus.lua:onUse
[25/2/2014 15:17:14] Description:
[25/2/2014 15:17:14] (LuaInterface::luaDoCreateMonster) Cannot create monster: War Golem
[25/2/2014 15:17:14] [Warning - Npc::createNpc] Cannot find npc with name: War Golem.
[25/2/2014 15:17:15] [Error - Action Interface]
[25/2/2014 15:17:15] In a timer event called from:
[25/2/2014 15:17:15] data/actions/scripts/quests/azerus.lua:onUse
[25/2/2014 15:17:15] Description:
[25/2/2014 15:17:15] (LuaInterface::luaDoCreateNpc) Npc with name 'War Golem' not found
[25/2/2014 15:18:22] [Error - CreatureScript Interface]
[25/2/2014 15:18:22] In a timer event called from:
[25/2/2014 15:18:22] domodlib('itemstats_conf')
[25/2/2014 15:18:22]
[25/2/2014 15:18:22] function round(n, s)
[25/2/2014 15:18:22] return tonumber(('%.' .. (s or 0) .. 'f'):format(n))
[25/2/2014 15:18:23] end
[25/2/2014 15:18:23]
[25/2/2014 15:18:23] function getContentDescription(uid, sep)
[25/2/2014 15:18:23] local ret, i, containers = '', 0, {}
[25/2/2014 15:18:23] while( i < getContainerSize(uid) )do
[25/2/2014 15:18:23] local v, s = getContainerItem(uid, i), ''
[25/2/2014 15:18:23] local k = getItemInfo(v.itemid)
[25/2/2014 15:18:24] k.name = getItemAttribute(v.uid, 'name') or k.name
[25/2/2014 15:18:24] if( k.name ~= '' )then
[25/2/2014 15:18:24] if( v.type > 1 and k.stackable and k.showCount )then
[25/2/2014 15:18:24] s = v.type .. ' ' .. k.plural
[25/2/2014 15:18:24] else
[25/2/2014 15:18:24] local article = getItemAttribute(v.uid, 'article') or k.article
[25/2/2014 15:18:25] s = (article == '' and '' or article .. ' ') .. k.name
[25/2/2014 15:18:25] end
[25/2/2014 15:18:25] ret = ret .. (i == 0 and not sep and '' or ', ') .. s
[25/2/2014 15:18:25] if( isContainer(v.uid) and getContainerSize(v.uid) ~= 0 )then
[25/2/2014 15:18:25] table.insert(containers, v.uid)
[25/2/2014 15:18:26] end
[25/2/2014 15:18:26] else
[25/2/2014 15:18:26] ret = ret .. (i == 0 and not sep and '' or ', ') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'
[25/2/2014 15:18:26] end
[25/2/2014 15:18:26] i = i + 1
[25/2/2014 15:18:26] end
[25/2/2014 15:18:27] for i = 1, #containers do
[25/2/2014 15:18:27] ret = ret .. getContentDescription(containers, true)
[25/2/2014 15:18:27] end
[25/2/2014 15:18:27] return ret
[25/2/2014 15:18:27] end
[25/2/2014 15:18:28]
[25/2/2014 15:18:28] local function send(cid, corpse, monster)
[25/2/2014 15:18:28] if( isPlayer(cid) )then
[25/2/2014 15:18:28] local ret = corpse and isContainer(corpse) and getContentDescription(corpse)
[25/2/2014 15:18:28] doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'))
[25/2/2014 15:18:28] local party = getPlayerParty(cid)
[25/2/2014 15:18:29] if( party )then
[25/2/2014 15:18:29] for _, pid in ipairs(getPartyMembers(party)) do
[25/2/2014 15:18:29] doPlayerSendChannelMessage(pid, '', 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'), TALKTYPE_CHANNEL_W, CHANNEL_PARTY)
[25/2/2014 15:18:29] end
[25/2/2014 15:18:29] end
[25/2/2014 15:18:29] end
[25/2/2014 15:18:30] end
[25/2/2014 15:18:30]
[25/2/2014 15:18:30] local function createLoot(i, ext)
[25/2/2014 15:18:30] local item = type(i.id) == 'table' and i.id[math.random(#i.id)] or i.id
[25/2/2014 15:18:30] local random = math.ceil(math.random(100000) / ext)
[25/2/2014 15:18:31] local tmpItem, f
[25/2/2014 15:18:31]
[25/2/2014 15:18:31] if( random < i.chance )then
[25/2/2014 15:18:31] if i.subType == -1 then
[25/2/2014 15:18:31] f = getItemInfo(item)
[25/2/2014 15:18:32] end
[25/2/2014 15:18:32] tmpItem = doCreateItemEx(item,
[25/2/2014 15:18:32] i.subType ~= -1 and i.subType or
[25/2/2014 15:18:32] f.stackable and random % i.count + 1 or
[25/2/2014 15:18:32] f.charges ~= 0 and f.charges or
[25/2/2014 15:18:32] 1
[25/2/2014 15:18:33] )
[25/2/2014 15:18:33] end
[25/2/2014 15:18:33]
[25/2/2014 15:18:33] if( not tmpItem )then
[25/2/2014 15:18:33] return
[25/2/2014 15:18:34] end
[25/2/2014 15:18:34]
[25/2/2014 15:18:34] if( i.actionId ~= -1 )then
[25/2/2014 15:18:34] doItemSetAttribute(tmpItem, 'aid', i.actionId)
[25/2/2014 15:18:34] end
[25/2/2014 15:18:34]
[25/2/2014 15:18:35] if( i.uniqueId ~= -1 )then
[25/2/2014 15:18:35] doItemSetAttribute(tmpItem, 'uid', i.uniqueId)
[25/2/2014 15:18:35] end
[25/2/2014 15:18:35]
[25/2/2014 15:18:35] if( i.text ~= '' )then
[25/2/2014 15:18:36] doItemSetAttribute(tmpItem, 'text', i.text)
[25/2/2014 15:18:36] end
[25/2/2014 15:18:36]
[25/2/2014 15:18:36] local ret, done
[25/2/2014 15:18:36]
[25/2/2014 15:18:36] for k, v in pairs(tiers) do
[25/2/2014 15:18:37] local cur, used = {}, {}
[25/2/2014 15:18:37] for i = 1, #v.chance do
[25/2/2014 15:18:37] if( math.random(100000) <= v.chance )then
[25/2/2014 15:18:37] if( f )then
[25/2/2014 15:18:37] f = getItemInfo(item)
[25/2/2014 15:18:37] end
[25/2/2014 15:18:38] if( not f.stackable )then
[25/2/2014 15:18:38] for m, n in pairs(attr) do
[25/2/2014 15:18:38] if( not table.find(used, m) and
[25/2/2014 15:18:38] (
[25/2/2014 15:18:38] ( table.find(n.types, MELEE) and table.find({WEAPON_SWORD, WEAPON_CLUB, WEAPON_AXE}, f.weaponType) ) or
[25/2/2014 15:18:39] ( table.find(n.types, DISTANCE) and f.weaponType == WEAPON_DIST and f.ammoType ~= 0 ) or
[25/2/2014 15:18:39] ( table.find(n.types, ARMOR) and f.armor ~= 0 and f.wieldPosition ~= CONST_SLOT_NECKLACE ) or
[25/2/2014 15:18:39] ( table.find(n.types, SHIELD) and f.defense ~= 0 and f.weaponType == WEAPON_SHIELD ) or
[25/2/2014 15:18:39] ( table.find(n.types, WAND) and f.weaponType == WEAPON_WAND ) or
[25/2/2014 15:18:39] ( table.find(n.types, DURATION_RING) and f.wieldPosition == CONST_SLOT_RING and f.transformEquipTo ~= 0 ) or
[25/2/2014 15:18:40] ( table.find(n.types, CHARGES) and table.find({CONST_SLOT_RING, CONST_SLOT_NECKLACE}, f.wieldPosition) and f.charges ~= 0 )
[25/2/2014 15:18:40] ) )then
[25/2/2014 15:18:40] table.insert(cur, m)
[25/2/2014 15:18:40] end
[25/2/2014 15:18:40] end
[25/2/2014 15:18:40]
[25/2/2014 15:18:41] if( #cur ~= 0 )then
[25/2/2014 15:18:41] local n = cur[math.random(#cur)]
[25/2/2014 15:18:41] table.insert(used, n)
[25/2/2014 15:18:41]
[25/2/2014 15:18:41] n = attr[n]
[25/2/2014 15:18:42] local percent, new, tmp = math.random(n.percent[1] + (v.extra[1] or 0), n.percent[2] + (v.extra[2] or 0))
[25/2/2014 15:18:42] -- hacks
[25/2/2014 15:18:42] if( n.attr == 'duration' )then
[25/2/2014 15:18:42] tmp = getItemInfo(f.transformEquipTo)
[25/2/2014 15:18:42] if tmp.transformDeEquipTo ~= item then
[25/2/2014 15:18:43] break
[25/2/2014 15:18:43] end
[25/2/2014 15:18:43] new = round( tmp.decayTime * (1 + percent / 100) * 1000 )
[25/2/2014 15:18:43] elseif( n.attr == 'attackSpeed' )then
[25/2/2014 15:18:43] new = round( vocation_base_attackspeed / (1 + percent / 100) )
[25/2/2014 15:18:44] elseif( n.attr == 'hitChance' ) then
[25/2/2014 15:18:44] new = round(
[25/2/2014 15:18:44] f.hitChance == -1 and
[25/2/2014 15:18:44] percent
[25/2/2014 15:18:44] or
[25/2/2014 15:18:45] f.hitChance * (1 + percent / 100)
[25/2/2014 15:18:45] )
[25/2/2014 15:18:45] else
[25/2/2014 15:18:45] new = round(
[25/2/2014 15:18:45] n.base and
[25/2/2014 15:18:46] f[n['attr']] + f[n['base']] * (percent / 100)
[25/2/2014 15:18:46] or
[25/2/2014 15:18:46] f[n['attr']] * (1 + percent / 100)
[25/2/2014 15:18:46] )
[25/2/2014 15:18:46]
[25/2/2014 15:18:47] if( new == f[n[n.base and 'base' or 'attr']] )then -- no improvement
[25/2/2014 15:18:47] break
[25/2/2014 15:18:47] end
[25/2/2014 15:18:47] end
[25/2/2014 15:18:47]
[25/2/2014 15:18:48] doItemSetAttribute(tmpItem, n.attr:lower(), new)
[25/2/2014 15:18:48]
[25/2/2014 15:18:48] local name = getItemAttribute(tmpItem, 'name')
[25/2/2014 15:18:48] if( v.attrNames or not name )then
[25/2/2014 15:18:48] local name = (v.attrNames and used[#used] or k) .. ' ' .. (name or f.name)
[25/2/2014 15:18:49] doItemSetAttribute(tmpItem, 'name', name)
[25/2/2014 15:18:49]
[25/2/2014 15:18:49] if( f.article ~= '' )then
[25/2/2014 15:18:49] local article = getArticle(name)
[25/2/2014 15:18:49] if( article ~= f.article )then
[25/2/2014 15:18:50] doItemSetAttribute(tmpItem, 'article', article)
[25/2/2014 15:18:50] end
[25/2/2014 15:18:50] end
[25/2/2014 15:18:50] end
[25/2/2014 15:18:50]
[25/2/2014 15:18:51] local desc = getItemAttribute(tmpItem, 'description') or f.description
[25/2/2014 15:18:51] doItemSetAttribute(tmpItem, 'description', '[' .. n.name .. ': +' .. percent .. '%]' .. (desc == '' and '' or '\n' .. desc))
[25/2/2014 15:18:51]
[25/2/2014 15:18:51] ret = k
[25/2/2014 15:18:51] end
[25/2/2014 15:18:52] cur = {}
[25/2/2014 15:18:52] if( #v.chance == i )then
[25/2/2014 15:18:52] done = true
[25/2/2014 15:18:52] end
[25/2/2014 15:18:52] end
[25/2/2014 15:18:53] else
[25/2/2014 15:18:53] done = i ~= 1
[25/2/2014 15:18:53] break
[25/2/2014 15:18:53] end
[25/2/2014 15:18:53] end
[25/2/2014 15:18:53] if( done )then
[25/2/2014 15:18:54] break
[25/2/2014 15:18:54] end
[25/2/2014 15:18:54] end
[25/2/2014 15:18:54]
[25/2/2014 15:18:54] return tmpItem, ret
[25/2/2014 15:18:55] end
[25/2/2014 15:18:55]
[25/2/2014 15:18:55] local function createChildLoot(parent, i, ext, pos)
[25/2/2014 15:18:55] if( not i or #i == 0 )then
[25/2/2014 15:18:56] return true
[25/2/2014 15:18:56] end
[25/2/2014 15:18:56]
[25/2/2014 15:18:56] local size, cap = 0, getContainerCap(parent)
[25/2/2014 15:18:56] for k = 1, #i do
[25/2/2014 15:18:56] if( size == cap )then
[25/2/2014 15:18:57] break
[25/2/2014 15:18:57] end
[25/2/2014 15:18:57] local tmp, ret = createLoot(i[k], ext)
[25/2/2014 15:18:57] if( tmp )then
[25/2/2014 15:18:57] if( isContainer(tmp) )then
[25/2/2014 15:18:58] if( createChildLoot(tmp, i[k].child, ext, pos) )then
[25/2/2014 15:18:58] doAddContainerItemEx(parent, tmp)
[25/2/2014 15:18:58] size = size + 1
[25/2/2014 15:18:58] else
[25/2/2014 15:18:58] doRemoveItem(tmp)
[25/2/2014 15:18:59] end
[25/2/2014 15:18:59] else
[25/2/2014 15:18:59] if( ret )then
[25/2/2014 15:18:59] doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN)
[25/2/2014 15:18:59] doSendAnimatedText(pos, ret:upper(), tiers[ret].color)
[25/2/2014 15:19:0] end
[25/2/2014 15:19:0] doAddContainerItemEx(parent, tmp)
[25/2/2014 15:19:0] size = size + 1
[25/2/2014 15:19:0] end
[25/2/2014 15:19:0] end
[25/2/2014 15:19:1] end
[25/2/2014 15:19:1]
[25/2/2014 15:19:1] return size > 0
[25/2/2014 15:19:1] end
[25/2/2014 15:19:1]
[25/2/2014 15:19:2] local function dropLoot(pos, v, ext, master, cid, target)
[25/2/2014 15:19:2] local corpse
[25/2/2014 15:19:2] if( not master or master == target )then -- 0.3/4
[25/2/2014 15:19:2] corpse = getTileItemById(pos, v.lookCorpse).uid
[25/2/2014 15:19:2] if( isContainer(corpse) )then
[25/2/2014 15:19:3] for i = 1, getContainerSize(corpse) do
[25/2/2014 15:19:3] doRemoveItem(getContainerItem(corpse, 0).uid)
[25/2/2014 15:19:3] end
[25/2/2014 15:19:3] local size, cap = 0, getContainerCap(corpse)
[25/2/2014 15:19:3] for i = 1, #v.loot do
[25/2/2014 15:19:4] if( size == cap )then
[25/2/2014 15:19:4] break
[25/2/2014 15:19:4] end
[25/2/2014 15:19:4] local tmp, ret = createLoot(v.loot, ext)
[25/2/2014 15:19:4] if( tmp )then
[25/2/2014 15:19:4] if( isContainer(tmp) )then
[25/2/2014 15:19:5] if( createChildLoot(tmp, v.loot.child, ext, pos) )then
[25/2/2014 15:19:5] doAddContainerItemEx(corpse, tmp)
[25/2/2014 15:19:5] size = size + 1
[25/2/2014 15:19:5] else
[25/2/2014 15:19:5] doRemoveItem(tmp)
[25/2/2014 15:19:6] end
[25/2/2014 15:19:6] else
[25/2/2014 15:19:6] if( ret )then
[25/2/2014 15:19:6] doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN)
[25/2/2014 15:19:7] doSendAnimatedText(pos, ret:upper(), tiers[ret].color)
[25/2/2014 15:19:7] end
[25/2/2014 15:19:7] doAddContainerItemEx(corpse, tmp)
[25/2/2014 15:19:7] size = size + 1
[25/2/2014 15:19:7] end
[25/2/2014 15:19:8] end
[25/2/2014 15:19:8] end
[25/2/2014 15:19:8] end
[25/2/2014 15:19:8] end
[25/2/2014 15:19:8] send(cid, corpse, v.description)
[25/2/2014 15:19:9] end
[25/2/2014 15:19:9]
[25/2/2014 15:19:9] function onKill(cid, target, damage, flags)
[25/2/2014 15:19:9] if( (damage == true or bit.band(flags, 1) == 1) and isMonster(target) )then -- 0.3/4
[25/2/2014 15:19:9] local v = getMonsterInfo(getCreatureName(target))
[25/2/2014 15:19:9] if( v and v.lookCorpse ~= 0 )then
[25/2/2014 15:19:10] local s = getCreatureStorage(cid, extra_loot_key)
[25/2/2014 15:19:10] addEvent(dropLoot, 0, getThingPos(target), v, s == -1 and rate or s, getCreatureMaster(target), cid, target)
[25/2/2014 15:19:10] end
[25/2/2014 15:19:10] end
[25/2/2014 15:19:10] return true
[25/2/2014 15:19:11] end
[25/2/2014 15:19:11] :onKill
[25/2/2014 15:19:11] Description:
[25/2/2014 15:19:11] (LuaInterface::luaGetThing) Thing not found