OutdatedMega-Thread - All Tutorials In One Thread

Posts 1–15 of 17 · Page 1 of 2
Mega-Thread - All Tutorials In One Thread
I'll be personally adding ALL tutorials to this thread within the next 24hrs, I'll also add a list of current releases if you'd like!


Firstly it's important to understand that for most of the things on this thread you're going to need the following tools:
Net Reflector: Download Here - or you can just find a "Free" version on google!
Reflexil: Download Here 100% free to download and use!
Now that you have those two you could also get Visual basic's to help you read the code but it's not NEEDED.

Repetitive tasks
 
Compiling

When compiling you're going to need to select compiler version "Unity/Silverlight" or you'll get errors!


 
Saving

To save your assembly you'll need to right click on "Assemblycsharp.dll" in reflector, now down to reflexil, save as and save it.




Tutorials

 
Unlimited stamina
Backup AssemblyCsharp.dll and then open it in reflector
Open tools and click reflexil (if not already open)
Find "CodeHatch.Thrones.Stamina"

Inside that find "StaminaManager"

Inside that find "Update()"

Right click in instructions on the right and click "Replace all with code"

Replace this selection

with this code
Code:
public void Update()
{
    this._stamina += this.StaminaRecovery;
}
So now you have this

Open Field stubs and comment out StaminaTimer Timer; with two / (//) like so

Compile, Save the Assembly and test in-game.

 
No Taxes

Backup AssemblyCsharp.dll and then open it in reflector
Open tools and click reflexil (if not already open)
Find "CodeHatch.Thrones.Tax"

Find "TaxCollector"

Find "IsTaxed(Player)"

Right click in instructions on the right and click "Replace all with code"

Replace this selection

with this code
Code:
        static bool IsTaxed(CodeHatch.Engine.Networking.Player player)
        {
            return false;
        }
So now you have this

Open Method stubs and comment out the following area's with two / (//)

Now you should have this

Next open "Field stubs" and comment out

Like so

Compile, Save the Assembly and test in-game.

 
Rapid Resources

Backup AssemblyCsharp.dll and then open it in reflector
Open tools and click reflexil (if not already open)
Open "-"

Find "Resource Handler"

Find "AddPending(ResourceAmount)"

Right click in instructions on the right and click "Replace all with code"

SELECT ALL THE CODE

Replace all the code with the following code
 
CODE
Code:
#region " Imports "
using System;
using System.Collections.Generic;
using System.Text;
using CodeHatch;
using CodeHatch.Engine.Core.Cache;
using CodeHatch.Inventory.Blueprints;
using CodeHatch.Networking.Events;
using CodeHatch.Networking.Events.Item;
using System.Linq;
using System.Runtime.CompilerServices;
using UnityEngine;
#endregion 

#region " Referenced assemblies "
// - UnityEngine v0.0.0.0
// - mscorlib v2.0.0.0
// - uLink v0.0.0.0
// - System.Core v3.5.0.0
// - System v2.0.0.0
// - Newtonsoft.Json v4.5.0.0
// - SteamworksManaged v1.0.0.0
// - ICSharpCode.SharpZipLib v0.86.0.518
// - JsonFx.Json v1.4.1003.3008
// - Ionic.Zip.Reduced v1.9.1.9000
// - protobuf-net v2.0.0.668
// - POpusCodec v1.0.0.0
// - NSpeex v1.1.3.0
// - KGFUtils.Settings v1.0.4512.18287
// - SmartAssembly.Attributes v6.0.0.0
// - mscorlib v2.0.5.0
// - Assembly-CSharp v0.0.0.0
// - Assembly-CSharp v0.0.0.0
#endregion 

class ResourceHandler
{
    // Limited support!
    // You can only reference methods or fields defined in the class (not in ancestors classes)
    // Fields and methods stubs are needed for compilation purposes only.
    // Reflexil will automaticaly map current type, fields or methods to original references.
    public void AddPending(ResourceAmount resource)
    {
        if (resource.Amount != 0f)
        {
            if (this.BeforeResourceAdded != null)
            {
                this.BeforeResourceAdded(resource);
            }
            if (this._pendingResourceChanges.ContainsKey(resource.resourceType))
            {
            Dictionary<ResourceType, float> dictionary = null;
            ResourceType resourceType = resource.resourceType;
            float num = dictionary[resourceType];
            (dictionary = this._pendingResourceChanges)[resourceType = resource.resourceType] = num + (resource.Amount);
              }
              else if (resource.resourceType == ResourceType.Stone)
              {
              this._pendingResourceChanges.Add(resource.resourceType, 10000f);
              }
              else
              {
              this._pendingResourceChanges.Add(resource.resourceType, 1000f);
              }
        }
    }

    
    #region " Fields stubs "
    // Do not add or update any field. If compilation fails because of a field declaration, comment it
    System.Action<ResourceAmount> BeforeResourceAdded;
    float UpdateRate;
    float updateTimer;
    System.Collections.Generic.Dictionary<CodeHatch.ResourceType, float> _pendingResourceChanges;
    #endregion 
}

Compile, Save the Assembly and test in-game.
 
Added Notes

Within this code the section here
Code:
              else if (resource.resourceType == ResourceType.Stone)
              {
              this._pendingResourceChanges.Add(resource.resourceType, 10000f);
              }
              else
              {
              this._pendingResourceChanges.Add(resource.resourceType, 1000f);
You can change the receive resources amount for specific items, for example 10000 wood from one hit could be done like so
Code:
              else if (resource.resourceType == ResourceType.Wood)
              {
              this._pendingResourceChanges.Add(resource.resourceType, 10000f);
              }
              else
              {
              this._pendingResourceChanges.Add(resource.resourceType, 1000f);
You could also set values for mutliple resource types like so
Code:
              else if (resource.resourceType == ResourceType.Stone)
              {
              this._pendingResourceChanges.Add(resource.resourceType, 10000f);
              }
              else if (resource.resourceType == ResourceType.Stick)
              {
              this._pendingResourceChanges.Add(resource.resourceType, 5000f);
              }
              else
              {
              this._pendingResourceChanges.Add(resource.resourceType, 1000f);
Here is a list of other resource types that you could edit
Code:
        Wood,
        Stone,
        Metal,
        Granite,
        Marble,
        Oil,
        Plastic,
        Glass,
        Aluminum,
        Titanium,
        Sand,
        Dirt,
        IronOre,
        OilShale,
        Clay,
        Gravel,
        SandStone,
        TitaniumOre,
        ObsidianOre,
        Sulphur,
        VoltronicOre,
        SaltexOre,
        GarrisonOre,
        CrystalisOre,
        DarkMatterShale,
        IronIngot,
        SteelIngot,
        TitaniumIngot,
        GrapheneIngot,
        MonolithiumIngot,
        SaltexPowder,
        ObsidianPowder,
        DarkPowder,
        Steel,
        Graphene,
        Monolithium,
        DarkSulphur,
        Antimatter,
        Water,
        Fiber,
        RawMeat,
        Grass,
        Grain,
        Charcoal,
        Wool,
        Fat,
        Bone,
        Heart,
        Blood,
        BearHide,
        LeatherHide,
        RawBird,
        Flowers,
        Roses,
        Stick,
        Bread,
        CookedMeat,
        CookedBird,
        Apple,
        Berry,
        Cabbage,
        Carrot,
        PlayerHead,
        BrownBeans,
        BatWing,
        DeerSkin,
        DuckFeet,
        Fang,
        Feather,
        Flax,
        Fuse,
        Liver,
        RabbitPelt,
        Diamond,
        GodTears,
        WolfPelt,
        StoneBlock,
        BakedClay,
        FireWater,
        BurntMeat,
        BurntBird,
        Count
    }
}
namespace CodeHatch
{
    using System;

    public enum ResourceType
    {
        Wood,
        Stone,
        Metal,
        Granite,
        Marble,
        Oil,
        Plastic,
        Glass,
        Aluminum,
        Titanium,
        Sand,
        Dirt,
        IronOre,
        OilShale,
        Clay,
        Gravel,
        SandStone,
        TitaniumOre,
        ObsidianOre,
        Sulphur,
        VoltronicOre,
        SaltexOre,
        GarrisonOre,
        CrystalisOre,
        DarkMatterShale,
        IronIngot,
        SteelIngot,
        TitaniumIngot,
        GrapheneIngot,
        MonolithiumIngot,
        SaltexPowder,
        ObsidianPowder,
        DarkPowder,
        Steel,
        Graphene,
        Monolithium,
        DarkSulphur,
        Antimatter,
        Water,
        Fiber,
        RawMeat,
        Grass,
        Grain,
        Charcoal,
        Wool,
        Fat,
        Bone,
        Heart,
        Blood,
        BearHide,
        LeatherHide,
        RawBird,
        Flowers,
        Roses,
        Stick,
        Bread,
        CookedMeat,
        CookedBird,
        Apple,
        Berry,
        Cabbage,
        Carrot,
        PlayerHead,
        BrownBeans,
        BatWing,
        DeerSkin,
        DuckFeet,
        Fang,
        Feather,
        Flax,
        Fuse,
        Liver,
        RabbitPelt,
        Diamond,
        GodTears,
        WolfPelt,
        StoneBlock,
        BakedClay,
        FireWater,
        BurntMeat,
        BurntBird,
NOTE: Some of these have not been tested and may have bad effects on the server/client, use at own risk





More tutorials will be added tomorrow, PM me any guides you'd like me to add that you've written, add my skype for any help!
Nice man! Gonna figure out how to do some things that i want

VOTE FOR STICKY!
Quote Originally Posted by goldenstyle View Post
Nice man! Gonna figure out how to do some things that i want

VOTE FOR STICKY!
Haha! Thanks man!, Hopefully this does get a sticky so that people can find it easily when this section gets busier!
If ANYONE needs anything you can contact me on Skype and I'll receive your message in college!
Great to see you giving back what you learned around the forums, on your own and with golden boy. Hope this gets stickied to help newcomers!
Ty soo much !!!!! i prefer tutorial with pics than the freaking hack it self.. gotta work for it ya know what i mean? ty soo much brah
when i compile stamine i get a error. it want a class a reference or something.
when i compile stamine i get a error. < yeah me too stamina can't compile 'EntityRigidbodyManager get_Manager()' get_manager this error 61line
Quote Originally Posted by devprogrammer112 View Post
I vote for sticky too, but could you please add credits to their respectful authors?
I would gladly provide credits to the respective coders, except technically speaking I'm not releasing anything and the tutorial is in my own words.
If you'd like to be credited for the resource section then just say so and I'll do it.

- - - Updated - - -

Quote Originally Posted by kkmzzang89 View Post
when i compile stamine i get a error. < yeah me too stamina can't compile 'EntityRigidbodyManager get_Manager()' get_manager this error 61line
Check back and make sure you've not made any mistakes.
I vote for sticky too, but could you please add credits to their respectful authors?
Why does my code always reset even after I compile it? Please help!
Quote Originally Posted by Salads47 View Post
First of all thank you for the tutorials!

I'm wondering the in-depth of why some variables aren't able to be used anymore?

In this case, the
Code:
StaminaTimer Timer;
and
Code:
this.Stamina
aren't able to be used anymore... why is this?

imgur.com/NdwNLkG.png
I think it's because of a missing method or namespace because of the IL Editor.

- - - Updated - - -

Quote Originally Posted by BadgerOnViagra View Post
Why does my code always reset even after I compile it? Please help!
You need to compile it then save the dll and reopen it
Anyone got an idea of where the damage modifier is in the Assembly, I have found a bunch of coding about "Damage" but it all leads to no good, at least of what ive tested?
First of all thank you for the tutorials!

I'm wondering the in-depth of why some variables aren't able to be used anymore?

In this case, the
Code:
StaminaTimer Timer;
and
Code:
this.Stamina
aren't able to be used anymore... why is this?

imgur.com/NdwNLkG.png
Sorry for gravedigging but will this still work after the updates?
when useing the moded file it just loads up to a black screen and stays there so its not working any more
Posts 1–15 of 17 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us