Dragonpriest4
The Destroyer
The error tells you the line number. That parameter is the tileid, remember that we get mod tile tileid by calling mod.TileType("name"), right?
I did that but now I get this error
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(69,202) : error CS0120: An object reference is required for the non-static field, method, or property 'Terraria.ModLoader.ModWorld.mod.get'
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(69,5) : error CS1502: The best overloaded method match for 'Terraria.WorldGen.OreRunner(int, int, double, int, ushort)' has some invalid arguments
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\EpicnessWorld.cs(69,202) : error CS1503: Argument 5: cannot convert from 'int' to 'ushort'
Here is the code
Code:
using System.IO;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.World.Generation;
using Microsoft.Xna.Framework;
using System;
namespace EpicnessMod
{
public class EpicnessWorld : ModWorld
{
private const int saveVersion = 0;
public static bool downedDarkNebula = false;
public static int DarkNebulaDefeated;
public const int MSG_BLESS = 1;
//public struct EpicnessMsgs
//{
public static string[] misc = {"Your world has been infected with Corrupt Ore!"};
//}
public override void Initialize()
{
downedDarkNebula = false;
}
public override void SaveCustomData(BinaryWriter writer)
{
writer.Write(saveVersion);
byte flags = 0;
writer.Write(DarkNebulaDefeated);
if (downedDarkNebula)
{
flags |= 1;
}
writer.Write(flags);
}
public override void LoadCustomData(BinaryReader reader)
{
reader.ReadInt32();
DarkNebulaDefeated = reader.ReadInt32();
byte flags = reader.ReadByte();
downedDarkNebula = ((flags & 1) == 1);
}
#region Bless() : void [STATIC]
public static void Bless()
{
if (Main.netMode == 1) return;
DarkNebulaDefeated++;
int amount = 0;
double num5;
num5 = Main.rockLayer;
int xloc = -100 + Main.maxTilesX - 100;
int yloc = -(int)num5 + Main.maxTilesY - 200;
int sum = xloc * yloc;
amount = (int)(sum / 10000) * 10;
if (DarkNebulaDefeated == 1)
{
if (DarkNebulaDefeated == 1)
{
for(int zz = 0; zz < amount; zz++)
{
int i2 = WorldGen.genRand.Next(100, Main.maxTilesX - 100);
double num6;
num6 = Main.rockLayer;
int j2 = WorldGen.genRand.Next((int)num6, Main.maxTilesY - 200);
WorldGen.OreRunner(i2, j2, (double)WorldGen.genRand.Next(WorldGen.genRand.Next(2, 4), WorldGen.genRand.Next(4, 7)), WorldGen.genRand.Next(WorldGen.genRand.Next(3, 5), WorldGen.genRand.Next(4, 8)), mod.TileType ("CorruptOre"));
}
if (Main.netMode == 0)
Main.NewText(EpicnessWorld.misc[1], 80, 65, 130);
else if (Main.netMode == 2)
NetMessage.SendData(25, -1, -1, EpicnessWorld.misc[1], 255, 80f, 65f, 130f, 0);
}
}
}
#endregion
}
}