Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ["Dog Mod", "Convert Person to Dog",
- {
- private _object = [_logic, false] call Ares_fnc_GetUnitUnderCursor;
- private _pos = getPos _object;
- private _dir = getDir _object;
- if (isNull _object) exitWith { [localize "STR_AMAE_NO_OBJECT_SELECTED"] call Achilles_fnc_showZeusErrorMessage; };
- killDog = 0;
- hintSilent "Converted to Dog";
- [_this select 1,"Fin_random_F"] spawn {
- params ["_guy","_class","_act"];
- private ["_dog"];
- _dog = createAgent [_class, getPos _guy, [], 0, "CAN_COLLIDE"];
- _dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
- if (isServer) then {
- _grp = createGroup CIVILIAN;
- _rabbit = _grp createUnit ["rabbit_F", getPos player, [], 5, "CAN_COLLIDE"];
- _rabbit attachTo [_dog,[0,0,0]];
- _rabbit hideObjectGlobal true;
- _rabbit setVariable ["BIS_fnc_animalBehaviour_disable", true];
- _guy hideObjectGlobal true;
- } else {
- [[_dog, _guy, player], {
- params ["_dog", "_guy", "_player"];
- _grp = createGroup CIVILIAN;
- _rabbit = _grp createUnit ["rabbit_F", getPos _player, [], 5, "CAN_COLLIDE"];
- _rabbit attachTo [_dog,[0,0,0]];
- _rabbit hideObjectGlobal true;
- _rabbit setVariable ["BIS_fnc_animalBehaviour_disable", true];
- _guy hideObjectGlobal true;
- }] remoteExec ["spawn", 2];
- };
- while {alive _guy && alive _dog} do {
- removeAllWeapons _guy;
- if (killDog ==1) then { //couldnt think of another way to remove the dog other than doing this, when killDog is set to 1 by the 2nd set of scripts it allows me to remove the dog & the rabbit (a place holder)
- deleteVehicle _dog;
- deleteVehicle _rabbit;
- };
- if (speed _guy > 10) then {
- _dog playMoveNow "Dog_Sprint";
- } else {
- if (speed _guy > 6) then {
- _dog playMoveNow "Dog_Run";
- } else {
- if ((speed _guy > 2) || (speed _guy < -2)) then {
- _dog playMoveNow "Dog_Walk";
- } else {
- if !(_guy getVariable ["bark",false]) then {
- if ((stance _guy) == "STAND") then {
- _dog playMoveNow "Dog_Stop";
- } else {
- if ((stance _guy) == "PRONE") then {
- _dog playMoveNow "Dog_Sit";
- } else {
- _dog playMoveNow "Dog_Idle_Stop";
- };
- };
- };
- };
- };
- };
- sleep 0.05;
- };
- while {alive _guy && !alive _dog && alive _rabbit} do {
- _guy setDamage 1;
- deleteVehicle _rabbit;
- };
- };}] call Ares_fnc_RegisterCustomModule;
- //reverses previous module
- ["Dog Mod", "Turn back to Human", {
- private _object = [_logic, false] call Ares_fnc_GetUnitUnderCursor;
- private _pos = getPos _object;
- private _dir = getDir _object;
- if (isNull _object) exitWith { [localize "STR_AMAE_NO_OBJECT_SELECTED"] call Achilles_fnc_showZeusErrorMessage; };
- _rabbit = _object getVariable ["rabbit_id", objNull];
- _rabbit setDamage 1;
- remoteExec ["_guy hideObjectGlobal true"];
- killDog = 1;
- }] call Ares_fnc_RegisterCustomModule;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement