//=============================================================================
// Hooker1.
//=============================================================================
class RPGRestOwner extends HumanCivilian;

var _MMRPGPlayer talkto;
var int talked;

function TakeDamageBase(int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType,
                        bool bPlayAnim)
{}

function Frob(Actor Frobber, Inventory frobWith)
{
	local RestRecipe Inv;
	local MMRPGCreditCard Cred;
	local _MMRPGPlayer Player;

	If (Frobber.IsA('DeusExPlayer'))
	{
		LookAtActor(Frobber, True, True, False);
		If(talked != 0)
		{
			_MMRPGPlayer(Frobber).ReceiveMessage("Someone is already talking to this person!");
			return;
		}
	}

//	Super.Frob(Frobber, frobWith);
	Player = _MMRPGPlayer(Frobber);
	talkto = Player;

	Player.bInConv = True;
		LookAtActor(Frobber, True, True, False);

	if (Player.Colamission == 1)
	{
		Player.ReceiveMessage("RESTAURANT OWNER: Is everything satisfactory?");
		talked = 1;
		SetTimer(3.5,False);
		return;
	}

	if (Player.Colamission == 2)
	{
		Player.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": Do you know where I can get some BlueCola?");
		talked = 2;
		SetTimer(3.7,False);
		return;
	}
			
	if (Player.Colamission == 3)
	{
		Inv=None;
		foreach AllActors(class'RestRecipe', Inv)
		{
			if (Inv.Owner == Player)
			{
				if (Inv != None)
				{
					Inv.Destroy();
					Player.ReceiveMessage("RESTAURANT OWNER: Thanks for the recipe, our store is through the door behind the counter");
					talked = 9;
					SetTimer(4.3,False);
					return;
				}
			}
		}

		if (Inv == None)
		{
			Player.ReceiveMessage("RESTAURANT OWNER: Get the secret recipe for me from the Pung-Yau Restaurant");
			Player.bInConv = False;
			talked = 0;
		}
	}

	if (Player.Colamission > 3)
	{
		Player.ReceiveMessage("RESTAURANT OWNER: Is everything satisfactory?");
		talked = 1;
		SetTimer(3.5,False);
		return;
	}
}


function Timer()
{

local MMRPGCreditCard Cred;

	if (talked == 1)
	{
		talkto.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": Yes thank you");
		talkto.bInConv = False;
		talked = 0;
		return;
	}

	else if (talked == 2)
	{
		talkto.ReceiveMessage("RESTAURANT OWNER: Ah... That's a very rare product that hasn't come out yet");
		talked = 3;
		SetTimer(3.8,False);
		return;
	}

	else if (talked == 3)
	{
		talkto.ReceiveMessage("RESTAURANT OWNER: There are only a few cans of it in the world");
		talked = 4;
		SetTimer(3.7,False);
		return;
	}

	else if (talked == 4)
	{
		talkto.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": Is there any way that I could get hold of a can?");
		talked = 5;
		SetTimer(3.5,False);
		return;
	}

	else if (talked == 5)
	{
		talkto.ReceiveMessage("RESTAURANT OWNER: We have several cans in our stores, and I may be willing to part with them...");
		talked = 6;
		SetTimer(4.3,False);
		return;
	}

	else if (talked == 6)
	{
		talkto.ReceiveMessage("RESTAURANT OWNER: for a small favour of course - Our rival is the Pung-Yau Restaurant");
		talked = 7;
		SetTimer(4.0,False);
		return;
	}
	else if (talked == 7)
	{
		talkto.ReceiveMessage("RESTAURANT OWNER: I want you to go to the Pung-Yau and steal their secret recipe");
		talkto.Colamission = 3;
		talkto.ClientMessage("Goal Received (Press F2 for details)");
		talkto.bInConv = False;
		talked = 0;
		return;
	}
	else if (talked == 9)
	{
		talkto.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": Awesome");
		talkto.SkillPointsAdd(400);
		talkto.Colamission = 4;
		talkto.ClientMessage("Goal Completed");
		talkto.ClientMessage("400 Skill Points awarded! Progress Bonus");
		talkto.bInConv = False;
		talked = 0;
		return;
	}
}

defaultproperties
{
     bfearAlarm=False
     bFearCarcass=False
     bFearDistress=False
     bFearShot=False
     bFearIndirectInjury=False
     Orders=Standing
     bInvincible=True
     bHateShot=False
     bHateInjury=False
     bReactPresence=False
     bEmitDistress=False
     CarcassType=Class'DeusEx.ChefCarcass'
     WalkingSpeed=0.213333
     walkAnimMult=0.750000
     GroundSpeed=180.000000
     Mesh=LodMesh'DeusExCharacters.GM_Suit'
     MultiSkins(0)=Texture'DeusExCharacters.Skins.ChefTex0'
     MultiSkins(1)=Texture'DeusExCharacters.Skins.PantsTex10'
     MultiSkins(2)=Texture'DeusExCharacters.Skins.ChefTex0'
     MultiSkins(3)=Texture'DeusExCharacters.Skins.ChefTex1'
     MultiSkins(4)=Texture'DeusExCharacters.Skins.ChefTex1'
     MultiSkins(5)=Texture'DeusExItems.Skins.GrayMaskTex'
     MultiSkins(6)=Texture'DeusExItems.Skins.BlackMaskTex'
     MultiSkins(7)=Texture'DeusExCharacters.Skins.ChefTex3'
     CollisionRadius=20.000000
     CollisionHeight=47.500000
     BindName="Chef"
     FamiliarName="Restaurant Owner"
     UnfamiliarName="Restaurant Owner"
}
