-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path[proc,script821].cs2
142 lines (142 loc) · 5.07 KB
/
[proc,script821].cs2
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// 821
[proc,script821](component $component0, int $comsubid1, int $comsubid2, int $comsubid3, int $comsubid4, int $comsubid5, int $comsubid6, int $comsubid7, component $component8, int $comsubid9, int $comsubid10, int $comsubid11, int $int12)
def_int $int13 = calc(%varbit4439 - 1);
def_inv $inv14 = enum(int, inv, enum_150, $int13);
if ($inv14 = null | stockmarket_isofferempty($int13) = true) {
if (cc_find($component0, $comsubid1) = ^true) {
cc_settext("No offer");
}
if (cc_find($component0, $comsubid2) = ^true) {
cc_sethide(true);
}
if (cc_find($component0, $comsubid3) = ^true) {
cc_setobject_nonum(obj_6512, 1);
}
if (cc_find($component0, $comsubid4) = ^true) {
cc_settext("No offer");
}
if (cc_find($component0, $comsubid5) = ^true) {
cc_settext("");
}
if (cc_find($component0, $comsubid6) = ^true) {
cc_settext("");
}
if (cc_find($component0, $comsubid7) = ^true) {
cc_settext("");
}
if (cc_find($component8, $comsubid9) = ^true) {
cc_sethide(true);
}
if (cc_find($component8, $comsubid10) = ^true) {
cc_settext("No offer found for this slot.");
}
if (cc_find($component8, $comsubid11) = ^true) {
~script812(-1, -1, -1, 1, $int12);
}
return;
}
def_int $int15 = stockmarket_getoffertype($int13);
def_obj $obj16 = stockmarket_getofferitem($int13);
if ($obj16 = null) {
$obj16 = obj_6512;
}
def_int $int17 = stockmarket_getoffercount($int13);
if ($int17 <= 0) {
$int17 = 1;
}
def_int $int18 = stockmarket_getoffercompletedcount($int13);
def_int $int19 = stockmarket_getofferprice($int13);
def_int $int20 = stockmarket_getoffercompletedgold($int13);
def_boolean $boolean21 = stockmarket_isofferfinished($int13);
def_string $string0 = ",";
if (cc_find($component0, $comsubid1) = ^true & .cc_find($component0, $comsubid2) = ^true) {
.cc_sethide(false);
if ($int15 = 1) {
cc_settext("Sell offer");
.cc_setgraphic("ge_smallicons,7");
} else {
cc_settext("Buy offer");
.cc_setgraphic("ge_smallicons,6");
}
}
if (cc_find($component0, $comsubid3) = ^true) {
cc_setobject_nonum($obj16, $int17);
}
if (cc_find($component0, $comsubid4) = ^true) {
cc_settext(oc_name($obj16));
}
if (cc_find($component0, $comsubid5) = ^true) {
cc_settext(~tostring_spacer($int17, $string0));
}
if (cc_find($component0, $comsubid6) = ^true) {
if ($int19 = 1) {
cc_settext("1 coin");
} else {
cc_settext("<~tostring_spacer($int19, $string0)> coins");
}
}
def_int $int22 = 0;
if (cc_find($component0, $comsubid7) = ^true) {
if (calc(^max_32bit_int / $int17) < $int19) {
cc_settext("Lots of money");
} else {
$int22 = calc($int17 * $int19);
if ($int22 = 1) {
cc_settext("1 coin");
} else {
cc_settext("<~tostring_spacer($int22, $string0)> coins");
}
}
}
def_graphic $graphic23 = "ge_cancel,0";
def_graphic $graphic24 = "ge_cancel,1";
if (cc_find($component8, $comsubid10) = ^true) {
if ($boolean21 = true) {
if ($int15 = 1) {
if ($int20 = 1) {
cc_settext("You sold a total of <col=ffb83f><~tostring_spacer($int18, $string0)></col><br>for a total price of <col=ffb83f>one</col> coin.");
} else {
cc_settext("You sold a total of <col=ffb83f><~tostring_spacer($int18, $string0)></col><br>for a total price of <col=ffb83f><~tostring_spacer($int20, $string0)></col> coins.");
}
} else if ($int20 = 1) {
cc_settext("You bought a total of <col=ffb83f><~tostring_spacer($int18, $string0)></col><br>for a total price of <col=ffb83f>one</col> coin.");
} else {
cc_settext("You bought a total of <col=ffb83f><~tostring_spacer($int18, $string0)></col><br>for a total price of <col=ffb83f><~tostring_spacer($int20, $string0)></col> coins.");
}
if (cc_find($component8, $comsubid9) = ^true) {
cc_sethide(true);
}
} else {
if ($int15 = 1) {
if ($int20 = 1) {
cc_settext("You have sold a total of <col=ffb83f><~tostring_spacer($int18, $string0)></col> so far<br>for a total price of <col=ffb83f>one</col> coin.");
} else {
cc_settext("You have sold a total of <col=ffb83f><~tostring_spacer($int18, $string0)></col> so far<br>for a total price of <col=ffb83f><~tostring_spacer($int20, $string0)></col> coins.");
}
} else if ($int20 = 1) {
cc_settext("You have bought a total of <col=ffb83f><~tostring_spacer($int18, $string0)></col> so far<br>for a total price of <col=ffb83f>one</col> coin.");
} else {
cc_settext("You have bought a total of <col=ffb83f><~tostring_spacer($int18, $string0)></col> so far<br>for a total price of <col=ffb83f><~tostring_spacer($int20, $string0)></col> coins.");
}
if (cc_find($component8, $comsubid9) = ^true) {
cc_sethide(false);
if (stockmarket_isofferstable($int13) = true) {
cc_settrans(0);
cc_setgraphic($graphic23);
cc_setonmouserepeat("cc_graphic_swapper(event_com, event_comsubid, $graphic24, null)");
cc_setonmouseleave("cc_graphic_swapper(event_com, event_comsubid, $graphic23, null)");
cc_setonop("opsound(event_opindex, 2)");
} else {
cc_settrans(120);
cc_setgraphic($graphic24);
cc_setonmouserepeat(null);
cc_setonmouseleave(null);
cc_setonop(null);
}
}
}
}
if (cc_find($component8, $comsubid11) = ^true) {
cc_sethide(false);
~script812($int13, $int17, $int18, 0, $int12);
}