Mercurial > hg > batmud > ggrtf
annotate gm-pplacer.tf @ 1677:32c6a74b989a
Improve spell handling, add grabbing of wiz-only spell chance value.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 27 Mar 2024 17:24:10 +0200 |
parents | 356c3c26aee6 |
children |
rev | line source |
---|---|
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 ;; |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 ;; GgrTF::PartyPlacer - Automagic party formation saving and restoring |
1655
356c3c26aee6
Get rid of ISO-8859-1 in copyrights.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
3 ;; (C) Copyright 2006-2015 Aloysha & Matti Hamalainen (Ggr) |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
4 ;; |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 ;; This file (triggerset) is Free Software distributed under |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
6 ;; GNU General Public License version 2. |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 ;; |
1277
980a1f19a258
More copyright and version requirement updates.
Matti Hamalainen <ccr@tnsp.org>
parents:
1206
diff
changeset
|
8 ;; NOTICE! This file requires GgrTF (version 0.6.15 or later) to be loaded. |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
9 ;; |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 /loaded GgrTF::PartyPlacer |
1035
c10f8a59a2e3
Use module depencies for checking required parent modules.
Matti Hamalainen <ccr@tnsp.org>
parents:
981
diff
changeset
|
11 /test prdefmodule("PartyPlacer", "PSSMangle") |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
12 |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 ;; Save positions to save variables |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
15 /def -i gparty_save =\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
16 /for _ccol 1 3 \ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
17 /for _crow 1 3 \ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
18 /let _gps=%%%{_crow}_%%%{_ccol}%%%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
19 /eval /set gparty_%%%{_gps}_fs=$$$$[gparty_%%%{_gps}_s] |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
20 |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
21 |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
22 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
23 ;; Find position of a player in party formation |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
24 /def -i gparty_getpos =\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
25 /let _crow=3%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
26 /while (_crow>0) \ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
27 /let _ccol=3%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 /while (_ccol>0) \ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
29 /let _gps=%{_crow}_%{_ccol}%;\ |
981
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
30 /let _tps=$[prgetval(strcat("gparty_",_gps,"_s"))]%;\ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
31 /if (_tps=~{1}) /return _gps%;/endif%;\ |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
32 /let _ccol=$[_ccol-1]%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
33 /done%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
34 /let _crow=$[_crow-1]%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
35 /done%;\ |
981
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
36 /return "" |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
37 |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
38 |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
40 ;; Save currently known party formation |
927
421fba240727
Make some macros invisible.
Matti Hamalainen <ccr@tnsp.org>
parents:
882
diff
changeset
|
41 /def -i ppsave =\ |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
42 /msq Saving current party formation ...%;\ |
1206
6d902ec31269
s/gparty_gag/gparty_grab/g.
Matti Hamalainen <ccr@tnsp.org>
parents:
1035
diff
changeset
|
43 /set gparty_grab=1%;\ |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
44 /set event_pss_once=gparty_save%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
45 @@party status short |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
46 |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
47 |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
48 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
49 ;; Restore party formation (correct execution requires that you have |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
50 ;; recently invoked party status so GgrTF knows current party formation) |
927
421fba240727
Make some macros invisible.
Matti Hamalainen <ccr@tnsp.org>
parents:
882
diff
changeset
|
51 /def -i ppreset =\ |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
52 /msq Restoring saved party formation ...%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
53 /set event_pss_once=gparty_reset_do%;\ |
1206
6d902ec31269
s/gparty_gag/gparty_grab/g.
Matti Hamalainen <ccr@tnsp.org>
parents:
1035
diff
changeset
|
54 /set gparty_grab=1%;\ |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
55 @@party forcefollow all%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
56 @@party status short |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
57 |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
58 /def -i gparty_reset_do =\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
59 /let _crow=3%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
60 /while (_crow>0) \ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
61 /let _ccol=3%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
62 /while (_ccol>0) \ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
63 /let _gps=%{_crow}_%{_ccol}%;\ |
981
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
64 /let _gcur=$[prgetval(strcat("gparty_",_gps,"_s"))]%;\ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
65 /let _gwant=$[prgetval(strcat("gparty_",_gps,"_fs"))]%;\ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
66 /if (_gcur!~_gwant) \ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
67 /if (_gcur!~"" & _gwant!~"") \ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
68 @@party swap %{_gcur} %{_gwant}%;\ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
69 /let _gfpos=$[gparty_getpos(_gwant)]%;\ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
70 /set gparty_%{_gfpos}_s=%{_gcur}%;\ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
71 /set gparty_%{_gps}_s=%{_gwant}%;\ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
72 /elseif (_gwant!~"") \ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
73 @@party place %{_gwant} %{_crow},%{_ccol}%;\ |
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
74 /let _gfpos=$[gparty_getpos(_gwant)]%;\ |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
75 /set gparty_%{_gfpos}_s=%;\ |
981
25ed3da96f88
Use prgetval() and get rid of /eval /set where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
927
diff
changeset
|
76 /set gparty_%{_gps}_s=%{_gwant}%;\ |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
77 /endif%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
78 /endif%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
79 /let _ccol=$[_ccol-1]%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
80 /done%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
81 /let _crow=$[_crow-1]%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
82 /done%;\ |
1206
6d902ec31269
s/gparty_gag/gparty_grab/g.
Matti Hamalainen <ccr@tnsp.org>
parents:
1035
diff
changeset
|
83 /set gparty_grab=1%;\ |
882
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
84 @@party forcefollow all%;\ |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
85 @@party status short |
04abd37e4751
Rename additional modules from ggrtf-*.tf to gm-*.tf.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
86 |