ScriptName aaaKimachuuBountyHunterToggle Extends ActiveMagicEffect

Actor Property PlayerRef Auto ;プレイヤー
Location Property loc01 Auto ;隔離セルのロケーション
Message Property mes01 Auto ;撤去メッセージ
Message Property mes02 Auto ;設置メッセージ
Message Property mes03 Auto ;エラーメッセージ
Message Property mes04 Auto ;受注中エラーメッセージ
ObjectReference Property marker01 Auto ;隔離セルのマーカー
ObjectReference Property BB01 Auto ;掲示板のRef
Quest Property que01 Auto ;検索および実行クエスト

Float fltAngle
Float fltX
Float fltY
Float fltZ

Event OnEffectStart(Actor akTarget, Actor akCaster)
	If que01.GetCurrentStageID() == 10
		mes04.Show()
		Return
	EndIf

	If (BB01.GetParentCell() == PlayerRef.GetParentCell())
		BB01.Disable()
		BB01.MoveTo(marker01)
		BB01.Enable()
		mes01.Show()
	ElseIf (loc01 == BB01.GetCurrentLocation())
		BB01.Disable()
		fltAngle = PlayerRef.GetAngleZ()
		fltX = PlayerRef.GetPositionX() + Math.Sin(fltAngle) * 75
		fltY = PlayerRef.GetPositionY() + Math.Cos(fltAngle) * 75
		fltZ = PlayerRef.GetPositionZ()
		BB01.MoveTo(PlayerRef)
		BB01.SetPosition(fltX, fltY, fltZ - 5)
		BB01.SetAngle(0, 0, fltAngle + 180)
		BB01.Enable()
		mes02.Show()
	Else
		mes03.Show()
	EndIf
EndEvent