User Tools

Site Tools


lua:scripting:examples:olcscripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
lua:scripting:examples:olcscripts [2016/10/02 03:26] – [Burnproof flag removal / Nonmetal Weapon adjust] vodurlua:scripting:examples:olcscripts [2016/10/02 03:26] (current) – [Reduce wealth of shops over 100%] vodur
Line 168: Line 168:
 ===== Reduce wealth of shops over 100% ===== ===== Reduce wealth of shops over 100% =====
  
-ssd+<code lua> 
 +do
  
-tacos+local cnt = 0 
 + 
 +for _,area in pairs(getarealist()) do 
 +    for _,mp in pairs(area.mobprotos) do 
 +        if mp.shop and mp.wealthpcnt> 100 then 
 +            mdo("medit "..mp.vnum) 
 +            olc("wealth 100"
 +            olc('done'
 +            cnt = cnt + 1 
 + 
 +        end 
 +    end 
 +end 
 +local msg = "Updated wealth on "..cnt.." mobs via lua script" 
 +log(msg, 'secure'
 +end 
 +</code>
  
lua/scripting/examples/olcscripts.1475378778.txt.gz · Last modified: 2016/10/02 03:26 by vodur