| Blockland Forums > Help |
| Make this a playertype |
| (1/1) |
| Mocha Furrier:
I got this leaper zombie code, but i want you to modify it: Make it not give the player zombie colored skin, make it easily modifyable, and send the package as private for me. Thanks! --- Code: ---function ZombieLeaperArmor::onCollision(%this, %obj, %col, %pos, %vel) { if(%vel > 12 && zombieValidTarget(%obj, %col)) { %dist = mCeil(vectorDist(%obj.zombieLeapPos, %obj.getPosition())); %mini = getMiniGameFromObject(%obj); if(%obj.zombieOnFire()) { %damagetype = $DamageType::BurningLeaper; %damage = mFloor(%vel * 0.862) * mFloor(%dist / 22); %damage = (zombieGameSetUpRight(%mini) ? mDirMod(%damage * 0.75, %damage * 1.25, %mini) : %damage); %damage = mFloor(%damage); if(%damage > 75) { %damage = 75; } } else { %damagetype = $DamageType::LeaperJump; %damage = mFloor(%vel * 0.475) * mFloor(%dist / 18); %damage = (zombieGameSetUpRight(%mini) ? mDirMod(%damage * 0.5, %damage * 1.0, %mini) : %damage); %damage = mFloor(%damage); if(%damage > 50) { %damage = 50; } } if(%damage > 0) { if(%damage >= 15 && !zombieBot(%col)) { %usedTool = %col.currTool; if(%usedTool == -1) { for(%a = 0; %a < 10; %a++) { if(isObject(%col.tool[%a])) { %usedTool = %a; break; } } } if(%usedTool != -1) { serverCmdDropTool(%col.client, %usedTool); %obj.playThread(0, 'root'); commandToClient(%col.client, 'centerPrint', "<font:impact:32>*POUNCED*\n<font:impact:16>A Leaper caused you to drop your weapon!!", 2.5); if(!zombieBot(%obj)) { commandToClient(%obj.client, 'centerPrint', "<font:impact:32>*CRUNCH*\n<font:impact:16>" @ %damage @ " damage + weapon lost!", 1.5); } } else if(!zombieBot(%obj)) { commandToClient(%obj.client, 'centerPrint', "<font:impact:32>*CRUNCH*\n<font:impact:16>" @ %damage @ " damage!", 1.5); } } else if(!zombieBot(%obj)) { commandToClient(%obj.client, 'centerPrint', "<font:impact:32>*CRUNCH*\n<font:impact:16>" @ %damage @ " damage!", 1.5); } serverPlay3D(ZombieCrunchSound, %pos); %col.damage(%obj, %pos, %damage, %damagetype); } } return parent::onCollision(%this, %obj, %col, %pos, %vel); } function ZombieLeaperArmor::onImpact(%this, %obj, %col, %vel, %z) { return parent::onImpact(%this, %obj, %col, %vel, %z); } function ZombieLeaperArmor::zombieDetectRoute(%this, %obj, %canSee, %dist, %reach, %zDist, %hCol, %lCol, %hHit, %lhit, %fhit) { if(%canSee && %dist > (%reach * 3) && %obj.getEnergyLevel() >= 50) { return "special"; } else { return parent::zombieDetectRoute(%this, %obj, %canSee, %dist, %reach, %zDist, %hCol, %lCol, %hHit, %lhit, %fhit); } } function ZombieLeaperArmor::zombieSpecial(%this, %obj) { %energy = %obj.getEnergyLevel(); if(%obj.isCrouched() || zombieBot(%obj)) { if(%energy >= 50) { %start = %obj.getPosition(); %end = vectorSub(%start, "0 0 2"); %masks = ($TypeMasks::FxBrickObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::StaticObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::VehicleObjectType); %ground = getWord(containerRayCast(%start, %end, %masks, %obj), 0); if(isObject(%ground)) { %canJump = true; } else { %end = vectorSub(%start, %obj.getForwardVector()); %ground = getWord(containerRayCast(%start, %end, %masks, %obj), 0); if(isObject(%ground)) { %canJump = true; } } if(%canJump) { %aimVec = %obj.zombieAimVec(); %obj.setVelocity(vectorScale(%aimVec, 40)); %obj.setEnergyLevel(%energy - 50); %obj.playThread(2, "jump"); %obj.zombieLeapPos = %obj.getPosition(); return true; } } } else { commandToClient(%obj.client, 'centerPrint', "<font:impact:16>Crouch before Jumping", 1.5); } return false; } --- End code --- |
| Mocha Furrier:
And make it a playertype. |
| Butler:
This belongs in General Modification Help. |
| Mocha Furrier:
--- Quote from: Butler on July 31, 2012, 12:47:10 PM ---This belongs in General Modification Help. --- End quote --- true. Could someone move it? |
| Butler:
Just copy the OP, lock the thread then paste it into a new thread in General Modification Help. |
| Navigation |
| Message Index |