Jump to content

Mabuhay

Members
  • Posts

    446
  • Joined

  • Last visited

  • Days Won

    34

Posts posted by Mabuhay

  1. Here are the options I suggest you do :

    1. Make duplicate of the guard NPC.
    2. Dont make the NPC A interact while guard NPC is still with another player.
    3. Put the player on an instance (unnecessary and complicated)
    4. Duplicate Maps and NPC (just like the default ones when spawning in-game for the first time - unnecessary also)

    3 and 4 obviously are out of question but Im still giving you the option.

    1 and 2 are your best options.

    • Upvote 1
  2. Here is a better thing to do for your script. I made one myself instead of editing yours..

    Anyways, I think you can understand this very clearly..

    prontera,150,150,0	script	NPC A	100,{
    	mes "Test..";
    	close2;
    	if ( done_walking ) end; // trigger only once, cannot be triggered twice per character..
    	donpcevent "NPC B::OnNPCWalk";
    	sleep2 1000; // 1 sec delay before player walks
    	unitwalk getcharid(3), 160, 158;
    	done_walking = true; // sets done walking here..
    	end;
    }
    
    prontera,150,152,0	script	NPC B	100,{
    	mes "Test";
    	close;
    OnNPCWalk:
    	npcspeed 200;
    	npcwalkto 160,160;
    	sleep 5000; // pause for 5 sec.. then..
    	npcwalkto .x, .y; // walk back to orig position
    	end;
    
    OnInit:
    	getmapxy .map$, .x, .y, BL_NPC, strnpcinfo(0); // save orig position
    	end;
    }

     

    • Love 1
  3. *unitwalk <GID>,<x>,<y>{,"<event label>"};
    *unitwalkto <GID>,<Target GID>{,"<event label>"};
    
    This command will tell a <GID> to walk to a position, defined either as a set of
    coordinates or another object. The command returns a 1 for success and 0 upon failure.
    
    If coordinates are passed, the <GID> will walk to the given x,y coordinates on the
    unit's current map. While there is no way to move across an entire map with 1 command
    use, this could be used in a loop to move long distances.
    
    If an object ID is passed, the initial <GID> will walk to the <Target GID> (similar to
    walking to attack). This is based on the distance from <GID> to <Target ID>. This command
    uses a hard walk check, so it will calculate a walk path with obstacles. Sending a bad
    target ID will result in an error.
    
    An optional Event Label can be passed as well which will execute when the <GID> has reached
    the given coordinates or <Target GID>.
    
    Examples:
    
    // Makes player walk to the coordinates (150,150).
    	unitwalk getcharid(3),150,150;
    
    // Performs a conditional check with the command and reports success or failure to the player.
    	if (unitwalk(getcharid(3),150,150))
    		dispbottom "Walking you there...";
    	else
    		dispbottom "That's too far away, man.";
    
    // Makes player walk to another character named "WalkToMe".
    	unitwalkto getcharid(3),getcharid(3,"WalkToMe");

     

  4. -	script	asdahjhla	-1,{
    OnPCKillEvent:
    	if ( inarray(.map$, strcharinfo(3)) != -1 ) {
    		if ( rand(100) <= .chance ) {
    			getitem 501, 10;
    			#CASHPOINTS += 1; // I forgot to add this
    			dispbottom "You earned 1 Cash Point. Total : "+ #CASHPOINTS;
    		}
    	}
    	end;
    
    OnInit:
    	.chance = 50; // chance to get something
    	setarray .map$, "prontera", "payon"; // map list
    }

     

    • Upvote 1
  5. *getusers(<type>)
    
    This function will return a number of users on a map or the whole server. What
    it returns is specified by Type.
    
    Type can be one of the following values, which control what will be returned:
    
        0 - Count of all characters on the map of the invoking character.
        1 - Count of all characters in the entire server.
        8 - Count of all characters on the map of the NPC the script is
            running in.

    Usage :

    prontera,150,180,0	script	njhaksdn	123,{
    	end;
    OnInit:
    	while (1) {
    		waitingroom "Players Online : "+ getmapusers(1), 0;
    		sleep 5000; // updates every 5 sec
    		delwaitingroom;
    	}
    }

     

  6. *getequipuniqueid(<equipment slot>{,<char_id>})
    
    This function returns the unique ID (as a string) of the item equipped in the equipment slot
    specified on the invoking character. If nothing is equipped there, it returns an empty string.
    See 'getequipid' for a full list of valid equipment slots.

    But I'm not sure how do you retrieve GID from items besides equipments.. or if it is possible.

  7. Not tested but do let me know :


    in pc.cpp

    Spoiler

    Search for the line with (-) then change to (+)..

    
    -return pc_readreg2( sd, ATTENDANCE_DATE_VAR ) >= date_get(DT_YYYYMMDD);
    +return pc_readaccountreg( sd, ATTENDANCE_DATE_VAR ) >= date_get(DT_YYYYMMDD);
    
    // Get the counter for the current period
    -int counter = pc_readreg2( sd, ATTENDANCE_COUNT_VAR );
    +int counter = pc_readaccountreg( sd, ATTENDANCE_COUNT_VAR );
    
    // Check if we have a remaining counter from a previous period
    -if( counter > 0 && pc_readreg2( sd, ATTENDANCE_DATE_VAR ) < period->start ){
    +if( counter > 0 && pc_readaccountreg( sd, ATTENDANCE_DATE_VAR ) < period->start ){
    	// Reset the counter to zero
    	-pc_setreg2( sd, ATTENDANCE_COUNT_VAR, 0 );
    	+pc_setaccountreg( sd, ATTENDANCE_COUNT_VAR, 0 );
    
    	return 0;
    }
    
    -int32 attendance_counter = pc_readreg2( sd, ATTENDANCE_COUNT_VAR );
    +int32 attendance_counter = pc_readaccountreg( sd, ATTENDANCE_COUNT_VAR );
    
    -pc_setreg2( sd, ATTENDANCE_DATE_VAR, date_get(DT_YYYYMMDD) );
    -pc_setreg2( sd, ATTENDANCE_COUNT_VAR, attendance_counter );
    +pc_setaccountreg( sd, ATTENDANCE_DATE_VAR, date_get(DT_YYYYMMDD) );
    +pc_setaccountreg( sd, ATTENDANCE_COUNT_VAR, attendance_counter );

     

     

     

    • Upvote 1
  8. You should do whatever interest you to do. Whether you start a server or not is not a question. The real problem is can you keep it running? Factors to include is time, cost, and skills. If you don't want to have the time to learn how to run a server and or the skill, it will cost you a lot. If you have the time and skill but you dont want to spend, well, that's another issue.. The point is that you should be committed and invested to it. You should be able to have time, money, and skills invested and 100% committed on a server. Otherwise, it will all be a waste which seemed to be your case. You have to change your mentality, if not, there's no point running a server you're not even interested in working with. 

    Ps: there are a lot of private servers already running. I have not heard a single one who got fined or whatnot. But if there were, well, they got very unlucky. 

  9. You cannot do player bound variables if you dont attach players. It is better to check for the current day using gettime then update every time player uses that npc. 

    More examples are best found in annieruru's blogspot. 

    • Like 1
×
×
  • Create New...