awesomazingxed Posted January 21, 2015 Group: Members Topic Count: 51 Topics Per Day: 0.01 Content Count: 95 Reputation: 1 Joined: 10/24/14 Last Seen: August 7, 2015 Share Posted January 21, 2015 Hello Everyone. Can someone make me a custom commands that has a function to warp in a specific location. @maintown = ( @warp phtownall 199,184 ) @mall = ( @warp turbo_room 100, 100 ) @event = ( @warp quiz_02 100,100 ) @donate = ( @warp turbo_room 200,200 ) I know there's @go commands. But is it possible to make a commands like that? Thank you in advance. Ciao. Quote Link to comment Share on other sites More sharing options...
Radian Posted January 21, 2015 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 1546 Reputation: 192 Joined: 07/23/14 Last Seen: June 24, 2024 Share Posted January 21, 2015 Try this you can do the same thing for others just change the " maintown " - script maintown -1,{ OnInit: bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: atcommand "@warp phtownall 199 184"; end; } 1 Quote Link to comment Share on other sites More sharing options...
1 Radian Posted February 20, 2018 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 1546 Reputation: 192 Joined: 07/23/14 Last Seen: June 24, 2024 Share Posted February 20, 2018 4 minutes ago, maken06 said: Is it possible to add restrictions so that it is only used for a level 45 gm? @Radian Change this part bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand"; Into this bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand",45,99; So a level 45 and 99 GM can only access this command. 1 Quote Link to comment Share on other sites More sharing options...
0 maken06 Posted February 20, 2018 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 234 Reputation: 115 Joined: 02/24/15 Last Seen: March 20, 2024 Share Posted February 20, 2018 On 21/1/2015 at 3:50 PM, Radian said: Try this you can do the same thing for others just change the " maintown " - script maintown -1,{ OnInit: bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: atcommand "@warp phtownall 199 184"; end; } Is it possible to add restrictions so that it is only used for a level 45 gm? @Radian Quote Link to comment Share on other sites More sharing options...
0 lanblakebea Posted January 5, 2020 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 16 Reputation: 0 Joined: 02/16/16 Last Seen: January 22, 2020 Share Posted January 5, 2020 how to add cast time or at least 5 seconds time before warping? Quote Link to comment Share on other sites More sharing options...
Garkor Posted January 21, 2015 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 69 Reputation: 3 Joined: 09/04/14 Last Seen: July 23, 2015 Share Posted January 21, 2015 (edited) Hello guy, i have try it and it works fine. You have to do 4 steps. First of all: [step 1] Add your custom Map in the src/common/mapindex.h file. After: #define MAP_ECLAGE_IN "ecl_in01" add this: #define MAP_MAINTOWN "phtownall" Now. Step 2. Open your src/map/atcommands.c file. Search for: /*========================================== * @tonpc *------------------------------------------*/ ACMD_FUNC(tonpc) { char npcname[NAME_LENGTH+1]; struct npc_data *nd; nullpo_retr(-1, sd); memset(npcname, 0, sizeof(npcname)); if (!message || !*message || sscanf(message, "%23[^\n]", npcname) < 1) { clif_displaymessage(fd, msg_txt(sd,1129)); // Please enter a NPC name (usage: @tonpc <NPC_name>). return -1; } if ((nd = npc_name2id(npcname)) != NULL) { if (pc_setpos(sd, map_id2index(nd->bl.m), nd->bl.x, nd->bl.y, CLR_TELEPORT) == 0) clif_displaymessage(fd, msg_txt(sd,0)); // Warped. else return -1; } else { clif_displaymessage(fd, msg_txt(sd,111)); // This NPC doesn't exist. return -1; } return 0; } And after it add this: /*========================================== * @maintown *------------------------------------------*/ ACMD_FUNC(maintown) { if (pc_setpos(sd, mapindex_name2id(MAP_MAINTOWN), 119, 184, CLR_TELEPORT) == 0){ clif_displaymessage(fd, msg_txt(sd,0)); // Warped. } else { return -1; } return 0; } After you finish that go to Step 3. Search for ACMD_DEF(tonpc), And after it add this one: ACMD_DEF(maintown), Last but not least: Step 4. Recompile your server and test it. It works fine for me You can use it for all 4 commands. I hope you like it and I hope you have a lot of fun with it. http://pastebin.com/D144ZaQ9 Best regards, Garkor Edited January 21, 2015 by Garkor Quote Link to comment Share on other sites More sharing options...
EL Dragon Posted January 21, 2015 Group: Members Topic Count: 86 Topics Per Day: 0.02 Content Count: 591 Reputation: 146 Joined: 06/19/12 Last Seen: December 10, 2016 Share Posted January 21, 2015 use bindatcmd - script warp#11 -1,{ OnInit: bindatcmd "maintown ", strnpcinfo(3) +"::OnMaintown"; bindatcmd "mall", strnpcinfo(3) +"::OnMall"; bindatcmd "event", strnpcinfo(3) +"::OnEvent"; bindatcmd "donate", strnpcinfo(3) +"::OnDonate"; end; OnMaintown: warp "phtownall",199,184; end; OnMall: warp "turbo_room",100,100; end; OnEvent: warp "quiz_02",100,100; end; OnDonate: warp "turbo_room",200,200; end; } Quote Link to comment Share on other sites More sharing options...
Luciar Posted January 21, 2015 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 177 Reputation: 21 Joined: 01/31/12 Last Seen: March 8, 2020 Share Posted January 21, 2015 use bindatcmd - script warp#11 -1,{ OnInit: bindatcmd "maintown ", strnpcinfo(3) +"::OnMaintown"; bindatcmd "mall", strnpcinfo(3) +"::OnMall"; bindatcmd "event", strnpcinfo(3) +"::OnEvent"; bindatcmd "donate", strnpcinfo(3) +"::OnDonate"; end; OnMaintown: warp "phtownall",199,184; end; OnMall: warp "turbo_room",100,100; end; OnEvent: warp "quiz_02",100,100; end; OnDonate: warp "turbo_room",200,200; end; } Each atcommand is only allowed one binding. If you rebind, it will override the original binding. and - script maintown -1,{ OnInit: bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: atcommand "@warp phtownall 199 184"; end; }Why use atcommand "@war... when you can use the warp script command?i.e. warp "phtownhall",199,184;So.. Maybe something like this (untested): - script atcmdwarp#Maintown -1,{ OnInit: bindatcmd strnpcinfo(3)+"::On"+strnpcinfo(3); end; OnMaintown: warp "phtownall",199,184; end; OnMall: warp "turbo_room",100,100; end; OnEvent: warp "quiz_02",100,100; end; OnDonate: warp "turbo_room",200,200; end; } - duplicate(Maintown) atcmdwarp#Mall -1 - duplicate(Maintown) atcmdwarp#Event -1 - duplicate(Maintown) atcmdwarp#Donate -1 Quote Link to comment Share on other sites More sharing options...
Question
awesomazingxed
Hello Everyone. Can someone make me a custom commands that has a function to warp in a specific location.
@maintown = ( @warp phtownall 199,184 )
@mall = ( @warp turbo_room 100, 100 )
@event = ( @warp quiz_02 100,100 )
@donate = ( @warp turbo_room 200,200 )
Thank you in advance. Ciao.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.