Jump to content
  • 0

Npc Party/MVP Warper


SaruSnow

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  09/27/18
  • Last Seen:  

Hello all, can someone help me with the following script?

I need and NPC that will warp the player to an MVP Room with the following conditions:

1. MVP in the room is alive (its a global npc with global respawn timer)
2. If Mvp is alive, party leader has to talk to npc and will be teleported to map. If Mvp is dead, it will tell the time left to respawn.
3. Other players will only be able to be teleported by npc if party leader is alive in the MVP Room (however each player needs to individually talk to npc to get warped)
4. There cannot be 2 parties in the room, so if a party has entered, another party leader cant enter
5. If all players in the room die, they are warped out after 3 minutes
6. If MVP is killed all players are warped out after 1 minute
7. If a player in the room stay completely inactive for 3 minutes its teleported out (inactive asin not moving, not buffing, not fighting, not chatting, etc)

Thanks in advance!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

prontera,140,140,4	script	MvP Warper	4_M_RACHMAN2,{

	.@party = getcharid(1);
	.@event$ = "put here your monster event";
	if(.@party) {
		if(mobcount(.map$,.@event$) && is_party_leader() && !.party) {
			warp .map$,0,0;
			.party = .@party;
		} else if(!is_party_leader() && .party == .@party) {
			.@leader = getpartyleader(.@party,2);
			if(strcharinfo(3,.@leader) == .map$ && getvar(HP,.@leader) > 0)
				warp .map$,0,0;
			else
				mes "Leader is not alive.";
		} else if(.party) {
			mes "Another party is registered.";
		}
	} else if(!.@party) {
		mes "You must be in a party.";
	}
	close;

OnPCDieEvent:

	if(strcharinfo(3) == .map$) {
		.@map_u = getmapusers(.map$);
		.@party = getcharid(1);
		if(.@party) {
			getpartymember .@party,1,.@party_cid;
			getpartymember .@party,2,.@party_aid;
			.@n = $@partymembercount;
			for(;.@i < .@n;.@i++) {
				if(isloggedin(.@party_aid[.@i],.@party_cid[.@i])) {
					if(getvar(HP,.@party_cid[.@i]) <= 0 && strcharinfo(3,.@party_cid[.@i]) == .map$)
						.@dead++;
				}
			}
			detachrid;
			if(.@dead >= .@map_u) {
				sleep 3*60*1000;
				.party = 0;
				mapwarp .map$,"prontera",0,0;
			}
		}
	}
	end;
OnInit:

	.map$ = "map";
	end;

}

And you have to add this to the event you have on your other script:

(event when mvp dead, something like OnMvPDead:)

	sleep 60*1000;
	.party = 0;
	mapwarp "map","prontera",0,0;
	end;

 I think can code the "idle" function, but I don't recommend you that, since it can cause some lag.

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