Herbs

For toolset tutorials as well as question and answers.
Locked
User avatar
Wynna
Dungeon Master
Posts: 5734
Joined: Sat Jan 03, 2004 10:09 am
Location: Seattle, WA (PST)

Herbs

Post by Wynna »

Teric, how does your system on OAS work and can I pillage it?
Enjoy the game
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post by Teric neDhalir »

If you mean the Soubar mage giving bounties on moss and mushrooms there is no "system" per se. What I've done is made placeables with an inventory containing the bounty items and then made ACR spawn points to generate them. I've then liberally sprinkled those spawn points about but with a very low spawn chance (I think it's 1%) so that you don't get the same thing in the same place over and over. In the mage's convo is a node for the PC with a conditional of gc_check_item and the tag of the bounty item. If the PC has one or more items she can say, "I have some XXXXX for you". Give the NPC a node from that, "Thank you, have something for your trouble" and reward the PC using a copy of the following script altered to give the rewards you want per item:
// Reward PC for each copy of item with tag "sjc_venison"
// they have in their inventory.
// Fired from conversation node after checking for presence of item
// with gc_check_item and sItem = "sjc_venison"
// Teric neDhalir 060907


#include "acr_xp_i"
void main()
{
object oPC = GetPCSpeaker();

// Start find/reward loop
int nItems = 0;
object oItem = GetFirstItemInInventory(oPC);

while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="011_sjc_venison")
{DestroyObject(oItem);
nItems = nItems + 1;}
oItem = GetNextItemInInventory(oPC);
}

int nGold = nItems*3; // Change "3" to the gold reward per item
int iXP = nItems*3; // Change "3" to the XP reward per item
ACR_GiveXPToPC(oPC, iXP);
GiveGoldToCreature(oPC, nGold);
}
The script adds up the number of items with the correct tag, deletes them and rewards the PC with items*reward for gold and XP.

A more skillful scripter could turn that into a generic ga_ script that takes the inputs of tag, gold and XP but I've never bothered. It's as easy to just duplicate and alter the reward values. To digress a bit the Heroes Guild has the same process for goblin hands etc, but I've duplicated the test and reward loops over and over for each type of humanoid body part so that you can collect all your bounties off one convo node. If you want to do it like that remember to change the name of the nItems variable (NItems1, nItems2, etc) for each loop, otherwise you end up only rewarding the first type of item in the list - a bug on the early OAS!

Hope that helps,
Teric
User avatar
Wynna
Dungeon Master
Posts: 5734
Joined: Sat Jan 03, 2004 10:09 am
Location: Seattle, WA (PST)

Post by Wynna »

Gotcha. Heard about a system involving herb hunting and thought it might be what I want. I think I'm ruminating over something a little more involved, but thanks for the reply!
Enjoy the game
Thangorn
Haste Bear
Posts: 2081
Joined: Fri Oct 01, 2004 1:00 pm
Location: Queenstown, New Zealand

Post by Thangorn »

Here's how I did this on NC in times gone by -:

1. Made a bunch of placeable bushes/trees, etc. with inventory (in this incarnation they'd need to be walkable, usuable placeables with inventory)
2. Made a bunch of herb items that relate to each placeable and put them in the inventory of each placeable blueprint.
3. Made a spawn script that randomly spawned one of the herb placeables (with inventory).
4. Laid a NESS spawn point in every area you could possibly find herbs and gave it a huge spawn radius (whole area). I had higher percentages/child numbers in some areas than others in terms of spawning herbs. I'm sure you could get the ALFA spawn system to do this.
5. I'm pretty sure I could dictate the highest child number that the spawn point might select from so I think I could tell the system "you can choose every herb up until swamp moss for this area" so I left my "special" herbs at higher numbers in terms of being referenced by the script in order to make them rarer finds and only in certain areas.

I can give you a hand if you like, I think I'd like to implement something like this when I have Elventree (or perhaps Phlan) added to the mod.
On indefinite real life hiatus

[22:52] <Veilan> obviously something sinister must be afoot if a DM does not have his social security number in his avatar name!
Locked