Jump to content
  • 0

One-click warp to party leader


Grifter

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  03/18/20
  • Last Seen:  

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.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  03/18/20
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  03/11/13
  • Last Seen:  

how to block map guild

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  30
  • Reputation:   0
  • Joined:  03/08/15
  • Last Seen:  

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

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