Jump to content
  • 0

Help, my script doesnt work


kevo89

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   1
  • Joined:  06/27/14
  • Last Seen:  

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;
}

My script doesnot work on rathena , but in eathena yes

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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

alter: getmapxy .map$,.x,.y,1;

for: getmapxy .map$,.x,.y,BL_NPC;

please show error image.

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
Answer this question...

×   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...