changeset 1356:4c4f36b8920b

Added skeleton bard module.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 16 Mar 2011 14:21:38 +0200
parents 1b74ab649379
children bc7a15e69a95
files gm-bard.tf
diffstat 1 files changed, 62 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gm-bard.tf	Wed Mar 16 14:21:38 2011 +0200
@@ -0,0 +1,62 @@
+;;
+;; GgrTF::Alchemist - Alchemist guild support and utility macros
+;; (C) Copyright 2011 Matti Hämäläinen (Ggr)
+;;
+;; This file (triggerset) is Free Software distributed under
+;; GNU General Public License version 2.
+;;
+;; NOTICE! This file requires GgrTF (version 0.6.15 or later) to be loaded.
+;;
+/loaded GgrTF:Bard
+/test prdefmodule("Bard")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; General settings and data
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+/set gbard_spells=Achromatic eyes|Campfire tune|Catchy singalong|Clandestine thoughts|Con fioco|Dancing blades|Jesters trivia|Kings feast|Melodical embracement|Melody of the misadventurer|Musicians alm|Noituloves deathlore|Noituloves dischord|Pathfinder|Singing shepherd|Soothing sounds|Sounds of silence|Strength in unity|Sweet lullaby|Uncontrollable mosh|Venturers way|Vigilant melody|War ensemble
+/set gbard_masters=Zinbaf Gilian Endek Dria Yomototh Vahearun Sineyole Derevan Zantus Forsimnetu Cyarus Noitulove Stringbreaker Zord Tinebring Otharus Aline Malecketh Razmatag Patricia Holm Fyanna Talos
+/eval /set gbard_list_spells=$[replace("|"," ",replace(" ","_",gbard_spells))]
+
+
+/def -i prlist_get_idx_do =\
+	/let _name=%{1}%;/shift%;\
+	/let _idx=0%;\
+	/while ({#})\
+		/let _idx=$[_idx+1]%;\
+		/if ({1}=~_name) /result _idx%;/endif%;\
+		/shift%;\
+	/done%;\
+	/result -1
+
+/def -i prlist_get_idx =\
+	/let _item=$[tolower(replace(" ","_",{2}))]%;\
+	/let _list=$[tolower(eval("/return %{1}",2))]%;\
+	/return $(/prlist_get_idx_do %{_item} %{_list})
+
+/def -i gbard_get_master =\
+	/let _idx=$[prlist_get_idx("gbard_list_spells", {1})]%;\
+	/if (_idx > 0)\
+		/return "$(/nth %{_idx} %{gbard_masters})"%;\
+	/else \
+		/return ""%;\
+	/endif
+
+
+/eval /def -i -F -p9999 -mregexp -t"^ (%{gbard_spells}) +(.+?)  +(known by heart|not in memory|currently in memory|once heard, barely in memory)$$" gbard_score =\
+	/let _col1=Cyellow%%;\
+	/if ({P3}=~"known by heart") /let _col3=Cgreen%%;/let _col1=Cgreen%%;/let _status=KBH%%;\
+	/elseif ({P3}=~"currently in memory") /let _col3=Cyellow%%;/let _status=memory%%;\
+	/else /let _col3=Cred%%;/let _status=-%%;/endif%%;\
+	/let _master=$$[gbard_get_master({P1})]%%;\
+	/substitute -p @{%%{_col1}} $$[prsubipad({P1},23)]@{n} | $$[prsubipad({P2},25)] | @{%%{_col3}}$$[prsubipad(_status,7)]@{n} | %%{_master}
+
+
+/def -i getmaster =\
+	/let _master=$[gbard_get_master({*})]%;\
+	/if (_master!~"")\
+		/msq Songmaster for spell '%{*}' is %{_master}.%;\
+		/send @@bgreet $[tolower(_master)]%;\
+	/else \
+		/msq No such bard spellsong '%{*}'.%;\
+	/endif
+