User Tools

Site Tools


lua:scripting:lua_queries

lua mtrigs sorted by security, area
luaq area.name,mobproto.name,mobproto.vnum,prog.vnum,prog.security from mtrig where prog.islua order by prog.security,area.name

All shops in the game
luaq area.name,vnum,shrotdescr,shop.profitbuy,shop.profitsell,shop.openhour,shop.closehour from mp where ingame and not(shop==nil) order by area.name width 15

All mobs who have 20+ instances in game.
luaq area.name,vnum,shortdescr,count from mp where ingame and count>19 order by count,area.name

Show rooms in current area with #mobs in them.
luaq vnum,name,#mobs as mobcnt from room where thisarea order by mobcnt

Show # of treasure items in each area, sorted by the #.
luaq name,(function() local cnt=0 for k,v in pairs(x.objprotos) do if v.otype=="treasure" then cnt=cnt+1 end end return cnt end)() as cnt from area where ingame order by cnt

Show all equipment > lvl 95, ingame, weartype, rating, and transparent (T/F)
luaq level,vnum,shortdescr,rating,weartype,extra("trans") from op where otype=="armor" and level>95 and ingame

Show all items that give +luck.
luaq area.name,apply("luck"),shortdescr from op where ingame and apply("luck") order by apply("luck")

Search help files for a string of text:
luaq * from help where text:find("lemonade")

Search for all pills that give cure blindness:
luaq * from op where otype=="pill" and ingame and hasval(spells, "cure blindness")

Search for all mobs that are not standing by default: (mprog breakers)
luaq vnum,shortdescr,area.name,defaultpos,startpos from mp where not(defaultpos=="standing") or not(startpos=="standing") width 10

List all random exits:
luaq * from reset where command == 'R'

List all weapons that are above level 90, with a damtype of either disease, poison, or energy.
luaq level,vnum,shortdescr,area.name,damtype,weapontype from op where otype=="weapon" and level>90 and ingame and (damtype=="disease" or damtype=="poison" or damtype=="energy")

List all armor that is transparent, above level 99, with a rating above 1, that is in the game. Sort by armor slot.
luaq level,vnum,shortdescr,rating,weartype,extra("trans") from op where otype=="armor" and level>99 and ingame and rating > 1 and extra("trans")==true order by weartype,extra("trans")

List all weapons and their types, in the game, between level 1 and 90
luaq level,shortdescr,weapontype,area.name from op where ingame and level>1 and level<90 and otype=="weapon" order by level,weapontype

List all areas and the number of weapons each of them has
luaq name,(function() local cnt=0 for k,v in pairs(x.objprotos) do if v.otype=="weapon" then cnt=cnt+1 end end return cnt end)() as # of weapons,minlevel as min level,maxlevel as max level from area where ingame order by min level

lua/scripting/lua_queries.txt · Last modified: 2024/07/18 02:56 by astark