Jump to content
  • 0

partyrecall and function doesn't close the window


Question

Posted

hello, i have this npc

izlude,93,136,4	script	Call Allies	484,50,50,{
mes "I can recall your party for 5,000,000z";
switch(select("Ok do it:No thx...")) {
case 1:
mes "Ok...";
next;
if (Zeny < 5000000) {
mes "You dont have enought zeny...";
close;
}
else {
mes "Allright, good luck!";
next;
set Zeny,Zeny-5000000;
callfunc( "F_PartyReCall" );
close;
}
case 2:
mes "As you wish..";
next;
close;
}
}

and this function (took from another post of capcuhe, thanks o:!)

function	script	F_PartyReCall	{
    if(getpartyleader(getcharid(1),2) == getcharid(0)) {
        set .@leader, getcharid(3);
        getmapxy .@mapl$, .@xl, .@yl, 0;
        getpartymember getcharid(1),2;
        set .@partymembercount, $@partymembercount;
        copyarray .@partymemberaid[0], $@partymemberaid[0], .@partymembercount;
        for(set .@i, 0; .@i < .@partymembercount; set .@i, .@i + 1) {
            if(attachrid(.@partymemberaid[.@i])) {
                if(HP > 0 && getcharid(3) != .@leader) {
                    warp .@mapl$, .@xl, .@yl;
                }
            }
        }
    }
    return;
}

when i choose no it's ok

whe i choose yes and i don't have money it's ok too

but if i choose yes and i have the money the npc recalls the party, but it gets stuck

which doesnt allow me to close the message window and continue D: dunno why

i tried a lot of thigns but no one worked

here is an example

dDjfImx.png

i would like to know how to make it close the last window

i know, it sounds simple, but for a weird reason i can't make it ): 

what did i miss or what i'm not lloking D:?

 

thanks in advance o:!

2 answers to this question

Recommended Posts

Posted

that's because inside the *callfunc made by Capuche, he uses attachrid

and he didn't attachrid back to the original RID

prontera,156,188,4	script	Call Allies	100,{
	mes "I can recall your party for 5,000,000z";
	if ( select( "Ok do it", "No thx..." ) == 2 ) {
		mes "As you wish..";
		close;
	}
	if ( !getcharid(1) ) { // you need this check as well
		mes "You don't even have a party ...";
		close;
	}
	if ( Zeny < 5000000 ) {
		mes "You don't have enough zeny...";
		close;
	}
	mes "All right, good luck !";
	next;
	Zeny = Zeny - 5000000;
	.@origin = getcharid(3); // <-- save the original RID
	getmapxy .@map$, .@x, .@y, 0;
	getpartymember getcharid(1), 1;
	getpartymember getcharid(1), 2;
	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
			attachrid $@partymemberaid[.@i];
			if ( Hp > 0 && getcharid(3) != .@origin && !getmapflag( strcharinfo(3), mf_nowarp ) ) // need another check to prevent players warp outside from events
				warp .@map$, .@x, .@y;
		}
	}
	attachrid .@origin; // attach back to original RID
	mes "Your party member has gather around you !";
	close;
}
  • Upvote 1

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