summaryrefslogtreecommitdiff
path: root/world/map/conf/magic-misc.sex
blob: 14d6ea3a5573e51778fb03855d7862f1a6d8fca3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
"--------------------------------------------------------------------------------"
" Special-purpose quasispells                                                    "
"--------------------------------------------------------------------------------"

(SPELL (NONMAGIC SILENT) marriage "marry" (PC target)
    (=>
        (GUARD
            (REQUIRE
                (||
                    (is_in
                        (location caster)
                        (@+
                            (@ "014-1" 28 39)
                            8
                            6))
                    (is_in
                        (location caster)
                        (@+
                            (@ "001-2" 21 27)
                            4
                            4)))))
        (EFFECT
            (IF (== target caster)
                (ABORT)) "no valid target or tried to marry self?"
            (IF (<
                    (level caster)
                    MIN_MARRY_LEVEL)
                (BLOCK
                    (message caster
                        (+
                            (+ "You must be level " MIN_MARRY_LEVEL)
                            " or higher to marry!"))
                    (ABORT)))
            (IF (<
                    (level target)
                    MIN_MARRY_LEVEL)
                (BLOCK
                    (message caster
                        (+
                            (+ "Your partner must be level " MIN_MARRY_LEVEL)
                            " or higher to marry!"))
                    (ABORT)))
            (IF (==
                    (partner caster)
                    target)
                (BLOCK
                    (message caster
                        (+
                            (+ "You and "
                                (name_of target))
                            " are already married."))
                    (ABORT)))
            (IF (is_married caster)
                (BLOCK
                    (message caster "You are already married!")
                    (ABORT)))
            (IF (is_married target)
                (BLOCK
                    (message caster
                        (+
                            (name_of target)
                            " is already married."))
                    (ABORT)))
            (IF (!=
                    (distance
                        (location caster)
                        (location target))
                    1)
                (BLOCK
                    (message caster "You need to stand next to each other.")
                    (ABORT)))
            (IF (||
                    (==
                        (count_item caster "WeddingRing")
                        0)
                    (==
                        (count_item target "WeddingRing")
                        0))
                (BLOCK
                    (message caster "You must both be wearing your wedding rings!")
                    (ABORT)))
            (SET script_target target)
            (SCRIPT "{
                announce @caster_name$ + \" is asking \" + strcharinfo(0) + \" for marriage.\", 2;
                mes @caster_name$ + \" wishes to marry you.\";
                mes \"Do you accept?\";
                next;
                menu
                    \"Yes, I do!\", L_yes,
                    \"No.\", L_Close;

            L_yes:
                if (marriage(@caster_name$))
                    announce @caster_name$ + \" and \" + strcharinfo(0) + \" are now married!\", 0;
                goto L_Close;

            L_Close:
                close;
            }")
            (IF (not
                    (is_married caster))
                (message caster
                    (+
                        (name_of target)
                        " turned down your marriage offer."))))))