Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //########## RPK47
- datablock AudioProfile(RPK47WhizSound){filename="./Sounds/whiz.wav";description=AudioClosest3d;preload=true;};
- datablock AudioProfile(RPK47DeploySound){filename="./Sounds/equip.wav";description=AudioClosest3d;preload=true;};
- datablock AudioProfile(RPK47HitSound){filename="./Add-Ons/Weapon_Gun/bulletHit.wav";description=AudioClosest3d;preload=true;};
- datablock AudioProfile(RPK47MetalHitSound){filename="./Add-Ons/Weapon_Gun/bulletHit.wav";description=AudioClosest3d;preload=true;};
- datablock AudioProfile(RPK47FireSound){filename="./Sounds/RPK47fire.wav";description=AudioClose3d;preload=true;};
- datablock AudioProfile(RPK47ClickSound){filename="./Sounds/empty.wav";description=AudioClosest3d;preload=true;};
- datablock AudioProfile(RPK47Reload1Sound){filename="./Sounds/RPK47Reload1.wav";description=AudioClosest3d;preload=true;};
- datablock AudioProfile(RPK47Reload2Sound){filename="./Sounds/RPK47Reload2.wav";description=AudioClosest3d;preload=true;};
- //
- datablock AudioProfile(RPK47CockSound){filename="./Sounds/RPK47Cock.wav";description=AudioClosest3d;preload=true;};
- datablock ParticleData(RPK47bulletExplosionParticle){dragCoefficient=8;gravityCoefficient=0;inheritedVelFactor=0.2;constantAcceleration=0;lifetimeMS=1000;lifetimeVarianceMS=0;textureName="base/data/particles/cloud";spinSpeed=10;spinRandomMin=-50;spinRandomMax=50;colors[0]="0.4 0.4 0.4 0.5";colors[1]="0.2 0.2 0.2 0";sizes[0]=0.5;sizes[1]=2;useInvAlpha=true;};
- datablock ParticleEmitterData(RPK47bulletExplosionEmitter){uiName="";ejectionPeriodMS=8;periodVarianceMS=0;ejectionVelocity=2;velocityVariance=1;ejectionOffset=0;thetaMin=89;thetaMax=90;phiReferenceVel=0;phiVariance=360;overrideAdvance=false;particles="RPK47bulletExplosionParticle";};
- datablock ParticleData(RPK47bulletDebrisExplosionParticle){dragCoefficient=0;gravityCoefficient=5;inheritedVelFactor=0.2;constantAcceleration=0;lifetimeMS=1000;lifetimeVarianceMS=500;textureName="base/data/particles/chunk";spinSpeed=10;spinRandomMin=-50;spinRandomMax=50;colors[0]="0.2 0.2 0.2 1";colors[1]="0.2 0.2 0.2 0";sizes[0]=0.2;sizes[1]=0.2;useInvAlpha=true;};
- datablock ParticleEmitterData(RPK47bulletDebrisExplosionEmitter){uiName="";ejectionPeriodMS=3;periodVarianceMS=0;ejectionVelocity=16;velocityVariance=8;ejectionOffset=0;thetaMin=0;thetaMax=30;phiReferenceVel=0;phiVariance=360;overrideAdvance=false;particles="RPK47bulletDebrisExplosionParticle";};
- datablock ParticleData(RPK47bulletExplosionSmokeParticle : RPK47bulletExplosionParticle){dragCoefficient=6;gravityCoefficient=0.2;inheritedVelFactor=0;lifetimeMS=1400;lifetimeVarianceMS=200;textureName="base/data/particles/cloud";colors[0]="0.6 0.6 0.6 1";colors[1]="0.6 0.6 0.6 0.2";colors[2]="0.4 0.4 0.4 0";sizes[0]=0.5;sizes[1]=0.6;sizes[2]=5;times[0]=0;times[1]=0.1;times[2]=1;useInvAlpha=true;};
- datablock ParticleEmitterData(RPK47bulletExplosionSmokeEmitter : RPK47bulletExplosionEmitter){uiName="";ejectionPeriodMS=8;ejectionVelocity=9;velocityVariance=8;thetaMin=0;thetaMax=30;overrideAdvance=false;particles="RPK47bulletExplosionSmokeParticle";};
- datablock ExplosionData(RPK47bulletExplosion){lifeTimeMS=50;emitter[0]=RPK47bulletExplosionSmokeEmitter;emitter[1]=RPK47bulletDebrisExplosionEmitter;faceViewer=true;explosionScale="1 1 1";shakeCamera=true;camShakeFreq="2 2 2";camShakeAmp="1 1 1";camShakeDuration=0.5;camShakeRadius=1;};
- datablock ExplosionData(RPK47RecoilExplosion){lifeTimeMS=1;explosionScale="1 1 1";shakeCamera=true;camShakeFreq="1.5 1.5 1.5";camShakeAmp="0.6 0.3 0.3";camShakeDuration=0.6;camShakeRadius=1;};
- datablock ProjectileData(RPK47Recoil){uiName="";explosion=RPK47RecoilExplosion;muzzleVelocity=0;velInheritFactor=1;lifetime=1;fadeDelay=1;explodeOnDeath=true;};
- datablock ParticleData(RPK47FlashParticle : RPK47bulletExplosionParticle){dragCoefficient=0;inheritedVelFactor=1;lifetimeMS=30;textureName="base/data/particles/cloud";spinSpeed=50;spinRandomMin=-500;spinRandomMax=500;colors[0]="1 0.5 0 1";colors[1]="1 0.8 0.6 1";colors[2]="1 0.6 0.3 0";sizes[0]=0.1;sizes[1]=0.5;sizes[2]=0;times[9]=0;times[1]=0.3;times[2]=1;useInvAlpha=false;};
- datablock ParticleEmitterData(RPK47FlashEmitter : RPK47bulletExplosionEmitter){ejectionPeriodMS=3;ejectionVelocity=50;velocityVariance=0;thetaMin=0;thetaMax=10;particles="RPK47FlashParticle";uiName="";};
- datablock DebrisData(RPK47ShellDebris){shapeFile="./Models/modernShell.dts";lifetime=2;minSpinSpeed=-400;maxSpinSpeed=200;elasticity=0.5;friction=0.2;numBounces=3;staticOnMaxBounce=true;snapOnMaxBounce=false;fade=true;gravModifier=2;};
- datablock ParticleData(RPK47TrailParticle)
- {
- dragCoefficient = 3.0;
- windCoefficient = 0.0;
- gravityCoefficient = 0.0;
- inheritedVelFactor = 0.0;
- constantAcceleration = 0.0;
- lifetimeMS = 120;
- lifetimeVarianceMS = 0;
- spinSpeed = 10.0;
- spinRandomMin = -50.0;
- spinRandomMax = 50.0;
- useInvAlpha = false;
- animateTexture = false;
- //framesPerSec = 1;
- textureName = "base/data/particles/dot";
- //animTexName = "~/data/particles/dot";
- // Interpolation variables
- colors[0] = "1 1 0 1";
- colors[1] = "1 1 0.4 1";
- colors[2] = "1 1 1 1";
- sizes[0] = 0.2;
- sizes[1] = 0.15;
- sizes[2] = 0.0;
- times[0] = 0.0;
- times[1] = 0.5;
- times[2] = 1.0;
- };
- datablock ParticleEmitterData(RPK47Tracer)
- {
- ejectionPeriodMS = 2;
- periodVarianceMS = 0;
- ejectionVelocity = 0; //0.25;
- velocityVariance = 0; //0.10;
- ejectionOffset = 0;
- thetaMin = 0.0;
- thetaMax = 30.0;
- particles = RPK47TrailParticle;
- useEmitterColors = true;
- };
- AddDamageType("RPK47",'<bitmap:Add-ons/Weapon_Engineer/CI_RPK47>%1','%2<bitmap:Add-ons/Weapon_Engineer/CI_RPK47> %1',0.2,1);
- datablock ProjectileData(RPK47Projectile){uiName="";
- projectileShapeName="./Models/modernBullet.dts";
- directDamage=48;
- directDamageType=$DamageType::RPK47;
- radiusDamageType=$DamageType::RPK47;brickExplosionRadius=0;
- brickExplosionImpact=true;
- brickExplosionForce=30;brickExplosionMaxVolume=1;
- brickExplosionMaxVolumeFloating=2;
- impactImpulse=60;
- explosion=RPK47bulletExplosion;
- particleEmitter = "RPK47Tracer";
- muzzleVelocity=500;
- verInheritFactor=1;
- lifetime=4000;
- fadeDelay=2000;
- bounceElasticity=0.5;
- bounceFriction=0.2;
- isBallistic=true;
- gravityMod=0.20;
- sound=RPK47WhizSound;
- };
- datablock ItemData(RPK47Item){uiName="RPK47";iconName="./RPK47";
- image=RPK47Image;category=Weapon;className=Weapon;shapeFile="./Models/RPK47Display.dts";
- mass=1;
- density=0.2;
- elasticity=0;
- friction=0.6;
- emap=true;
- doColorShift=true;
- colorShiftColor="1 1 1 1";
- canDrop=true;RPK47reload=1;RPK47maxmag=45;};
- datablock shapeBaseImageData(RPK47Image){shapeFile="./Models/RPK47.dts";
- emap=true;
- correctMuzzleVector=true;className="WeaponImage";
- item=RPK47Item;
- ammo="";
- projectile=RPK47Projectile;
- projectileType=Projectile;
- casing=RPK47ShellDebris;
- shellExitDir="1 0.5 0.5";
- shellExitVariance=10;
- shellVelocity=6;
- melee=false;
- doReaction=false;
- armReady=true;
- doColorShift=true;
- colorShiftColor="1 1 1 1";
- //#########################################################################################
- //#-Sequences- #
- //# #
- //# fire / fire the weapon #
- //# reload / reloads the weapon -clipIn and clipOut combined- #
- //# use / When you equip the weapon -I added this- #
- //# #
- //#########################################################################################
- offset = "0 0.25 0"; //-Left +Right, -Back +Front, -Down +Up
- stateName[0]="Activate";
- stateTimeoutValue[0]=0.6;
- stateTransitionOnTimeout[0]="AmmoCheck";
- stateSequence[0]="use";
- stateSound[0]=RPK47DeploySound;
- stateName[1]="Ready";
- stateTransitionOnTriggerDown[1]="Fire1";
- stateAllowImageChange[1]=true;
- stateTransitionOnNoAmmo[1]="Empty";
- stateName[2]="Fire1";
- stateTransitionOnTimeout[2]="AmmoCheck";
- stateTimeoutValue[2]="0.09";
- stateFire[2]=true;
- stateAllowImageChange[2]=false;
- stateWaitForTimeout[2]=true;
- stateEmitter[2]=RPK47FlashEmitter;
- stateEmitterTime[2]=0.05;
- stateEmitterNode[2]="muzzlePoint";
- stateSound[2]=RPK47FireSound;
- stateScript[2]="onFire1";
- stateEjectShell[2]=true;
- stateSequence[2]="Fire";
- stateName[3]="Fire2";
- stateTransitionOnTimeout[3]="AmmoCheck";
- stateTimeoutValue[3]="0.23";
- stateFire[3]=true;
- stateAllowImageChange[3]=false;
- stateWaitForTimeout[3]=true;
- stateEmitter[3]=RPK47FlashEmitter;
- stateEmitterTime[3]=0.05;
- stateEmitterNode[3]="muzzlePoint";
- stateSound[3]=RPK47FireSound;
- stateScript[3]="onFire2";
- stateEjectShell[3]=true;
- stateSequence[3]="Fire";
- stateName[4]="AmmoCheck";
- stateTransitionOnTimeout[4]="Ready";
- stateAllowImageChange[4]=true;
- stateScript[4]="onAmmoCheck";
- stateName[5]="Reload";
- stateTimeoutValue[5]=0.5;
- stateSequence[5]="Reload1";
- stateTransitionOnTimeout[5]="Reload2";
- stateWaitForTimeout[5]=true;
- stateSound[5]=RPK47Reload1Sound;
- stateAllowImageChange[5]=true;
- stateName[9]="Reload2";
- stateTimeoutValue[9]=1.0;
- stateSequence[9]="Reload2";
- stateTransitionOnTimeout[9]="Cock";
- stateWaitForTimeout[9]=true;
- stateSound[9]=RPK47Reload2Sound;
- stateAllowImageChange[9]=true;
- stateName[10]="Cock";
- stateTimeoutValue[10]=1.0;
- stateSequence[10]="Cock";
- stateTransitionOnTimeout[10]="Done";
- stateWaitForTimeout[10]=true;
- stateSound[10]=RPK47CockSound;
- stateAllowImageChange[10]=true;
- stateName[6]="Done";
- stateTransitionOnTimeout[6]="Ready";
- stateTimeoutValue[6]=0.1;
- stateAllowImageChange[6]=true;
- stateScript[6]="onReload";stateName[7]="Empty";
- stateTransitionOnTriggerDown[7]="EmptyFire";
- stateAllowImageChange[7]=true;
- stateTransitionOnAmmo[7]="Reload";
- stateName[8]="EmptyFire";
- stateTransitionOnTriggerUp[8]="Ready";
- stateTimeoutValue[8]="0.15";
- stateAllowImageChange[8]=false;
- stateWaitForTimeout[8]=true;
- stateSound[8]=RPK47ClickSound;
- };
- datablock shapeBaseImageData(RPK47ImageScoped : RPK47Image)
- {
- offset = "-0.0 0.0 0.0"; //-Left +Right, -Back +Front, -Down +Up
- eyeOffset="0.0 0.0 -0.0"; //-Left +Right, -Back +Front, -Down +Up
- stateName[0]="Activate";
- stateTimeoutValue[0]=0.2;
- stateTransitionOnTimeout[0]="AmmoCheck";
- //stateSequence[0]="Sight";
- stateName[1]="Ready";
- stateTransitionOnTriggerDown[1]="Fire1";
- stateAllowImageChange[1]=true;
- stateTransitionOnNoAmmo[1]="Empty";
- stateSequence[1]="Ready";
- stateName[2]="Fire1";
- stateTransitionOnTimeout[2]="AmmoCheck";
- stateTimeoutValue[2]="0.1";
- stateFire[2]=true;
- stateAllowImageChange[2]=false;
- stateWaitForTimeout[2]=true;
- stateEmitter[2]=RPK47FlashEmitter;
- stateEmitterTime[2]=0.10;
- stateEmitterNode[2]="muzzlePoint";
- stateSound[2]=RPK47FireSound;
- stateScript[2]="onFire1";
- stateEjectShell[2]=true;
- stateSequence[2]="Fire";
- stateName[3]="Fire2";
- stateTransitionOnTimeout[3]="AmmoCheck";
- stateTimeoutValue[3]="0.25";
- stateFire[3]=true;
- stateAllowImageChange[3]=false;
- stateWaitForTimeout[3]=true;
- stateEmitter[3]=RPK47FlashEmitter;
- stateEmitterTime[3]=0.05;
- stateEmitterNode[3]="muzzlePoint";
- stateSound[3]=RPK47FireSound;
- stateScript[3]="onFire2";
- stateEjectShell[3]=true;
- stateSequence[3]="Fire";
- stateName[4]="AmmoCheck";
- stateTransitionOnTimeout[4]="Ready";
- stateAllowImageChange[4]=true;
- stateScript[4]="onAmmoCheck";
- stateName[5]="Reload";
- stateTimeoutValue[5]=0.5;
- stateSequence[5]="Reload";
- stateTransitionOnTimeout[5]="Reload2";
- stateWaitForTimeout[5]=true;
- stateSound[5]=RPK47Reload1Sound;
- stateAllowImageChange[5]=true;
- stateSequence[5]="Reload1";
- stateName[10]="Reload2";
- stateTimeoutValue[10]=1.0;
- stateSequence[10]="Reload2";
- stateTransitionOnTimeout[10]="Cock";
- stateWaitForTimeout[10]=true;
- stateSound[10]=RPK47Reload2Sound;
- stateAllowImageChange[10]=true;
- stateName[11]="Cock";
- stateTimeoutValue[11]=1.0;
- stateSequence[11]="Cock";
- stateTransitionOnTimeout[11]="Done";
- stateWaitForTimeout[11]=true;
- stateSound[11]=RPK47CockSound;
- stateAllowImageChange[11]=true;
- stateName[6]="Done";
- stateTransitionOnTimeout[6]="Ready";
- stateTimeoutValue[6]=0.1;
- stateAllowImageChange[6]=true;
- stateScript[6]="onReload";
- stateName[7]="Empty";
- stateTransitionOnTriggerDown[7]="EmptyFire";
- stateAllowImageChange[7]=true;
- stateTransitionOnAmmo[7]="Reload";
- stateName[8]="EmptyFire";
- stateTransitionOnTriggerUp[8]="Ready";
- stateTimeoutValue[8]="0.15";
- stateAllowImageChange[8]=false;
- stateWaitForTimeout[8]=true;
- stateSound[8]=RPK47ClickSound;
- stateName[9]="ReadyWeap";
- stateSequence[9]="Ready";
- stateTimeoutValue[9]=0.95;
- stateSound[9]=RPK47DeploySound;
- stateTransitionOnTimeout[9]="Ready";
- };
- function RPK47Image::onAmmoCheck(%this,%obj,%slot)
- {
- if(%obj.toolMag[%obj.currTool]<1)
- {
- %obj.toolMag[%obj.currTool]=0;
- }
- if(%obj.toolMag[%obj.currTool]>%this.item.RPK47maxmag)
- {
- %obj.toolMag[%obj.currTool]=%this.item.RPK47maxmag;
- }
- if(%obj.toolMag[%obj.currTool]<1)
- {
- %obj.toolMag[%obj.currTool]=0;%obj.setImageAmmo(0,0);
- }
- }
- function RPK47Image::onReload(%this,%obj,%slot)
- {
- %obj.toolMag[%obj.currTool]=%this.item.RPK47maxmag;%obj.setImageAmmo(0,1);
- }
- function RPK47Image::onFire1(%this,%obj,%slot)
- {
- %obj.toolMag[%obj.currTool]-=1;if(%obj.toolMag[%obj.currTool]<1)
- {
- %obj.toolMag[%obj.currTool]=0;%obj.setImageAmmo(0,0);
- }
- RPK47Fire(%this,%obj,%slot,0.0015,1,0.02);
- }
- function RPK47Image::onFire2(%this,%obj,%slot)
- {
- %obj.toolMag[%obj.currTool]-=1;
- if(%obj.toolMag[%obj.currTool]<1)
- {
- %obj.toolMag[%obj.currTool]=0;%obj.setImageAmmo(0,0);
- }
- RPK47Fire(%this,%obj,%slot,0.0030,1,0.04);
- }
- function RPK47Image::onMount(%this,%obj,%slot)
- {
- if(%obj.toolMag[%obj.currTool]$="")
- {
- %obj.toolMag[%obj.currTool]=%this.item.RPK47maxmag;
- }
- parent::onMount(%this,%obj,%slot);
- %obj.hideNode("LHand");
- %obj.hideNode("RHand");
- %obj.hideNode("LHook");
- %obj.hideNode("RHook");
- }
- function RPK47Image::onUnMount(%this,%obj,%slot)
- {
- parent::onUnMount(%this,%obj,%slot);
- %obj.unhideNode("ALL");
- if(isObject(%obj.client))
- {
- %obj.client.applyBodyParts();
- %obj.client.applyBodyColors();
- }
- else{applyDefaultCharacterPrefs(%obj);
- }
- %obj.client.setControlCameraFov(90);
- }
- function RPK47ImageScoped::onAmmoCheck(%this,%obj,%slot)
- {
- if(%obj.toolMag[%obj.currTool]<1)
- {
- %obj.toolMag[%obj.currTool]=0;
- }
- if(%obj.toolMag[%obj.currTool]>%this.item.RPK47maxmag)
- {
- %obj.toolMag[%obj.currTool]=%this.item.RPK47maxmag;
- }
- if(%obj.toolMag[%obj.currTool]<1)
- {
- %obj.toolMag[%obj.currTool]=0;
- %obj.setImageAmmo(0,0);
- }
- }
- function RPK47ImageScoped::onReload(%this,%obj,%slot)
- {
- %obj.toolMag[%obj.currTool]=%this.item.RPK47maxmag;
- %obj.setImageAmmo(0,1);
- }
- function RPK47ImageScoped::onFire1(%this,%obj,%slot)
- {
- %obj.toolMag[%obj.currTool]-=1;
- if(%obj.toolMag[%obj.currTool]<1)
- {
- %obj.toolMag[%obj.currTool]=0;
- %obj.setImageAmmo(0,0);
- }
- RPK47Fire(%this,%obj,%slot,0.0015,1,0.02);
- }
- function RPK47ImageScoped::onFire2(%this,%obj,%slot)
- {
- %obj.toolMag[%obj.currTool]-=1;
- if(%obj.toolMag[%obj.currTool]<1)
- {
- %obj.toolMag[%obj.currTool]=0;
- %obj.setImageAmmo(0,0);
- }
- RPK47Fire(%this,%obj,%slot,0.0030,1,0.04);
- }
- function RPK47ImageScoped::onUnMount(%this,%obj,%slot)
- {
- parent::onUnMount(%this,%obj,%slot);
- %obj.unhideNode("ALL");
- if(isObject(%obj.client))
- {
- %obj.client.applyBodyParts();
- %obj.client.applyBodyColors();
- }
- else{applyDefaultCharacterPrefs(%obj);
- }
- %obj.client.setControlCameraFov(90);
- }
- function RPK47Projectile::onCollision(%this,%obj,%col,%fade,%pos,%norm)
- {
- if(%col.getClassName()$="WheeledVehicle"||%col.getClassName()$="FlyingVehicle")serverPlay3D(RPK47MetalHitSound,%obj.getTransform());
- else{serverPlay3D(RPK47HitSound,%obj.getTransform());
- }
- parent::onCollision(%this,%obj,%col,%fade,%pos,%norm);
- }
- function RPK47Fire(%this,%obj,%slot,%spread,%shellcount,%recoil)
- {
- if(%obj.isCrouched()==1){%spread=%spread-0.00001;%recoil=%recoil/2;
- }
- if(vectorLen(%obj.getVelocity()) >= 0.1 && !isObject(%obj.getObjectMount()))
- {
- %spread=%spread+0.0001;}%vector=%obj.getMuzzleVector(%slot);%p=new Projectile()
- {
- dataBlock=RPK47Recoil;initialVelocity=%obj.getVelocity();
- initialPosition=%obj.getEyePoint();
- sourceObject=%obj;sourceSlot=%slot;client=%obj.client;};
- for(%shell=0;%shell<%shellcount;
- %shell++){%x=(getRandom()-0.5)*5.415926*%spread;
- %y=(getRandom()-0.5)*5.415926*%spread;
- %z=(getRandom()-0.5)*5.415926*%spread;
- %p=new Projectile(){dataBlock=RPK47Projectile;
- initialVelocity=MatrixMulVector(MatrixCreateFromEuler(%x@" "@%y@" "@%z),VectorScale(%obj.getMuzzleVector(%slot),RPK47Projectile.muzzleVelocity));
- initialPosition=%obj.getMuzzlePoint(%slot);
- sourceObject=%obj;sourceSlot=%slot;
- client=%obj.client;};
- MissionCleanup.add(%p);
- }
- if(isObject(%obj.getObjectMount()))
- {
- return %p;}%a=%obj.getTransform();
- %rnd=getRandom(1);if(%rnd==1)
- {
- %recoil=%recoil*-1;
- }
- %obj.setTransform(getWord(%a,0)@" "@getWord(%a,1)@" "@getWord(%a,2)@" "@getWord(%a,3)@" "@getWord(%a,4)@" "@getWord(%a,5)@" "@getWord(%a,6)+%recoil);
- return %p;}package RPK47
- {
- function GameConnection::onDeath(%this,%killerPlayer,%killer,%damageType,%damageLoc)
- {
- %this.player.client.setControlCameraFov(90);
- parent::onDeath(%this,%killerPlayer,%killer,%damageType,%damageLoc);
- }
- function Armor::onTrigger(%this,%player,%slot,%val){if(isObject(%player.getMountedImage(0)))
- {
- %item=%player.getMountedImage(0).getName();if((%item $= "RPK47Image" || %item $= "RPK47ImageScoped") && %slot $= 4 && %val)
- {
- if(%item$="RPK47Image"){%player.mountImage(RPK47ImageScoped,0);
- %player.client.setControlCameraFov(80);
- }
- if(%item$="RPK47ImageScoped")
- {
- %player.mountImage(RPK47Image,0);
- %player.client.setControlCameraFov(90);
- }
- }
- else{parent::onTrigger(%this,%player,%slot,%val);
- }
- }
- else{parent::onTrigger(%this,%player,%slot,%val);
- }
- }
- function Player::pickUp(%this,%item)
- {
- %data=%item.dataBlock;
- %mag=%item.mag;
- %status=parent::pickUp(%this,%item);
- if(!%status==1)
- {
- return %status;}
- %slot=-1;
- for(%i=0;%i<%this.dataBlock.maxTools;%i++)
- if(isObject(%this.tool[%i])&&%this.tool[%i].getID()==%data.getID()){%slot=%i;break;
- }
- if(%slot == -1)
- {
- return %val;
- }
- if(%mag $= "")
- {
- %this.toolMag[%slot]=%data.RPK47maxmag;
- }
- else%this.toolMag[%slot]=%mag;
- }
- function serverCmdDropTool(%client,%slot)
- {
- if(!isObject(%client.player))
- {
- return parent::serverCmdDropTool(%client,%slot);
- }
- $weaponMag=%client.player.toolMag[%client.player.currTool];
- %client.player.toolMag[%client.player.currTool]="";
- return parent::serverCmdDropTool(%client,%slot);
- }
- function ItemData::onAdd(%this,%obj){if($weaponMag!$="")
- {
- %obj.mag=$weaponMag;$weaponMag="";
- }
- parent::onAdd(%this,%obj);
- }
- function serverCmdLight(%client)
- {
- %player=%client.player;
- %image=%player.getMountedImage(0);
- if(%image.item.RPK47reload)
- {
- if(%player.getImageState(0)$="Ready"||%player.getImageState(0)$="Empty")
- {
- if(%player.toolMag[%player.currTool]<%image.item.RPK47maxmag)
- {
- %player.setImageAmmo(0,0);
- %player.Schedule(50,setImageAmmo,0,1);
- }
- else{parent::serverCmdLight(%client);
- }
- }
- return;}parent::serverCmdLight(%client);
- }
- }
- ;activatePackage(RPK47);
- function RPK47Image::onUnMount(%this,%obj,%slot)
- {
- parent::onUnMount(%this,%obj,%slot);
- %obj.unhideNode("ALL");
- crossHair.setBitmap("base/client/ui/crosshair.png");
- if(isObject(%obj.client))
- {
- %obj.client.applyBodyParts();
- %obj.client.applyBodyColors();
- }
- else{applyDefaultCharacterPrefs(%obj);
- }
- %obj.client.setControlCameraFov(90);
- }
- function RPK47ImageScoped::onUnMount(%this,%obj,%slot)
- {
- parent::onUnMount(%this,%obj,%slot);
- %obj.unhideNode("ALL");
- crossHair.setBitmap("base/client/ui/crosshair.png");
- if(isObject(%obj.client))
- {
- %obj.client.applyBodyParts();
- %obj.client.applyBodyColors();
- }
- else{applyDefaultCharacterPrefs(%obj);
- }
- %obj.client.setControlCameraFov(90);
- }
- function RPK47ImageScoped::onMount(%this,%obj,%slot)
- {
- if(%obj.toolMag[%obj.currTool]$="")
- {
- %obj.toolMag[%obj.currTool]=%this.item.RPK47maxmag;
- }
- crossHair.setBitmap("base/client/ui/crosshair.png");
- parent::onMount(%this,%obj,%slot);
- %obj.hideNode("LHand");
- %obj.hideNode("RHand");
- %obj.hideNode("LHook");
- %obj.hideNode("RHook");
- }
- function RPK47Image::onMount(%this,%obj,%slot)
- {
- if(%obj.toolMag[%obj.currTool]$="")
- {
- %obj.toolMag[%obj.currTool]=%this.item.RPK47maxmag;
- }
- crossHair.setBitmap("base/client/ui/crosshair.png");
- parent::onMount(%this,%obj,%slot);
- %obj.hideNode("LHand");
- %obj.hideNode("RHand");
- %obj.hideNode("LHook");
- %obj.hideNode("RHook");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement