Jump to content
  • 0

Warp NPC


Kami675

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  90
  • Reputation:   1
  • Joined:  10/17/13
  • Last Seen:  

Hello again everyone, I am currently looking for a NPC that if clicked by a GM will warp all players on that map to its location. This is for a Death by Dice game. I have everything setup but i'm having a issue with warping players out of the boxes that didn't die and it's really annoying warping them out 1 by 1 =/

 

thanks in advance

- Kris

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


- script atcmd_example -1,{

OnInit:

bindatcmd "recallmap",strnpcinfo(3)+"::OnAtcommand";

end;

OnAtcommand:

.count = 0;

.origin = getcharid(3) ;

getmapxy .map_self$, .x_self, .y_self, 0;

addrid 4,0, 1,200,1,200;

.count++;

warp .map_self$, .x_self, .y_self;

if ( getcharid(3) != .origin ) end;

dispbottom .count + " player(s) recalled";

end;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  90
  • Reputation:   1
  • Joined:  10/17/13
  • Last Seen:  

-	script	atcmd_example	-1,{
OnInit:
	bindatcmd "recallmap",strnpcinfo(3)+"::OnAtcommand";
	end;
OnAtcommand:
	.count = 0;
	.origin = getcharid(3) ;
	getmapxy .map_self$, .x_self, .y_self, 0;

	addrid 4,0, 1,200,1,200;
	.count++;
	warp .map_self$, .x_self, .y_self;
	if ( getcharid(3) != .origin ) end;
	dispbottom .count + " player(s) recalled";
	end;
}

I'm sorry to ask a stupid question but where should I place this? xD

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Adding_a_Script

Then --> @recallmap

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  90
  • Reputation:   1
  • Joined:  10/17/13
  • Last Seen:  

Adding_a_Script

Then --> @recallmap

erm i probably should of mentioned I use eAthena lol so the coding will prob be different >_< sry

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

eAthena doesn't support direct variable initiation and doesn't support bindatcmd command as far as i know :P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

I am currently looking for a NPC that if clicked by a GM will warp all players on that map to its location.

then its time to show some "oldies" tricks

 

guild_vs2,49,49,5    script    dkfjdhsfkjsh    100,{
    while ( getd( ".aid_"+ .@i ) ) {
        if ( isloggedin( getd( ".aid_"+ .@i ) ) ) {
            attachrid getd( ".aid_"+ .@i );
            getmapxy .@map$, .@x, .@y, 0;
            if ( .@map$ != .map$ ) {
                callsub L_moveindex, .@i;
                set .@i, .@i -1;
            }
            else
                warp .map$, .x, .y;
        }
        else {
            callsub L_moveindex, .@i;
            set .@i, .@i -1;
        }
        set .@i, .@i +1;
    }
    announce .mapcount +" players warpped", bc_npc;
    end;
L_moveindex:
    .@i = getarg(0);
    while ( .@i < .mapcount ) {
        setd ".aid_"+ .@i, getd( ".aid_"+( .@i +1 ) );
        set .@i, .@i +1;
    }
    set .mapcount, .mapcount -1;
    return;
OnPCLoadMapEvent:
    while ( getd( ".aid_"+ .@i ) != getcharid(3) && .@i < .mapcount )
        set .@i, .@i +1;
    if ( .@i < .mapcount ) end;
    setd ".aid_"+ .@i, getcharid(3);
    set .mapcount, .mapcount +1;
    end;
OnInit:
    getmapxy .map$, .x, .y, 1;
    end;
}
guild_vs2    mapflag    loadevent

This is for a Death by Dice game. I have everything setup but i'm having a issue with warping players out of the boxes that didn't die and it's really annoying warping them out 1 by 1 =/

try show your dice game script

I'm very sure that script having problems with *areawarp script command

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