------------------------------------------------------------------ -- \author miyazaki -- \date 2010/04/22 ------------------------------------------------------------------ -- sa25d -> sa25e への移動不可イベント local id = ccGetScriptId(); local targetDir = 90; local moveDist = 100; while ( true ) do ccSuspendScript(); -- プレイヤーロック ccSetAdvPlayerLockOperate( id, false ); ccSetAdvPlayerState( id, CCD_ADV_CHARA_STATE_WAIT ); ccSetAdvSupportLockOperateAll( false ); -- イベントコリジョンオフ ccSetAdvMobEventCollision( id, false ); local num = math.random( 0, 3 ); if num == 0 then MobUtil_TalkMsgLeader( id, "talk_al_ssk_00" ); elseif num == 1 then MobUtil_TalkMsgLeader( id, "talk_al_ssk_01" ); elseif num == 2 then MobUtil_TalkMsgLeader( id, "talk_al_ssk_02" ); elseif num == 3 then MobUtil_TalkMsgLeader( id, "talk_al_ssk_03" ); end ccInitAdvPlayerRotation( id, 0, 0, targetDir ); local pos = ccGetPlayerPosition( id ); local dir = ccGetPlayerDirection( id ); dir = ccAdvEventVector3Normalize( dir ); dir = ccAdvEventVector3Scale( dir, moveDist ); local targetPos = ccAdvEventVector3Add( pos, dir ); -- 移動させる ccWalkAdvPlayer( id, targetPos.x, targetPos.y, targetPos.z ); ccWaitPlayerAct( id ); ccSuspendScript(); -- イベントヒットを復活 ccSetAdvMobEventCollision( id, true ); -- プレイヤーロック解除 ccSetAdvPlayerLockOperate( id, true ); ccSetAdvSupportLockOperateAll( true ); end -- while(true)