#library "NyssDial.acs"
#include "zcommon.acs"
#import "InterCustomFunctions.acs"

//Nyss

Script "BYOCNyssInteractButtonDisplay" (void) NET
{
	int plr = PlayerNumber();
	if (plr!=-1)
	{
		NamedExecuteClientScript("NyssButtonDisplayClient", plr,0.25); 
	}
}

Script "NyssButtonDisplayClient" (int frametime) CLIENTSIDE
{
	HudMessage(s:"Press USE [ ", k:"+use", s:" ] to talk to the Nyss"; HUDMSG_PLAIN, 309, CR_YELLOW, 0.5, 0.65, frametime);
}

Script "BYOCNyssInteractionStart" (void) NET
{
	int plr = PlayerNumber();
	if (plr!=-1)
	{
		NamedExecuteClientScript("BYOCNyssInteractionStartClient", plr,plr); 
	}
}

Script "BYOCNyssInteractionStartClient" (int myPLR) CLIENTSIDE
{
	int plr = myPLR;
	int mySkinIndex = GetPlayerSkin(plr,0);
	str skinName = GetSkinProperty (mySkinIndex,"Name",0,0);
	
	str classSpecificScript = strparam(s:GetActorClass(0), s:"_BYOCNyssInteraction");
	str skinSpecificScript = strparam(s:skinName, s:"skin_BYOCNyssInteraction");
	
	localDialogueCharacterArray[0] = "Nyss";
	localDialoguePortraitArray[0] = "NPC5ST01";
	localDialogueSoundArray[0] = strparam(s:"toink");
	
	if (StrICmp(skinName, "base") != 0)
	{
		if (CheckScript(skinSpecificScript,true))
		{
			ACS_NamedExecuteWithResult(skinSpecificScript, 0, 0, 0, 0);
			terminate;
		}
	}
	
	if (CheckScript(classSpecificScript,true))
	{
		ACS_NamedExecuteWithResult(classSpecificScript, 0, 0, 0, 0);
		terminate;
	}

	int randomNum = Random(0,7);

	
	switch(randomNum)
	{
		case 0: 
			localDialogueArray[0] = strparam(s:"I didn't have enough money for the \nplane tickets. ");
			localDialogueArray[1] = strparam(s:"They said 'battle glowy' is not \na cuwwency. So I'm now employed! ");
			localDialoguePortraitArray[1] = "NPC5ST01";
			break;
		case 1: 
			localDialogueArray[0] = strparam(s:"Do chicken weally have fingews? \nThat's scawy.");
			break;
		case 2: 
			localDialogueArray[0] = strparam(s:"I'm not fwat. \nI have body awmow.");
			break;
		case 3: 
			localDialogueArray[0] = strparam(s:"Gwa gwa.");
			localDialoguePortraitArray[0] = "NPC5ST04";
			break;
		case 4: 
			localDialogueSoundArray[0] = strparam(s:"fat");
		    localDialoguePortraitArray[0] = "NPC5ST02";
			localDialogueArray[0] = strparam(s:" ");
			break;
		case 5: 
			localDialogueArray[0] = strparam(s:"Listen to the belly. \nIt holds the knowledge.");
			break;
		case 6:
			localDialogueArray[0] = strparam(s:"Teo tells me that I won't get a \nwaise if I keep talking to you about waw.");
			localDialogueArray[1] = strparam(s:"But Teo doesn't know I'm \nalweady waising...");
			localDialogueArray[2] = strparam(s:"canes.");
			localDialoguePortraitArray[0] = "NPC5ST01";
			localDialoguePortraitArray[1] = "NPC5ST01"; localDialoguePortraitArray[2] = "NPC5ST04";
			break;
		case 7:
			localDialogueArray[0] = strparam(s:"I wouldn't eat the wats from \nthe gwound if I wewe you.");
			break;
	}
	
	ACS_NamedExecuteWithResult("BYOCStartGenericConversationBasic");
	
}

Script "DrDoomguy_BYOCNyssInteraction" (int myPLR) CLIENTSIDE
{

			localDialogueArray[0] = strparam(s:"Can you sew limbs back togethew? \nWould be useful.");
			localDialoguePortraitArray[0] = "NPC5ST04";
			ACS_NamedExecuteWithResult("BYOCStartGenericConversationBasic");
	
}

Script "Doomslayer_BYOCNyssInteraction" (int myPLR) CLIENTSIDE
{

			localDialogueArray[0] = strparam(s:"A wwist blade is a gweat choice.\nI need to invest into that myself.");
			localDialogueArray[1] = strparam(s:"I'm too wide to weach fow \nmy knife fwom behind sometimes.");
			localDialoguePortraitArray[0] = "NPC5ST01";
			localDialoguePortraitArray[1] = "NPC5ST04";
			ACS_NamedExecuteWithResult("BYOCStartGenericConversationBasic");
	
}

Script "RaymanClass_BYOCNyssInteraction" (int myPLR) CLIENTSIDE
{

			localDialogueArray[0] = strparam(s:"Can you launch youw fists like \nawwows? Wish I could do that too...");
			localDialogueArray[1] = strparam(s:"They don't make shelves \nfor shorties nowadays.");
			localDialoguePortraitArray[0] = "NPC5ST01";
			localDialoguePortraitArray[1] = "NPC5ST04";
			ACS_NamedExecuteWithResult("BYOCStartGenericConversationBasic");
	
}