demented
Member
Hello All,
I am working on a new Custom OWLTR release and am finding myself a bit stuck atm...
What I am attempting to do Like Daat's OWLTR is make it so the Player..Mines or Lumberjaxes Different Resources from a Harvest Vien Via the Harvest system.. So this way a player cant just sit and camp out on a Harvest Vein..In Daat's System he makes the option to Have it available or Not..I'm attempting to Make It Already Built in..so it just does it..Not the Option to Do it...So far this is what i have Figured out...
With Daat's System He Has This:
This seems to Check the players Skill and if the vein is Prospected..and using OOP Design "daatHarvesting" which calls to the resource Helper file and then there is this line :
This Part am Not 100% Sure but seems to Mine the ore and Lumber and if packs Full places at your feet
what i have done is this....
But after Testing I only seem to Get Normal Resource Like Iron or Log and what ever other Resources it gives..Like sometime it Shadow Iron or sometimes its Copper Or Like with Lumber the same thing...
Do i also need to Add the Skill Check and what Else am i missing to make the Ore/Lumber more random for the Different resources.
Any Help Would Be Greatly Appreciated...
Oh and dont know if this Matters ..but I basicly almost re-wrote all of the Lumberjacking System to work like the Mining System heh....
I am working on a new Custom OWLTR release and am finding myself a bit stuck atm...
What I am attempting to do Like Daat's OWLTR is make it so the Player..Mines or Lumberjaxes Different Resources from a Harvest Vien Via the Harvest system.. So this way a player cant just sit and camp out on a Harvest Vein..In Daat's System he makes the option to Have it available or Not..I'm attempting to Make It Already Built in..so it just does it..Not the Option to Do it...So far this is what i have Figured out...
With Daat's System He Has This:
Code:
//daat99 OWLTR start - daat99 harvesting
type = GetResourceType(from, tool, def, map, loc, resource);
bool daatHarvesting = false;
if (daat99.OWLTROptionsManager.IsEnabled(daat99.OWLTROptionsManager.OPTIONS_ENUM.DAAT99_MINING) && (type.IsSubclassOf(typeof(BaseOre)) || type.IsSubclassOf(typeof(BaseGranite))))
daatHarvesting = true;
else if (daat99.OWLTROptionsManager.IsEnabled(daat99.OWLTROptionsManager.OPTIONS_ENUM.DAAT99_LUMBERJACKING) && type.IsSubclassOf(typeof(BaseLog)))
daatHarvesting = true;
if ( daatHarvesting || (skillBase >= resource.ReqSkill && from.CheckSkill( def.Skill, resource.MinSkill, resource.MaxSkill )) )
{
type = GetResourceType( from, tool, def, map, loc, resource );
if ( type != null )
type = MutateType( type, from, tool, def, map, loc, resource );
if (daatHarvesting)
{
type = ResourceHelper.GetDaat99HarvestedType(type, bank.Vein.IsProspected, skillValue);
from.CheckSkill(def.Skill, 0.0, from.Skills[def.Skill].Cap + (vein.IsProspected?10.0:0.0));
}
//daat99 OWLTR end - daat99 harvesting
This seems to Check the players Skill and if the vein is Prospected..and using OOP Design "daatHarvesting" which calls to the resource Helper file and then there is this line :
Code:
//daat99 OWLTR start - custom harvesting
CraftResource craftResourceFromType = CraftResources.GetFromType(type);
string s_Type = "UNKNOWN";
int i_Tokens = 1;
if (craftResourceFromType != CraftResource.None)
{
s_Type = CraftResources.GetInfo(craftResourceFromType).Name;
i_Tokens = CraftResources.GetIndex(craftResourceFromType) + 1;
}
if (craftResourceFromType != CraftResource.None && daat99.OWLTROptionsManager.IsEnabled(daat99.OWLTROptionsManager.OPTIONS_ENUM.DAAT99_MINING) && def.Skill == SkillName.Mining && (type.IsSubclassOf(typeof(Server.Items.BaseOre)) || type.IsSubclassOf(typeof(Server.Items.BaseGranite))))
{
if (type.IsSubclassOf(typeof(Server.Items.BaseOre)))
{
if ( Give( from, item, def.PlaceAtFeetIfFull ) )
from.SendMessage("You dig some {0} ore and placed it in your backpack.", s_Type);
else
{
from.SendMessage("Your backpack is full, so the ore you mined is lost.");
item.Delete();
}
}
else
{
if ( Give( from, item, def.PlaceAtFeetIfFull ) )
from.SendMessage("You carefully extract some workable stone from the ore vein.");
else
{
from.SendMessage("Your backpack is full, so the ore you mined is lost.");
item.Delete();
}
}
}
else if (craftResourceFromType != CraftResource.None && OWLTROptionsManager.IsEnabled(OWLTROptionsManager.OPTIONS_ENUM.DAAT99_LUMBERJACKING) && def.Skill == SkillName.Lumberjacking)
{
if ( Give( from, item, def.PlaceAtFeetIfFull ) )
from.SendMessage("You placed some {0} logs in your backpack.", s_Type);
else
{
from.SendMessage("You can't place any wood into your backpack!");
item.Delete();
}
}
else
{
//daat99 OWLTR end - custom harvesting
if (this.Give(from, item, def.PlaceAtFeetIfFull))
{
this.SendSuccessTo(from, item, resource);
}
else
{
this.SendPackFullTo(from, item, def, resource);
item.Delete();
}
//daat99 OWLTR start - custom harvesting
This Part am Not 100% Sure but seems to Mine the ore and Lumber and if packs Full places at your feet
what i have done is this....
Code:
//daat99 OWLTR start - custom harvesting
CraftResource craftResourceFromType = CraftResources.GetFromType(type);
string s_Type = "UNKNOWN";
if (craftResourceFromType != CraftResource.None)
{
s_Type = CraftResources.GetInfo(craftResourceFromType).Name;
CraftResources.GetIndex(craftResourceFromType);
}
if (craftResourceFromType != CraftResource.None && def.Skill == SkillName.Mining && (type.IsSubclassOf(typeof(Server.Items.BaseOre)) || type.IsSubclassOf(typeof(Server.Items.BaseGranite))))
{
if (type.IsSubclassOf(typeof(Server.Items.BaseOre)))
{
if ( Give( from, item, def.PlaceAtFeetIfFull ) )
from.SendMessage("You dig some {0} ore and placed it in your backpack.", s_Type);
else
{
from.SendMessage("Your backpack is full, so the ore you mined is lost.");
item.Delete();
}
}
else
{
if ( Give( from, item, def.PlaceAtFeetIfFull ) )
from.SendMessage("You carefully extract some workable stone from the ore vein.");
else
{
from.SendMessage("Your backpack is full, so the ore you mined is lost.");
item.Delete();
}
}
}
else if (craftResourceFromType != CraftResource.None && def.Skill == SkillName.Lumberjacking)
{
if ( Give( from, item, def.PlaceAtFeetIfFull ) )
from.SendMessage("You placed some {0} logs in your backpack.", s_Type);
else
{
from.SendMessage("You can't place any wood into your backpack!");
item.Delete();
}
}
else
{
//daat99 OWLTR end - custom harvesting
Do i also need to Add the Skill Check and what Else am i missing to make the Ore/Lumber more random for the Different resources.
Any Help Would Be Greatly Appreciated...
Oh and dont know if this Matters ..but I basicly almost re-wrote all of the Lumberjacking System to work like the Mining System heh....