Jump to content

Utility: Campfire


Emistry

Recommended Posts


  • Group:  Members
  • Topic Count:  83
  • Topics Per Day:  0.03
  • Content Count:  188
  • Reputation:   3
  • Joined:  12/17/16
  • Last Seen:  

@Emistry Please can you provide me any information about how to add the source code to the server files?

And thank you

 

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  116
  • Reputation:   18
  • Joined:  09/08/17
  • Last Seen:  

Just apply the diff patch. Applied it to my server without any issues.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  83
  • Topics Per Day:  0.03
  • Content Count:  188
  • Reputation:   3
  • Joined:  12/17/16
  • Last Seen:  

Hello , I added the source code and compiled with 0% error , Thank you 

But when clicking the item get this error in server

image.png.24dbd93231c7c4363be2b94af3bd0a5e.png

I tried to use the sprite ( 4_BONFIRE ) or it's ID 10252  But getting error and exit the client ( And using the latest version of KRO ) 

So where to change the campfire ID to any another sprite?

Or anyone have the files of sprite to add it?

Thank you all

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  150
  • Reputation:   11
  • Joined:  12/03/18
  • Last Seen:  

On 11/25/2018 at 11:44 AM, OscarScorp said:

5

 

On 11/25/2018 at 11:44 AM, OscarScorp said:

Got mine working now. Here's my CampfireUpdater item if it helps anyone:


7203,Solid_Twig,Strong Branch,0,190,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc("func_UpdateCampFire", 5, 30, 5); },{},{}

 

Working for me thanks OSCARSCROP

902,Tree_Root,Tree Root,0,190,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc("func_UpdateCampFire",5, 30, 5); },{},{}
7850,Wooden_Block_,Wooden Block,0,190,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc("func_UpdateCampFire", 3, 60, 10); },{},{}
7035,Matchstick,Matchstick,0,190,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc("func_CreateCampFire",3, 60, 8); },{},{}
 

  • Upvote 1
Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   58
  • Joined:  07/11/14
  • Last Seen:  

I would like to share what happened to me, after trying to save the account_id in <New NPC hidden name> the map-server ended up crashing, I tried in several ways to understand what was happening, until testing the problem was in the name hidden that I was trying to save, until I went to the src code and verified that the limit for the name was being used NAME_LENGTH which has a small limit instead of NPC_NAME_LENGTH, after making the change it worked as it should.

strangely it should point out the error with a very long name but it didn't happen and it crashed.

Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.02
  • Content Count:  178
  • Reputation:   6
  • Joined:  10/22/18
  • Last Seen:  

Error on mapserver upon starting and ending of campfire.

Using latest rathena version.

Capture.JPG

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   58
  • Joined:  07/11/14
  • Last Seen:  

11 hours ago, Frost Diver said:

Error on mapserver upon starting and ending of campfire.

Using latest rathena version.

Capture.JPG

This happens in relation to the standard system for dynamically duplicating npcs that was implemented.
I made the update but forgot to share with the guys xD

duplicatenpcV3_(2022-12+)_dynamicnpc.diff

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.02
  • Content Count:  178
  • Reputation:   6
  • Joined:  10/22/18
  • Last Seen:  

3 hours ago, Hyroshima said:

This happens in relation to the standard system for dynamically duplicating npcs that was implemented.
I made the update but forgot to share with the guys xD

duplicatenpcV3_(2022-12+)_dynamicnpc.diff

Thanks mate. But i still got an error regarding the special effect upon starting the campfire

Capture.JPG

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   58
  • Joined:  07/11/14
  • Last Seen:  

1 hour ago, Frost Diver said:

Thanks mate. But i still got an error regarding the special effect upon starting the campfire

Capture.JPG

When does the error occur?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.02
  • Content Count:  178
  • Reputation:   6
  • Joined:  10/22/18
  • Last Seen:  

40 minutes ago, Hyroshima said:

When does the error occur?

It's coming from the npc script in this line:

specialeffect(EF_FIREWALL2, AREA, .@cid);

and this line:

specialeffect(EF_HEAL, AREA, getcharid(3));

 

Link to comment
Share on other sites

  • 5 weeks later...

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   58
  • Joined:  07/11/14
  • Last Seen:  

On 7/15/2023 at 11:34 PM, Frost Diver said:

It's coming from the npc script in this line:

specialeffect(EF_FIREWALL2, AREA, .@cid);

and this line:

specialeffect(EF_HEAL, AREA, getcharid(3));

 

Alter:

specialeffect(EF_FIREWALL2, AREA, .@cid);

To:

specialeffect(EF_FIREWALL2, AREA, convertpcinfo(.@cid,CPC_NAME));

 

And:

specialeffect(EF_HEAL, AREA, getcharid(3));

To:

specialeffect(EF_HEAL, AREA, strcharinfo(0));

 

Edited by Hyroshima
Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  24
  • Reputation:   1
  • Joined:  06/11/23
  • Last Seen:  

sir,

I found this error, can you help?

818461a2a5106848f267e5e8e22fadce.png.ccd856477105bd13f7e7d41c23a62c1f.png

Full Script


function	script	func_CreateCampFire	{
	
	.@cid = getcharid(3);
	
	.@range = getarg(0, 3); 	// Heal Range
	.@duration = getarg(1, 60); // Duration
	.@rate = getarg(2, 1); 		// Heal Rate

	getmapxy(.@map$, .@mapx, .@mapy, BL_PC);

	if(getmapxy(.@npc_map$, .@x, .@y, BL_NPC, sprintf("Camp Fire#CF_%d",.@cid)) == 0)
		donpcevent "Camp Fire#" + sprintf("CF_%d", .@cid) + "::OnCampFireEnd";

	showscript "Starting a Camp Fire...";
	specialeffect(EF_FIREWALL2, AREA, convertpcinfo(.@cid,CPC_NAME));
	progressbar "0xFFFFFF", 1;
	
	duplicatenpc("cf_main", "Camp Fire", sprintf("CF_%d", .@cid), .@map$, .@mapx, (.@mapy - 1), DIR_SOUTH, 10252, .@range, .@range);
	
	set(getvariableofnpc(getd(sprintf(".CF_%d_range", .@cid)), "Camp Fire#" + sprintf("CF_%d", .@cid)), .@range);
	set(getvariableofnpc(getd(sprintf(".CF_%d_duration", .@cid)), "Camp Fire#" + sprintf("CF_%d", .@cid)), .@duration);
	set(getvariableofnpc(getd(sprintf(".CF_%d_healrate", .@cid)), "Camp Fire#" + sprintf("CF_%d", .@cid)), .@rate);
	donpcevent "Camp Fire#" + sprintf("CF_%d", .@cid) + "::OnCampFireStart";
	
	return;
}

function	script	func_UpdateCampFire	{

	.@cid = getcharid(3);
	
	.@range = getarg(0, 3); 	// Heal Range
	.@duration = getarg(1, 60); // Duration
	.@rate = getarg(2, 1); 		// Heal Rate

	getmapxy(.@map$, .@mapx, .@mapy, BL_PC);

	if(getmapxy(.@npc_map$, .@x, .@y, BL_NPC, sprintf("Camp Fire#CF_%d",.@cid)) == 0) {
		if (.@npc_map$ != .@map$ || distance(.@mapx, .@mapy, .@x, .@y) > 5) {
			dispbottom "<Camp Fire> You're too far away from the Campfire.";
		}
		else {
			showscript "!!";
			specialeffect(EF_FIREWALL2, AREA, "Camp Fire#" + sprintf("CF_%d", .@cid));
			
			.@range = min(8, getvariableofnpc(getd(sprintf(".CF_%d_range", .@cid)), "Camp Fire#" + sprintf("CF_%d", .@cid)) + .@range);
			.@duration = min(300, getvariableofnpc(getd(sprintf(".CF_%d_duration", .@cid)), "Camp Fire#" + sprintf("CF_%d", .@cid)) + .@duration);
			.@rate = min(15, getvariableofnpc(getd(sprintf(".CF_%d_healrate", .@cid)), "Camp Fire#" + sprintf("CF_%d", .@cid)) + .@rate);
			
			set(getvariableofnpc(getd(sprintf(".CF_%d_range", .@cid)), "Camp Fire#" + sprintf("CF_%d", .@cid)), .@range);
			set(getvariableofnpc(getd(sprintf(".CF_%d_duration", .@cid)), "Camp Fire#" + sprintf("CF_%d", .@cid)), .@duration);
			set(getvariableofnpc(getd(sprintf(".CF_%d_healrate", .@cid)), "Camp Fire#" + sprintf("CF_%d", .@cid)), .@rate);
		}
	}
	else {
		dispbottom "<Camp Fire> Start a Campfire...";
	}
	
	return;
}


-	script	Camp Fire::cf_main	FAKE_NPC,{
	end;
	
OnCampFireStart:
	getmapxy(.@map$, .@x, .@y, BL_NPC);
	
	.@npcname$ = strnpcinfo(2);
	
	do {
		.@range = getd(sprintf(".%s_range", .@npcname$));
		.@healrate = getd(sprintf(".%s_healrate", .@npcname$));
		
		specialeffect EF_DRAGONSMOKE, AREA;
		
		showscript "HEAL: "+.@healrate+"% | AREA:"+.@range+" | TIME: "+getd(sprintf(".%s_duration", .@npcname$));
		
		setd(sprintf(".%s_duration", .@npcname$)), getd(sprintf(".%s_duration", .@npcname$)) - 1;
		
		areapercentheal(.@map$, (.@x - .@range), (.@y - .@range), (.@x + .@range), (.@y + .@range), .@healrate, .@healrate);
		sleep 1000;
		
		.@counter++;
		if (.@counter > 0 && .@counter % 10 == 0 && .@healrate > 1) // every 10 seconds reduce heal rate
			setd(sprintf(".%s_healrate", .@npcname$), getd(sprintf(".%s_healrate", .@npcname$)) - 1);
		if (.@counter > 0 && .@counter % 30 == 0 && .@range > 1) // every 30 seconds reduce range
			setd(sprintf(".%s_range", .@npcname$), getd(sprintf(".%s_range", .@npcname$)) - 1); 
		
	} while (getd(sprintf(".%s_duration", .@npcname$)) > 0);
	
	setd(sprintf(".%s_range", .@npcname$), 0);
	setd(sprintf(".%s_duration", .@npcname$), 0);
	setd(sprintf(".%s_healrate", .@npcname$), 0);
	duplicateremove(strnpcinfo(3));
	end;

OnCampFireEnd:
	.@npcname$ = strnpcinfo(2);
	setd(sprintf(".%s_duration", .@npcname$), 0);
	awake strnpcinfo(3);
	end;

OnTouch:
	specialeffect(EF_HEAL, AREA, strcharinfo(0));
	dispbottom("You are feeling warm and cozy.");
	end;
}

 

when the npc is gone an error appears like this

650cbdede9db01fb926b3050bd3dcea5.png.db5208610af61db7bc54164fd7e42740.png

thx for advanced

Edited by Akbare-2nd
Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.07
  • Content Count:  58
  • Reputation:   3
  • Joined:  06/21/23
  • Last Seen:  

bump !

solved

Edited by jamesandrew
Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...