Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Magic;
- namespace PBTrainer
- {
- class WeaponEditor
- {
- /*
- * Editor de armas do PointBlank
- * Criado por Drizer
- * (c) 2012
- */
- static uint ReadPointer(BlackMagic bmagic, uint pointerAddr, uint[] offsets, uint nOffset = 0)
- {
- // ler um pointer estático.
- uint currAddr = pointerAddr;
- foreach (uint offset in offsets)
- {
- try
- {
- currAddr = (bmagic.ReadUInt(currAddr)) + offset;
- }
- catch (Exception)
- {
- };
- };
- return (currAddr) + nOffset;
- }
- public WeaponEditor(BlackMagic magic, uint weapAddr, uint[] offsets)
- {
- // instancia o blackmagic, e o address.
- uint weapPt = ReadPointer(magic, weapAddr, offsets);
- WeaponAddress = weapPt - 8;
- mMagic = magic;
- }
- public uint WeaponAddress;
- private BlackMagic mMagic;
- private int mDamage = -23981;
- private int mWeight = -23981;
- private int mReload = -23981;
- private int mBullets = -23981;
- private int mRecoilV = -23981;
- private int mRecoilH = -23981;
- private int mNoSpread = -23981;
- private int mAcr = -23981;
- public void Update()
- {
- /*
- * Valores exatos (offsets) para a structs das armas.
- * +[8,50,2555,2569,2635,2643,2651,2667]
- */
- if (mDamage != -23981)
- {
- mMagic.WriteByte(WeaponAddress + 8, (byte)mDamage); // Dano
- };
- if (mWeight != -23981)
- {
- mMagic.WriteByte(WeaponAddress + 50, (byte)mWeight); // Peso
- }
- if (mReload != -23981)
- {
- mMagic.WriteByte(WeaponAddress + 2555, (byte)mReload); // Velocidade de recarga
- }
- if (mBullets != -23981)
- {
- mMagic.WriteByte(WeaponAddress + 2569, (byte)mBullets); // Munição
- }
- if (mRecoilV != -23981)
- {
- mMagic.WriteByte(WeaponAddress + 2643, (byte)mRecoilV); // Recuo v
- }
- if (mRecoilH != -23981)
- {
- mMagic.WriteByte(WeaponAddress + 2651, (byte)mRecoilH); // Recuo h
- }
- if (mNoSpread != -23981)
- {
- mMagic.WriteByte(WeaponAddress + 2635, (byte)mNoSpread); // No Spread
- };
- if (mAcr != -23981)
- {
- mMagic.WriteByte(WeaponAddress + 2667, (byte)mAcr); // Precisao
- }
- }
- public void SetDamage(int val)
- {
- mDamage = val;
- }
- public void SetWeight(int val)
- {
- mWeight = val;
- }
- public void SetAcr(int val)
- {
- mAcr = val;
- }
- public void SetReloadTime(int val)
- {
- mReload = val;
- }
- public void InfBullets()
- {
- mBullets = 100;
- }
- public void NoRecoil()
- {
- mRecoilH = 0;
- mRecoilV = 0;
- }
- public void NoSpread()
- {
- mNoSpread = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement