function PetBaseRoutine( PetMem ) cExecCheck( "PetBaseRoutine" ) if PetMem == nil then DebugLog( "PetBaseRoutine::PetMem is nil" ) return ReturnAI["END"] end local nHandle = PetMem["PetInfo"]["nHandle"] -- Æê »ç¸Á½Ã if cIsObjectDead( nHandle ) == 1 then -- AI ½ºÅ©¸³Æ® ÇØÁ¦ cAIScriptSet( nHandle ) -- ¸Þ¸ð¸® ÇØÁ¦ gPetAIMemory["PetBase"][ nHandle ] = nil DebugLog( "PetBaseRoutine::Pet Has Died - nHandle( "..nHandle.." )" ) return ReturnAI["END"] end -- Æê ´ë±â¸ðµå -- ÁÖÀÎ ÀÖ´ÂÁö üũ( ¸Ê¸µÅ© ¶§¹®¿¡ ) -- ÁÖÀÎ Á×¾ú´ÂÁö üũ ( »ç¸Á üũ ) -- ÁÖÀÎÀÌ ºÎ¸¥ »óÅÂÀÎÁö üũ ( Á¸¿¡ ¼ÂÆÃµÈ ÁÖÀÎÀÌ ºÒ·¶´Ù üũ ) -- ÁÖÀΰúÀÇ °Å¸® üũ( ¸Ö¾îÁö¸é µû¶ó°¡¶ó ) -- Æê ¼ºÇâ ÀúÀå½Ã°£ üũ -- Æê ´ë±â ½ÃÀÛ ½Ã°£ üũ local nMasterHandle = PetMem["MasterInfo"]["nHandle"] if cIsObjectDead( nMasterHandle ) == 1 then -- ¿©±ä °´Ã¼°¡ ¾ø°Å³ª ½Ãü»óÅÂÀ϶§¸¸ µé¾î¿À´Â °÷.. ¾ÆÁ÷Àº ÀÇ¹Ì ¾øÀ½ end local sMasterMode = cGetObjectMode( nMasterHandle ); if sMasterMode == nil then -- ¸¶½ºÅÍ ¸ðµå ¸øãÀ½ : ¹®Á¦ ÀÖÀ¸¹Ç·Î ¼ßÇØÁ¦ÇػڷÁ ¾ø°Å³ª ¹¹ ±×·±°Å´Ï±î cAIScriptSet( nHandle ) gPetAIMemory["PetBase"][ nHandle ] = nil DebugLog( "PetBaseRoutine::cGetObjectMode Fail - nHandle( "..nHandle.." )" ) return ReturnAI["END"] end DebugLog( "PetBaseRoutine:: Point 1 - ÇöÀç ¸¶½ºÅÍ »óÅ¿¡ µû¶ó¼­.." ) ------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------- ------ ¸¶½ºÅÍÀÇ »óÅ¿¡ µû¶ó ³»ºÎ º¯¼ö¹× Çൿ º¯È­ ¼³Á¤ : »óÅÂÁøÀÔó¸®, ƯÁ¤»óÅ¿¡¼­ÀÇ »óÅÂÁøÀÔó¸® local tMode = PetMem["PetInfo"]["PetMode"] -- ¸ðµå Á¢±ÙÀ» ÆíÇÏ°Ô Çϱâ À§ÇØ -- Á×¾ú´Ù »ì¾Æ³ª¸é ¿ì¼±¼øÀ§°¡ ³·Àº AI¸¦ À§ÇØ AI ÃʱâÈ­ if tMode["nMasterMode"] == PMM_DIE and sMasterMode ~= "corpse" then local tPetCoord = PetMem["PetInfo"]["Coord"]["Cur"] PetMem["PetInfo"]["Coord"]["Next"]["x"] = tPetCoord["x"] PetMem["PetInfo"]["Coord"]["Next"]["y"] = tPetCoord["y"] tMode["nMasterMode"] = PMM_NONE tMode["nActionMode"] = PAM_NONE end -- ¾ÆÀÌµé ¾×¼ÇÀÌ ¾Æ´Ò¶© ÀÌ °ª Ç×»ó ÃʱâÈ­ ÇØÁÖ±â if tMode["nMasterMode"] ~= PMM_IDLE or tMode["nActionMode"] ~= PAM_IDLE_ACT then PetMem["PetInfo"]["Time"]["EnterIdleAction"] = PetMem["InitialSec"] end if sMasterMode == "linking" then tMode["nMasterMode"] = PMM_LINK DebugLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_LINK - nHandle( "..nHandle.." )" ) elseif sMasterMode == "corpse" then if tMode["nMasterMode"] < PMM_DIE -- ¿ì¼±¼øÀ§Ã¼Å© then -- Die ÁøÀÔ ¼ÂÆà local tPetCoord = PetMem["PetInfo"]["Coord"]["Cur"] -- Á¦ÀÚ¸®·Î À̵¿ÇÑ°Íó·³ Ç¥½Ã PetMem["PetInfo"]["Coord"]["Next"]["x"] = tPetCoord["x"] PetMem["PetInfo"]["Coord"]["Next"]["y"] = tPetCoord["y"] tMode["nActionMode"] = PAM_NONE -- PupCaseDesc ¿¡¼­ Æê Á¾·ù±îÁö °í·ÁÇؼ­ ·¹ÄÚµå °¡Á®¿Í¼­ PAI ŸÀÔÀ» È®ÀÎ ÈÄ Valid ÀÏ ¶§ ½ºÅ©¸³Æ® ¸Þ¼¼Áö¿Í Çì¾îÀÌÆåÆ®, »ç¿îµå¸¦ ¹ß»ý½ÃŲ´Ù. local tPetDieActRecord = { cPet_GetActionRecord( nHandle, "die" ) } -- { "PupAITypeString", "SM_Inx", "HairEffect", "SoundFile" } if tPetDieActRecord ~= nil then if tPetDieActRecord[ 1 ] == "script" then if tPetDieActRecord[ 2 ] ~= "-" then PetBaseScriptMessage( nHandle, tPetDieActRecord[ 2 ] ) end if tPetDieActRecord[ 3 ] ~= "-" then PetBaseObjectEffect( nHandle, tPetDieActRecord[ 3 ] ) end if tPetDieActRecord[ 4 ] ~= "-" then PetBaseObjectSound( nHandle, tPetDieActRecord[ 4 ] ) end cExecCheck( "PetBaseRoutine" ) else ErrorLog( "PetBaseRoutine::cPet_GetActionRecord Failed ["..nHandle.."]" ); end else ErrorLog( "PetBaseRoutine::cPet_GetActionRecord Failed ["..nHandle.."]" ); end CheckLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_DIE - nHandle( "..nHandle.." )" ) end tMode["nMasterMode"] = PMM_DIE DebugLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_DIE - nHandle( "..nHandle.." )" ) elseif sMasterMode == "normal" or sMasterMode == "fight" or sMasterMode == "riding" or sMasterMode == "house" or sMasterMode == "booth" then -- ÁÖÀÎÀÌ ºÒ·¶´ÂÁö üũ if cPet_IsMasterCalling( nHandle ) == true then -- ÁÖÀÎÀÌ ºÎ¸§ if tMode["nMasterMode"] <= PMM_CALL -- ¿ì¼±¼øÀ§Ã¼Å© then -- Call ÁøÀÔ ¼ÂÆà -- PupCaseDesc ¿¡¼­ Æê Á¾·ù±îÁö °í·ÁÇؼ­ ·¹ÄÚµå °¡Á®¿Í¼­ PAI ŸÀÔÀ» È®ÀÎ ÈÄ Valid ÀÏ ¶§ ½ºÅ©¸³Æ® ¸Þ¼¼Áö¿Í Çì¾îÀÌÆåÆ®, »ç¿îµå¸¦ ¹ß»ý½ÃŲ´Ù. local tPetCallActRecord = { cPet_GetActionRecord( nHandle, "call" ) } -- { "PupAITypeString", "SM_Inx", "HairEffect", "SoundFile" } if tPetCallActRecord ~= nil then if tPetCallActRecord[ 1 ] == "script" then if tPetCallActRecord[ 2 ] ~= "-" then PetBaseScriptMessage( nHandle, tPetCallActRecord[ 2 ] ) end if tPetCallActRecord[ 3 ] ~= "-" then PetBaseObjectEffect( nHandle, tPetCallActRecord[ 3 ] ) end if tPetCallActRecord[ 4 ] ~= "-" then PetBaseObjectSound( nHandle, tPetCallActRecord[ 4 ] ) end cExecCheck( "PetBaseRoutine" ) else ErrorLog( "PetBaseRoutine::cPet_GetActionRecord Failed ["..nHandle.."]" ); end else ErrorLog( "PetBaseRoutine::cPet_GetActionRecord Failed ["..nHandle.."]" ); end -- ÀÏ´Ü ÇÏ´ø°Í ¸ØÃß±â : »óȲºÁ¼­ »¬Áö¸»Áö °áÁ¤Çϱâ local tPetCoord = PetMem["PetInfo"]["Coord"]["Cur"] -- Á¦ÀÚ¸® À̵¿ ¿äû½Ã, ¸ØÃá´Ù±âº¸´Ù Ŭ¶ó¿Í ½ÌÅ© ¸ÂÃç¼­ ¾à°£ °ø°£À̵¿ÇÑ°Í󷳵DZ⠶§¹®¿¡ ±×³É ¸÷Ç¥ÁöÁ¡ ¸Þ¸ð¸®¸¸ Ç¥½Ã. -- cRunTo( nHandle, tPetCoord["x"], tPetCoord["y"], 1000 ) -- Á¦ÀÚ¸®·Î À̵¿ÇÑ°Íó·³ Ç¥½Ã PetMem["PetInfo"]["Coord"]["Next"]["x"] = tPetCoord["x"] PetMem["PetInfo"]["Coord"]["Next"]["y"] = tPetCoord["y"] tMode["nActionMode"] = PAM_NONE CheckLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_CALL - nHandle( "..nHandle.." )" ) end tMode["nMasterMode"] = PMM_CALL DebugLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_CALL - nHandle( "..nHandle.." )" ) else -- ÁÖÀÎÀÌ ºÎ¸£Áö ¾ÊÀ½ if tMode["nActionMode"] <= PAM_FAR_MISSED -- ´õ »óÀ§ ¿ì¼±¼øÀ§¿¡ ÀÇÇØ ÇൿÇϴ°ÍÀÌ ¾Æ´Ò¶§¸¸ ó¸®Çϱâ. then if tMode["nActionMode"] <= PAM_FAR_MISSED -- ´õ »óÀ§ ¿ì¼±¼øÀ§¿¡ ÀÇÇØ ÇൿÇϴ°ÍÀÌ ¾Æ´Ò¶§¸¸ ó¸®Çϱâ. then local nDistanceSquare = cDistanceSquar( nHandle, nMasterHandle ) ---------------------------------------------------------------------- ---------- //°Å¸®º° Pattern Decision --------------------------------- if nDistanceSquare < PS_nDS_AwayStart then if tMode["nMasterMode"] == PMM_AWAY then -- ÃæºÐÈ÷ °¡±î¿öÁ³À¸´Ï ¸ØÃá°Í ó·³ local tPetCoord = PetMem["PetInfo"]["Coord"]["Cur"] -- cRunTo( nHandle, tPetCoord["x"], tPetCoord["y"], 1000 ) PetMem["PetInfo"]["Coord"]["Next"]["x"] = tPetCoord["x"] PetMem["PetInfo"]["Coord"]["Next"]["y"] = tPetCoord["y"] end if tMode["nMasterMode"] ~= PMM_IDLE then local nWaitIdleActSec = cRandomInt( PetSystem_nSecMinWaitActAtIdle, PetSystem_nSecMaxWaitActAtIdle ) -- Idle ÁøÀÔ ¼ÂÆà PetMem["PetInfo"]["Time"]["ExecSaveTendency"] = PetMem["CurSec"] + PetSystem_nSecWaitSaveTendencyAtIdle PetMem["PetInfo"]["Time"]["ExecIdleActMode"] = PetMem["CurSec"] + nWaitIdleActSec CheckLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_IDLE - nHandle( "..nHandle.." )" ) end tMode["nMasterMode"] = PMM_IDLE DebugLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_IDLE - nHandle( "..nHandle.." )" ) elseif nDistanceSquare < PS_nDS_FarStart then if tMode["nMasterMode"] ~= PMM_AWAY then -- Away ÁøÀÔ ¼ÂÆà -- PupCaseDesc ¿¡¼­ Æê Á¾·ù±îÁö °í·ÁÇؼ­ ·¹ÄÚµå °¡Á®¿Í¼­ PAI ŸÀÔÀ» È®ÀÎ ÈÄ Valid ÀÏ ¶§ ½ºÅ©¸³Æ® ¸Þ¼¼Áö¿Í Çì¾îÀÌÆåÆ®, »ç¿îµå¸¦ ¹ß»ý½ÃŲ´Ù. local tPetFollowActRecord = { cPet_GetActionRecord( nHandle, "follow" ) } -- { "PupAITypeString", "SM_Inx", "HairEffect", "SoundFile" } if tPetFollowActRecord ~= nil then if tPetFollowActRecord[ 1 ] == "script" then if tPetFollowActRecord[ 2 ] ~= "-" then PetBaseScriptMessage( nHandle, tPetFollowActRecord[ 2 ] ) end if tPetFollowActRecord[ 3 ] ~= "-" then PetBaseObjectEffect( nHandle, tPetFollowActRecord[ 3 ] ) end if tPetFollowActRecord[ 4 ] ~= "-" then PetBaseObjectSound( nHandle, tPetFollowActRecord[ 4 ] ) end cExecCheck( "PetBaseRoutine" ) else ErrorLog( "PetBaseRoutine::cPet_GetActionRecord Failed ["..nHandle.."]" ); end else ErrorLog( "PetBaseRoutine::cPet_GetActionRecord Failed ["..nHandle.."]" ); end CheckLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_AWAY - nHandle( "..nHandle.." )" ) end tMode["nMasterMode"] = PMM_AWAY DebugLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_AWAY - nHandle( "..nHandle.." )" ) else if tMode["nMasterMode"] == PMM_AWAY or tMode["nMasterMode"] == PMM_IDLE then -- ³Ê¹« ¸Ö¾îÁ³À¸´Ï ¸ØÃá°Íó·³ local tPetCoord = PetMem["PetInfo"]["Coord"]["Cur"] -- cRunTo( nHandle, tPetCoord["x"], tPetCoord["y"], 1000 ) PetMem["PetInfo"]["Coord"]["Next"]["x"] = tPetCoord["x"] PetMem["PetInfo"]["Coord"]["Next"]["y"] = tPetCoord["y"] end if tMode["nMasterMode"] ~= PMM_FAR then -- Far ÁøÀÔ ¼ÂÆà PetMem["PetInfo"]["Time"]["EnterFarIdle"] = PetMem["CurSec"] CheckLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_FAR - nHandle( "..nHandle.." )" ) end tMode["nMasterMode"] = PMM_FAR DebugLog( "PetBaseRoutine::PET_MASTER_MODE-PMM_FAR - nHandle( "..nHandle.." )" ) end ---------- °Å¸®º° Pattern Decision// --------------------------------- ---------------------------------------------------------------------- end end end elseif sMasterMode == "logoutwait" then -- ·Î±×¾Æ¿ô´ë±â : ÀÌ°Ç ¹ºÁö ¾Ë¾Æº¸±â else -- ÀÌ»óÇÑ ¸®ÅÏ°ª : ¹®Á¦ ÀÖÀ¸¹Ç·Î ¼ßÇØÁ¦ end DebugLog( "PetBaseRoutine:: Point 2 - ÇൿÇÏ°í ÀÖ´Â °Í¿¡ µû¶ó¼­.." ) ------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------- ------ ¼³Á¤µÈ ¸¶½ºÅÍ ¸ðµå¿¡ µû¶ó Çൿ ó¸® if tMode["nMasterMode"] == PMM_IDLE -----------------------------------------------------------------------------------------------------------PMM_IDLE then -- ¾ÆÀÌµé ½Ã°£ Ä«¿îÆà 2°¡Áö Çϱâ -- Çൿ ŸÀÓ¿¡ Çൿ ¼³Á¤ if PetMem["PetInfo"]["Time"]["ExecIdleActMode"] < PetMem["CurSec"] then -- ÇൿÇÒ ½Ã°£ÀÌ ¿ÔÀ½ --local tPetIdleActRecord = { cPet_GetActionRecord( nHandle, "idle" ) } -- { "PupAITypeString", "SM_Inx", "HairEffect", "SoundFile" } if PetMem["PetInfo"]["tCurIdleActRecord"] == nil then PetMem["PetInfo"]["tCurIdleActRecord"] = { cPet_GetActionRecord( nHandle, "idle" ) } end --if tPetIdleActRecord ~= nil if PetMem["PetInfo"]["tCurIdleActRecord"] ~= nil then if PetBaseIdleAction( PetMem, PetMem["PetInfo"]["tCurIdleActRecord"] ) == false then ErrorLog( "PetBaseRoutine::PetBaseIdleAction Failed ["..nHandle.."]" ); end cExecCheck( "PetBaseRoutine" ) else ErrorLog( "PetBaseRoutine::cPet_GetActionRecord Failed ["..nHandle.."]" ); end -- Çൿ»óÅ·ΠÁ¶Á¤ tMode["nActionMode"] = PAM_IDLE_ACT DebugLog( "PetBaseRoutine::PET_ACTION_MODE-PAM_IDLE_ACT - nHandle( "..nHandle.." )" ) else tMode["nActionMode"] = PAM_IDLE_WAIT DebugLog( "PetBaseRoutine::PET_ACTION_MODE-PAM_IDLE_WAIT - nHandle( "..nHandle.." )" ) end -- ÀúÀå ŸÀÓ¿¡ ÀúÀå ¿äû if PetMem["PetInfo"]["Time"]["ExecSaveTendency"] < PetMem["CurSec"] then -- ÀúÀåÇÒ ½Ã°£ÀÌ ¿ÔÀ½ if cPet_SaveTendency( nHandle ) == nil then ErrorLog( "PetBaseRoutine::cPet_SaveTendency Failed ["..nHandle.."]" ) else CheckLog( "PetBaseRoutine::cPet_SaveTendency Failed ["..nHandle.."]" ) end PetMem["PetInfo"]["Time"]["ExecSaveTendency"] = PetMem["CurSec"] + PetSystem_nSecWaitSaveTendencyAtIdle end elseif tMode["nMasterMode"] == PMM_AWAY -----------------------------------------------------------------------------------------------------------PMM_AWAY then -- ¸¶½ºÅÍ ÂÊÀ¸·Î À̵¿ local tMasterCoord = PetMem["MasterInfo"]["Coord"]["Cur"] local tTargetCoord = {} tTargetCoord["x"], tTargetCoord["y"] = cGetCoord_Circle( tMasterCoord["x"], tMasterCoord["y"], PetSystem_nDistanceFollowingStop ) if tTargetCoord["x"] ~= nil then cRunTo( nHandle, tTargetCoord["x"], tTargetCoord["y"], PetSystem_nSpeedRateFollowingMil ) PetMem["PetInfo"]["Coord"]["Next"]["x"] = tTargetCoord["x"] PetMem["PetInfo"]["Coord"]["Next"]["y"] = tTargetCoord["y"] else ErrorLog( "Following Move Target Coord is not Found" )-- ½ÇÆи޼¼Áö end elseif tMode["nMasterMode"] == PMM_FAR -----------------------------------------------------------------------------------------------------------PMM_FAR then -- À̵¿ ÇÏ´ø°Í ¸ØÃß°í Á¤Áö ÈÄ(À§¿¡¼­ ó¸®) ½Ã°£ Ä«¿îÆà -- ³Ê¹« ¸Ö¾îÁ®¼­ ±æ ÀÒ¾î »ç¶óÁö´Â ½Ã°£ üũ ÈÄ ¼Òȯ ÇØÁ¦ ó¸® if PetMem["PetInfo"]["Time"]["EnterFarIdle"] + PetSystem_nSecWaitMissingAtFar < PetMem["CurSec"] then -- ¼Òȯ ÇØÁ¦ ¿äû if cPet_Unsummon( nMasterHandle ) == nil then -- ¼ÒȯÇØÁ¦¿¡ ¹®Á¦ »ý±è : ½É°¢ÇÑ ¹®Á¦ ó¸® end -- AI ½ºÅ©¸³Æ® ÇØÁ¦ cAIScriptSet( nHandle ) -- ¸Þ¸ð¸® ÇØÁ¦ gPetAIMemory["PetBase"][ nHandle ] = nil DebugLog( "PetBaseRoutine::Pet Has Unsummoned - nHandle( "..nHandle.." )" ) return ReturnAI["END"] end elseif tMode["nMasterMode"] == PMM_CALL -----------------------------------------------------------------------------------------------------------PMM_CALL then -- ¸¶½ºÅÍ È¤Àº ¸ñÇ¥ ÁöÁ¡ ÂÊÀ¸·Î À̵¿ ÈÄ ÃÄ´Ùº¸±â local tPetCoord = PetMem["PetInfo"]["Coord"]["Cur"] local tDestCoord = PetMem["PetInfo"]["Coord"]["Next"] local tMasterCoord = PetMem["MasterInfo"]["Coord"]["Cur"] local nCallingDistanceSquare = cDistanceSquar( tPetCoord["x"], tPetCoord["y"], tDestCoord["x"], tDestCoord["y"] ) local nFollowingDistanceSquare = cDistanceSquar( nHandle, nMasterHandle ) local nDistanceSquare -- ºÒ·Á¼­ ¿À°íÀÖ´Ù¸é ±× ¸ñÇ¥ÁöÁ¡¿¡¼­ÀÇ °Å¸®¸¦ º¸°í -- ±×°Ô ¾Æ´Ï¶ó¸é ÇöÀç ¸¶½ºÅÍ¿ÍÀÇ °Å¸®¸¦ º¸ÀÚ. if tMode["nActionMode"] == PAM_CALL_COME then nDistanceSquare = nCallingDistanceSquare else nDistanceSquare = nFollowingDistanceSquare end if tMode["nActionMode"] == PAM_CALL_SEE then -- ¼³Á¤µÈ ½Ã°£¸¸Å­¸¸ ÁÖÀÎÀ» ÃÄ´Ùº»´Ù. if PetMem["PetInfo"]["Time"]["LastEnterStayAtCallSee"] + PetSystem_nSecStayAtCallSee < PetMem["CurSec"] then -- ¸ðµç ¸ðµå Ãë¼Ò tMode["nMasterMode"] = PMM_NONE tMode["nActionMode"] = PAM_NONE end -- ÃÄ´Ùº¸±â cSetObjectDirect( nHandle, tMasterCoord["x"], tMasterCoord["y"] ) -- °¨Á¤Ç¥Çö --????????????????????????????????????????????????????? else ---------------------------------------------------------------------- ---------- //°Å¸®º° Pattern Decision --------------------------------- if nDistanceSquare < PS_nDS_CallingStop then -- °¡±î¿öÁ³À¸¸é µµÂøÇÑ°ÍÀÌ´Ù. if tMode["nActionMode"] == PAM_CALL_COME then -- ÃæºÐÈ÷ °¡±î¿öÁ³À¸´Ï ¸ØÃá°Íó·³ local tPetCoord = PetMem["PetInfo"]["Coord"]["Cur"] -- cRunTo( nHandle, tPetCoord["x"], tPetCoord["y"], 1000 ) PetMem["PetInfo"]["Coord"]["Next"]["x"] = tPetCoord["x"] PetMem["PetInfo"]["Coord"]["Next"]["y"] = tPetCoord["y"] end if tMode["nActionMode"] ~= PAM_CALL_SEE then PetMem["PetInfo"]["Time"]["LastEnterStayAtCallSee"] = PetMem["CurSec"] -- ÁÖÀÎ ÃÄ´Ùº¸±â ÁøÀÔ ¼ÂÆà : ¸îÃʳª ÃÄ´ÙºÁ?????????????????????????????????? -- ÀÌ »óȲÀ» ¾î¶»°Ô ó¸®ÇÒÁö Ãß°¡ Áú¹® ÇÊ¿ä end tMode["nActionMode"] = PAM_CALL_SEE DebugLog( "PetBaseRoutine::PET_ACTION_MODE-PAM_CALL_SEE - nHandle( "..nHandle.." )" ) else if tMode["nActionMode"] ~= PAM_CALL_COME then -- ÁÖÀÎÀÌ ºÎ¸£¸é À̵¿Çϱâ ÁøÀÔ ¼ÂÆà -- ¸¶½ºÅÍ ÂÊÀ¸·Î À̵¿ : ÁÖÀÎÀÌ ºÎ¸¥ ½ÃÁ¡, µü Çѹø¸¸ üũÇÏ¿© À̵¿ÇÑ´Ù. ºÎ¸¥À§Ä¡¸¦ ¾Æ´Â°ÅÁö ¸¶½ºÅÍ À§Ä¡¸¦ ¾Æ´Â°Ô ¾Æ´Ô. local tMasterCoord = PetMem["MasterInfo"]["Coord"]["Cur"] local tTargetCoord = {} tTargetCoord["x"], tTargetCoord["y"] = cGetCoord_Circle( tMasterCoord["x"], tMasterCoord["y"], PetSystem_nDistanceCallingStop ) if tTargetCoord["x"] ~= nil then cRunTo( nHandle, tTargetCoord["x"], tTargetCoord["y"], PetSystem_nSpeedRateCallingMil ) PetMem["PetInfo"]["Coord"]["Next"]["x"] = tTargetCoord["x"] PetMem["PetInfo"]["Coord"]["Next"]["y"] = tTargetCoord["y"] else ErrorLog( "Calling Move Target Coord is not Found" )-- ½ÇÆи޼¼Áö end end tMode["nActionMode"] = PAM_CALL_COME DebugLog( "PetBaseRoutine::PET_ACTION_MODE-PAM_CALL_COME - nHandle( "..nHandle.." )" ) end ---------- °Å¸®º° Pattern Decision// --------------------------------- ---------------------------------------------------------------------- end elseif tMode["nMasterMode"] == PMM_DIE -----------------------------------------------------------------------------------------------------------PMM_DIE then -- ¸¶½ºÅÍ È¤Àº ¸ñÇ¥ ÁöÁ¡ ÂÊÀ¸·Î À̵¿ ÈÄ ÃÄ´Ùº¸±â local tPetCoord = PetMem["PetInfo"]["Coord"]["Cur"] local tDestCoord = PetMem["PetInfo"]["Coord"]["Next"] local tMasterCoord = PetMem["MasterInfo"]["Coord"]["Cur"] local nDiedDistanceSquare = cDistanceSquar( tPetCoord["x"], tPetCoord["y"], tDestCoord["x"], tDestCoord["y"] ) local nFollowingDistanceSquare = cDistanceSquar( nHandle, nMasterHandle ) local nDistanceSquare -- ºÒ·Á¼­ ¿À°íÀÖ´Ù¸é ±× ¸ñÇ¥ÁöÁ¡¿¡¼­ÀÇ °Å¸®¸¦ º¸°í -- ±×°Ô ¾Æ´Ï¶ó¸é ÇöÀç ¸¶½ºÅÍ¿ÍÀÇ °Å¸®¸¦ º¸ÀÚ. if tMode["nActionMode"] == PAM_DIE_COME then nDistanceSquare = nDiedDistanceSquare else nDistanceSquare = nFollowingDistanceSquare end if tMode["nActionMode"] == PAM_DIE_SAD then -- ¼³Á¤µÈ ½Ã°£¸¸Å­¸¸ Á×Àº ÁÖÀÎÀ» ÃÄ´Ùº¸¸ç ½½ÆÛÇÑ´Ù. if PetMem["PetInfo"]["Time"]["LastEnterStayAtDiedSad"] + PetSystem_nSecStayAtDiedSad < PetMem["CurSec"] then -- ¸ðµç ¸ðµå Ãë¼Ò tMode["nMasterMode"] = PMM_NONE tMode["nActionMode"] = PAM_NONE end -- ÃÄ´Ùº¸±â cSetObjectDirect( nHandle, tMasterCoord["x"], tMasterCoord["y"] ) -- ½½ÆÛÇϱâ´Â ¸»·Î¼­ Ç¥Çö else ---------------------------------------------------------------------- ---------- //°Å¸®º° Pattern Decision --------------------------------- if nDistanceSquare < PS_nDS_DiedStop then -- °¡±î¿öÁ³À¸¸é µµÂøÇÑ°ÍÀÌ´Ù. if tMode["nActionMode"] == PAM_DIE_COME then -- ÃæºÐÈ÷ °¡±î¿öÁ³À¸´Ï ¸ØÃß±â local tPetCoord = PetMem["PetInfo"]["Coord"]["Cur"] -- cRunTo( nHandle, tPetCoord["x"], tPetCoord["y"], 1000 ) PetMem["PetInfo"]["Coord"]["Next"]["x"] = tPetCoord["x"] PetMem["PetInfo"]["Coord"]["Next"]["y"] = tPetCoord["y"] end if tMode["nActionMode"] ~= PAM_DIE_SAD then -- ½½ÇÄ ÁøÀÔ ¼ÂÆà : ÇҰžø°í ´ÙÀ½·çƾºÎÅÍ ÇÒÀÏÇÔ PetMem["PetInfo"]["Time"]["LastEnterStayAtDiedSad"] = PetMem["CurSec"] CheckLog( "PetBaseRoutine::PET_ACTION_MODE-PAM_DIE_SAD - nHandle( "..nHandle.." )" ) end tMode["nActionMode"] = PAM_DIE_SAD DebugLog( "PetBaseRoutine::PET_ACTION_MODE-PAM_DIE_SAD - nHandle( "..nHandle.." )" ) else if tMode["nActionMode"] ~= PAM_DIE_COME then -- ÁÖÀÎÀÌ ºÎ¸£¸é À̵¿Çϱâ ÁøÀÔ ¼ÂÆà -- ¸¶½ºÅÍ ÂÊÀ¸·Î À̵¿ : ÁÖÀÎÀÌ ºÎ¸¥ ½ÃÁ¡, µü Çѹø¸¸ üũÇÏ¿© À̵¿ÇÑ´Ù. ºÎ¸¥À§Ä¡¸¦ ¾Æ´Â°ÅÁö ¸¶½ºÅÍ À§Ä¡¸¦ ¾Æ´Â°Ô ¾Æ´Ô. local tMasterCoord = PetMem["MasterInfo"]["Coord"]["Cur"] local tTargetCoord = {} tTargetCoord["x"], tTargetCoord["y"] = cGetCoord_Circle( tMasterCoord["x"], tMasterCoord["y"], PetSystem_nDistanceDiedStop ) if tTargetCoord["x"] ~= nil then cRunTo( nHandle, tTargetCoord["x"], tTargetCoord["y"], PetSystem_nSpeedRateMasterDiedMil ) PetMem["PetInfo"]["Coord"]["Next"]["x"] = tTargetCoord["x"] PetMem["PetInfo"]["Coord"]["Next"]["y"] = tTargetCoord["y"] else ErrorLog( "Master Died Move Target Coord is not Found" )-- ½ÇÆи޼¼Áö end CheckLog( "PetBaseRoutine::PET_ACTION_MODE-PAM_DIE_COME - nHandle( "..nHandle.." )" ) end tMode["nActionMode"] = PAM_DIE_COME DebugLog( "PetBaseRoutine::PET_ACTION_MODE-PAM_DIE_COME - nHandle( "..nHandle.." )" ) end ---------- °Å¸®º° Pattern Decision// --------------------------------- ---------------------------------------------------------------------- end elseif tMode["nMasterMode"] == PMM_LINK -----------------------------------------------------------------------------------------------------------PMM_LINK then tMode["nActionMode"] = PAM_LINK else -- Á¤ÀÇ ¾ÈµÈ ¸ðµåÀ̰ųª ¾Æ¹«°Íµµ ¾Æ´Ï°Å³ª.. end -- ¿ø·¡ ¸÷ÀÇ AI ¸¦ Àû¿ë return ReturnAI["CPP"] end