-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathharvestAnimal.sqf
193 lines (182 loc) · 6.85 KB
/
harvestAnimal.sqf
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
private ["_item","_no","_inhuntingarea","_animal","_r"];
if doingSomething exitwith {};
doingSomething = true;
_animal = _this select 3;
_r = floor(random 2);
_item = "";
_no = 0;
if (iscop) then {
if (!("huntinglicense" in INV_LizenzOwner)) then {
_animal = "none";
["GC_HandBad",["CHAOS LIFE POLICE","As a cop, you must have a hunting license!"]] spawn bis_fnc_showNotification;
} else {
_inhuntingarea = false;
{
if (player distance getmarkerpos (_x select 0) <= (_x select 1)) exitWith {
_inhuntingarea = true;
}
} foreach huntinggrounds;
if (!_inhuntingarea) then {
_animal = "none";
["GC_HandBad",["CHAOS LIFE POLICE","As a cop, you must be in the hunting grounds!"]] spawn bis_fnc_showNotification;
};
};
};
switch _animal do
{
case "rabbit":
{
switch _r do
{
case 0: {
_item = "boar"; //actually rabbit (A3 hack)
_no = ceil(random 2);
};
case 1: {
_item = "boarpelt";
_no = 1;
};
};
if (((call INV_GetOwnWeight) + (_item call INV_getitemTypeKg)*_no) > INV_Tragfaehigkeit) exitwith
{
["GC_HandBad",["CHAOS LIFE HUNTING",localize "STRS_inv_buyitems_maxgewicht"]] spawn bis_fnc_showNotification;
};
player playMove "AinvPknlMstpSlayWrflDnon_medic";
(nearestObjects [player, ["Rabbit_F"], 3] select 0) setVariable ["inuse", 1, true];
call compile format['SFXPvEh_%1 = ["%2","harvestsfx"];',rolenumber,rolestring];
publicVariable format["SFXPvEh_%1", rolenumber];
vehicle player say ["harvestsfx",100];
sleep 3;
waitUntil {animationState player != "AinvPknlMstpSlayWrflDnon_medic"};
deleteVehicle (nearestObjects [player, ["Rabbit_F"], 3] select 0);
[_item, _no] call INV_AddInventoreItem;
_addskill = (_no / 100);
["SKILL_HUNTING",_addskill] call GC_addSkill;
["GC_Hand",["CHAOS LIFE HUNTING",format["you got %1 %2", _no, (_item call INV_getItemName)]]] spawn bis_fnc_showNotification;
};
case "snake":
{
switch _r do
{
case 0: {
_item = "snake";
_no = ceil(random 2);
};
case 1: {
_item = "snakeskin";
_no = 1;
};
};
if (((call INV_GetOwnWeight) + (_item call INV_getitemTypeKg)*_no) > INV_Tragfaehigkeit) exitwith
{
["GC_HandBad",["CHAOS LIFE HUNTING",localize "STRS_inv_buyitems_maxgewicht"]] spawn bis_fnc_showNotification;
};
player playMove "AinvPknlMstpSlayWrflDnon_medic";
(nearestObjects [player, ["Snake_random_F"], 3] select 0) setVariable ["inuse", 1, true];
call compile format['SFXPvEh_%1 = ["%2","harvestsfx"];',rolenumber,rolestring];
publicVariable format["SFXPvEh_%1", rolenumber];
vehicle player say ["harvestsfx",100];
sleep 3;
waitUntil {animationState player != "AinvPknlMstpSlayWrflDnon_medic"};
deleteVehicle (nearestObjects [player, ["Snake_random_F"], 3] select 0);
[_item, _no] call INV_AddInventoreItem;
_addskill = (_no / 100);
["SKILL_HUNTING",_addskill] call GC_addSkill;
["GC_Hand",["CHAOS LIFE HUNTING",format["you got %1 %2", _no, (_item call INV_getItemName)]]] spawn bis_fnc_showNotification;
};
case "sheep":
{
switch _r do
{
case 0: {
_item = "sheep";
_no = ceil(random 2);
};
case 1: {
_item = "sheepskin";
_no = 1
};
};
if (((call INV_GetOwnWeight) + (_item call INV_getitemTypeKg)*_no) > INV_Tragfaehigkeit) exitwith
{
["GC_HandBad",["CHAOS LIFE HUNTING",localize "STRS_inv_buyitems_maxgewicht"]] spawn bis_fnc_showNotification;
};
player playMove "AinvPknlMstpSlayWrflDnon_medic";
(nearestObjects [player, ["Sheep_random_F"], 3] select 0) setVariable ["inuse", 1, true];
call compile format['SFXPvEh_%1 = ["%2","harvestsfx"];',rolenumber,rolestring];
publicVariable format["SFXPvEh_%1", rolenumber];
vehicle player say ["harvestsfx",100];
sleep 3;
waitUntil {animationState player != "AinvPknlMstpSlayWrflDnon_medic"};
deleteVehicle (nearestObjects [player, ["Sheep_random_F"], 3] select 0);
[_item, _no] call INV_AddInventoreItem;
_addskill = (_no / 100);
["SKILL_HUNTING",_addskill] call GC_addSkill;
["GC_Hand",["CHAOS LIFE HUNTING",format["you got %1 %2", _no, (_item call INV_getItemName)]]] spawn bis_fnc_showNotification;
};
case "turtle":
{
switch _r do
{
case 0: {
_item = "turtle";
_no = ceil(random 2);
};
case 1: {
_item = "turtleshell";
_no = 1;
};
};
if (((call INV_GetOwnWeight) + (_item call INV_getitemTypeKg)*_no) > INV_Tragfaehigkeit) exitwith
{
["GC_HandBad",["CHAOS LIFE HUNTING",localize "STRS_inv_buyitems_maxgewicht"]] spawn bis_fnc_showNotification;
};
//player playMove "AinvPknlMstpSlayWrflDnon_medic";
(nearestObjects [player, ["Turtle_F"], 3] select 0) setVariable ["inuse", 1, true];
call compile format['SFXPvEh_%1 = ["%2","harvestsfx"];',rolenumber,rolestring];
publicVariable format["SFXPvEh_%1", rolenumber];
vehicle player say ["harvestsfx",100];
sleep 3;
//waitUntil {animationState player != "AinvPknlMstpSlayWrflDnon_medic"};
deleteVehicle (nearestObjects [player, ["Turtle_F"], 3] select 0);
[_item, _no] call INV_AddInventoreItem;
_addskill = (_no / 100);
["SKILL_HUNTING",_addskill] call GC_addSkill;
["GC_Hand",["CHAOS LIFE HUNTING",format["you got %1 %2", _no, (_item call INV_getItemName)]]] spawn bis_fnc_showNotification;
};
case "fish":
{
_item = "fish";
_no = ceil(random 2);
if (((call INV_GetOwnWeight) + (_item call INV_getitemTypeKg)*_no) > INV_Tragfaehigkeit) exitwith
{
["GC_HandBad",["CHAOS LIFE HUNTING",localize "STRS_inv_buyitems_maxgewicht"]] spawn bis_fnc_showNotification;
};
//player playMove "AinvPknlMstpSlayWrflDnon_medic";
(nearestObjects [player, fishtypes, 3] select 0) setVariable ["inuse", 1, true];
call compile format['SFXPvEh_%1 = ["%2","harvestsfx"];',rolenumber,rolestring];
publicVariable format["SFXPvEh_%1", rolenumber];
vehicle player say ["harvestsfx",100];
sleep 3;
//waitUntil {animationState player != "AinvPknlMstpSlayWrflDnon_medic"};
deleteVehicle (nearestObjects [player, fishtypes, 3] select 0);
[_item, _no] call INV_AddInventoreItem;
_addskill = (_no / 100);
["SKILL_FISHING",_addskill] call GC_addSkill;
["GC_Hand",["CHAOS LIFE HUNTING",format["you got %1 %2", _no, (_item call INV_getItemName)]]] spawn bis_fnc_showNotification;
};
};
if (!("huntinglicense" in INV_LizenzOwner)) then {
format [" [""Poaching"", %1] spawn Isse_AddCrimeLogEntry; if(!(""poaching"" in %1_reason))then{%1_reason = %1_reason + [""poaching""]}; %1_wanted = 1; kopfcash_%1 = kopfcash_%1 + 5000;", player, name player] call broadcast;
} else {
_inhuntingarea = false;
{
if (player distance getmarkerpos (_x select 0) <= (_x select 1)) exitWith {
_inhuntingarea = true;
}
} foreach huntinggrounds;
if (!_inhuntingarea) then {
format [" [""Poaching"", %1] spawn Isse_AddCrimeLogEntry; if(!(""poaching"" in %1_reason))then{%1_reason = %1_reason + [""poaching""]}; %1_wanted = 1; kopfcash_%1 = kopfcash_%1 + 5000;", player, name player] call broadcast;
};
};
doingSomething = false;