lua:scripting:examples:olcscripts
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lua:scripting:examples:olcscripts [2015/03/15 08:53] – vodur | lua:scripting:examples:olcscripts [2016/10/02 03:26] (current) – [Reduce wealth of shops over 100%] vodur | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Edit v1 and v2 values for all wands and staffs | + | ====== OLC scripts ====== |
| + | |||
| + | ===== Edit all wands and staffs | ||
| + | |||
| + | <code lua> | ||
| + | do | ||
| + | |||
| + | for _,area in pairs(getarealist()) do | ||
| + | for _,op in pairs(area.objprotos) do | ||
| + | if op.otype==" | ||
| + | if not(op.chargesleft==50) or not(op.chargestotal==50) then | ||
| + | mdo(" | ||
| + | olc(" | ||
| + | olc(" | ||
| + | olc(" | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | |||
| + | end | ||
| + | </ | ||
| + | |||
| + | ===== Shop wands/ | ||
| + | |||
| + | -1 makes the # of charges randomize then item pops. | ||
| <code lua> | <code lua> | ||
| Line 59: | Line 84: | ||
| end | end | ||
| </ | </ | ||
| - | < | ||
| + | ===== Surreal reset culling ===== | ||
| + | |||
| + | [[http:// | ||
| + | |||
| + | <code lua> | ||
| + | do | ||
| + | local area=getroom(2031).area | ||
| + | |||
| + | for _,room in pairs(area.rooms) do | ||
| + | local edited=false | ||
| + | clearloopcount() | ||
| + | local finished | ||
| + | while not finished do | ||
| + | finished=true | ||
| + | local num_resets=# | ||
| + | |||
| + | for i,reset in ipairs(room.resets) do | ||
| + | if reset.command==" | ||
| + | goto(room.vnum) | ||
| + | local rmax=reset.arg4 | ||
| + | local amax=reset.arg2 | ||
| + | local mvnum=reset.arg1 | ||
| + | |||
| + | if amax>25 then | ||
| + | local newmax=25 | ||
| + | rmax=math.min(rmax, | ||
| + | --local newmax=math.max(20, | ||
| + | --newmax=math.min(amax, | ||
| + | edited=true | ||
| + | mdo(" | ||
| + | mdo(" | ||
| + | finished=false | ||
| + | break | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | if edited then mdo(' | ||
| + | end | ||
| + | |||
| + | end | ||
| + | </ | ||
| + | ===== Burnproof flag removal / Nonmetal Weapon adjust ===== | ||
| + | |||
| + | <code lua> | ||
| + | function anti_burnproof() | ||
| + | local count = 0 | ||
| + | for _,area in pairs(getarealist()) do | ||
| + | if not area: | ||
| + | for _,op in pairs(area.objprotos) do | ||
| + | if op: | ||
| + | -- adjust damage using olc | ||
| + | mdo(" | ||
| + | olc(" | ||
| + | olc(" | ||
| + | count = count + 1 | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | sendtochar(mob, | ||
| + | end | ||
| + | |||
| + | function nonmetal_weapons() | ||
| + | local count = 0 | ||
| + | for _,area in pairs(getarealist()) do | ||
| + | if not area: | ||
| + | for _,op in pairs(area.objprotos) do | ||
| + | if op: | ||
| + | -- remove burnproof flag using olc | ||
| + | mdo(" | ||
| + | olc(" | ||
| + | olc(" | ||
| + | count = count + 1 | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | sendtochar(mob, | ||
| + | end | ||
| + | </ | ||
| + | ===== Reduce wealth of shops over 100% ===== | ||
| + | |||
| + | <code lua> | ||
| + | do | ||
| + | |||
| + | local cnt = 0 | ||
| + | |||
| + | for _,area in pairs(getarealist()) do | ||
| + | for _,mp in pairs(area.mobprotos) do | ||
| + | if mp.shop and mp.wealthpcnt> | ||
| + | mdo(" | ||
| + | olc(" | ||
| + | olc(' | ||
| + | cnt = cnt + 1 | ||
| + | |||
| + | end | ||
| + | end | ||
| + | end | ||
| + | local msg = " | ||
| + | log(msg, ' | ||
| + | end | ||
| </ | </ | ||
lua/scripting/examples/olcscripts.1426409608.txt.gz · Last modified: 2015/03/15 08:53 by vodur