PDA

View Full Version : A Way to Add a Lumberjack Skill


Malevolent
04-17-2002, 01:53 AM
I was experimenting last night (after I had dragons attacking kelethin =P) with a way to spawn trees of various materials using the procreation code that I have in. As I worked it, I realized I could easily shift this over to a kind of lumberjack tradeskill.

I reckon that trees (race 655) should only be capable of being cut down if you are using a 1hs or 2hs weapon. They do attack back (if you cut wood, you'll know what I mean here), but its only a minor irritation. Thus, I've been working on getting them spawned at level 1 with about 5,000 to 10,000 hitpoints.

It makes sense that the material used to build the tree should denote the kind of wood on it, which for now can be the wood stalks used in fletching.

To accomplish the above, I stripped out the #spawn code and added a new method to entity_list called SpawnNPC(mob,x,y,z,heading) where mob is a mob you want to be similar too. Adding items for race 655 is no longer random, but set to specific numbers. This is invoked by the procreation related timers, which are then to sprawl out the seeds for the tree in a given area.

I haven't yet placed any checks for forcing someone to use a 1hs or 2hs skill when attacking the tree, but do not expect that to be too difficult. Thus, when all the above is complete, a person could be a lumberjack -- and even have to deal with natural resource environmental issues too. Is it better to preserve the land or to conserve it?

--MV

Lurker_005
04-17-2002, 10:20 AM
Wow Malevolent your really taking the Emu in all directions! Keep going, this is great work your doing.

Hmm
04-17-2002, 11:20 AM
heh nice!!

Razzle
04-20-2002, 05:42 AM
Have you thought of adding this to the herbivore/carnivore code?

Have a limited number of plants that are automatic spawns, and every few hours have them run a check on their current size, and if it is above/below a certain number, they either add 1 to their current size, or they have a random chance of dropping a seed a defined distance away. (or both)

The seed then does a random check daily and has a 30% chance of sprouting into a seedling (plant at size 1), a 50% chance to do nothing, and a 20% chance to die.

Players walking within a certain distance of a seed (if they are not of the druid or ranger class) create a chance to kill the seed, thus creating areas lacking plant growth due to player traffic.

Herbivores then run a check when they are hungry on nearby plants to see if they are edible by the species, making animals go toward forest areas, and away from areas that are often inhabited by players.

Carnivores will follow the food, and will go away from player areas as well.

This can make a constantly changing world, and will make interaction with NPCs much less stagnant. Druids and Rangers could even pick up seeds, since they wouldn't die when they walked near, and spread plant life to other areas. Druid spells could effect seeds to make them sprout, or trees to make them blossom and spread seeds.

Just an idea- I wish I could code it.

Lurker_005
04-20-2002, 06:03 AM
Razzle, sounds like a pretty cool idea.

Malevolent
04-20-2002, 06:24 AM
Have you thought of adding this to the herbivore/carnivore code?


I've something very similar to this -- trees don't age, but the placeholder code is there. I just need a little more time to get that area setup. I'm going to setup age for mobs that modify their bases stats over time too.

They do follow a fairly random seed generation, and lumberjacks in a zone tend to cut them down. I have a ton of screenshots of rather curious things that have happened. :)

Razzle
04-20-2002, 07:05 AM
Just popped into my mind- rain can increase the speed of plant growth, and lack of rain could create plant decay. I'm sure we don't want trees sprouting all over nro just because no one is walking in the zone.

Hmm
04-20-2002, 07:58 AM
heh if area code ( fopr random pathing pourpses ) are added it can be used to set areas where trees cant spawn ( like deasert side of Sro )

heh just for fun how about this

#GoseedsGo ( makes all trees spawn seeds right away then seeds spourt into trees size 1 right away )

#killtrees ( all trees despawn )

#treespeed ( set speed of growth and seeding. )

if trees is targetable..

#settreesize
#spawnseed
#killtree