Jump to content
  • 0

One-click warp to party leader


Question

Posted

Is it possible to create an NPC script that works like this:

If the player is in a party with a party leader that is also online, clicking on this NPC will warp the player to the party leader no matter where the party leader is. If the these conditions are not met then clicking on the NPC does nothing.

I'd like for players to be able to teleport from town to the party leader, even if in an instance.

4 answers to this question

Recommended Posts

  • 1
Posted (edited)
prontera,155,181,5	script	Yumi	94,{

	.@aid = getpartyleader(getcharid(1),1);
	.@cid = getpartyleader(getcharid(1),2);
	if(!isloggedin(.@aid,.@cid)){
		message strcharinfo(0),"Party Leader is Offline";
		end;
	}
	getmapxy(.@map$,.@x,.@y,BL_PC,.@aid);
	warp .@map$,.@x,.@y;
	end;
}

 

Edited by Haruka Mayumi
  • 0
Posted
1 hour ago, Haruka Mayumi said:

prontera,155,181,5	script	Yumi	94,{

	.@aid = getpartyleader(getcharid(1),1);
	.@cid = getpartyleader(getcharid(1),2);
	if(!isloggedin(.@aid,.@cid)){
		message strcharinfo(0),"Party Leader is Offline";
		end;
	}
	getmapxy(.@map$,.@x,.@y,BL_PC,.@aid);
	warp .@map$,.@x,.@y;
	end;
}

 

Woah, thank you. That works perfectly.

  • 0
Posted

I saw a similar script for this.

It has options to warp you not only to your party leader but also to other members of the party. I tested it on my test server but it doesn't work as intended.

 

Heres the script:

prontera,155,181,5    script    Yumi    94,{

    if(!getcharid(3)) end;
    getpartymember(getcharid(1),2);
    copyarray .@paid[0], $@partymemberaid[0],128;
    getpartymember(getcharid(1),1);
    copyarray .@pcid[0], $@partymembercid[0],128;
    set .@len, $@partymembercount;
    set .@cid, getcharid(0);
    
    for(set(.@i,0);.@i<.@len;set(.@i,.@i+1)) {
        if(isloggedin(.@paid[.@i],.@pcid[.@i])&&.@pcid[.@i]!=.@cid)
            set(.@menu$,.@menu$+rid2name(.@paid[.@i])+":");
        else {
            deletearray .@paid[.@i],1;
            deletearray .@pcid[.@i],1;
            set(.@i,.@i-1);
            set(.@len,.@len-1);
        }
    }
    
    if(.@menu$=="") end;
    mes "Select who you warp to!";
    if(set(@menu,prompt(.@menu$)-1)>253) end;
    getmapxy(.@map$,.@x,.@y,0,rid2name(.@paid[@menu]));
    if(getmapusers(.@map$)<0) end;
    warp .@map$,.@x,.@y;
    end;
}

Also, is it possible to map restrictions to this?

Thanks in advance

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.

  • Recently Browsing   0 members

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