Jump to content

Recommended Posts

Posted

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

  • 3 months later...
Posted
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
  • 1 year later...
Posted

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.

  • 1 year later...
Posted
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?

Posted
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));

 

  • 5 weeks later...
Posted (edited)
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
  • 2 months later...
Posted (edited)

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
  • 2 weeks later...

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...