Jump to content

Recommended Posts

[NPC] Campfire to regenerate HP/SP


Originally:

There is a nice contribution from meko on that subject,

Menhir (Big rock that possesses magical powers and able to restore Health and Energy of Seekers resting/meditating nearby)

Thanks, meko!

But, I thought to myself, well, that is wonderful, but why not make it portable?

The Idea:

An element of role play, a way to add functionality 
to the item 7035 - Matchstick, To light a Campfire.
A Campfire is a portable temporary regeneration NPC.
OW, and it is configurable ;).

dfUPJPu.jpg

Campfire to restore / regenerate HP & SP.

When you sit by the Campfire, you start feeling the warmth and the comfort, thus your HP & SP begin to regenerate.

 

Mechanics 

xPQdPzk.gif

A phosphorus tipped stick that can be used to start a fire. (Now Indeed :meh:)

When you use the itemfbrrRyO.gif Matchstick in your inventory, it will spawn a duplicate of the NPC called Campfire.

This will help you when you are in the field, farming, grinding, starting a Campfire will help you rest.

VvXo4vX.jpg

- You need to sit close to the Campfire (3 cells ) to feel the warmth.

- Anyone can sit by your Campfire and rest.

- Campfire lasts 2-3 minutes.

- Need to sit for at least some time to begin feeling the warmth and comfort.

- you cannot start a fire within 5 cells of another NPC

- If you use a match one more time, old Campfire disappears and a new one appears.

 

I think it will add an element of roleplay and romanticism to the gameplay.

 

 

Installation

  1. To be able to use this script you need a plugin npc-duplicate.c
    https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/npc-duplicate.c
    Install & enable this plugin
  2. This script uses a relatively new NPC sprite at the moment of writing this release.
    4_BONFIRE
    Therefore, you may have to edit the Hercules source to allow for this new NPC
    To the /db/constants.conf
    add this line:
    4_BONFIRE: 10252
    In the /src/map/npc.h
    change this line:
    #define MAX_NPC_CLASS2_END 10800
    This will allow for way more NPCs
    Save and recompile Hercules.
  3. In the client, you may not have this NPC
    But luckily for you, I've included with this release a data.zip archive containing the NPC sprite
    and the sound of striking a matchstick.
    Just add it to your GRF or data folder if you use data folder.
  4. In the client, Lua Files make sure you have this NPC sprite

    LuaFiles514/Lua Files/Datainfo/NPCIdentity.lub
    JT_4_BONFIRE = 10252,

    LuaFiles514/Lua Files/Datainfo/jobName.lub
     
    [jobtbl.JT_4_BONFIRE] = "4_bonfire",
  5. In the /db/re/item_db.conf or /db/pre-re/item_db.conf
    find Id: 7035
    and add these 3 attributes
    
    	Type: 2
    	Delay: 3000
    	Script: <" callfunc("F_CreateCFDup"); ">

     

Configuration

It is a configurable script

All of the parameters are explicitly commented for a better understanding of the rules

	.refillHP_rate = 15;	// number of HP to give every refill
	.refillSP_rate = 5;		// number of SP to give every refill
	.refill_distance = 3;	// max distance from fire HP/SP regeneration will work
	.camp_fire_delay = 5;	// Skip how many ticks before feel warm ;)
	.refill_timer = 300;	// wait rand(X) ms before refil

Feel free to adjust to your server needs

	.@nofire_distance = 5;			// How far from other NPCs allowed to make fire.
	.@fire_duration = 1000 * 60 * 3;// 3 minutes (How long will the Campfire last, in ms)

 


 

Share this post


Link to post
Share on other sites

Amazing idea, and keeps relates to the RPG style
the NPC worked ok, still i have this err every time i try using the Matchstick.
would love if you could help me in it, if so i'm on debian 9, [v2019.06.02] `June 2 2019` version

currently, planning to use it as Valkyrie NPC helping valhala warriors in the monster invasion without need to sit, until it's fixed or so.

image.png.4fef339002d3595119bf981a2962eeff.png

Share this post


Link to post
Share on other sites
On 7/10/2019 at 12:43 PM, ajoope said:

Amazing idea, and keeps relates to the RPG style
the NPC worked ok, still i have this err every time i try using the Matchstick.
would love if you could help me in it, if so i'm on debian 9, [v2019.06.02] `June 2 2019` version

currently, planning to use it as Valkyrie NPC helping valhala warriors in the monster invasion without need to sit, until it's fixed or so.

image.png.4fef339002d3595119bf981a2962eeff.png

 

1 hour ago, leertaste said:

having the same issue

It's because the plugin (https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/npc-duplicate.c) has changed it's syntax

So, do the following in campfire.txt, Change

duplicatenpc("Campfire#CF", "Campfire", sprintf("CF_%d", .@curr_char_id), .@mapname$, .@mapx, .@mapy, 0);

to

duplicatenpc("Campfire#CF", sprintf("Campfire#CF_%d", .@curr_char_id), .@mapname$, .@mapx, .@mapy, 0);

 

Share this post


Link to post
Share on other sites
On 7/14/2019 at 5:15 PM, Dastgir said:

 

It's because the plugin (https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/npc-duplicate.c) has changed it's syntax

So, do the following in campfire.txt, Change

duplicatenpc("Campfire#CF", "Campfire", sprintf("CF_%d", .@curr_char_id), .@mapname$, .@mapx, .@mapy, 0);


duplicatenpc("Campfire#CF", "Campfire", sprintf("CF_%d", .@curr_char_id), .@mapname$, .@mapx, .@mapy, 0);

 to

duplicatenpc("Campfire#CF", sprintf("Campfire#CF_%d", .@curr_char_id), .@mapname$, .@mapx, .@mapy, 0);


duplicatenpc("Campfire#CF", sprintf("Campfire#CF_%d", .@curr_char_id), .@mapname$, .@mapx, .@mapy, 0);

  

thank you very much! , it solved the problem, but apparently there's another, i tried many solution before posting again here. none of it helped really

image.png.71bebbdb8336d47d2a34802e9445671b.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.