Jump to content
  • 0
Sign in to follow this  
Kevo

I need help with my embellishment scripts NPC WALKS

Question

prontera.gat,155,203,3	script	Bird#1::Vmp	2727,{
	// -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o- \\
	// Header - Please include this header in your Walk Enabled NPCs to control distance errors
	// Set the status to "In Use" (multiplayer)
	   set .inUse, .inUse + 1;
	// Reset the current lock time while the user talk with the NPC
	   set .curLockT,0;
	// -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o- \\
	

OnInit:
	// Define the coordinates for this NPC (you can use 0,400/0,400 for a full map movement)
	// Horizontal coordinates
	set .minX,137;
	set .maxX,177;
	// Vertical coordinates
	set .minY,184;
	set .maxY,223;
	// Define the min/max distance for each movement
	set .minD,0;
	set .maxD,10;
	// Define stopped steps before change the status back to "Free to walk"
	set .maxLock,30;
	// Set the speed for this NPC (50=Faster / 250=Slower)
	npcspeed 230;
	
	// Start the movements
	initnpctimer;
	end;
	
// Set here the time for the next movement (ms)
OnTimer2000:
	if (.inUse) {
		set .curLockT, .curLockT + 1;
		if (.curLockT > .maxLock) set .inUse, 0;
	} else {
		getmapxy .map$,.x,.y,1;
		set .curX, callfunc("NPCWalk",.minX, .maxX,.minD,.maxD,.x);
		set .curY, callfunc("NPCWalk",.minY, .maxY,.minD,.maxD,.y);
		npcwalkto .curX, .curY;
	}
	stopnpctimer;
	initnpctimer;
	end;
}

prontera.gat,155,203,3	duplicate(Vmp)	Bird#2	2727
prontera.gat,155,203,3	duplicate(Vmp)	Guard#3	2726
//prontera.gat,155,203,3	duplicate(Vmp)	Bird#4	2123
//prontera.gat,147,203,3	duplicate(Vmp)	Bird#5	2123
//prontera.gat,147,203,3	duplicate(Vmp)	Bird#6	2123
//prontera.gat,147,203,3	duplicate(Vmp)	Bird#7	2123
//prontera.gat,156,212,3	duplicate(Vmp)	Bird#8	2123
//prontera.gat,156,212,3	duplicate(Vmp)	Bird#9	2123
//prontera.gat,156,212,3	duplicate(Vmp)	Bird#10	2123
//prontera.gat,164,203,3	duplicate(Vmp)	Bird#11	2123
//prontera.gat,164,203,3	duplicate(Vmp)	Bird#12	2123
//prontera.gat,164,203,3	duplicate(Vmp)	Bird#13	2123
//prontera.gat,174,201,3	duplicate(Vmp)	Bird#14	2123
//prontera.gat,174,201,3	duplicate(Vmp)	Bird#15	2123
//prontera.gat,174,201,3	duplicate(Vmp)	Bird#16	2123
//prontera.gat,137,206,3	duplicate(Vmp)	Bird#17	2123
//prontera.gat,137,206,3	duplicate(Vmp)	Bird#18	2123
// -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o- \\
//                                 END SAMPLE                                    \\
// -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o- \\

// Function to calculate one single coordinate
function	script	NPCWalk	{
	set .CP, getarg(4);
	set .DST, rand(getarg(2),getarg(3));
	if (rand(2))
		set .CP, .CP + .DST;
	else
		set .CP, .CP - .DST;
	if (.CP < getarg(0)) set .CP, .CP + .DST;
	if (.CP > getarg(1)) set .CP, .CP - .DST;
	return .CP;
}

I'm sorry I'm interested in a script that serves as an ornament I liked in eathena but I can't make it work could you support me

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

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

Guest
Answer this question...

×   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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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