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/10/18 21:46] – bobble | lua:scripting:examples:olcscripts [2016/10/02 03:26] (current) – [Reduce wealth of shops over 100%] vodur | ||
---|---|---|---|
Line 127: | Line 127: | ||
end | end | ||
</ | </ | ||
- | ===== Burnproof flag removal ===== | + | ===== Burnproof flag removal |
<code lua> | <code lua> | ||
Line 133: | Line 133: | ||
local count = 0 | local count = 0 | ||
for _,area in pairs(getarealist()) do | for _,area in pairs(getarealist()) do | ||
- | for _,op in pairs(area.objprotos) do | + | |
- | if op: | + | |
- | -- remove burnproof flag using olc | + | if op: |
- | mdo(" | + | -- adjust damage |
- | olc(" | + | mdo(" |
- | olc(" | + | olc(" |
- | count = count + 1 | + | olc(" |
+ | count = count + 1 | ||
+ | end | ||
end | end | ||
end | end | ||
end | end | ||
sendtochar(mob, | 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 | end | ||
</ | </ | ||
lua/scripting/examples/olcscripts.1445204775.txt.gz · Last modified: 2015/10/18 21:46 by bobble