changeset 682:f564ca55e0a9

Added support for maximum durations (after that the prot will be automatically dropped)
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 05 Oct 2007 15:13:08 +0000
parents f52eeb232f78
children 1ae8728d68cc
files ggrtf-ptracker.tf
diffstat 1 files changed, 39 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/ggrtf-ptracker.tf	Fri Oct 05 04:47:47 2007 +0000
+++ b/ggrtf-ptracker.tf	Fri Oct 05 15:13:08 2007 +0000
@@ -51,10 +51,15 @@
 
 
 /def -i prdefpartyprot =\
-	/if (!getopts("i:n:A:","")) /gerror Invalid prot tracker definition!%;/break%;/endif%;\
+	/if (!getopts("i:n:A:m:","")) /gerror Invalid prot tracker definition!%;/break%;/endif%;\
 	/set lst_pprots=%{lst_pprots} %{opt_i}%;\
 	/set pprot_%{opt_i}_n=%{opt_n}%;\
-	/set pprot_%{opt_i}_A=$[tolower(opt_A)]
+	/set pprot_%{opt_i}_A=$[tolower(opt_A)]%;\
+	/if (opt_m > 0)\
+		/set pprot_%{opt_i}_m=%{opt_m}%;\
+	/else \
+		/set pprot_%{opt_i}_m=0%;\
+	/endif
 
 
 /def -i gpprot_getn_do =\
@@ -149,8 +154,16 @@
 /def -i gpprots_update_member =\
 	/let _zplr=%{1}%;/shift%;\
 	/while ({#})\
-		/eval /set _ztm=$$[pprot_%{_zplr}_%{1}]%;\
-		/if (_ztm > 0) /test prlist_insert("lst_pactive",{1})%;/endif%;\
+		/eval /set _zta=$$[pprot_%{_zplr}_%{1}]%;\
+		/eval /set _ztt=$$[pprot_%{_zplr}_%{1}_t]%;\
+		/eval /set _ztm=$$[pprot_%{_zplr}_%{1}_m]%;\
+		/if (_zta > 0)\
+			/if (_ztm > 0 & (time()-_ztt) >= _ztm)\
+				/set pprot_%{_zplr}_%{1}=0%;\
+			/else \
+				/test prlist_insert("lst_pactive",{1})%;\
+			/endif%;\
+		/endif%;\
 		/shift%;\
 	/done
 
@@ -189,26 +202,31 @@
 ;; Define prots and patterns
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 /prdefpartyprot -i"unstun"	-n"Unstun"	-A"Unstun|uns"
+/prdefpartyprot -i"hw"		-n"HW"		-A"heavy weight|heavyweight|hw"
+/prdefpartyprot -i"unp"		-n"Unpain"	-A"Unpain|unp"
+/prdefpartyprot -i"pfg"		-n"PfG"		-A"protection from good|pfg"	-m1200
+/prdefpartyprot -i"pfe"		-n"PfE" 	-A"protection from evil|pfe"	-m1200
+/prdefpartyprot -i"flex"	-n"Flex"	-A"flex shield|flex"
+
+/prdefpartyprot -i"fsh"		-n"FSh"		-A"Force Shield|fsh|fshield"	-m1800
+
 /prdefpartyprot -i"warez"	-n"WarEs"	-A"War Ensemble|warez|war"
-/prdefpartyprot -i"fabs"	-n"Fabs"	-A"Force Absorption|fabs|force absorbsion"
-/prdefpartyprot -i"aoa"		-n"AoA"		-A"Armour of Aether|AoA|aether armour|Armor of Aether|GPhys"
-/prdefpartyprot -i"fsh"		-n"FSh"		-A"Force Shield|fsh|fshield"
-/prdefpartyprot -i"hw"		-n"HW"		-A"heavy weight|heavyweight|hw"
-/prdefpartyprot -i"pfg"		-n"PfG"		-A"protection from good|pfg"
-/prdefpartyprot -i"unp"		-n"Unpain"	-A"Unpain|unp"
-/prdefpartyprot -i"pfe"		-n"PfE" 	-A"protection from evil|pfe"
-/prdefpartyprot -i"flex"	-n"Flex"	-A"flex shield|flex"
 /prdefpartyprot -i"mel"		-n"EMelo"	-A"Embracing melody|melodical embracement|melody"
+
+/prdefpartyprot -i"aoa"		-n"AoA"		-A"Armour of Aether|AoA|aether armour|Armor of Aether|GPhys"
+/prdefpartyprot -i"macid"	-n"MAcid"	-A"Acid Shield|GAcid"		-m1020
+/prdefpartyprot -i"mpois"	-n"MPois"	-A"Shield of detoxification|poison prot|detox|GPoison"		-m1020
+/prdefpartyprot -i"melec"	-n"MElec"	-A"Lightning Shield|GElec"		-m1020
+/prdefpartyprot -i"masph"	-n"MAsph"	-A"Aura of Wind|GAsph"		-m1020
+/prdefpartyprot -i"mfire"	-n"MFire"	-A"Flame Shield|GFire"		-m1020
+/prdefpartyprot -i"mmana"	-n"MMana"	-A"Repulsor Aura|GMana"		-m1020
+/prdefpartyprot -i"mpsi"	-n"MPsi"	-A"Psionic Phalanx"		-m1020
+/prdefpartyprot -i"mcold"	-n"MCold"	-A"Frost Shield|GCold"		-m1020
+
+/prdefpartyprot -i"fabs"	-n"Fabs"	-A"Force Absorption|fabs|force absorbsion"
 /prdefpartyprot -i"sop"		-n"SoP"		-A"Shield of protection|sop"
-/prdefpartyprot -i"macid"	-n"MAcid"	-A"Acid Shield|GAcid"
-/prdefpartyprot -i"mpois"	-n"MPois"	-A"Shield of detoxification|poison prot|detox|GPoison"
-/prdefpartyprot -i"melec"	-n"MElec"	-A"Lightning Shield|GElec"
-/prdefpartyprot -i"masph"	-n"MAsph"	-A"Aura of Wind|GAsph"
-/prdefpartyprot -i"mfire"	-n"MFire"	-A"Flame Shield|GFire"
-/prdefpartyprot -i"mmana"	-n"MMana"	-A"Repulsor Aura|GMana"
-/prdefpartyprot -i"mpsi"	-n"MPsi"	-A"Psionic Phalanx"
-/prdefpartyprot -i"mcold"	-n"MCold"	-A"Frost Shield|GCold"
-/prdefpartyprot -i"displ"	-n"Displ"	-A"Displacement|blur image"
+/prdefpartyprot -i"displ"	-n"Displ"	-A"Displacement|blur image"	-m1020
+
 /prdefpartyprot -i"aoh"		-n"AoH"		-A"aura of hate|aoh"
 /prdefpartyprot -i"sshield"	-n"SShld" 	-A"soul shield|soul_shield|soulshield"
 /prdefpartyprot -i"suppr"	-n"Suppr" 	-A"suppress magic|magic suppression|suppress"