//-----------------------------------------------------------
// 
//-----------------------------------------------------------
class RPGSmug expands BotScripted2;


var _MMRPGPlayer talkto;
var int talked;
var int errand;

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

Function PostBeginPlay()
{
	SetOrders('Wandering',, True);
	Super.PostBeginPlay();
}

function ChatWith(Pawn Frobber)
{
	local _MMRPGPlayer Player;
	local Medkit med;

	If (Frobber.IsA('DeusExPlayer'))
	{
		If(talked != 0)
		{
			if(DeusExPlayer(Frobber) == talkto)
				return;

			_MMRPGPlayer(Frobber).ReceiveMessage("Someone is already talking to this person!");
			return;
		}
		if(errand != 0)
		{
			_MMRPGPlayer(Frobber).ReceiveMessage("This person is busy!");
			return;
		}
	}

	Player = _MMRPGPlayer(Frobber);
	talkto = Player;

	Player.bInConv = True;
		LookAtActor(Frobber, True, True, False);
	
	if (player.contmission == 1)
	{
		Player.ReceiveMessage("ARMS DEALER: Yes?");
		talked = 1;
		SetTimer(2.4,False);
		return;
	}

	else if (player.contmission == 2)
	{
		Player.ReceiveMessage("ARMS DEALER: Yes?");
		talked = 2;
		SetTimer(2.4,False);
		return;
	}
}

/*
function Frob(Actor Frobber, Inventory frobWith)
{
	local _MMRPGPlayer Player;

	If (Frobber.IsA('DeusExPlayer'))
	{
		If(talked != 0)
		{
			_MMRPGPlayer(Frobber).ReceiveMessage("Someone is already talking to this person!");
			return;
		}
		if(errand != 0)
		{
			_MMRPGPlayer(Frobber).ReceiveMessage("This person is busy!");
			return;
		}
	}

	Player = _MMRPGPlayer(Frobber);
		LookAtActor(Frobber, True, True, False);
	talkto = Player;

	if (Player.contmission == 2)
	{
		Player.ReceiveMessage(""$Player.PlayerReplicationInfo.PlayerName$": What ammunition do you have?");
		talked = 4;
		SetTimer(3.6,False);
		return;
	}
}
*/

function Timer()
{
	local MMRPGCreditCard Cred;
	local Keydummy hmm2;
	local RPGSpawn Spawnobject;
	local AptWeapzIn Pla;

	if (talked == 1)
	{
		talkto.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": Open up!");
		talked = 0;
		talkto.bInConv = False;
		return;
	}

	else if (talked == 2)
	{
		talkto.ReceiveMessage(""$talkto.PlayerReplicationInfo.PlayerName$": I'm interested in buying some weapons");
		talked = 3;
		SetTimer(4.5,False);
		return;
	}

	else if (talked == 3)
	{
		talkto.ReceiveMessage("ARMS DEALER: Uh, come in then");
		foreach AllActors(class'AptWeapzIn', Pla)
		{
			Pla.GoLagshotGo(talkto);
		}
		talked = 0;
		talkto.bInConv = False;
		return;
	}

	else if (talked == 4)
	{
		errand = 1;
		talkto.ReceiveMessage("ARMS DEALER: Some 5.45mm, .440 Corbon, erm, let me check.");
		talked = 0;
		talkto.bInConv = False;
		SetOrders('GoingTo', 'ADAway', True);
		SetTimer(2.5,False);
		return;
	}

	if(errand == 1)
	{
		errand = 2;
		SetOrders('GoingTo', 'ADBack', True);
		SetTimer(2.5,False);
	}

	if(errand == 2)
	{
		errand = 0;
		SetOrders('Wandering',, True);
	}
}


defaultproperties
{
     InitialAlliances(0)=(AllianceName=Player,AllianceLevel=1.000000,bPermanent=False)
     bfearAlarm=False
     bFearCarcass=False
     bFearDistress=False
     bFearShot=False
     bFearIndirectInjury=False
     bInvincible=True
     bHateShot=True
     bHateInjury=True
     bHateIndirectInjury=True
     bHateWeapon=True
     bReactPresence=True
     bEmitDistress=False
     bInvincible=True
     CarcassType=Class'DeusEx.CopCarcass'
     Orders='Wandering'
     WalkingSpeed=0.296000
     InitialInventory(0)=(Inventory=Class'Contender.BotAssaultGun3')
     walkAnimMult=0.780000
     GroundSpeed=200.000000
     Mesh=LodMesh'DeusExCharacters.GM_Trench'
     MultiSkins(0)=Texture'DeusExCharacters.Skins.FordSchickTex0'
     MultiSkins(1)=Texture'DeusExCharacters.Skins.JuanLebedevTex2'
     MultiSkins(2)=Texture'DeusExCharacters.Skins.AlexJacobsonTex2'
     MultiSkins(3)=Texture'DeusExCharacters.Skins.JuanLebedevTex2'
     MultiSkins(4)=Texture'DeusExCharacters.Skins.JockTex1'
     MultiSkins(5)=Texture'DeusExCharacters.Skins.JuanLebedevTex2'
     MultiSkins(6)=Texture'DeusExItems.Skins.GrayMaskTex'
     MultiSkins(7)=Texture'DeusExItems.Skins.PinkMaskTex'
     CollisionRadius=20.000000
     CollisionHeight=47.500000
     BindName="ArmsDealer"
     FamiliarName="Arms Dealer"
     UnfamiliarName="Arms Dealer"
     DrawType=DT_Mesh
}
