changeset 1226:e0d6d64b18fa

Cleanups; Add saving of barbarian rep variables, if statesaving is used.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 25 May 2010 18:42:02 +0000
parents 9157e2a5441e
children e5a7b455e681
files gm-barb.tf
diffstat 1 files changed, 19 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/gm-barb.tf	Tue May 25 18:27:34 2010 +0000
+++ b/gm-barb.tf	Tue May 25 18:42:02 2010 +0000
@@ -1,11 +1,11 @@
 ;;
 ;; GgrTF::Barbarian - Barbarian guild support @ BatMUD
-;; (C) Copyright 2005-2006 Jarkko Vääräniemi (Jeskko) & Matti Hämäläinen (Ggr)
+;; (C) Copyright 2005-2010 Jarkko Vääräniemi (Jeskko) & 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.0 or later) to be loaded.
+;; NOTICE! This file requires GgrTF (version 0.6.14 or later) to be loaded.
 ;;
 /loaded GgrTF::Barbarian
 /test prdefmodule("Barbarian")
@@ -38,30 +38,35 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Reputation bar translator
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-/set repu_cur=0
+/test prlist_insert("lst_resetfuncs", "gbarbrep_reset")
 
-/def -i -ag -msimple -t"Reputation bar:" grepu_get1
+/def -i gbarbrep_reset =\
+	/prdefivar barbrep_cur 0%;\
+	/prdefivar barbrep_old 0
 
-/def -i -ag -mregexp -t"^\[(X*)(@*)(#*)(:*)(\.*)\]$" grepu_get2 =\
+
+/def -i -ag -msimple -t"Reputation bar:" gbarbrep_get1
+
+/def -i -mregexp -t"^\[(X*)(@*)(#*)(:*)(\.*)\]$" gbarbrep_get2 =\
 	/let _repval=$[(strlen({P1})*10000) + (strlen({P2})*1000) + (strlen({P3})*100) + (strlen({P4})*10) + strlen({P5})]%;\
-	/if (repu_gag)\
-		/set repu_gag=0%;\
-		/set repu_old=%{repu_cur}%;\
-		/set repu_cur=%{_repval}%;\
-		/msw Reputation: @{BCwhite}%{repu_cur}@{n} $[prgetdiff(repu_cur,repu_old)]%;\
+	/if (barbrep_gag)\
+		/set barbrep_gag=0%;\
+		/set barbrep_old=%{barbrep_cur}%;\
+		/set barbrep_cur=%{_repval}%;\
+ 		/mss Reputation: @{BCwhite}%{barbrep_cur}@{n} $[prgetdiff(barbrep_cur,barbrep_old)]%;\
 	/else \
-		/msw Reputation: @{BCwhite}%{_repval}@{n} [@{BCred}%{P1}@{nBCgreen}$[replace("@","@@",{P2})]@{nCgreen}%{P3}@{nBCyellow}%{P4}@{nCyellow}%{P5}@{n}]%;\
+		/mss Reputation: @{BCwhite}%{_repval}@{n} [@{BCred}%{P1}@{nBCgreen}$[replace("@","@@",{P2})]@{nCgreen}%{P3}@{nBCyellow}%{P4}@{nCyellow}%{P5}@{n}]%;\
 	/endif
 
 /def -i showrep =\
-	/set repu_gag=1%;\
+	/set barbrep_gag=1%;\
 	@@grep '[[]' barbarian binfo %{set_plrname}%;\
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Looting and burning
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-/eval /set event_skill_intr=%{event_skill_intr} gburn_intr
+/test prlist_insert("event_skill_intr", "gburn_intr")
 
 /prdefsetting -n"burnaction" -d"What items are dropped after burn" -s"off cash noeq"
 /burnaction off
@@ -94,6 +99,7 @@
 ;; Define a new RIP function for looting and burning
 /prdefripfunc lb /lootburn
 
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Lure translator
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;