Having an issue getting ore and wood elementals to spawn. We added some custom materials into our server and I was trying to add in gargoyle's axe and gargoyle's knife using the Daat stuff as a baseline. Gargoyle knives work fine, however pickaxes and lumberjacks axes aren't bringing any elementals. I am running on the latest repo and the newest client
From my mining.cs
And from my lumberjacking.cs
If anyone could point me in the right direction of what i might be missing here it'd be greatly appreciated.
The materials work really well as far as crafting with them, and harvesting them regularly. They show up in bods, the name shows up when i craft with them and scroll over etc.... it's JUST gargoyle tools right now that i cannot get to work. I've been pulling my hair out for days trying to figure out what i'm missing here.
From my mining.cs
mining.cs:
public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
{
if (tool is GargoylesPickaxe && def == this.m_OreAndStone && 0.1 > Utility.RandomDouble() && HarvestMap.CheckMapOnHarvest(from, harvested, def) == null)
{
HarvestResource res = vein.PrimaryResource;
if (res == resource && res.Types.Length >= 3)
{
try
{
Map map = from.Map;
if (map == null)
return;
BaseCreature spawned = Activator.CreateInstance(res.Types[2], new object[] { 25 }) as BaseCreature;
if (spawned != null)
{
int offset = Utility.Random(8) * 2;
for (int i = 0; i < m_Offsets.Length; i += 2)
{
int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if (map.CanSpawnMobile(x, y, from.Z))
{
spawned.OnBeforeSpawn(new Point3D(x, y, from.Z), map);
spawned.MoveToWorld(new Point3D(x, y, from.Z), map);
spawned.Combatant = from;
return;
}
else
{
int z = map.GetAverageZ(x, y);
if (Math.Abs(z - from.Z) < 10 && map.CanSpawnMobile(x, y, z))
{
spawned.OnBeforeSpawn(new Point3D(x, y, z), map);
spawned.MoveToWorld(new Point3D(x, y, z), map);
spawned.Combatant = from;
return;
}
}
}
spawned.OnBeforeSpawn(from.Location, from.Map);
spawned.MoveToWorld(from.Location, from.Map);
spawned.Combatant = from;
}
}
catch
{
}
}
}
}
And from my lumberjacking.cs
lumberjacking.cs:
public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
{
if (tool is GargoylesAxe && def == this.m_Definition && 0.9 > Utility.RandomDouble() && HarvestMap.CheckMapOnHarvest(from, harvested, def) == null)
{
HarvestResource res = vein.PrimaryResource;
if (res == resource && res.Types.Length >= 3)
{
try
{
Map map = from.Map;
if (map == null)
return;
BaseCreature spawned = Activator.CreateInstance(res.Types[1], new object[] { 25 }) as BaseCreature;
if (spawned != null)
{
int offset = Utility.Random(8) * 2;
for (int i = 0; i < m_Offsets.Length; i += 2)
{
int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if (map.CanSpawnMobile(x, y, from.Z))
{
spawned.MoveToWorld(new Point3D(x, y, from.Z), map);
spawned.Combatant = from;
return;
}
else
{
int z = map.GetAverageZ(x, y);
if (map.CanSpawnMobile(x, y, z))
{
spawned.MoveToWorld(new Point3D(x, y, z), map);
spawned.Combatant = from;
return;
}
}
}
spawned.MoveToWorld(from.Location, from.Map);
spawned.Combatant = from;
}
}
catch
{
}
}
}
}
If anyone could point me in the right direction of what i might be missing here it'd be greatly appreciated.
The materials work really well as far as crafting with them, and harvesting them regularly. They show up in bods, the name shows up when i craft with them and scroll over etc.... it's JUST gargoyle tools right now that i cannot get to work. I've been pulling my hair out for days trying to figure out what i'm missing here.