//================= Hercules Script =======================================
//=       _   _                     _
//=      | | | |                   | |
//=      | |_| | ___ _ __ ___ _   _| | ___  ___
//=      |  _  |/ _ \ '__/ __| | | | |/ _ \/ __|
//=      | | | |  __/ | | (__| |_| | |  __/\__ \
//=      \_| |_/\___|_|  \___|\__,_|_|\___||___/
//================= License ===============================================
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
//= Copyright (C) 2023-2026 Hercules Dev Team
//= Copyright (C) KirieZ
//=
//= Hercules is free software: you can redistribute it and/or modify
//= it under the terms of the GNU General Public License as published by
//= the Free Software Foundation, either version 3 of the License, or
//= (at your option) any later version.
//=
//= This program is distributed in the hope that it will be useful,
//= but WITHOUT ANY WARRANTY; without even the implied warranty of
//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//= GNU General Public License for more details.
//=
//= You should have received a copy of the GNU General Public License
//= along with this program.  If not, see <http://www.gnu.org/licenses/>.
//=========================================================================
//= DynamicNPC Create
//= This NPC is invoked when client sends a "DynamicNPC Create Request".
//=
//= It is expected that the script provides an answer with dynamicnpccreateresult()
//=========================================================================

-	script	dynamicnpc_create	FAKE_NPC,{
	end;

// @name$ contains the name sent by the client
OnRequest:
	if (strcmp(@name$, "GOLDPCCAFE") == 0) {
		if (!calldynamicnpc("GoldPC_NPC")) {
			dynamicnpccreateresult(DYNAMICNPC_RESULT_DUPLICATED);
			end;
		}

		dynamicnpccreateresult(DYNAMICNPC_RESULT_SUCCESS);
		end;
	}

	consolemes(CONSOLEMES_DEBUG, sprintf("dynamicnpc_create::OnRequest: Received unhandled name \"%s\"", @name$));
	dynamicnpccreateresult(DYNAMICNPC_RESULT_UNKNOWN);
	end;
}
