lua:scripting:examples:vodurbirthdayletters
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lua:scripting:examples:vodurbirthdayletters [2014/07/07 18:42] – vodur | lua:scripting:examples:vodurbirthdayletters [2026/10/13 21:20] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | < | ||
| - | |||
| - | Area: [ 57] Aes Sedai Clan Area | ||
| - | |||
| - | Vnum: [31450] | ||
| - | |||
| - | Type: [treasure] | ||
| - | |||
| - | Level: | ||
| - | |||
| - | Wear flags: | ||
| - | |||
| - | Extra flags: [nolocate] | ||
| - | |||
| - | Material: | ||
| - | |||
| - | Condition: | ||
| - | |||
| - | Weight: | ||
| - | |||
| - | Cost: [ 0] | ||
| - | |||
| - | OPs: [ 0/ 5] | ||
| - | |||
| - | Short desc: birthday quest letter | ||
| - | |||
| - | Long desc: | ||
| - | |||
| - | | ||
| - | |||
| - | Notes: | ||
| - | |||
| - | Used for birthday quest, progs will set the actual | ||
| - | |||
| - | name, desc, etc. | ||
| - | |||
| - | OBJPrograms for [31450]: | ||
| - | |||
| - | Number Vnum Trigger Phrase | ||
| - | |||
| - | ------ ---- ------- ------ | ||
| - | |||
| - | </ | ||
| - | |||
| - | <code lua> | ||
| - | local bname=" | ||
| - | local bcolor=" | ||
| - | |||
| - | local qpreward=29 | ||
| - | -- try to make word out of obj and all letters in cont | ||
| - | -- return true if doesn' | ||
| - | -- and reward qp and destroy the letters | ||
| - | function put_trigger( ch, cont ) | ||
| - | local letters={} | ||
| - | for i=1,#bname do | ||
| - | letters[i]=bname: | ||
| - | end | ||
| - | |||
| - | local items={ obj } | ||
| - | for k,v in pairs(cont.contents) do | ||
| - | if v.vnum==lettervnum then | ||
| - | table.insert(items, | ||
| - | end | ||
| - | end | ||
| - | |||
| - | local used={} | ||
| - | for k,v in pairs(items) do | ||
| - | local iletter=string.match(v.name, | ||
| - | for i=# | ||
| - | if iletter==letters[i] then | ||
| - | table.insert(used, | ||
| - | table.remove(letters, | ||
| - | break | ||
| - | end | ||
| - | end | ||
| - | end | ||
| - | |||
| - | if # | ||
| - | sendtochar( ch, "The letters merge together to form the word " | ||
| - | " | ||
| - | ch: | ||
| - | |||
| - | for k,v in pairs(used) do | ||
| - | v:destroy() | ||
| - | end | ||
| - | return false | ||
| - | end | ||
| - | |||
| - | return true | ||
| - | end | ||
| - | |||
| - | function make_letter(l) | ||
| - | if not(l.vnum == lettervnum) then | ||
| - | error(" | ||
| - | end | ||
| - | |||
| - | local letters={} | ||
| - | for i=1,#bname do | ||
| - | letters[i]=bname: | ||
| - | end | ||
| - | |||
| - | local letter=letters[randnum(1, | ||
| - | |||
| - | l.name=" | ||
| - | l.shortdescr=" | ||
| - | l.description=" | ||
| - | </ | ||
lua/scripting/examples/vodurbirthdayletters.1404758571.txt.gz · Last modified: by vodur
