awesomazingxed Posted January 21, 2015 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
Radian Posted January 21, 2015 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
1 Radian Posted February 20, 2018 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
0 maken06 Posted February 20, 2018 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
0 lanblakebea Posted January 5, 2020 Posted January 5, 2020 how to add cast time or at least 5 seconds time before warping? Quote
Garkor Posted January 21, 2015 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
EL Dragon Posted January 21, 2015 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
Luciar Posted January 21, 2015 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
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.
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.