Jump to content
  • 0

Portal party warp


UnknownUser0317

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   1
  • Joined:  11/19/16
  • Last Seen:  

Requesting a script that uses warp portal sprite, if all of the members of the party is not standing above the warp npc, it will not warp the party, unless all of the members are already above the warp npc. thanks!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can try something like this.

https://pastebin.com/jJsAAmq2

 

@Skorm

your approach doesn't always work. There are few parts you can fix the issue.

  • Change from using OnTouch to OnTouch_ or...
  • Only triggered by Party Leader to avoid calling the npc checking whenever a party member reach the portal.
  • .pre_cnt and .party_id potentially always get override by other member who entered the area, caused the value might get reset halfway during the checking.
  • addrid caused the script run extra instances depend on all member in that area.

 

Link to comment
Share on other sites

  • 1

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Requesting a script that uses warp portal sprite, if all of the members of the party is not standing above the warp npc, it will not warp the party, unless all of the members are already above the warp npc. thanks!

That are a bunch of ways to do this but here's one.

prontera,190,181,5	script	Online Guild	45,2,2,{
end;
OnTouch:
	.pre_cnt = 0;
	.party = getcharid(1);
	if( !.party ) end;
	getpartymember .party;
	.party_cnt = $@partymembercount;
	addrid( 4, 0, 190-2, 181+2, 190+2, 181-2 );
	if( .party == getcharid(1) ) {
		.pre_cnt++;
		if( .pre_cnt == .party_cnt )
			warpparty "geffen",192,178,.party;
	}
	end;
}

 

Edited by Skorm
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

5 hours ago, Emistry said:

your approach doesn't always work. There are few parts you can fix the issue.

  • Change from using OnTouch to OnTouch_ or...
  • Only triggered by Party Leader to avoid calling the npc checking whenever a party member reach the portal.
  • .pre_cnt and .party_id potentially always get override by other member who entered the area, caused the value might get reset halfway during the checking.
  • addrid caused the script run extra instances depend on all member in that area.

 

Already completely aware of this. The chance of the script failing is extremely small so I thought whatever.

Edited by Skorm
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

actually the chance of script failing is low because you test with less player. If there are high amount of player, the chance would be increased.

All you need is just one or few more char without party keep walking around to reset the variables to fail the warp for other party.

 

it's actually from 10 lines to around 15 lines of changes if you ignore those unnecessary lines.

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