Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===== Hercules Plugin ======================================
- //= @refresh NPC fix
- //===== By ===================================================
- //= Wolfie of BlackoutRO (https://blackout-ro.net)
- //===== Description ==========================================
- //= Fixes issue of client getting stuck when using the
- // @refresh command.
- //= npc_rr_secure_timeout_timer is where this code comes from.
- //============================================================
- #include "common/hercules.h"
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include "map/atcommand.h"
- #include "map/clif.h"
- #include "map/npc.h"
- #include "map/pc.h"
- #include "common/HPMDataCheck.h"
- HPExport struct hplugin_info pinfo = {
- "@refresh NPC Fix", // Plugin name
- SERVER_TYPE_MAP, // Which server types this plugin works with?
- "1.0", // Plugin version
- HPM_VERSION, // HPM Version (don't change, macro is automatically updated)
- };
- ACMD(refresh)
- {
- if (sd->npc_id) {
- /**
- * If we still have the NPC script attached, tell it to stop.
- **/
- if (sd->st)
- sd->st->state = END;
- sd->state.menu_or_input = 0;
- sd->npc_menu = 0;
- clif->scriptclose(sd, sd->npc_id);
- /**
- * We will end the script ourselves, client will request to end it again if it have dialog,
- * however it will be ignored, workaround for client stuck if NPC have no dialog. [hemagx]
- **/
- sd->state.dialog = 0;
- npc->scriptcont(sd, sd->npc_id, true);
- }
- clif->refresh(sd);
- return true;
- }
- /* Server Startup */
- HPExport void plugin_init(void)
- {
- addAtcommand("refresh", refresh);
- }
- HPExport void server_online(void)
- {
- ShowInfo("'%s' Plugin by Wolfie/blackout-ro.net. Version '%s'\n", pinfo.name, pinfo.version);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement