This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
lua:scripting:astarkspank [2014/12/24 05:19] vodur removed |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Place 100 random Astarks in luai: | ||
| - | |||
| - | <code lua> | ||
| - | for i=1,100 do | ||
| - | getrandomroom():mload(4849) | ||
| - | end | ||
| - | </code> | ||
| - | |||
| - | <code> | ||
| - | Name: [commander astar] | ||
| - | Area: [ 142] Special Gear | ||
| - | Act: [npc sentinel no_track trigger_always no_quest safe traveller] | ||
| - | Vnum: [ 4849] Sex: [male ] Race: [minotaur] | ||
| - | Level: [ 0] Align: [ 0] | ||
| - | Hitroll: [100%= 0] Damage: [100%= 2] Dam Type: [none] | ||
| - | Hitpoints: [100%= 50] Mana: [100%= 50] Move: [100%= 50] | ||
| - | Armor: [100%= 100] Saves: [100%= 0] | ||
| - | Affected by: [dark_vision] | ||
| - | Form: [edible sentient biped mammal] | ||
| - | Parts: [head arms legs heart brains guts hands feet fingers ear eye tail horns] | ||
| - | Imm: [summon] | ||
| - | Res: [bash cold] | ||
| - | Vuln: [disease] | ||
| - | Off: [none] | ||
| - | Size: [huge] | ||
| - | Start pos. [standing] | ||
| - | Default pos [standing] | ||
| - | Wealth: [100%=0] | ||
| - | Stance: [default] | ||
| - | Short descr: Commander Astark | ||
| - | Long descr: | ||
| - | Commander Astark is here with a swollen behind | ||
| - | Description: | ||
| - | It's the BIRTHDAY BOY. | ||
| - | Comments: | ||
| - | Astark's bday quest mob. | ||
| - | MOBPrograms for [ 4849]: | ||
| - | Number Vnum Trigger Phrase | ||
| - | ------ ---- ------- ------ | ||
| - | [ 0] 4849 TIMER 300 | ||
| - | [ 1] 4849 SOCIAL spank | ||
| - | </code> | ||
| - | |||
| - | <code lua> | ||
| - | -- astark's bday mob (4849) | ||
| - | if trigtype=="social" then | ||
| - | local tbl=loadtbl("astark_bday") or {} | ||
| - | |||
| - | local cnt = tbl[ch.name] or 0 | ||
| - | |||
| - | if cnt >= 27 then | ||
| - | say("You've reddened my butt quite enough!") | ||
| - | emote("disappears!") | ||
| - | goto("wrandom") | ||
| - | return | ||
| - | end | ||
| - | |||
| - | cnt=cnt+1 | ||
| - | |||
| - | tbl[ch.name]=cnt | ||
| - | savetbl( "astark_bday", tbl) | ||
| - | |||
| - | if cnt < 27 then | ||
| - | emote("giggles happily.") | ||
| - | say("Oh you rascal!") | ||
| - | reward(ch, "qp", randnum(1,3)) | ||
| - | emote("disappears!") | ||
| - | goto("wrandom") | ||
| - | return | ||
| - | else | ||
| - | say("Alright, enough, enough! You win!") | ||
| - | reward(ch, "qp", 25) | ||
| - | emote("disappears!") | ||
| - | goto("wrandom") | ||
| - | return | ||
| - | end | ||
| - | |||
| - | elseif trigtype=="timer" then | ||
| - | say("I'm outta here!") | ||
| - | emote("disappears!") | ||
| - | goto("wrandom") | ||
| - | |||
| - | elseif trigtype=="call" then -- mprun 4849 to show status | ||
| - | local tbl=getmobproto(4849).area:loadtbl("astark_bday") or {} | ||
| - | | ||
| - | for k,v in pairs(tbl) do | ||
| - | sendtochar( mob, ("%-15s %d\n\r"):format(k,v) ) | ||
| - | end | ||
| - | end | ||
| - | </code> | ||