Litro Endemic Posted September 8, 2018 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 283 Reputation: 79 Joined: 06/13/13 Last Seen: June 7, 2023 Share Posted September 8, 2018 Can anyone help me to covert atcommand addwarp to script function with additional paramter, the parameter should look like below? *addwarp("warpname","mapname",x,y,"mapname_target",x_destination,y_destination); also can the warp added be deleted with unloadnpc? because atcommand addwarp is persist until reboot Quote Link to comment Share on other sites More sharing options...
0 Functor Posted September 9, 2018 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 352 Reputation: 267 Joined: 09/08/13 Last Seen: 23 hours ago Share Posted September 9, 2018 Open ../src/map/script.cpp and before: /// script command definitions /// for an explanation on args, see add_buildin_func struct script_function buildin_func[] = { add: BUILDIN_FUNC(addwarp) { struct npc_data *nd; const char *warpname; const char *mapname_src; const char *mapname_dst; unsigned short m_src, m_dst; int x_src, y_src, x_dst, y_dst; warpname = script_getstr(st,2); mapname_src = script_getstr(st,3); x_src = script_getnum(st,4); y_src = script_getnum(st,5); mapname_dst = script_getstr(st,6); x_dst = script_getnum(st,7); y_dst = script_getnum(st,8); if ((m_src = map_mapname2mapid(mapname_src)) < 0) { return SCRIPT_CMD_FAILURE; } if ((m_dst = mapindex_name2id(mapname_dst)) == 0) { return SCRIPT_CMD_FAILURE; } nd = npc_add_warp((char*)warpname, m_src, x_src, y_src, 2, 2, m_dst, x_dst, y_dst); if (nd == NULL) { return SCRIPT_CMD_FAILURE; } return SCRIPT_CMD_SUCCESS; } after: /// script command definitions /// for an explanation on args, see add_buildin_func struct script_function buildin_func[] = { add: BUILDIN_DEF(addwarp, "ssiisii"), P.S. @unloadnpc works fine for me. 1 Quote Link to comment Share on other sites More sharing options...
0 Litro Endemic Posted September 9, 2018 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 283 Reputation: 79 Joined: 06/13/13 Last Seen: June 7, 2023 Author Share Posted September 9, 2018 thanks functor Quote Link to comment Share on other sites More sharing options...
Question
Litro Endemic
Can anyone help me to covert atcommand addwarp to script function with additional paramter, the parameter should look like below?
*addwarp("warpname","mapname",x,y,"mapname_target",x_destination,y_destination);
also can the warp added be deleted with unloadnpc? because atcommand addwarp is persist until reboot
Link to comment
Share on other sites
2 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.