mirror of
https://gitlab.com/YuukiPS/GSServer-CBT.git
synced 2025-08-03 10:20:12 +03:00
melon
This commit is contained in:
121
soggy_resources/lua/Actor/Npc/BaseDailyNpc.lua
Normal file
121
soggy_resources/lua/Actor/Npc/BaseDailyNpc.lua
Normal file
@@ -0,0 +1,121 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local BaseDailyNpc = class("BaseDailyNpc", NpcActorProxy)
|
||||
|
||||
|
||||
--@region Handlers
|
||||
--- 碰撞反馈回调
|
||||
BaseDailyNpc.OnCollisionEnter = nil
|
||||
--- 事件回调
|
||||
BaseDailyNpc.OnEvent = nil
|
||||
--- 白天回调
|
||||
BaseDailyNpc.StartDay = nil
|
||||
function BaseDailyNpc:CallStartDay()
|
||||
if self.StartDay ~= nil then
|
||||
self:StartDay()
|
||||
end
|
||||
end
|
||||
--- 黑夜回调
|
||||
BaseDailyNpc.StartNight = nil
|
||||
function BaseDailyNpc:CallStartNight()
|
||||
if self.StartNight ~= nil then
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
--- 小时回调
|
||||
BaseDailyNpc.HourBehave = nil
|
||||
|
||||
function BaseDailyNpc:RegisterDailyHandler()
|
||||
if self.OnCollisionEnter ~= nil then
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
end
|
||||
if self.OnEvent ~= nil then
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
end
|
||||
if self.StartDay ~= nil then
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
end
|
||||
if self.StartNight ~= nil then
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
end
|
||||
if self.HourBehave ~= nil then
|
||||
self:RegisterSelfHour(self.HourBehave)
|
||||
end
|
||||
end
|
||||
function BaseDailyNpc:UnregisterDailyHandler()
|
||||
if self.OnCollisionEnter ~= nil then
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
end
|
||||
-- don't clear event that can be still notified in any mode
|
||||
-- if self.OnEvent ~= nil then
|
||||
-- self:UnregisterActorEvent(self.OnEvent)
|
||||
-- end
|
||||
if self.StartDay ~= nil then
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
end
|
||||
if self.StartNight ~= nil then
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
end
|
||||
if self.HourBehave ~= nil then
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
end
|
||||
end
|
||||
--@endregion
|
||||
|
||||
--@region Default Method
|
||||
function BaseDailyNpc:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
function BaseDailyNpc:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
--@endregion
|
||||
|
||||
--@region Mode
|
||||
BaseDailyNpc.modeDic = {}
|
||||
function BaseDailyNpc:RegisterMode(modeType)
|
||||
local mode = npcMode:GetMode(modeType)
|
||||
if mode ~= nil then
|
||||
self.modeDic[modeType] = mode
|
||||
end
|
||||
end
|
||||
--@endregion
|
||||
|
||||
--@region Default Start
|
||||
function BaseDailyNpc:Start()
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function BaseDailyNpc:StartDaily()
|
||||
self:RegisterDailyHandler()
|
||||
if globalActor.isDay then
|
||||
self:CallStartDay()
|
||||
else
|
||||
self:CallStartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function BaseDailyNpc:ResetDaily()
|
||||
self:Stop()
|
||||
self:UnregisterDailyHandler()
|
||||
end
|
||||
|
||||
function BaseDailyNpc:SwitchMode(modeType)
|
||||
local mode = self.modeDic[modeType]
|
||||
local modeFunc = nil
|
||||
if mode ~= nil then
|
||||
modeFunc = mode[self.alias]
|
||||
if modeFunc == nil then
|
||||
modeFunc = mode.DefaultAction
|
||||
end
|
||||
end
|
||||
|
||||
if modeFunc ~= nil then
|
||||
self:ResetDaily()
|
||||
modeFunc(self)
|
||||
end
|
||||
end
|
||||
--@endregion
|
||||
|
||||
return BaseDailyNpc
|
248
soggy_resources/lua/Actor/Npc/Config/CfgMengdeDayPatrol.lua
Normal file
248
soggy_resources/lua/Actor/Npc/Config/CfgMengdeDayPatrol.lua
Normal file
@@ -0,0 +1,248 @@
|
||||
require('Actor/ActorCommon')
|
||||
|
||||
local CfgMengdeDayPatrol = {}
|
||||
|
||||
CfgMengdeDayPatrol.DummyPointData =
|
||||
{
|
||||
Npc = "MengdeDayPatrol",
|
||||
PosData={
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos07").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos08").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos09").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos10").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos11").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos12").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos13").pos,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos06").pos,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos07").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos08").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos09").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos10").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos11").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos12").pos,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos07").pos,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos07").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos08").pos,
|
||||
},
|
||||
},
|
||||
DirData={
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos01").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos02").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos03").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos04").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos05").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos06").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos07").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos08").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos09").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos10").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos11").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos12").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos13").rot,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos01").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos02").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos03").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos04").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos05").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos06").rot,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos01").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos02").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos03").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos04").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos05").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos06").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos07").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos08").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos09").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos10").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos11").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos12").rot,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos01").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos02").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos03").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos04").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos05").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos06").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos07").rot,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos01").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos02").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos03").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos04").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos05").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos06").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos07").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos08").rot,
|
||||
},
|
||||
},
|
||||
TimeData={
|
||||
{
|
||||
25,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
25,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
{
|
||||
10,
|
||||
10,
|
||||
0,
|
||||
0,
|
||||
20,
|
||||
20,
|
||||
},
|
||||
{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
15,
|
||||
0,
|
||||
15,
|
||||
0,
|
||||
15,
|
||||
0,
|
||||
15,
|
||||
0,
|
||||
},
|
||||
{
|
||||
15,
|
||||
0,
|
||||
20,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
{
|
||||
15,
|
||||
0,
|
||||
0,
|
||||
15,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
},
|
||||
Pos01Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos01").pos,
|
||||
},
|
||||
Pos02Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos02").pos,
|
||||
},
|
||||
Pos03Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos03").pos,
|
||||
},
|
||||
Pos04Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos04").pos,
|
||||
},
|
||||
Pos05Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos05").pos,
|
||||
},
|
||||
Pos06Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol05Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol10Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol13Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayPatrol18Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayPatrol14Pos06").pos,
|
||||
},
|
||||
NpcID =
|
||||
{
|
||||
1421,
|
||||
1431,
|
||||
1455,
|
||||
1461,
|
||||
1463,
|
||||
},
|
||||
DialogID =
|
||||
{
|
||||
4015142199,
|
||||
4015143199,
|
||||
4015145599,
|
||||
4015146199,
|
||||
4015146399,
|
||||
},
|
||||
}
|
||||
|
||||
return CfgMengdeDayPatrol
|
20
soggy_resources/lua/Actor/Npc/Config/CfgMengdeDaySit.lua
Normal file
20
soggy_resources/lua/Actor/Npc/Config/CfgMengdeDaySit.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
require('Actor/ActorCommon')
|
||||
|
||||
local CfgMengdeDaySit = {}
|
||||
|
||||
CfgMengdeDaySit.DummyPointData =
|
||||
{
|
||||
Npc = "MengdeDaySit",
|
||||
NpcID =
|
||||
{
|
||||
1475,
|
||||
1477,
|
||||
},
|
||||
DialogID =
|
||||
{
|
||||
4015147599,
|
||||
4015147799,
|
||||
},
|
||||
}
|
||||
|
||||
return CfgMengdeDaySit
|
63
soggy_resources/lua/Actor/Npc/Config/CfgMengdeDayStand.lua
Normal file
63
soggy_resources/lua/Actor/Npc/Config/CfgMengdeDayStand.lua
Normal file
@@ -0,0 +1,63 @@
|
||||
require('Actor/ActorCommon')
|
||||
|
||||
local CfgMengdeDayStand = {}
|
||||
|
||||
CfgMengdeDayStand.DummyPointData =
|
||||
{
|
||||
Npc = "MengdeDayStand",
|
||||
BornDir =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayStand01Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayStand01Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayStand02Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayStand03Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayStand04Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayStand05Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayStand08Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayStand09Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayStand15Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayStand12Born").rot,
|
||||
},
|
||||
BornPos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayStand01Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayStand01Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayStand02Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayStand03Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayStand04Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayStand05Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayStand08Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayStand09Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleDayStand15Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleDayStand12Born").pos,
|
||||
},
|
||||
NpcID =
|
||||
{
|
||||
1401,
|
||||
1403,
|
||||
1405,
|
||||
1409,
|
||||
1411,
|
||||
1413,
|
||||
1427,
|
||||
1429,
|
||||
1451,
|
||||
1453,
|
||||
1453,
|
||||
},
|
||||
DialogID =
|
||||
{
|
||||
4015140199,
|
||||
4015140399,
|
||||
4015140599,
|
||||
4015140999,
|
||||
4015141199,
|
||||
4015141399,
|
||||
4015142799,
|
||||
4015142999,
|
||||
4015145199,
|
||||
4015145399,
|
||||
},
|
||||
}
|
||||
|
||||
return CfgMengdeDayStand
|
189
soggy_resources/lua/Actor/Npc/Config/CfgMengdeInsomniaPatrol.lua
Normal file
189
soggy_resources/lua/Actor/Npc/Config/CfgMengdeInsomniaPatrol.lua
Normal file
@@ -0,0 +1,189 @@
|
||||
require('Actor/ActorCommon')
|
||||
|
||||
local CfgMengdeInsomniaPatrol = {}
|
||||
|
||||
CfgMengdeInsomniaPatrol.DummyPointData =
|
||||
{
|
||||
Npc = "MengdeInsomniaPatrol",
|
||||
PosData={
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos07").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos08").pos,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos07").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos08").pos,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos06").pos,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos07").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos08").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos09").pos,
|
||||
},
|
||||
},
|
||||
DirData={
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos01").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos02").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos03").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos04").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos05").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos06").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos07").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos08").rot,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos01").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos02").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos03").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos04").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos05").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos06").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos07").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos08").rot,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos01").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos02").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos03").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos04").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos05").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos06").rot,
|
||||
},
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos01").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos02").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos03").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos04").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos05").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos06").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos07").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos08").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos09").rot,
|
||||
},
|
||||
},
|
||||
TimeData={
|
||||
{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
},
|
||||
Pos01Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos01").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos01").pos,
|
||||
},
|
||||
Pos02Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos02").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos02").pos,
|
||||
},
|
||||
Pos03Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos03").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos03").pos,
|
||||
},
|
||||
Pos04Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos04").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos04").pos,
|
||||
},
|
||||
Pos05Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos05").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos05").pos,
|
||||
},
|
||||
Pos06Pos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol07Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol12Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol13Pos06").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaPatrol14Pos06").pos,
|
||||
},
|
||||
NpcID =
|
||||
{
|
||||
1433,
|
||||
1445,
|
||||
1447,
|
||||
1449,
|
||||
},
|
||||
DialogID =
|
||||
{
|
||||
4015143399,
|
||||
4015144599,
|
||||
4015144799,
|
||||
4015144999,
|
||||
},
|
||||
}
|
||||
|
||||
return CfgMengdeInsomniaPatrol
|
115
soggy_resources/lua/Actor/Npc/Config/CfgMengdeInsomniaStand.lua
Normal file
115
soggy_resources/lua/Actor/Npc/Config/CfgMengdeInsomniaStand.lua
Normal file
@@ -0,0 +1,115 @@
|
||||
require('Actor/ActorCommon')
|
||||
|
||||
local CfgMengdeInsomniaStand = {}
|
||||
|
||||
CfgMengdeInsomniaStand.DummyPointData =
|
||||
{
|
||||
Npc = "MengdeInsomniaStand",
|
||||
BornDir =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand06Born").rot, --弃用
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand06Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleInsomniaStand04Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleInsomniaStand06Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleInsomniaStand07Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleInsomniaStand11Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand08Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand09Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand10Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand11Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand16Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand17Born").rot,
|
||||
sceneData:GetDummyPoint(1009, "NpcMaleInsomniaStand19Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand20Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleInsomniaStand15Born").rot,
|
||||
sceneData:GetDummyPoint(1008, "NpcFemaleInsomniaStand16Born").rot,
|
||||
sceneData:GetDummyPoint(1008, "NpcFemaleInsomniaStand17Born").rot,
|
||||
sceneData:GetDummyPoint(3, "Q467Lynn1").rot,
|
||||
},
|
||||
BornPos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand06Born").pos, --弃用
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand06Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleInsomniaStand04Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleInsomniaStand06Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleInsomniaStand07Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleInsomniaStand11Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand08Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand09Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand10Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand11Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand16Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand17Born").pos,
|
||||
sceneData:GetDummyPoint(1009, "NpcMaleInsomniaStand19Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleInsomniaStand20Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcFemaleInsomniaStand15Born").pos,
|
||||
sceneData:GetDummyPoint(1008, "NpcFemaleInsomniaStand16Born").pos,
|
||||
sceneData:GetDummyPoint(1008, "NpcFemaleInsomniaStand17Born").pos,
|
||||
sceneData:GetDummyPoint(3, "Q467Lynn1").pos,
|
||||
},
|
||||
NpcID =
|
||||
{
|
||||
1415,
|
||||
1417,
|
||||
1419,
|
||||
1423,
|
||||
1425,
|
||||
1435,
|
||||
1437,
|
||||
1439,
|
||||
1441,
|
||||
1443,
|
||||
1457,
|
||||
1459,
|
||||
1465,
|
||||
1467,
|
||||
1469,
|
||||
1471,
|
||||
1473,
|
||||
1479,
|
||||
},
|
||||
DialogID =
|
||||
{
|
||||
4015141599,
|
||||
4015141799,
|
||||
4015141999,
|
||||
4015142399,
|
||||
4015142599,
|
||||
4015143599,
|
||||
4015143799,
|
||||
4015143999,
|
||||
4015144199,
|
||||
4015144399,
|
||||
4015145799,
|
||||
4015145999,
|
||||
4015146599,
|
||||
4015146799,
|
||||
4015146999,
|
||||
4015147199,
|
||||
4015147399,
|
||||
4015148001,
|
||||
},
|
||||
BubbleCtrl =
|
||||
{
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
},
|
||||
}
|
||||
|
||||
return CfgMengdeInsomniaStand
|
@@ -0,0 +1,28 @@
|
||||
require('Actor/ActorCommon')
|
||||
|
||||
local CfgMengdeNightConfuse = {}
|
||||
|
||||
CfgMengdeNightConfuse.DummyPointData =
|
||||
{
|
||||
Npc = "MengdeNightConfuse",
|
||||
Pos01Pos =
|
||||
{
|
||||
},
|
||||
Pos02Pos =
|
||||
{
|
||||
},
|
||||
Pos03Pos =
|
||||
{
|
||||
},
|
||||
Pos04Pos =
|
||||
{
|
||||
},
|
||||
NpcID =
|
||||
{
|
||||
},
|
||||
DialogID =
|
||||
{
|
||||
},
|
||||
}
|
||||
|
||||
return CfgMengdeNightConfuse
|
22
soggy_resources/lua/Actor/Npc/Config/CfgMengdeNightSit.lua
Normal file
22
soggy_resources/lua/Actor/Npc/Config/CfgMengdeNightSit.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
require('Actor/ActorCommon')
|
||||
|
||||
local CfgMengdeNightSit = {}
|
||||
|
||||
CfgMengdeNightSit.DummyPointData =
|
||||
{
|
||||
Npc = "MengdeNightSit",
|
||||
NpcID =
|
||||
{
|
||||
1404,
|
||||
1410,
|
||||
1414,
|
||||
},
|
||||
DialogID =
|
||||
{
|
||||
4015140499,
|
||||
4015141099,
|
||||
4015141499,
|
||||
},
|
||||
}
|
||||
|
||||
return CfgMengdeNightSit
|
34
soggy_resources/lua/Actor/Npc/Config/CfgMengdeNightStand.lua
Normal file
34
soggy_resources/lua/Actor/Npc/Config/CfgMengdeNightStand.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
require('Actor/ActorCommon')
|
||||
|
||||
local CfgMengdeNightStand = {}
|
||||
|
||||
CfgMengdeNightStand.DummyPointData =
|
||||
{
|
||||
Npc = "MengdeNightStand",
|
||||
BornDir =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleNightStand02Born").rot,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleNightStand04Born").rot,
|
||||
sceneData:GetDummyPoint(1008, "NpcFemaleNightStand09Born").rot,
|
||||
},
|
||||
BornPos =
|
||||
{
|
||||
sceneData:GetDummyPoint(3, "NpcMaleNightStand02Born").pos,
|
||||
sceneData:GetDummyPoint(3, "NpcMaleNightStand04Born").pos,
|
||||
sceneData:GetDummyPoint(1008, "NpcFemaleNightStand09Born").pos,
|
||||
},
|
||||
NpcID =
|
||||
{
|
||||
1408,
|
||||
1412,
|
||||
1430,
|
||||
},
|
||||
DialogID =
|
||||
{
|
||||
4015140899,
|
||||
4015141299,
|
||||
4015143099,
|
||||
},
|
||||
}
|
||||
|
||||
return CfgMengdeNightStand
|
168
soggy_resources/lua/Actor/Npc/JohnDoe01.lua
Normal file
168
soggy_resources/lua/Actor/Npc/JohnDoe01.lua
Normal file
@@ -0,0 +1,168 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local JohnDoe01 = class("JohnDoe01", NpcActorProxy)
|
||||
|
||||
JohnDoe01.defaultAlias = "JohnDoe01"
|
||||
JohnDoe01.pointID = 1
|
||||
JohnDoe01.currWeather = WeatherType.ClearSky
|
||||
|
||||
local JohnDoe01Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "JohnDoe01Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "JohnDoe01Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "JohnDoe01Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "JohnDoe01Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "JohnDoe01Pos01").pos,
|
||||
Pos01Dir = sceneData:GetDummyPoint(3, "JohnDoe01Pos01").rot,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "JohnDoe01Pos02").pos,
|
||||
Pos02Dir = sceneData:GetDummyPoint(3, "JohnDoe01Pos02").rot,
|
||||
Pos03Pos = sceneData:GetDummyPoint(3, "JohnDoe01Pos03").pos,
|
||||
Pos03Dir = sceneData:GetDummyPoint(3, "JohnDoe01Pos03").rot,
|
||||
Pos04Pos = sceneData:GetDummyPoint(3, "JohnDoe01Pos04").pos,
|
||||
Pos04Dir = sceneData:GetDummyPoint(3, "JohnDoe01Pos04").rot,
|
||||
ScaredPos = sceneData:GetDummyPoint(3, "NPCScaredPoint01").pos,
|
||||
}
|
||||
|
||||
|
||||
function JohnDoe01:Start()
|
||||
--print("start!JohnDoe01")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function JohnDoe01:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function JohnDoe01:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function JohnDoe01:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe01:StartDaily()
|
||||
--print("JohnDoe01 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfHour(self.HourBehave)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe01:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe01:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe01Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoChat)
|
||||
end
|
||||
|
||||
function JohnDoe01:GoChat()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(JohnDoe01Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(JohnDoe01Data.Pos02Pos, self.Chat, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(JohnDoe01Data.Pos03Pos, self.Chat, self.Standby)
|
||||
elseif self.pointID == 4 then
|
||||
self:WalkToTask(JohnDoe01Data.Pos04Pos, self.Chat, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe01:SelfPointUpdate()
|
||||
if globalActor.isDay then
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoChat()
|
||||
else
|
||||
self.pointID = self.pointID - 1
|
||||
self:GoHome()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe01:Chat()
|
||||
if self.pointID < 2 then
|
||||
self:GoChat()
|
||||
elseif self.pointID == 2 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe01Data.Pos02Dir))
|
||||
elseif self.pointID == 3 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe01Data.Pos03Dir))
|
||||
elseif self.pointID == 4 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe01Data.Pos04Dir))
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe01:HourBehave(Hour)
|
||||
if Hour == 9 or Hour == 12 or Hour == 15 then
|
||||
self.pointID = 3
|
||||
self:GoChat()
|
||||
elseif Hour == 10 or Hour == 13 or Hour == 16 then
|
||||
self.pointID = 4
|
||||
self:GoChat()
|
||||
elseif Hour == 11 or Hour == 14 or Hour == 17 then
|
||||
self.pointID = 2
|
||||
self:GoChat()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe01:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function JohnDoe01:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe01Data.HomeDir))
|
||||
self:DoDisappear()
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe01:GoHomeRoute()
|
||||
if self.pointID > 2 then
|
||||
self.pointID = 3
|
||||
self:WalkToTask(JohnDoe01Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(JohnDoe01Data.HomePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe01:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:DoAppear()
|
||||
self:SetPos(JohnDoe01Data.ScaredPos)
|
||||
self:DoFreeStyle(362)
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return JohnDoe01
|
171
soggy_resources/lua/Actor/Npc/JohnDoe02.lua
Normal file
171
soggy_resources/lua/Actor/Npc/JohnDoe02.lua
Normal file
@@ -0,0 +1,171 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local JohnDoe02 = class("JohnDoe02", NpcActorProxy)
|
||||
|
||||
JohnDoe02.defaultAlias = "JohnDoe02"
|
||||
JohnDoe02.pointID = 1
|
||||
JohnDoe02.currWeather = WeatherType.ClearSky
|
||||
|
||||
local JohnDoe02Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "JohnDoe02Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "JohnDoe02Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "JohnDoe02Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "JohnDoe02Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "JohnDoe02Pos01").pos,
|
||||
Pos01Dir = sceneData:GetDummyPoint(3, "JohnDoe02Pos01").rot,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "JohnDoe02Pos02").pos,
|
||||
Pos02Dir = sceneData:GetDummyPoint(3, "JohnDoe02Pos02").rot,
|
||||
Pos03Pos = sceneData:GetDummyPoint(3, "JohnDoe02Pos03").pos,
|
||||
Pos03Dir = sceneData:GetDummyPoint(3, "JohnDoe02Pos03").rot,
|
||||
Pos04Pos = sceneData:GetDummyPoint(3, "JohnDoe02Pos04").pos,
|
||||
Pos04Dir = sceneData:GetDummyPoint(3, "JohnDoe02Pos04").rot,
|
||||
ScaredPos = sceneData:GetDummyPoint(3, "NPCScaredPoint02").pos,
|
||||
}
|
||||
|
||||
|
||||
function JohnDoe02:Start()
|
||||
--print("start!JohnDoe02")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function JohnDoe02:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function JohnDoe02:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function JohnDoe02:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe02:StartDaily()
|
||||
--print("JohnDoe02 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfHour(self.HourBehave)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe02:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe02:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe02Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoChat)
|
||||
end
|
||||
|
||||
function JohnDoe02:GoChat()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(JohnDoe02Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(JohnDoe02Data.Pos02Pos, self.Chat, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(JohnDoe02Data.Pos03Pos, self.Chat, self.Standby)
|
||||
elseif self.pointID == 4 then
|
||||
self:WalkToTask(JohnDoe02Data.Pos04Pos, self.Chat, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe02:SelfPointUpdate()
|
||||
if globalActor.isDay then
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoChat()
|
||||
else
|
||||
self.pointID = self.pointID - 1
|
||||
self:GoHome()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe02:Chat()
|
||||
if self.pointID < 2 then
|
||||
self:GoChat()
|
||||
elseif self.pointID == 2 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe02Data.Pos02Dir))
|
||||
elseif self.pointID == 3 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe02Data.Pos03Dir))
|
||||
elseif self.pointID == 4 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe02Data.Pos04Dir))
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe02:HourBehave(Hour)
|
||||
if Hour == 9 or Hour == 12 or Hour == 15 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 3
|
||||
self:GoChat()
|
||||
elseif Hour == 10 or Hour == 13 or Hour == 16 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 4
|
||||
self:GoChat()
|
||||
elseif Hour == 11 or Hour == 14 or Hour == 17 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 2
|
||||
self:GoChat()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe02:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function JohnDoe02:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe02Data.HomeDir))
|
||||
self:DoDisappear()
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe02:GoHomeRoute()
|
||||
if self.pointID > 2 then
|
||||
self.pointID = 3
|
||||
self:WalkToTask(JohnDoe02Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(JohnDoe02Data.HomePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe02:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:DoAppear()
|
||||
self:SetPos(JohnDoe02Data.ScaredPos)
|
||||
self:DoFreeStyle(362)
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return JohnDoe02
|
171
soggy_resources/lua/Actor/Npc/JohnDoe03.lua
Normal file
171
soggy_resources/lua/Actor/Npc/JohnDoe03.lua
Normal file
@@ -0,0 +1,171 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local JohnDoe03 = class("JohnDoe03", NpcActorProxy)
|
||||
|
||||
JohnDoe03.defaultAlias = "JohnDoe03"
|
||||
JohnDoe03.pointID = 1
|
||||
JohnDoe03.currWeather = WeatherType.ClearSky
|
||||
|
||||
local JohnDoe03Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "JohnDoe03Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "JohnDoe03Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "JohnDoe03Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "JohnDoe03Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "JohnDoe03Pos01").pos,
|
||||
Pos01Dir = sceneData:GetDummyPoint(3, "JohnDoe03Pos01").rot,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "JohnDoe03Pos02").pos,
|
||||
Pos02Dir = sceneData:GetDummyPoint(3, "JohnDoe03Pos02").rot,
|
||||
Pos03Pos = sceneData:GetDummyPoint(3, "JohnDoe03Pos03").pos,
|
||||
Pos03Dir = sceneData:GetDummyPoint(3, "JohnDoe03Pos03").rot,
|
||||
Pos04Pos = sceneData:GetDummyPoint(3, "JohnDoe03Pos04").pos,
|
||||
Pos04Dir = sceneData:GetDummyPoint(3, "JohnDoe03Pos04").rot,
|
||||
ScaredPos = sceneData:GetDummyPoint(3, "NPCScaredPoint03").pos,
|
||||
}
|
||||
|
||||
|
||||
function JohnDoe03:Start()
|
||||
--print("start!JohnDoe03")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function JohnDoe03:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function JohnDoe03:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function JohnDoe03:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe03:StartDaily()
|
||||
--print("JohnDoe03 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfHour(self.HourBehave)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe03:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe03:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe03Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoChat)
|
||||
end
|
||||
|
||||
function JohnDoe03:GoChat()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(JohnDoe03Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(JohnDoe03Data.Pos02Pos, self.Chat, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(JohnDoe03Data.Pos03Pos, self.Chat, self.Standby)
|
||||
elseif self.pointID == 4 then
|
||||
self:WalkToTask(JohnDoe03Data.Pos04Pos, self.Chat, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe03:SelfPointUpdate()
|
||||
if globalActor.isDay then
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoChat()
|
||||
else
|
||||
self.pointID = self.pointID - 1
|
||||
self:GoHome()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe03:Chat()
|
||||
if self.pointID < 2 then
|
||||
self:GoChat()
|
||||
elseif self.pointID == 2 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe03Data.Pos02Dir))
|
||||
elseif self.pointID == 3 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe03Data.Pos03Dir))
|
||||
elseif self.pointID == 4 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe03Data.Pos04Dir))
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe03:HourBehave(Hour)
|
||||
if Hour == 9 or Hour == 12 or Hour == 15 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 3
|
||||
self:GoChat()
|
||||
elseif Hour == 10 or Hour == 13 or Hour == 16 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 4
|
||||
self:GoChat()
|
||||
elseif Hour == 11 or Hour == 14 or Hour == 17 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 2
|
||||
self:GoChat()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe03:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function JohnDoe03:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe03Data.HomeDir))
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe03:GoHomeRoute()
|
||||
if self.pointID > 2 then
|
||||
self.pointID = 3
|
||||
self:WalkToTask(JohnDoe03Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(JohnDoe03Data.HomePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe03:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:DoAppear()
|
||||
self:SetPos(JohnDoe03Data.ScaredPos)
|
||||
self:DoFreeStyle(362)
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return JohnDoe03
|
171
soggy_resources/lua/Actor/Npc/JohnDoe04.lua
Normal file
171
soggy_resources/lua/Actor/Npc/JohnDoe04.lua
Normal file
@@ -0,0 +1,171 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local JohnDoe04 = class("JohnDoe04", NpcActorProxy)
|
||||
|
||||
JohnDoe04.defaultAlias = "JohnDoe04"
|
||||
JohnDoe04.pointID = 1
|
||||
JohnDoe04.currWeather = WeatherType.ClearSky
|
||||
|
||||
local JohnDoe04Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "JohnDoe04Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "JohnDoe04Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "JohnDoe04Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "JohnDoe04Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "JohnDoe04Pos01").pos,
|
||||
Pos01Dir = sceneData:GetDummyPoint(3, "JohnDoe04Pos01").rot,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "JohnDoe04Pos02").pos,
|
||||
Pos02Dir = sceneData:GetDummyPoint(3, "JohnDoe04Pos02").rot,
|
||||
Pos03Pos = sceneData:GetDummyPoint(3, "JohnDoe04Pos03").pos,
|
||||
Pos03Dir = sceneData:GetDummyPoint(3, "JohnDoe04Pos03").rot,
|
||||
Pos04Pos = sceneData:GetDummyPoint(3, "JohnDoe04Pos04").pos,
|
||||
Pos04Dir = sceneData:GetDummyPoint(3, "JohnDoe04Pos04").rot,
|
||||
ScaredPos = sceneData:GetDummyPoint(3, "NPCScaredPoint04").pos,
|
||||
}
|
||||
|
||||
|
||||
function JohnDoe04:Start()
|
||||
--print("start!JohnDoe04")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function JohnDoe04:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function JohnDoe04:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function JohnDoe04:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe04:StartDaily()
|
||||
--print("JohnDoe04 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfHour(self.HourBehave)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe04:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe04:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe04Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoChat)
|
||||
end
|
||||
|
||||
function JohnDoe04:GoChat()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(JohnDoe04Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(JohnDoe04Data.Pos02Pos, self.Chat, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(JohnDoe04Data.Pos03Pos, self.Chat, self.Standby)
|
||||
elseif self.pointID == 4 then
|
||||
self:WalkToTask(JohnDoe04Data.Pos04Pos, self.Chat, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe04:SelfPointUpdate()
|
||||
if globalActor.isDay then
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoChat()
|
||||
else
|
||||
self.pointID = self.pointID - 1
|
||||
self:GoHome()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe04:Chat()
|
||||
if self.pointID < 2 then
|
||||
self:GoChat()
|
||||
elseif self.pointID == 2 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe04Data.Pos02Dir))
|
||||
elseif self.pointID == 3 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe04Data.Pos03Dir))
|
||||
elseif self.pointID == 4 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe04Data.Pos04Dir))
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe04:HourBehave(Hour)
|
||||
if Hour == 9 or Hour == 12 or Hour == 15 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 3
|
||||
self:GoChat()
|
||||
elseif Hour == 10 or Hour == 13 or Hour == 16 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 4
|
||||
self:GoChat()
|
||||
elseif Hour == 11 or Hour == 14 or Hour == 17 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 2
|
||||
self:GoChat()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe04:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function JohnDoe04:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe04Data.HomeDir))
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe04:GoHomeRoute()
|
||||
if self.pointID > 2 then
|
||||
self.pointID = 3
|
||||
self:WalkToTask(JohnDoe04Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(JohnDoe04Data.HomePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe04:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:DoAppear()
|
||||
self:SetPos(JohnDoe04Data.ScaredPos)
|
||||
self:DoFreeStyle(362)
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return JohnDoe04
|
150
soggy_resources/lua/Actor/Npc/JohnDoe05.lua
Normal file
150
soggy_resources/lua/Actor/Npc/JohnDoe05.lua
Normal file
@@ -0,0 +1,150 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local JohnDoe05 = class("JohnDoe05", NpcActorProxy)
|
||||
|
||||
JohnDoe05.defaultAlias = "JohnDoe05"
|
||||
-- JohnDoe05.pointID = 1
|
||||
-- JohnDoe05.targetPos = sceneData:GetDummyPoint(3, "JohnDoe05Born").pos
|
||||
JohnDoe05.currWeather = WeatherType.ClearSky
|
||||
|
||||
local JohnDoe05Data =
|
||||
{
|
||||
-- BornPos = sceneData:GetDummyPoint(3, "JohnDoe05Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "JohnDoe05Born").rot,
|
||||
-- HomePos = sceneData:GetDummyPoint(3, "JohnDoe05Home").pos,
|
||||
-- HomeDir = sceneData:GetDummyPoint(3, "JohnDoe05Home").rot,
|
||||
-- Pos01Pos = sceneData:GetDummyPoint(3, "JohnDoe05Pos01").pos,
|
||||
-- Pos01Dir = sceneData:GetDummyPoint(3, "JohnDoe05Pos01").rot,
|
||||
-- Pos02Pos = sceneData:GetDummyPoint(3, "JohnDoe05Pos02").pos,
|
||||
-- Pos02Dir = sceneData:GetDummyPoint(3, "JohnDoe05Pos02").rot,
|
||||
-- Pos03Pos = sceneData:GetDummyPoint(3, "JohnDoe05Pos03").pos,
|
||||
-- Pos03Dir = sceneData:GetDummyPoint(3, "JohnDoe05Pos03").rot,
|
||||
-- Pos04Pos = sceneData:GetDummyPoint(3, "JohnDoe05Pos04").pos,
|
||||
-- Pos04Dir = sceneData:GetDummyPoint(3, "JohnDoe05Pos04").rot,
|
||||
-- Pos05Pos = sceneData:GetDummyPoint(3, "JohnDoe05Pos05").pos,
|
||||
-- Pos05Dir = sceneData:GetDummyPoint(3, "JohnDoe05Pos05").rot,
|
||||
-- Pos06Pos = sceneData:GetDummyPoint(3, "JohnDoe05Pos06").pos,
|
||||
-- Pos06Dir = sceneData:GetDummyPoint(3, "JohnDoe05Pos06").rot,
|
||||
}
|
||||
|
||||
|
||||
function JohnDoe05:Start()
|
||||
-- print("start!JohnDoe05")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function JohnDoe05:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function JohnDoe05:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function JohnDoe05:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe05:StartDaily()
|
||||
-- print("JohnDoe05 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe05:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe05:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe05Data.BornDir))
|
||||
self:PerformDither(true, 2, self.Chat)
|
||||
end
|
||||
|
||||
-- function JohnDoe05:RandomStand()
|
||||
-- self:TargetDect()
|
||||
-- print("self.pointID = "..self.pointID)
|
||||
-- self:WalkToTask(JohnDoe05.targetPos, self.NextMove, self.Standby)
|
||||
-- end
|
||||
|
||||
-- function JohnDoe05:TargetDect()
|
||||
-- self.pointID = math.random(1,6)
|
||||
-- if self.pointID == 1 then
|
||||
-- JohnDoe05.targetPos = JohnDoe05Data.Pos01Pos
|
||||
-- elseif self.pointID == 2 then
|
||||
-- JohnDoe05.targetPos = JohnDoe05Data.Pos02Pos
|
||||
-- elseif self.pointID == 3 then
|
||||
-- JohnDoe05.targetPos = JohnDoe05Data.Pos03Pos
|
||||
-- elseif self.pointID == 4 then
|
||||
-- JohnDoe05.targetPos = JohnDoe05Data.Pos04Pos
|
||||
-- elseif self.pointID == 5 then
|
||||
-- JohnDoe05.targetPos = JohnDoe05Data.Pos05Pos
|
||||
-- elseif self.pointID == 6 then
|
||||
-- JohnDoe05.targetPos = JohnDoe05Data.Pos06Pos
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- function JohnDoe05:NextMove()
|
||||
-- self:CallDelay(math.random(3,7), self.RandomStand)
|
||||
-- end
|
||||
|
||||
-- function JohnDoe05:StartDay()
|
||||
-- self:ClearFollowTask()
|
||||
-- self:ShowSelf()
|
||||
-- self:TurnTo(M.Euler2DirXZ(JohnDoe05Data.BornDir))
|
||||
-- self:PerformDither(true, 2, self.DelayChat)
|
||||
-- self:RandomTest()
|
||||
-- end
|
||||
|
||||
-- function JohnDoe05:DelayChat()
|
||||
-- self:CallDelay(7, self.Chat)
|
||||
-- end
|
||||
|
||||
function JohnDoe05:Chat()
|
||||
self:DoFreeStyle(52)
|
||||
end
|
||||
|
||||
function JohnDoe05:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
-- self:GoHome()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
-- function JohnDoe05:GoHome()
|
||||
-- self:TurnTo(M.Euler2DirXZ(JohnDoe05Data.HomeDir))
|
||||
-- self:PerformDither(false, 2, self.HideSelf)
|
||||
-- end
|
||||
|
||||
function JohnDoe05:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return JohnDoe05
|
150
soggy_resources/lua/Actor/Npc/JohnDoe06.lua
Normal file
150
soggy_resources/lua/Actor/Npc/JohnDoe06.lua
Normal file
@@ -0,0 +1,150 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local JohnDoe06 = class("JohnDoe06", NpcActorProxy)
|
||||
|
||||
JohnDoe06.defaultAlias = "JohnDoe06"
|
||||
-- JohnDoe06.pointID = 1
|
||||
-- JohnDoe06.targetPos = sceneData:GetDummyPoint(3, "JohnDoe06Born").pos
|
||||
JohnDoe06.currWeather = WeatherType.ClearSky
|
||||
|
||||
local JohnDoe06Data =
|
||||
{
|
||||
-- BornPos = sceneData:GetDummyPoint(3, "JohnDoe06Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "JohnDoe05Home").rot,
|
||||
-- HomePos = sceneData:GetDummyPoint(3, "JohnDoe06Home").pos,
|
||||
-- HomeDir = sceneData:GetDummyPoint(3, "JohnDoe06Home").rot,
|
||||
-- Pos01Pos = sceneData:GetDummyPoint(3, "JohnDoe06Pos01").pos,
|
||||
-- Pos01Dir = sceneData:GetDummyPoint(3, "JohnDoe06Pos01").rot,
|
||||
-- Pos02Pos = sceneData:GetDummyPoint(3, "JohnDoe06Pos02").pos,
|
||||
-- Pos02Dir = sceneData:GetDummyPoint(3, "JohnDoe06Pos02").rot,
|
||||
-- Pos03Pos = sceneData:GetDummyPoint(3, "JohnDoe06Pos03").pos,
|
||||
-- Pos03Dir = sceneData:GetDummyPoint(3, "JohnDoe06Pos03").rot,
|
||||
-- Pos04Pos = sceneData:GetDummyPoint(3, "JohnDoe06Pos04").pos,
|
||||
-- Pos04Dir = sceneData:GetDummyPoint(3, "JohnDoe06Pos04").rot,
|
||||
-- Pos05Pos = sceneData:GetDummyPoint(3, "JohnDoe06Pos05").pos,
|
||||
-- Pos05Dir = sceneData:GetDummyPoint(3, "JohnDoe06Pos05").rot,
|
||||
-- Pos06Pos = sceneData:GetDummyPoint(3, "JohnDoe06Pos06").pos,
|
||||
-- Pos06Dir = sceneData:GetDummyPoint(3, "JohnDoe06Pos06").rot,
|
||||
}
|
||||
|
||||
|
||||
function JohnDoe06:Start()
|
||||
-- print("start!JohnDoe06")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function JohnDoe06:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function JohnDoe06:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function JohnDoe06:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe06:StartDaily()
|
||||
-- print("JohnDoe06 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe06:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe06:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe06Data.BornDir))
|
||||
self:PerformDither(true, 2, self.Chat)
|
||||
end
|
||||
|
||||
-- function JohnDoe06:RandomStand()
|
||||
-- self:TargetDect()
|
||||
-- print("self.pointID = "..self.pointID)
|
||||
-- self:WalkToTask(JohnDoe06.targetPos, self.NextMove, self.Standby)
|
||||
-- end
|
||||
|
||||
-- function JohnDoe06:TargetDect()
|
||||
-- self.pointID = math.random(1,6)
|
||||
-- if self.pointID == 1 then
|
||||
-- JohnDoe06.targetPos = JohnDoe06Data.Pos01Pos
|
||||
-- elseif self.pointID == 2 then
|
||||
-- JohnDoe06.targetPos = JohnDoe06Data.Pos02Pos
|
||||
-- elseif self.pointID == 3 then
|
||||
-- JohnDoe06.targetPos = JohnDoe06Data.Pos03Pos
|
||||
-- elseif self.pointID == 4 then
|
||||
-- JohnDoe06.targetPos = JohnDoe06Data.Pos04Pos
|
||||
-- elseif self.pointID == 5 then
|
||||
-- JohnDoe06.targetPos = JohnDoe06Data.Pos05Pos
|
||||
-- elseif self.pointID == 6 then
|
||||
-- JohnDoe06.targetPos = JohnDoe06Data.Pos06Pos
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- function JohnDoe06:NextMove()
|
||||
-- self:CallDelay(math.random(3,7), self.RandomStand)
|
||||
-- end
|
||||
|
||||
-- function JohnDoe06:StartDay()
|
||||
-- self:ClearFollowTask()
|
||||
-- self:ShowSelf()
|
||||
-- self:TurnTo(M.Euler2DirXZ(JohnDoe06Data.BornDir))
|
||||
-- self:PerformDither(true, 2, self.DelayChat)
|
||||
-- self:RandomTest()
|
||||
-- end
|
||||
|
||||
-- function JohnDoe06:DelayChat()
|
||||
-- self:CallDelay(7, self.Chat)
|
||||
-- end
|
||||
|
||||
function JohnDoe06:Chat()
|
||||
self:DoFreeStyle(52)
|
||||
end
|
||||
|
||||
function JohnDoe06:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
-- self:GoHome()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
-- function JohnDoe06:GoHome()
|
||||
-- self:TurnTo(M.Euler2DirXZ(JohnDoe06Data.HomeDir))
|
||||
-- self:PerformDither(false, 2, self.HideSelf)
|
||||
-- end
|
||||
|
||||
function JohnDoe06:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return JohnDoe06
|
147
soggy_resources/lua/Actor/Npc/JohnDoe07.lua
Normal file
147
soggy_resources/lua/Actor/Npc/JohnDoe07.lua
Normal file
@@ -0,0 +1,147 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local JohnDoe07 = class("JohnDoe07", NpcActorProxy)
|
||||
|
||||
JohnDoe07.defaultAlias = "JohnDoe07"
|
||||
JohnDoe07.pointID = 1
|
||||
JohnDoe07.currWeather = WeatherType.ClearSky
|
||||
|
||||
local JohnDoe07Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "JohnDoe07Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "JohnDoe07Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "JohnDoe07Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "JohnDoe07Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "JohnDoe07Pos01").pos,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "JohnDoe07Pos02").pos,
|
||||
Pos03Pos = sceneData:GetDummyPoint(3, "JohnDoe07Pos03").pos,
|
||||
Pos04Pos = sceneData:GetDummyPoint(3, "JohnDoe07Pos04").pos,
|
||||
Pos05Pos = sceneData:GetDummyPoint(3, "JohnDoe07Pos05").pos,
|
||||
Pos06Pos = sceneData:GetDummyPoint(3, "JohnDoe07Pos06").pos,
|
||||
Pos07Pos = sceneData:GetDummyPoint(3, "JohnDoe07Pos07").pos,
|
||||
Pos08Pos = sceneData:GetDummyPoint(3, "JohnDoe07Pos08").pos,
|
||||
Pos09Pos = sceneData:GetDummyPoint(3, "JohnDoe07Pos09").pos,
|
||||
}
|
||||
|
||||
|
||||
function JohnDoe07:Start()
|
||||
--print("start!JohnDoe07")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function JohnDoe07:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function JohnDoe07:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function JohnDoe07:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe07:StartDaily()
|
||||
--print("JohnDoe07 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe07:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe07:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe07Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoPatrol)
|
||||
end
|
||||
|
||||
function JohnDoe07:GoPatrol()
|
||||
if self.pointID == 10 then
|
||||
self.pointID = 1
|
||||
end
|
||||
self:GoPatrolRoute()
|
||||
end
|
||||
|
||||
function JohnDoe07:GoPatrolRoute()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(JohnDoe07Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(JohnDoe07Data.Pos02Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(JohnDoe07Data.Pos03Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 4 then
|
||||
self:WalkToTask(JohnDoe07Data.Pos04Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 5 then
|
||||
self:WalkToTask(JohnDoe07Data.Pos05Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 6 then
|
||||
self:WalkToTask(JohnDoe07Data.Pos06Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 7 then
|
||||
self:WalkToTask(JohnDoe07Data.Pos07Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 8 then
|
||||
self:WalkToTask(JohnDoe07Data.Pos08Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 9 then
|
||||
self:WalkToTask(JohnDoe07Data.Pos09Pos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe07:SelfPointUpdate()
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoPatrol()
|
||||
end
|
||||
|
||||
function JohnDoe07:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function JohnDoe07:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe07Data.HomeDir))
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe07:GoHomeRoute()
|
||||
if self.pointID > 1 then
|
||||
self.pointID = 1
|
||||
self:WalkToTask(JohnDoe07Data.HomePos, self.GoHome, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe07:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return JohnDoe07
|
147
soggy_resources/lua/Actor/Npc/JohnDoe08.lua
Normal file
147
soggy_resources/lua/Actor/Npc/JohnDoe08.lua
Normal file
@@ -0,0 +1,147 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local JohnDoe08 = class("JohnDoe08", NpcActorProxy)
|
||||
|
||||
JohnDoe08.defaultAlias = "JohnDoe08"
|
||||
JohnDoe08.pointID = 1
|
||||
JohnDoe08.currWeather = WeatherType.ClearSky
|
||||
|
||||
local JohnDoe08Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "JohnDoe08Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "JohnDoe08Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "JohnDoe08Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "JohnDoe08Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "JohnDoe08Pos01").pos,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "JohnDoe08Pos02").pos,
|
||||
Pos03Pos = sceneData:GetDummyPoint(3, "JohnDoe08Pos03").pos,
|
||||
Pos04Pos = sceneData:GetDummyPoint(3, "JohnDoe08Pos04").pos,
|
||||
Pos05Pos = sceneData:GetDummyPoint(3, "JohnDoe08Pos05").pos,
|
||||
Pos06Pos = sceneData:GetDummyPoint(3, "JohnDoe08Pos06").pos,
|
||||
Pos07Pos = sceneData:GetDummyPoint(3, "JohnDoe08Pos07").pos,
|
||||
Pos08Pos = sceneData:GetDummyPoint(3, "JohnDoe08Pos08").pos,
|
||||
Pos09Pos = sceneData:GetDummyPoint(3, "JohnDoe08Pos09").pos,
|
||||
}
|
||||
|
||||
|
||||
function JohnDoe08:Start()
|
||||
--print("start!JohnDoe08")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function JohnDoe08:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function JohnDoe08:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function JohnDoe08:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe08:StartDaily()
|
||||
--print("JohnDoe08 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe08:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe08:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe08Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoPatrol)
|
||||
end
|
||||
|
||||
function JohnDoe08:GoPatrol()
|
||||
if self.pointID == 10 then
|
||||
self.pointID = 1
|
||||
end
|
||||
self:GoPatrolRoute()
|
||||
end
|
||||
|
||||
function JohnDoe08:GoPatrolRoute()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(JohnDoe08Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(JohnDoe08Data.Pos02Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(JohnDoe08Data.Pos03Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 4 then
|
||||
self:WalkToTask(JohnDoe08Data.Pos04Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 5 then
|
||||
self:WalkToTask(JohnDoe08Data.Pos05Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 6 then
|
||||
self:WalkToTask(JohnDoe08Data.Pos06Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 7 then
|
||||
self:WalkToTask(JohnDoe08Data.Pos07Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 8 then
|
||||
self:WalkToTask(JohnDoe08Data.Pos08Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 9 then
|
||||
self:WalkToTask(JohnDoe08Data.Pos09Pos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe08:SelfPointUpdate()
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoPatrol()
|
||||
end
|
||||
|
||||
function JohnDoe08:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function JohnDoe08:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(JohnDoe08Data.HomeDir))
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe08:GoHomeRoute()
|
||||
if self.pointID > 1 then
|
||||
self.pointID = 1
|
||||
self:WalkToTask(JohnDoe08Data.HomePos, self.GoHome, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function JohnDoe08:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return JohnDoe08
|
81
soggy_resources/lua/Actor/Npc/MengdeSample01.lua
Normal file
81
soggy_resources/lua/Actor/Npc/MengdeSample01.lua
Normal file
@@ -0,0 +1,81 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local MengdeSample01 = class("MengdeSample01", NpcActorProxy)
|
||||
|
||||
MengdeSample01.defaultAlias = "MengdeSample01"
|
||||
MengdeSample01.currWeather = WeatherType.ClearSky
|
||||
|
||||
function MengdeSample01:Start()
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function MengdeSample01:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function MengdeSample01:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeSample01:StartDaily()
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
self:ShowBubble()
|
||||
end
|
||||
|
||||
function MengdeSample01:StartNight()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2, self.Play)
|
||||
end
|
||||
|
||||
function MengdeSample01:ShowBubble()
|
||||
self:TriggerNpcSpeechBubble(915, 4016412)
|
||||
self:BubbleTime()
|
||||
end
|
||||
|
||||
function MengdeSample01:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeSample01:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(915)
|
||||
self:BubbleGap()
|
||||
end
|
||||
|
||||
function MengdeSample01:BubbleGap()
|
||||
self:CallDelay(5, self.ShowBubble)
|
||||
end
|
||||
|
||||
function MengdeSample01:StartDay()
|
||||
self:PerformDither(false, 2, self.Home)
|
||||
end
|
||||
|
||||
function MengdeSample01:Play()
|
||||
self:ShowSelf()
|
||||
end
|
||||
|
||||
function MengdeSample01:Home()
|
||||
self:HideSelf()
|
||||
end
|
||||
|
||||
function MengdeSample01:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return MengdeSample01
|
78
soggy_resources/lua/Actor/Npc/MengdeSample02.lua
Normal file
78
soggy_resources/lua/Actor/Npc/MengdeSample02.lua
Normal file
@@ -0,0 +1,78 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local MengdeSample02 = class("MengdeSample02", NpcActorProxy)
|
||||
|
||||
MengdeSample02.defaultAlias = "MengdeSample02"
|
||||
MengdeSample02.currWeather = WeatherType.ClearSky
|
||||
|
||||
function MengdeSample02:Start()
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function MengdeSample02:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function MengdeSample02:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeSample02:StartDaily()
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeSample02:StartDay()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2, self.Play)
|
||||
end
|
||||
|
||||
function MengdeSample02:ShowBubble()
|
||||
self:TriggerNpcSpeechBubble(916, 4016510)
|
||||
self:BubbleTime()
|
||||
end
|
||||
|
||||
function MengdeSample02:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeSample02:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(916)
|
||||
self:NotifyTo("MengdeSample04", 4016509)
|
||||
end
|
||||
|
||||
function MengdeSample02:StartNight()
|
||||
self:PerformDither(false, 2, self.Home)
|
||||
end
|
||||
|
||||
function MengdeSample02:Play()
|
||||
self:ShowSelf()
|
||||
end
|
||||
|
||||
function MengdeSample02:Home()
|
||||
self:HideSelf()
|
||||
end
|
||||
|
||||
function MengdeSample02:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
elseif evt.evtType == 4016510 then
|
||||
self:ShowBubble()
|
||||
end
|
||||
end
|
||||
|
||||
return MengdeSample02
|
62
soggy_resources/lua/Actor/Npc/MengdeSample03.lua
Normal file
62
soggy_resources/lua/Actor/Npc/MengdeSample03.lua
Normal file
@@ -0,0 +1,62 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local MengdeSample03 = class("MengdeSample03", NpcActorProxy)
|
||||
|
||||
MengdeSample03.defaultAlias = "MengdeSample03"
|
||||
MengdeSample03.currWeather = WeatherType.ClearSky
|
||||
|
||||
function MengdeSample03:Start()
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function MengdeSample03:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function MengdeSample03:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeSample03:StartDaily()
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeSample03:StartDay()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2, self.Play)
|
||||
end
|
||||
|
||||
function MengdeSample03:StartNight()
|
||||
self:PerformDither(false, 2, self.Home)
|
||||
end
|
||||
|
||||
function MengdeSample03:Play()
|
||||
self:ShowSelf()
|
||||
end
|
||||
|
||||
function MengdeSample03:Home()
|
||||
self:HideSelf()
|
||||
end
|
||||
|
||||
function MengdeSample03:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return MengdeSample03
|
80
soggy_resources/lua/Actor/Npc/MengdeSample04.lua
Normal file
80
soggy_resources/lua/Actor/Npc/MengdeSample04.lua
Normal file
@@ -0,0 +1,80 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local MengdeSample04 = class("MengdeSample04", NpcActorProxy)
|
||||
|
||||
MengdeSample04.defaultAlias = "MengdeSample04"
|
||||
MengdeSample04.currWeather = WeatherType.ClearSky
|
||||
|
||||
function MengdeSample04:Start()
|
||||
self:StartDaily()
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
end
|
||||
|
||||
function MengdeSample04:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function MengdeSample04:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeSample04:StartDaily()
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
self:ShowBubble()
|
||||
end
|
||||
|
||||
function MengdeSample04:StartDay()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2, self.Play)
|
||||
end
|
||||
|
||||
function MengdeSample04:ShowBubble()
|
||||
self:TriggerNpcSpeechBubble(918, 4016509)
|
||||
self:BubbleTime()
|
||||
end
|
||||
|
||||
function MengdeSample04:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeSample04:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(918)
|
||||
self:NotifyTo("MengdeSample02", 4016510)
|
||||
end
|
||||
|
||||
function MengdeSample04:StartNight()
|
||||
self:PerformDither(false, 2, self.Home)
|
||||
end
|
||||
|
||||
function MengdeSample04:Play()
|
||||
self:ShowSelf()
|
||||
end
|
||||
|
||||
function MengdeSample04:Home()
|
||||
self:HideSelf()
|
||||
end
|
||||
|
||||
function MengdeSample04:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
elseif evt.evtType == 4016509 then
|
||||
self:ShowBubble()
|
||||
end
|
||||
end
|
||||
|
||||
return MengdeSample04
|
64
soggy_resources/lua/Actor/Npc/MengdeSample05.lua
Normal file
64
soggy_resources/lua/Actor/Npc/MengdeSample05.lua
Normal file
@@ -0,0 +1,64 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local MengdeSample05 = class("MengdeSample05", NpcActorProxy)
|
||||
|
||||
MengdeSample05.defaultAlias = "MengdeSample05"
|
||||
MengdeSample05.currWeather = WeatherType.ClearSky
|
||||
|
||||
function MengdeSample05:Start()
|
||||
self:HideSelf()
|
||||
self:SitOnChair()
|
||||
self:CallDelay(3, self.StartDaily)
|
||||
end
|
||||
|
||||
function MengdeSample05:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function MengdeSample05:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeSample05:StartDaily()
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeSample05:StartNight()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2, self.Play)
|
||||
|
||||
end
|
||||
|
||||
function MengdeSample05:StartDay()
|
||||
self:PerformDither(false, 2, self.Home)
|
||||
end
|
||||
|
||||
function MengdeSample05:Play()
|
||||
end
|
||||
|
||||
function MengdeSample05:Home()
|
||||
self:HideSelf()
|
||||
end
|
||||
|
||||
function MengdeSample05:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return MengdeSample05
|
17
soggy_resources/lua/Actor/Npc/NPCEventType.lua
Normal file
17
soggy_resources/lua/Actor/Npc/NPCEventType.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
local EventType = {}
|
||||
|
||||
EventType.DailyNpcEventType =
|
||||
{
|
||||
--@region EventType List
|
||||
--恢复日常巡逻模式
|
||||
STARTDAILY = 0,
|
||||
--隐藏自身
|
||||
HIDESELF = 1,
|
||||
--屏蔽日常行为
|
||||
BANDAILY = 2,
|
||||
|
||||
--@endregion
|
||||
}
|
||||
|
||||
|
||||
return EventType
|
105
soggy_resources/lua/Actor/Npc/NpcActorProxy.lua
Normal file
105
soggy_resources/lua/Actor/Npc/NpcActorProxy.lua
Normal file
@@ -0,0 +1,105 @@
|
||||
----------------------
|
||||
-- 这是Lua端NpcActor的基类,包含了控制Npc行为的方法。继承自EntityActorProxy
|
||||
-- @classmod NpcActorProxy
|
||||
require('Actor/ActorCommon')
|
||||
local entityActorProxy = require('Actor/EntityActorProxy')
|
||||
|
||||
local NpcActorProxy = class("NpcActorProxy", entityActorProxy)
|
||||
|
||||
NpcActorProxy.actorType = ActorType.NPC_ACTOR
|
||||
|
||||
local super = nil
|
||||
|
||||
function NpcActorProxy:OnPreInit()
|
||||
super = self.__super
|
||||
super:OnPreInit()
|
||||
end
|
||||
|
||||
-- local param begin
|
||||
-- local param end
|
||||
|
||||
function NpcActorProxy:CreateNpcUActor(alias)
|
||||
local uActor = actorUtils.CreateActor(self, ActorType.NPC_ACTOR, alias, self.metaPath)
|
||||
if self.bornPos == nil then
|
||||
self.bornPos = M.Pos(0,0,0)
|
||||
end
|
||||
if self.bornDir == nil then
|
||||
self.bornDir = M.Pos(0,0,0)
|
||||
end
|
||||
uActor = actorUtils.CreateNpcActor(self.configID, self.bornPos, self.bornDir, uActor, self.bornSceneID, self.bornRoomID)
|
||||
return uActor
|
||||
end
|
||||
|
||||
function NpcActorProxy:CreateUActor(alias)
|
||||
return self:CreateNpcUActor(alias)
|
||||
end
|
||||
|
||||
--- NpcActor内部交互行为方法
|
||||
-- @section interaction
|
||||
|
||||
--- NpcActor添加交互行为,会截断内置的行为
|
||||
-- @tparam InterTimingType timingType 交互时机
|
||||
-- @tparam table interCfg 交互配置表
|
||||
function NpcActorProxy:AddPriorityInter(timingType, interCfg)
|
||||
self.uActor:AddPriorityInter(timingType, interCfg)
|
||||
end
|
||||
--- NpcActor清除交互行为,根据时机
|
||||
-- @tparam InterTimingType timingType 交互时机
|
||||
function NpcActorProxy:ClearPriorityInter(timingType)
|
||||
self.uActor:ClearPriorityInter(timingType)
|
||||
end
|
||||
--- NpcActor检查是否有对话项
|
||||
function NpcActorProxy:CheckNpcTalk()
|
||||
self.uActor:CheckNpcTalk()
|
||||
end
|
||||
|
||||
--- NpcActor注册碰撞回调
|
||||
function NpcActorProxy:CallOnCollisionEnter(onCollision)
|
||||
self.uActor:CallOnCollisionEnter(onCollision)
|
||||
end
|
||||
function NpcActorProxy:ClearOnCollisionEnter(onCollision)
|
||||
self.uActor:ClearOnCollisionEnter(onCollision)
|
||||
end
|
||||
|
||||
--- NpcActor临时关闭打开控头
|
||||
-- @tparam bool value flase是关,true是开
|
||||
function NpcActorProxy:EnableHeadCtrl(value)
|
||||
self.uActor:EnableHeadCtrl(value)
|
||||
end
|
||||
|
||||
function NpcActorProxy:OnDestroy()
|
||||
|
||||
end
|
||||
|
||||
function NpcActorProxy:Destroy(isActorOnly)
|
||||
self:OnDestroy()
|
||||
self:ClearCoroutine()
|
||||
if self.uActor ~= nil then
|
||||
self.uActor:Destroy(isActorOnly)
|
||||
end
|
||||
actorMgr:ClearActor(self.alias)
|
||||
self.uActor = nil
|
||||
self.actorData = nil
|
||||
end
|
||||
|
||||
function NpcActorProxy:ClearActor()
|
||||
self.uActor:ClearActor()
|
||||
|
||||
self.targetPos = nil
|
||||
self.routePoints = nil
|
||||
|
||||
self.BeFollowLen = 10
|
||||
self.BeFollowFailedLen = 20
|
||||
self.BeFollowState = BeFollowState.ING
|
||||
self.BeFollowFailed = nil
|
||||
|
||||
self.CurrDialogList = nil
|
||||
self.CurrDialogIndex = 1
|
||||
self.CurrDuration = 0
|
||||
self.CurrDurationCnt = 0
|
||||
self.NarratorPauseLen = 10
|
||||
self.NarratorResumeLen = 5
|
||||
self.NarratorState = NarratorState.ING
|
||||
end
|
||||
|
||||
return NpcActorProxy
|
64
soggy_resources/lua/Actor/Npc/NpcDailyCommon.lua
Normal file
64
soggy_resources/lua/Actor/Npc/NpcDailyCommon.lua
Normal file
@@ -0,0 +1,64 @@
|
||||
local DailyNpcCommon={}
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
local NpcModeType = require('Actor/Npc/NpcMode/NpcModeType')
|
||||
|
||||
local NpcEventType = NpcEventType.DailyNpcEventType
|
||||
|
||||
DailyNpcCommon.Register= function(actor)
|
||||
actor:RegisterMode(NpcModeType.MODE_HIDE)
|
||||
actor:RegisterMode(NpcModeType.MODE_BANDAILY)
|
||||
end
|
||||
|
||||
DailyNpcCommon.InvokeOnResetFreeStyle= function(actor,freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 then
|
||||
actor:RecoverFromFreeStyle()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
DailyNpcCommon.OnEvent= function(evt,actor)
|
||||
if evt.evtType == NpcEventType.STARTDAILY then
|
||||
actor:StartDaily()
|
||||
elseif evt.evtType == NpcEventType.HIDESELF then
|
||||
actor:SwitchMode(NpcModeType.MODE_HIDE)
|
||||
elseif evt.evtType == NpcEventType.BANDAILY then
|
||||
actor:SwitchMode(NpcModeType.MODE_BANDAILY)
|
||||
end
|
||||
end
|
||||
|
||||
DailyNpcCommon.OnCollisionEnter= function(targetInfo,actor)
|
||||
if actor.OnAction==1 then
|
||||
return
|
||||
end
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
--actor:AddPriorityInter(InterTimingType.BTN, NoReplyInter)
|
||||
actor.OnAction=1
|
||||
local avatarPos = actorUtils.GetAvatarPos()
|
||||
local selfPos = actor:GetPos()
|
||||
local TurnDir = { x = selfPos.x-avatarPos.x, y = selfPos.y,-avatarPos.y, z = selfPos.z-avatarPos.z}
|
||||
actor:Standby()
|
||||
actor:TurnTo(TurnDir)
|
||||
actor:DoFreeStyleTask(9010, true, actor.RecoverFromCollisionEnter)
|
||||
--[[actor:CallDelay(0,
|
||||
function(actor)
|
||||
actor:DoFreeStyleTask(9010, true, actor.RecoverFromCollisionEnter)
|
||||
end)]]--
|
||||
else
|
||||
actor.OnAction=1
|
||||
local avatarPos = actorUtils.GetAvatarPos()
|
||||
local selfPos = actor:GetPos()
|
||||
local TurnDir = { x = avatarPos.x-selfPos.x, y = avatarPos.y-selfPos.y, z = avatarPos.z-selfPos.z}
|
||||
actor:Standby()
|
||||
actor:TurnTo(TurnDir)
|
||||
--[[actor:CallDelay(0,
|
||||
afunction(actor)
|
||||
actor:DoFreeStyleTask(9020, true, actor.RecoverFromCollisionEnter)
|
||||
end)]]--
|
||||
actor:DoFreeStyleTask(9020, true,actor.RecoverFromCollisionEnter)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return DailyNpcCommon
|
169
soggy_resources/lua/Actor/Npc/NpcMengdeDayPatrol.lua
Normal file
169
soggy_resources/lua/Actor/Npc/NpcMengdeDayPatrol.lua
Normal file
@@ -0,0 +1,169 @@
|
||||
require('Actor/ActorCommon')
|
||||
local BaseDailyNpc = require('Actor/Npc/BaseDailyNpc')
|
||||
local MengdeDayPatrol = class("MengdeDayPatrol", BaseDailyNpc)
|
||||
local DailyNpcCommon = require('Actor/Npc/NpcDailyCommon')
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
MengdeDayPatrol.defaultAlias = "MengdeDayPatrol"
|
||||
MengdeDayPatrol.pointID = 1
|
||||
|
||||
|
||||
|
||||
|
||||
local Config = require('Actor/Npc/Config/CfgMengdeDayPatrol')
|
||||
local DummyPointData = Config.DummyPointData
|
||||
|
||||
|
||||
|
||||
function MengdeDayPatrol:PreGetAlias()
|
||||
local NpcAlias = DummyPointData.Npc .. '_' .. tostring(self.dataIndex)
|
||||
return NpcAlias
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:Register()
|
||||
DailyNpcCommon.Register(self)
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:RecoverFromFreeStyle()
|
||||
print("RecoverFromFreeStyle")
|
||||
self:Recover()
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:RecoverFromCollisionEnter()
|
||||
print("RecoverFromCollisionEnter")
|
||||
self:Recover()
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:Recover()
|
||||
self.OnAction=0
|
||||
self:GoPatrol1()
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:InvokeOnResetFreeStyle(freeStyleType)
|
||||
DailyNpcCommon.InvokeOnResetFreeStyle(self,freeStyleType)
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:OnCollisionEnter(targetInfo)
|
||||
DailyNpcCommon.OnCollisionEnter(targetInfo,self)
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:DataInit()
|
||||
self.Data=DummyPointData.PosData[self.dataIndex]
|
||||
self.Count=#DummyPointData.PosData[self.dataIndex]
|
||||
self.Time=DummyPointData.TimeData[self.dataIndex]
|
||||
self.Dir=DummyPointData.DirData[self.dataIndex]
|
||||
self.pointID=math.random(1,self.Count)
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:StartDay()
|
||||
--print("start day"..tostring(self.dataIndex))
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
--self:GoPatrol()
|
||||
--self:CallDelay(2,self.GoPatrol1)
|
||||
self:GoPatrol1()
|
||||
self:StartBubble()
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:Start()
|
||||
--print("start!!!!!!!!!!!!!!!!!!!!!"..tostring(self.dataIndex))
|
||||
self:DataInit()
|
||||
self:SetPos(self.Data[self.pointID],true)
|
||||
--self:CallDelay(5,self.StartDaily)
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:StartBubble()
|
||||
if self.bubble~=1 then
|
||||
self:ShowBubble()
|
||||
self.bubble=1
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:ShowBubble()
|
||||
if DummyPointData.DialogID[self.dataIndex] ~= 0 then
|
||||
self:TriggerNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex], DummyPointData.DialogID[self.dataIndex])
|
||||
self:BubbleTime()
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:BubbleGap()
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:BubbleGap()
|
||||
self:CallDelay(math.random(7,8), self.ShowBubble)
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:GoPatrol1()
|
||||
if self.pointID == self.Count+1 then
|
||||
self.pointID = 1
|
||||
end
|
||||
--self:CallDelay(math.random(10,20), self.GoPatrolRoute1)
|
||||
self:GoPatrolRoute1()
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:GoPatrolRoute1()
|
||||
--print("npc"..tostring(self.dataIndex).."walkto"..tostring(self.pointID))
|
||||
self:WalkToTask(self.Data[self.pointID], self.SelfPointUpdate1, self.Standby)
|
||||
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:SelfPointUpdate1()
|
||||
local time=self.Time[self.pointID]
|
||||
local dir=self.Dir[self.pointID]
|
||||
self.pointID = self.pointID + 1
|
||||
if time==0 then
|
||||
self:GoPatrol1()
|
||||
else
|
||||
self:Standby()
|
||||
--self:TurnTo(M.Euler2DirXZ(dir))
|
||||
self:SteerToTask(M.Euler2DirXZ(dir),1,true,true)
|
||||
self:CallDelay(time, self.GoPatrol1)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function MengdeDayPatrol:GoPatrol()
|
||||
if self.pointID == 7 then
|
||||
self.pointID = 1
|
||||
end
|
||||
self:GoPatrolRoute()
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:GoPatrolRoute()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(DummyPointData.Pos01Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(DummyPointData.Pos02Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(DummyPointData.Pos03Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 4 then
|
||||
self:WalkToTask(DummyPointData.Pos04Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 5 then
|
||||
self:WalkToTask(DummyPointData.Pos05Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 6 then
|
||||
self:WalkToTask(DummyPointData.Pos06Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:SelfPointUpdate()
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoPatrol()
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:StartNight()
|
||||
self:Standby()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeDayPatrol:OnEvent(evt)
|
||||
DailyNpcCommon.OnEvent(evt,self)
|
||||
end
|
||||
|
||||
return MengdeDayPatrol
|
68
soggy_resources/lua/Actor/Npc/NpcMengdeDaySit.lua
Normal file
68
soggy_resources/lua/Actor/Npc/NpcMengdeDaySit.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
require('Actor/ActorCommon')
|
||||
local BaseDailyNpc = require('Actor/Npc/BaseDailyNpc')
|
||||
local MengdeDaySit = class("MengdeDaySit", BaseDailyNpc)
|
||||
local DailyNpcCommon = require('Actor/Npc/NpcDailyCommon')
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
MengdeDaySit.defaultAlias = "MengdeDaySit"
|
||||
|
||||
local Config = require('Actor/Npc/Config/CfgMengdeDaySit')
|
||||
local DummyPointData = Config.DummyPointData
|
||||
|
||||
function MengdeDaySit:PreGetAlias()
|
||||
local NpcAlias = DummyPointData.Npc .. '_' .. tostring(self.dataIndex)
|
||||
return NpcAlias
|
||||
end
|
||||
|
||||
function MengdeDaySit:Register()
|
||||
DailyNpcCommon.Register(self)
|
||||
end
|
||||
|
||||
function MengdeDaySit:StartDay()
|
||||
self:SitOnChair()
|
||||
self:CallDelay(4, self.AfterSit)
|
||||
end
|
||||
|
||||
function MengdeDaySit:AfterSit()
|
||||
self:DoFreeStateTrigger()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
self:StartBubble()
|
||||
end
|
||||
|
||||
function MengdeDaySit:StartBubble()
|
||||
if self.bubble~=1 then
|
||||
self:ShowBubble()
|
||||
self.bubble=1
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeDaySit:ShowBubble()
|
||||
if DummyPointData.DialogID[self.dataIndex] ~= 0 then
|
||||
self:TriggerNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex], DummyPointData.DialogID[self.dataIndex])
|
||||
self:BubbleTime()
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeDaySit:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeDaySit:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:BubbleGap()
|
||||
end
|
||||
|
||||
function MengdeDaySit:BubbleGap()
|
||||
self:CallDelay(math.random(7,8), self.ShowBubble)
|
||||
end
|
||||
|
||||
function MengdeDaySit:StartNight()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeDaySit:OnEvent(evt)
|
||||
DailyNpcCommon.OnEvent(evt,self)
|
||||
end
|
||||
|
||||
return MengdeDaySit
|
112
soggy_resources/lua/Actor/Npc/NpcMengdeDayStand.lua
Normal file
112
soggy_resources/lua/Actor/Npc/NpcMengdeDayStand.lua
Normal file
@@ -0,0 +1,112 @@
|
||||
require('Actor/ActorCommon')
|
||||
local BaseDailyNpc = require('Actor/Npc/BaseDailyNpc')
|
||||
local MengdeDayStand = class("MengdeDayStand", BaseDailyNpc)
|
||||
local DailyNpcCommon = require('Actor/Npc/NpcDailyCommon')
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
MengdeDayStand.defaultAlias = "MengdeDayStand"
|
||||
|
||||
local Config = require('Actor/Npc/Config/CfgMengdeDayStand')
|
||||
local DummyPointData = Config.DummyPointData
|
||||
|
||||
|
||||
|
||||
function MengdeDayStand:PreGetAlias()
|
||||
local NpcAlias = DummyPointData.Npc .. '_' .. tostring(self.dataIndex)
|
||||
return NpcAlias
|
||||
end
|
||||
|
||||
function MengdeDayStand:Register()
|
||||
DailyNpcCommon.Register(self)
|
||||
end
|
||||
|
||||
function MengdeDayStand:InvokeOnResetFreeStyle(freeStyleType)
|
||||
DailyNpcCommon.InvokeOnResetFreeStyle(self,freeStyleType)
|
||||
end
|
||||
|
||||
function MengdeDayStand:OnCollisionEnter(targetInfo)
|
||||
DailyNpcCommon.OnCollisionEnter(targetInfo,self)
|
||||
end
|
||||
|
||||
function MengdeDayStand:WalkBack()
|
||||
print("walkback")
|
||||
self:WalkToTask(DummyPointData.BornPos[self.dataIndex],self.Recover)
|
||||
--self:StartDay()
|
||||
end
|
||||
|
||||
function MengdeDayStand:RecoverFromFreeStyle()
|
||||
print("RecoverFromFreeStyle")
|
||||
self:Recover()
|
||||
end
|
||||
|
||||
function MengdeDayStand:RecoverFromCollisionEnter()
|
||||
print("RecoverFromCollisionEnter")
|
||||
--self:ClearAllTask()
|
||||
self:Recover()
|
||||
--self:CallDelay(0.5,self.WalkBack)
|
||||
end
|
||||
|
||||
function MengdeDayStand:Recover()
|
||||
self.OnAction=0
|
||||
self:Standby()
|
||||
--self:TurnTo(M.Euler2DirXZ(DummyPointData.BornDir[self.dataIndex]))
|
||||
self:SteerToTask(M.Euler2DirXZ(DummyPointData.BornDir[self.dataIndex]),1,true,true)
|
||||
self:DoFreeStateTrigger()
|
||||
end
|
||||
|
||||
function MengdeDayStand:StartDay()
|
||||
self:Standby()
|
||||
self:TurnTo(M.Euler2DirXZ(DummyPointData.BornDir[self.dataIndex]))
|
||||
self:DoFreeStateTrigger()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
self:StartBubble()
|
||||
end
|
||||
|
||||
function MengdeDayStand:StartBubble()
|
||||
if self.bubble~=1 then
|
||||
self:ShowBubble()
|
||||
self.bubble=1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function MengdeDayStand:StartBubble()
|
||||
--print("startbubble")
|
||||
--if self.bubble~=1 then
|
||||
--print("startbubble1")
|
||||
self:ShowBubble()
|
||||
--self.bubble=1
|
||||
--end
|
||||
end
|
||||
|
||||
function MengdeDayStand:ShowBubble()
|
||||
if DummyPointData.DialogID[self.dataIndex] ~= 0 then
|
||||
self:TriggerNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex], DummyPointData.DialogID[self.dataIndex])
|
||||
self:BubbleTime()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function MengdeDayStand:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeDayStand:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:BubbleGap()
|
||||
end
|
||||
|
||||
function MengdeDayStand:BubbleGap()
|
||||
self:CallDelay(math.random(7,8), self.ShowBubble)
|
||||
end
|
||||
|
||||
function MengdeDayStand:StartNight()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeDayStand:OnEvent(evt)
|
||||
DailyNpcCommon.OnEvent(evt,self)
|
||||
end
|
||||
|
||||
return MengdeDayStand
|
163
soggy_resources/lua/Actor/Npc/NpcMengdeInsomniaPatrol.lua
Normal file
163
soggy_resources/lua/Actor/Npc/NpcMengdeInsomniaPatrol.lua
Normal file
@@ -0,0 +1,163 @@
|
||||
require('Actor/ActorCommon')
|
||||
local BaseDailyNpc = require('Actor/Npc/BaseDailyNpc')
|
||||
local MengdeInsomniaPatrol = class("MengdeInsomniaPatrol", BaseDailyNpc)
|
||||
local DailyNpcCommon = require('Actor/Npc/NpcDailyCommon')
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
MengdeInsomniaPatrol.defaultAlias = "MengdeInsomniaPatrol"
|
||||
MengdeInsomniaPatrol.pointID = 1
|
||||
|
||||
local Config = require('Actor/Npc/Config/CfgMengdeInsomniaPatrol')
|
||||
local DummyPointData = Config.DummyPointData
|
||||
|
||||
function MengdeInsomniaPatrol:PreGetAlias()
|
||||
local NpcAlias = DummyPointData.Npc .. '_' .. tostring(self.dataIndex)
|
||||
return NpcAlias
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:Register()
|
||||
DailyNpcCommon.Register(self)
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:RecoverFromFreeStyle()
|
||||
print("RecoverFromFreeStyle")
|
||||
self:Recover()
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:RecoverFromCollisionEnter()
|
||||
print("RecoverFromCollisionEnter")
|
||||
self:Recover()
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:Recover()
|
||||
self.OnAction=0
|
||||
self:GoPatrol1()
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:InvokeOnResetFreeStyle(freeStyleType)
|
||||
DailyNpcCommon.InvokeOnResetFreeStyle(self,freeStyleType)
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:OnCollisionEnter(targetInfo)
|
||||
DailyNpcCommon.OnCollisionEnter(targetInfo,self)
|
||||
end
|
||||
|
||||
|
||||
|
||||
function MengdeInsomniaPatrol:DataInit()
|
||||
self.Data=DummyPointData.PosData[self.dataIndex]
|
||||
self.Count=#DummyPointData.PosData[self.dataIndex]
|
||||
self.Time=DummyPointData.TimeData[self.dataIndex]
|
||||
self.Dir=DummyPointData.DirData[self.dataIndex]
|
||||
self.pointID=math.random(1,self.Count)
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:StartBubble()
|
||||
if self.bubble~=1 then
|
||||
self:ShowBubble()
|
||||
self.bubble=1
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:StartDay()
|
||||
print("start day"..tostring(self.dataIndex))
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
--self:GoPatrol()
|
||||
--self:CallDelay(2,self.GoPatrol1)
|
||||
self:GoPatrol1()
|
||||
self:StartBubble()
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:Start()
|
||||
print("start!!!!!!!!!!!!!!!!!!!!!"..tostring(self.dataIndex))
|
||||
self:DataInit()
|
||||
self:SetPos(self.Data[self.pointID],true)
|
||||
--self:CallDelay(5,self.StartDaily)
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:ShowBubble()
|
||||
if DummyPointData.DialogID[self.dataIndex] ~= 0 then
|
||||
self:TriggerNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex], DummyPointData.DialogID[self.dataIndex])
|
||||
self:BubbleTime()
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:BubbleGap()
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:BubbleGap()
|
||||
self:CallDelay(math.random(7,8), self.ShowBubble)
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:GoPatrol1()
|
||||
if self.pointID == self.Count+1 then
|
||||
self.pointID = 1
|
||||
end
|
||||
--self:CallDelay(math.random(10,20), self.GoPatrolRoute1)
|
||||
self:GoPatrolRoute1()
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:GoPatrolRoute1()
|
||||
print("npc"..tostring(self.dataIndex).."walkto"..tostring(self.pointID))
|
||||
self:WalkToTask(self.Data[self.pointID], self.SelfPointUpdate1, self.Standby)
|
||||
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:SelfPointUpdate1()
|
||||
local time=self.Time[self.pointID]
|
||||
local dir=self.Dir[self.pointID]
|
||||
self.pointID = self.pointID + 1
|
||||
if time==0 then
|
||||
self:GoPatrol1()
|
||||
else
|
||||
self:Standby()
|
||||
--self:TurnTo(M.Euler2DirXZ(dir))
|
||||
self:SteerToTask(M.Euler2DirXZ(dir),1,true,true)
|
||||
self:CallDelay(time, self.GoPatrol1)
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:GoPatrol()
|
||||
if self.pointID == 7 then
|
||||
self.pointID = 1
|
||||
end
|
||||
self:GoPatrolRoute()
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:GoPatrolRoute()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(DummyPointData.Pos01Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(DummyPointData.Pos02Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(DummyPointData.Pos03Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 4 then
|
||||
self:WalkToTask(DummyPointData.Pos04Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 5 then
|
||||
self:WalkToTask(DummyPointData.Pos05Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 6 then
|
||||
self:WalkToTask(DummyPointData.Pos06Pos[self.dataIndex], self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:SelfPointUpdate()
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoPatrol()
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:StartNight()
|
||||
self:StartDay()
|
||||
end
|
||||
|
||||
function MengdeInsomniaPatrol:OnEvent(evt)
|
||||
DailyNpcCommon.OnEvent(evt,self)
|
||||
end
|
||||
|
||||
return MengdeInsomniaPatrol
|
105
soggy_resources/lua/Actor/Npc/NpcMengdeInsomniaStand.lua
Normal file
105
soggy_resources/lua/Actor/Npc/NpcMengdeInsomniaStand.lua
Normal file
@@ -0,0 +1,105 @@
|
||||
require('Actor/ActorCommon')
|
||||
local BaseDailyNpc = require('Actor/Npc/BaseDailyNpc')
|
||||
local MengdeInsomniaStand = class("MengdeInsomniaStand", BaseDailyNpc)
|
||||
local DailyNpcCommon = require('Actor/Npc/NpcDailyCommon')
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
MengdeInsomniaStand.defaultAlias = "MengdeInsomniaStand"
|
||||
|
||||
local Config = require('Actor/Npc/Config/CfgMengdeInsomniaStand')
|
||||
local DummyPointData = Config.DummyPointData
|
||||
|
||||
BubbleCtrl_NpcMengdeInsomniaStand = DummyPointData.BubbleCtrl
|
||||
|
||||
function MengdeInsomniaStand:PreGetAlias()
|
||||
local NpcAlias = DummyPointData.Npc .. '_' .. tostring(self.dataIndex)
|
||||
return NpcAlias
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:Register()
|
||||
DailyNpcCommon.Register(self)
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:InvokeOnResetFreeStyle(freeStyleType)
|
||||
DailyNpcCommon.InvokeOnResetFreeStyle(self,freeStyleType)
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:OnCollisionEnter(targetInfo)
|
||||
DailyNpcCommon.OnCollisionEnter(targetInfo,self)
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:WalkBack()
|
||||
print("walkback")
|
||||
self:WalkToTask(DummyPointData.BornPos[self.dataIndex],self.Recover)
|
||||
--self:StartDay()
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:RecoverFromFreeStyle()
|
||||
print("RecoverFromFreeStyle")
|
||||
self:Recover()
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:RecoverFromCollisionEnter()
|
||||
print("RecoverFromCollisionEnter")
|
||||
--self:ClearAllTask()
|
||||
self:Recover()
|
||||
--self:CallDelay(0.5,self.WalkBack)
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:Recover()
|
||||
self.OnAction=0
|
||||
self:Standby()
|
||||
self:SteerToTask(M.Euler2DirXZ(DummyPointData.BornDir[self.dataIndex]),1,true,true)
|
||||
--self:TurnTo(M.Euler2DirXZ(DummyPointData.BornDir[self.dataIndex]))
|
||||
self:DoFreeStateTrigger()
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:StartDay()
|
||||
self:Standby()
|
||||
self:TurnTo(M.Euler2DirXZ(DummyPointData.BornDir[self.dataIndex]))
|
||||
self:DoFreeStateTrigger()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
self:StartBubble()
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:StartBubble()
|
||||
--print("start bubble")
|
||||
if self.bubble~=1 then
|
||||
--print("bubble!=1")
|
||||
self:ShowBubble()
|
||||
self.bubble=1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function MengdeInsomniaStand:ShowBubble()
|
||||
if DummyPointData.DialogID[self.dataIndex] ~= 0 then
|
||||
if BubbleCtrl_NpcMengdeInsomniaStand[self.dataIndex] ~= -1 then
|
||||
self:TriggerNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex], DummyPointData.DialogID[self.dataIndex])
|
||||
end
|
||||
self:BubbleTime()
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:BubbleGap()
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:BubbleGap()
|
||||
self:CallDelay(math.random(7,8), self.ShowBubble)
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:StartNight()
|
||||
self:StartDay()
|
||||
end
|
||||
|
||||
function MengdeInsomniaStand:OnEvent(evt)
|
||||
DailyNpcCommon.OnEvent(evt,self)
|
||||
end
|
||||
|
||||
return MengdeInsomniaStand
|
110
soggy_resources/lua/Actor/Npc/NpcMengdeNightConfuse.lua
Normal file
110
soggy_resources/lua/Actor/Npc/NpcMengdeNightConfuse.lua
Normal file
@@ -0,0 +1,110 @@
|
||||
require('Actor/ActorCommon')
|
||||
local BaseDailyNpc = require('Actor/Npc/BaseDailyNpc')
|
||||
local MengdeNightConfuse = class("MengdeNightConfuse", BaseDailyNpc)
|
||||
local DailyNpcCommon = require('Actor/Npc/NpcDailyCommon')
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
MengdeNightConfuse.defaultAlias = "MengdeNightConfuse"
|
||||
MengdeNightConfuse.pointID = 1
|
||||
MengdeNightConfuse.nightConfuseTargetPos = nil
|
||||
|
||||
local Config = require('Actor/Npc/Config/CfgMengdeNightConfuse')
|
||||
local DummyPointData = Config.DummyPointData
|
||||
|
||||
function MengdeNightConfuse:PreGetAlias()
|
||||
local NpcAlias = DummyPointData.Npc .. '_' .. tostring(self.dataIndex)
|
||||
return NpcAlias
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:Register()
|
||||
DailyNpcCommon.Register(self)
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:RecoverFromFreeStyle()
|
||||
print("RecoverFromFreeStyle")
|
||||
self:Recover()
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:RecoverFromCollisionEnter()
|
||||
print("RecoverFromCollisionEnter")
|
||||
self:Recover()
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:Recover()
|
||||
self:RandomStand()
|
||||
end
|
||||
|
||||
|
||||
function MengdeNightConfuse:InvokeOnResetFreeStyle(freeStyleType)
|
||||
DailyNpcCommon.InvokeOnResetFreeStyle(self,freeStyleType)
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:OnCollisionEnter(targetInfo)
|
||||
DailyNpcCommon.OnCollisionEnter(targetInfo,self)
|
||||
end
|
||||
|
||||
|
||||
function MengdeNightConfuse:StartDay()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:StartNight()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
self:RandomStand()
|
||||
self:StartBubble()
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:StartBubble()
|
||||
if self.bubble~=1 then
|
||||
self:ShowBubble()
|
||||
self.bubble=1
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:ShowBubble()
|
||||
if DummyPointData.DialogID[self.dataIndex] ~= 0 then
|
||||
self:TriggerNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex], DummyPointData.DialogID[self.dataIndex])
|
||||
self:BubbleTime()
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:BubbleGap()
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:BubbleGap()
|
||||
self:CallDelay(math.random(7,8), self.ShowBubble)
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:RandomStand()
|
||||
self:ChooseRandomPos()
|
||||
self:WalkToTask(self.nightConfuseTargetPos, self.NextMove, self.Standby)
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:ChooseRandomPos()
|
||||
self.pointID = math.random(1,4)
|
||||
if self.pointID == 1 then
|
||||
self.nightConfuseTargetPos = DummyPointData.Pos01Pos[self.dataIndex]
|
||||
elseif self.pointID == 2 then
|
||||
self.nightConfuseTargetPos = DummyPointData.Pos02Pos[self.dataIndex]
|
||||
elseif self.pointID == 3 then
|
||||
self.nightConfuseTargetPos = DummyPointData.Pos03Pos[self.dataIndex]
|
||||
elseif self.pointID == 4 then
|
||||
self.nightConfuseTargetPos = DummyPointData.Pos04Pos[self.dataIndex]
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:NextMove()
|
||||
self:CallDelay(math.random(3,10), self.RandomStand)
|
||||
end
|
||||
|
||||
function MengdeNightConfuse:OnEvent(evt)
|
||||
DailyNpcCommon.OnEvent(evt,self)
|
||||
end
|
||||
|
||||
return MengdeNightConfuse
|
68
soggy_resources/lua/Actor/Npc/NpcMengdeNightSit.lua
Normal file
68
soggy_resources/lua/Actor/Npc/NpcMengdeNightSit.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
require('Actor/ActorCommon')
|
||||
local BaseDailyNpc = require('Actor/Npc/BaseDailyNpc')
|
||||
local MengdeNightSit = class("MengdeNightSit", BaseDailyNpc)
|
||||
local DailyNpcCommon = require('Actor/Npc/NpcDailyCommon')
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
MengdeNightSit.defaultAlias = "MengdeNightSit"
|
||||
|
||||
local Config = require('Actor/Npc/Config/CfgMengdeNightSit')
|
||||
local DummyPointData = Config.DummyPointData
|
||||
|
||||
function MengdeNightSit:PreGetAlias()
|
||||
local NpcAlias = DummyPointData.Npc .. '_' .. tostring(self.dataIndex)
|
||||
return NpcAlias
|
||||
end
|
||||
|
||||
function MengdeNightSit:Register()
|
||||
DailyNpcCommon.Register(self)
|
||||
end
|
||||
|
||||
function MengdeNightSit:StartNight()
|
||||
self:SitOnChair()
|
||||
self:CallDelay(4, self.AfterSit)
|
||||
end
|
||||
|
||||
function MengdeNightSit:AfterSit()
|
||||
self:DoFreeStateTrigger()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
self:StartBubble()
|
||||
end
|
||||
|
||||
function MengdeNightSit:StartBubble()
|
||||
if self.bubble~=1 then
|
||||
self:ShowBubble()
|
||||
self.bubble=1
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeNightSit:ShowBubble()
|
||||
if DummyPointData.DialogID[self.dataIndex] ~= 0 then
|
||||
self:TriggerNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex], DummyPointData.DialogID[self.dataIndex])
|
||||
self:BubbleTime()
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeNightSit:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeNightSit:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:BubbleGap()
|
||||
end
|
||||
|
||||
function MengdeNightSit:BubbleGap()
|
||||
self:CallDelay(math.random(7,8), self.ShowBubble)
|
||||
end
|
||||
|
||||
function MengdeNightSit:StartDay()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeNightSit:OnEvent(evt)
|
||||
DailyNpcCommon.OnEvent(evt,self)
|
||||
end
|
||||
|
||||
return MengdeNightSit
|
100
soggy_resources/lua/Actor/Npc/NpcMengdeNightStand.lua
Normal file
100
soggy_resources/lua/Actor/Npc/NpcMengdeNightStand.lua
Normal file
@@ -0,0 +1,100 @@
|
||||
require('Actor/ActorCommon')
|
||||
local BaseDailyNpc = require('Actor/Npc/BaseDailyNpc')
|
||||
local MengdeNightStand = class("MengdeNightStand", BaseDailyNpc)
|
||||
local DailyNpcCommon = require('Actor/Npc/NpcDailyCommon')
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
MengdeNightStand.defaultAlias = "MengdeNightStand"
|
||||
|
||||
local Config = require('Actor/Npc/Config/CfgMengdeNightStand')
|
||||
local DummyPointData = Config.DummyPointData
|
||||
|
||||
function MengdeNightStand:PreGetAlias()
|
||||
local NpcAlias = DummyPointData.Npc .. '_' .. tostring(self.dataIndex)
|
||||
return NpcAlias
|
||||
end
|
||||
|
||||
function MengdeNightStand:Register()
|
||||
DailyNpcCommon.Register(self)
|
||||
end
|
||||
|
||||
function MengdeNightStand:InvokeOnResetFreeStyle(freeStyleType)
|
||||
DailyNpcCommon.InvokeOnResetFreeStyle(self,freeStyleType)
|
||||
end
|
||||
|
||||
function MengdeNightStand:OnCollisionEnter(targetInfo)
|
||||
DailyNpcCommon.OnCollisionEnter(targetInfo,self)
|
||||
end
|
||||
|
||||
function MengdeNightStand:WalkBack()
|
||||
print("walkback")
|
||||
self:WalkToTask(DummyPointData.BornPos[self.dataIndex],self.Recover)
|
||||
--self:StartDay()
|
||||
end
|
||||
|
||||
function MengdeNightStand:RecoverFromFreeStyle()
|
||||
print("RecoverFromFreeStyle")
|
||||
self:Recover()
|
||||
end
|
||||
|
||||
function MengdeNightStand:RecoverFromCollisionEnter()
|
||||
print("RecoverFromCollisionEnter")
|
||||
self:ClearAllTask()
|
||||
self:Recover()
|
||||
--self:CallDelay(0.5,self.WalkBack)
|
||||
end
|
||||
|
||||
function MengdeNightStand:Recover()
|
||||
self.OnAction=0
|
||||
self:Standby()
|
||||
--self:TurnTo(M.Euler2DirXZ(DummyPointData.BornDir[self.dataIndex]))
|
||||
self:SteerToTask(M.Euler2DirXZ(DummyPointData.BornDir[self.dataIndex]),1,true,true)
|
||||
self:DoFreeStateTrigger()
|
||||
end
|
||||
|
||||
|
||||
function MengdeNightStand:StartDay()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function MengdeNightStand:StartNight()
|
||||
self:Standby()
|
||||
self:TurnTo(M.Euler2DirXZ(DummyPointData.BornDir[self.dataIndex]))
|
||||
self:DoFreeStateTrigger()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
self:StartBubble()
|
||||
end
|
||||
|
||||
function MengdeNightStand:StartBubble()
|
||||
if self.bubble~=1 then
|
||||
self:ShowBubble()
|
||||
self.bubble=1
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeNightStand:ShowBubble()
|
||||
if DummyPointData.DialogID[self.dataIndex] ~= 0 then
|
||||
self:TriggerNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex], DummyPointData.DialogID[self.dataIndex])
|
||||
self:BubbleTime()
|
||||
end
|
||||
end
|
||||
|
||||
function MengdeNightStand:BubbleTime()
|
||||
self:CallDelay(5, self.CloseBubble)
|
||||
end
|
||||
|
||||
function MengdeNightStand:CloseBubble()
|
||||
self:ClearNpcSpeechBubble(DummyPointData.NpcID[self.dataIndex])
|
||||
self:BubbleGap()
|
||||
end
|
||||
|
||||
function MengdeNightStand:BubbleGap()
|
||||
self:CallDelay(math.random(7,8), self.ShowBubble)
|
||||
end
|
||||
|
||||
function MengdeNightStand:OnEvent(evt)
|
||||
DailyNpcCommon.OnEvent(evt,self)
|
||||
end
|
||||
|
||||
return MengdeNightStand
|
26
soggy_resources/lua/Actor/Npc/NpcMode/NpcModeType.lua
Normal file
26
soggy_resources/lua/Actor/Npc/NpcMode/NpcModeType.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
local NpcModeType =
|
||||
{
|
||||
--@region ModeType List
|
||||
--隐藏自身
|
||||
MODE_HIDE = 1,
|
||||
MODE_BANDAILY = 2,
|
||||
|
||||
--@endregion
|
||||
}
|
||||
|
||||
NpcModeType.ModeScript =
|
||||
{
|
||||
'Actor/Npc/NpcMode/NpcMode_MengdeHide',
|
||||
'Actor/Npc/NpcMode/NpcMode_BanDaily',
|
||||
}
|
||||
|
||||
function NpcModeType:GetMode(modeType)
|
||||
local modeScript = self.ModeScript[modeType]
|
||||
if modeScript ~= nil then
|
||||
local mode = require(modeScript)
|
||||
return mode
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
return NpcModeType
|
27
soggy_resources/lua/Actor/Npc/NpcMode/NpcMode_BanDaily.lua
Normal file
27
soggy_resources/lua/Actor/Npc/NpcMode/NpcMode_BanDaily.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
local BaseMode = require('Actor/BaseActorMode')
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
local NpcMode_Hide = class("NpcMode_MengdeHide", BaseMode)
|
||||
|
||||
--@region Default
|
||||
NpcMode_Hide.DefaultAction = function(self)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
self:StartDay()
|
||||
end
|
||||
--@endregion
|
||||
|
||||
|
||||
NpcMode_Hide.OnEvent=function(actor,evt)
|
||||
if evt.evtType == NpcEventType.STARTDAILY then
|
||||
print("NpcMode_Hide STARTDAILY")
|
||||
actor:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
--@region PatrolInsomnia
|
||||
NpcMode_Hide["MengdeDayPatrol_1"] = function(self)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
end
|
||||
|
||||
|
||||
|
||||
return NpcMode_Hide
|
78
soggy_resources/lua/Actor/Npc/NpcMode/NpcMode_MengdeHide.lua
Normal file
78
soggy_resources/lua/Actor/Npc/NpcMode/NpcMode_MengdeHide.lua
Normal file
@@ -0,0 +1,78 @@
|
||||
local BaseMode = require('Actor/BaseActorMode')
|
||||
local NpcEventType = require('Actor/Npc/NPCEventType')
|
||||
local NpcMode_Hide = class("NpcMode_MengdeHide", BaseMode)
|
||||
|
||||
--@region Default
|
||||
NpcMode_Hide.DefaultAction = function(self)
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
end
|
||||
--@endregion
|
||||
|
||||
--@region StoreKeeper01
|
||||
NpcMode_Hide["StoreKeeper01"] = function(self)
|
||||
local scaredPos = sceneData:GetDummyPoint(3, "NPCScaredPoint05").pos
|
||||
self:DoAppear()
|
||||
self:SetPos(scaredPos)
|
||||
self:DoFreeStyle(362)
|
||||
end
|
||||
--@endregion
|
||||
|
||||
NpcMode_Hide.OnEvent=function(actor,evt)
|
||||
if evt.evtType == NpcEventType.STARTDAILY then
|
||||
print("NpcMode_Hide STARTDAILY")
|
||||
actor:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
--@region PatrolInsomnia
|
||||
-- NpcMode_Hide["MengdeDayPatrol_1"] = function(self)
|
||||
-- self:PerformDither(false, 2, self.HideSelf)
|
||||
-- self:RegisterActorEvent(self.OnEvent)
|
||||
-- end
|
||||
-- NpcMode_Hide["MengdeDayPatrol_2"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayPatrol_3"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayPatrol_4"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayPatrol_5"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayStand_1"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayStand_2"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayStand_3"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayStand_4"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayStand_5"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayStand_6"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayStand_7"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayStand_8"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayStand_9"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDayStand_10"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaPatrol_1"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaPatrol_2"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaPatrol_3"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaPatrol_4"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_1"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_2"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_3"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_4"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_5"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_6"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_7"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_8"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_9"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_10"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_11"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_12"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_13"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_14"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_15"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_16"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeInsomniaStand_17"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeNightSit_1"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeNightSit_2"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeNightSit_3"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeNightStand_1"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeNightStand_2"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeNightStand_3"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDaySit_1"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
-- NpcMode_Hide["MengdeDaySit_2"] = NpcMode_Hide["MengdeDayPatrol_1"]
|
||||
--@endregion
|
||||
|
||||
return NpcMode_Hide
|
24
soggy_resources/lua/Actor/Npc/Razor.lua
Normal file
24
soggy_resources/lua/Actor/Npc/Razor.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local Razor = class("Razor", npcActorProxy)
|
||||
|
||||
Razor.defaultAlias = "Razor"
|
||||
|
||||
-- local config begin
|
||||
local q451Cfg = require('Quest/Client/Q451ClientConfig')
|
||||
local q452Cfg = require('Quest/Client/Q452ClientConfig')
|
||||
local q453Cfg = require('Quest/Client/Q453ClientConfig')
|
||||
local q454Cfg = require('Quest/Client/Q454ClientConfig')
|
||||
-- local config end
|
||||
|
||||
function Razor:Start()
|
||||
print("start!Razor")
|
||||
|
||||
end
|
||||
|
||||
function Razor:OnDestroy()
|
||||
print("Razor " .. self.configID .. " destroied")
|
||||
end
|
||||
|
||||
return Razor
|
24
soggy_resources/lua/Actor/Npc/RazorFarmer.lua
Normal file
24
soggy_resources/lua/Actor/Npc/RazorFarmer.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local RazorFarmer = class("RazorFarmer", npcActorProxy)
|
||||
|
||||
RazorFarmer.defaultAlias = "RazorFarmer"
|
||||
|
||||
-- local config begin
|
||||
local q451Cfg = require('Quest/Client/Q451ClientConfig')
|
||||
local q452Cfg = require('Quest/Client/Q452ClientConfig')
|
||||
local q453Cfg = require('Quest/Client/Q453ClientConfig')
|
||||
local q454Cfg = require('Quest/Client/Q454ClientConfig')
|
||||
-- local config end
|
||||
|
||||
function RazorFarmer:Start()
|
||||
print("start!RazorFarmer")
|
||||
|
||||
end
|
||||
|
||||
function RazorFarmer:OnDestroy()
|
||||
print("RazorFarmer " .. self.configID .. " destroied")
|
||||
end
|
||||
|
||||
return RazorFarmer
|
24
soggy_resources/lua/Actor/Npc/RazorWolfBoss.lua
Normal file
24
soggy_resources/lua/Actor/Npc/RazorWolfBoss.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local RazorWolfBoss = class("RazorWolfBoss", npcActorProxy)
|
||||
|
||||
RazorWolfBoss.defaultAlias = "RazorWolfBoss"
|
||||
|
||||
-- local config begin
|
||||
local q451Cfg = require('Quest/Client/Q451ClientConfig')
|
||||
local q452Cfg = require('Quest/Client/Q452ClientConfig')
|
||||
local q453Cfg = require('Quest/Client/Q453ClientConfig')
|
||||
local q454Cfg = require('Quest/Client/Q454ClientConfig')
|
||||
-- local config end
|
||||
|
||||
function RazorWolfBoss:Start()
|
||||
print("start!RazorWolfBoss")
|
||||
|
||||
end
|
||||
|
||||
function RazorWolfBoss:OnDestroy()
|
||||
print("RazorWolfBoss " .. self.configID .. " destroied")
|
||||
end
|
||||
|
||||
return RazorWolfBoss
|
24
soggy_resources/lua/Actor/Npc/RazorWolfWound.lua
Normal file
24
soggy_resources/lua/Actor/Npc/RazorWolfWound.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local RazorWolfWound = class("RazorWolfWound", npcActorProxy)
|
||||
|
||||
RazorWolfWound.defaultAlias = "RazorWolfWound"
|
||||
|
||||
-- local config begin
|
||||
local q451Cfg = require('Quest/Client/Q451ClientConfig')
|
||||
local q452Cfg = require('Quest/Client/Q452ClientConfig')
|
||||
local q453Cfg = require('Quest/Client/Q453ClientConfig')
|
||||
local q454Cfg = require('Quest/Client/Q454ClientConfig')
|
||||
-- local config end
|
||||
|
||||
function RazorWolfWound:Start()
|
||||
print("start!RazorWolfWound")
|
||||
|
||||
end
|
||||
|
||||
function RazorWolfWound:OnDestroy()
|
||||
print("RazorWolfWound " .. self.configID .. " destroied")
|
||||
end
|
||||
|
||||
return RazorWolfWound
|
134
soggy_resources/lua/Actor/Npc/SneakAI.lua
Normal file
134
soggy_resources/lua/Actor/Npc/SneakAI.lua
Normal file
@@ -0,0 +1,134 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local SneakAI = class("SneakAI", npcActorProxy)
|
||||
|
||||
SneakAI.defaultAlias = "SneakAI"
|
||||
SneakAI.PatrolPosNum = 0
|
||||
SneakAI.PatrolPos = nil
|
||||
SneakAI.PatrolDir = nil
|
||||
SneakAI.PatrolNext = 1
|
||||
|
||||
local q415Cfg = require('Quest/Client/Q415ClientConfig')
|
||||
local q375Cfg = require('Quest/Client/Q375ClientConfig')
|
||||
|
||||
|
||||
|
||||
function SneakAI:StartPatrol()
|
||||
if self.uActor == nil then
|
||||
return
|
||||
end
|
||||
|
||||
if self.PatrolPosNum == 1 then
|
||||
self:Standby()
|
||||
self:TurnTo(M.Euler2DirXZ(self.PatrolDir[1]))
|
||||
elseif self.PatrolPosNum > 1 then
|
||||
self.PatrolNext = self.PatrolNext + 1
|
||||
if self.PatrolNext > self.PatrolPosNum then
|
||||
self.PatrolNext = 1
|
||||
end
|
||||
-- print("****************")
|
||||
-- print(self.PatrolNext)
|
||||
-- print(self.PatrolPos[self.PatrolNext])
|
||||
self:WalkToTask(self.PatrolPos[self.PatrolNext], self.Behave)
|
||||
end
|
||||
end
|
||||
|
||||
function SneakAI:Behave()
|
||||
if self.uActor == nil then
|
||||
return
|
||||
end
|
||||
|
||||
self:Standby()
|
||||
local selfPos = self:GetPos()
|
||||
-- print(selfPos)
|
||||
self:CallDelay(3, self.StartPatrol)
|
||||
end
|
||||
|
||||
function SneakAI:ReturnToPatrol()
|
||||
-- print("********************ReturnToPatrol")
|
||||
local effectPos = self:GetPos()
|
||||
effectPos.y = effectPos.y + 1
|
||||
-- self:PlayEffect("FlyRace_Goal_Marker_AS", effectPos)
|
||||
-- if self.PatrolPosNum == 1 then
|
||||
-- self:Standby()
|
||||
-- self:TurnTo(M.Euler2DirXZ(self.PatrolDir[1]))
|
||||
-- end
|
||||
self:DoFreeStateTrigger()
|
||||
self:WalkToTask(self.PatrolPos[self.PatrolNext], self.StartPatrol)
|
||||
end
|
||||
|
||||
function SneakAI:Aware()
|
||||
-- print("********************Aware")
|
||||
self:ClearFollowTask()
|
||||
self:Standby()
|
||||
local effectPos = self:GetPos()
|
||||
effectPos.y = effectPos.y + 1
|
||||
-- self:PlayEffect("FlyRace_Marker_Active_AS", effectPos)
|
||||
self:NarratorOnlyTask(q415Cfg.AwareReminder)
|
||||
local avatarPos = actorUtils.GetAvatarPos()
|
||||
local selfPos = self:GetPos()
|
||||
local TurnDir = { x = avatarPos.x-selfPos.x, y = avatarPos.y-selfPos.y, z = avatarPos.z-selfPos.z}
|
||||
-- print("TurnDir")
|
||||
-- print(TurnDir.x)
|
||||
self:TurnTo(TurnDir)
|
||||
self:DoFreeStyle(1)
|
||||
end
|
||||
|
||||
function SneakAI:CheckLure()
|
||||
print("********************CheckLure")
|
||||
self:Standby()
|
||||
self:DoFreeStyle(3)
|
||||
self:CallDelay(6, self.ReturnToPatrol)
|
||||
end
|
||||
|
||||
function SneakAI:OnLure(task, info)
|
||||
if info.hasSound == true then
|
||||
print("********************MoveToLure")
|
||||
local selfPos = self:GetPos()
|
||||
local TurnDir = { x = info.soundPos.x-selfPos.x, y = info.soundPos.y-selfPos.y, z = info.soundPos.z-selfPos.z}
|
||||
print("TurnDir")
|
||||
print(TurnDir.x)
|
||||
self:TurnTo(TurnDir)
|
||||
self:DoFreeStyle(0)
|
||||
self:CallDelay(3,
|
||||
function(self, task)
|
||||
self:Standby()
|
||||
self:DoFreeStateTrigger()
|
||||
self:WalkToTask(info.soundPos, self.CheckLure)
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
function SneakAI:Discover()
|
||||
print("********************Discover")
|
||||
self:Standby()
|
||||
self:DoFreeStateTrigger()
|
||||
self:NarratorOnlyTask(q415Cfg.DiscoverReminder)
|
||||
self:DoFreeStyle(2)
|
||||
q375Cfg.FailureNum = q375Cfg.FailureNum + 1
|
||||
print("FailureNum is", q375Cfg.FailureNum)
|
||||
if q375Cfg.FailureNum >= 2 then
|
||||
local quest = actorMgr:GetActor(q375Cfg.ActorAlias)
|
||||
if quest ~= nil then
|
||||
print("Sneak Failed OOOMG")
|
||||
quest:FinishQuest(true, nil)
|
||||
end
|
||||
else
|
||||
local quest = actorMgr:GetActor(q375Cfg.ActorAlias)
|
||||
if quest ~= nil then
|
||||
print("Sneak Failed")
|
||||
quest:FinishQuest(true, nil)
|
||||
end
|
||||
end
|
||||
local targetPos = self:GetPos()
|
||||
self:EnterSceneLookCamera(targetPos, 0, 2, true)
|
||||
end
|
||||
|
||||
function SneakAI:Start()
|
||||
self:ThreatTask(self.Discover, self.Aware, self.ReturnToPatrol, self.OnLure)
|
||||
self:StartPatrol()
|
||||
end
|
||||
|
||||
return SneakAI
|
120
soggy_resources/lua/Actor/Npc/SneakAdvAI.lua
Normal file
120
soggy_resources/lua/Actor/Npc/SneakAdvAI.lua
Normal file
@@ -0,0 +1,120 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local SneakAdvAI = class("SneakAdvAI", npcActorProxy)
|
||||
|
||||
SneakAdvAI.defaultAlias = "SneakAdvAI"
|
||||
SneakAdvAI.PatrolPosNum = 0
|
||||
SneakAdvAI.PatrolPos = nil
|
||||
SneakAdvAI.PatrolDir = nil
|
||||
SneakAdvAI.PatrolNext = 1
|
||||
|
||||
local q424Cfg = require('Quest/Client/Q424ClientConfig')
|
||||
|
||||
function SneakAdvAI:StartPatrol()
|
||||
if self.uActor == nil then
|
||||
return
|
||||
end
|
||||
|
||||
if self.PatrolPosNum == 1 then
|
||||
self:Standby()
|
||||
self:TurnTo(M.Euler2DirXZ(self.PatrolDir[1]))
|
||||
elseif self.PatrolPosNum > 1 then
|
||||
self.PatrolNext = self.PatrolNext + 1
|
||||
if self.PatrolNext > self.PatrolPosNum then
|
||||
self.PatrolNext = 1
|
||||
end
|
||||
self:WalkToTask(self.PatrolPos[self.PatrolNext], self.Behave)
|
||||
end
|
||||
end
|
||||
|
||||
function SneakAdvAI:Behave()
|
||||
if self.uActor == nil then
|
||||
return
|
||||
end
|
||||
|
||||
self:Standby()
|
||||
self:CallDelay(3, self.StartPatrol)
|
||||
end
|
||||
|
||||
function SneakAdvAI:ReturnToPatrol()
|
||||
self:DoFreeStateTrigger()
|
||||
self:WalkToTask(self.PatrolPos[self.PatrolNext], self.StartPatrol)
|
||||
end
|
||||
|
||||
function SneakAdvAI:Aware()
|
||||
self:ClearFollowTask()
|
||||
self:Standby()
|
||||
self:NarratorOnlyTask(q424Cfg.AwareReminder)
|
||||
local avatarPos = actorUtils.GetAvatarPos()
|
||||
local selfPos = self:GetPos()
|
||||
local TurnDir = { x = avatarPos.x-selfPos.x, y = avatarPos.y-selfPos.y, z = avatarPos.z-selfPos.z}
|
||||
self:TurnTo(TurnDir)
|
||||
self:DoFreeStyle(1)
|
||||
end
|
||||
|
||||
function SneakAdvAI:CheckLure()
|
||||
print("********************CheckLure")
|
||||
self:Standby()
|
||||
self:DoFreeStyle(3)
|
||||
self:CallDelay(6, self.ReturnToPatrol)
|
||||
end
|
||||
|
||||
function SneakAdvAI:OnLure(task, info)
|
||||
if info.hasSound == true then
|
||||
print("********************MoveToLure")
|
||||
local selfPos = self:GetPos()
|
||||
local TurnDir = { x = info.soundPos.x-selfPos.x, y = info.soundPos.y-selfPos.y, z = info.soundPos.z-selfPos.z}
|
||||
print("TurnDir")
|
||||
print(TurnDir.x)
|
||||
self:TurnTo(TurnDir)
|
||||
self:DoFreeStyle(0)
|
||||
self:CallDelay(3,
|
||||
function(self, task)
|
||||
self:Standby()
|
||||
self:DoFreeStateTrigger()
|
||||
self:WalkToTask(info.soundPos, self.CheckLure)
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
function SneakAdvAI:Discover()
|
||||
print("********************Discover")
|
||||
self:Standby()
|
||||
self:DoFreeStateTrigger()
|
||||
self:NarratorOnlyTask(q424Cfg.DiscoverReminder)
|
||||
self:DoFreeStyle(2)
|
||||
local quest = actorMgr:GetActor(q424Cfg.ActorAlias)
|
||||
if quest ~= nil then
|
||||
print("Sneak Failed")
|
||||
quest:FinishQuestID(true, 42403)
|
||||
end
|
||||
local targetPos = self:GetPos()
|
||||
self:EnterSceneLookCamera(targetPos, 0, 2, true)
|
||||
end
|
||||
|
||||
function SneakAdvAI:Stun()
|
||||
print("********************Stun")
|
||||
self:DoFreeStyle(5)
|
||||
self:EnableAI(false)
|
||||
self:EnableInteraction(false)
|
||||
self:CallDelay(30,
|
||||
function(self, task)
|
||||
self:EnableAI(true)
|
||||
self:EnableInteraction(true)
|
||||
self:DoFreeStateTrigger()
|
||||
self:Standby()
|
||||
self:ReturnToPatrol()
|
||||
-- local avatarPos = actorUtils.GetAvatarPos()
|
||||
-- self:RunToTask(avatarPos, self.CheckLure)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
function SneakAdvAI:Start()
|
||||
self:ThreatTask(self.Discover, self.Aware, self.ReturnToPatrol, self.OnLure)
|
||||
self:StartPatrol()
|
||||
end
|
||||
|
||||
return SneakAdvAI
|
12
soggy_resources/lua/Actor/Npc/SneakBlackDoor.lua
Normal file
12
soggy_resources/lua/Actor/Npc/SneakBlackDoor.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local SneakBlackDoor = class("SneakBlackDoor", npcActorProxy)
|
||||
|
||||
SneakBlackDoor.defaultAlias = "SneakBlackDoor"
|
||||
|
||||
function SneakBlackDoor:Start()
|
||||
|
||||
end
|
||||
|
||||
return SneakBlackDoor
|
12
soggy_resources/lua/Actor/Npc/SneakJudge.lua
Normal file
12
soggy_resources/lua/Actor/Npc/SneakJudge.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local SneakJudge = class("SneakJudge", npcActorProxy)
|
||||
|
||||
SneakJudge.defaultAlias = "SneakJudge"
|
||||
|
||||
function SneakJudge:Start()
|
||||
|
||||
end
|
||||
|
||||
return SneakJudge
|
12
soggy_resources/lua/Actor/Npc/SneakRedDoor.lua
Normal file
12
soggy_resources/lua/Actor/Npc/SneakRedDoor.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local SneakRedDoor = class("SneakRedDoor", npcActorProxy)
|
||||
|
||||
SneakRedDoor.defaultAlias = "SneakRedDoor"
|
||||
|
||||
function SneakRedDoor:Start()
|
||||
|
||||
end
|
||||
|
||||
return SneakRedDoor
|
157
soggy_resources/lua/Actor/Npc/Soilder01.lua
Normal file
157
soggy_resources/lua/Actor/Npc/Soilder01.lua
Normal file
@@ -0,0 +1,157 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local Soilder01 = class("Soilder01", NpcActorProxy)
|
||||
|
||||
Soilder01.defaultAlias = "Soilder01"
|
||||
Soilder01.pointID = 1
|
||||
Soilder01.currWeather = WeatherType.ClearSky
|
||||
|
||||
local Soilder01Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "Soilder01Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "Soilder01Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "Soilder01Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "Soilder01Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "Soilder01Pos01").pos,
|
||||
Pos01Dir = sceneData:GetDummyPoint(3, "Soilder01Pos01").rot,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "Soilder01Pos02").pos,
|
||||
Pos02Dir = sceneData:GetDummyPoint(3, "Soilder01Pos02").rot,
|
||||
Pos03Pos = sceneData:GetDummyPoint(3, "Soilder01Pos03").pos,
|
||||
Pos03Dir = sceneData:GetDummyPoint(3, "Soilder01Pos03").rot,
|
||||
}
|
||||
|
||||
|
||||
function Soilder01:Start()
|
||||
--print("start!Soilder01")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function Soilder01:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function Soilder01:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function Soilder01:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder01:StartDaily()
|
||||
--print("Soilder01 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfHour(self.HourBehave)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder01:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder01:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(Soilder01Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoChat)
|
||||
end
|
||||
|
||||
function Soilder01:GoChat()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(Soilder01Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(Soilder01Data.Pos02Pos, self.Chat, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(Soilder01Data.Pos03Pos, self.Chat, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder01:SelfPointUpdate()
|
||||
if globalActor.isDay then
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoChat()
|
||||
else
|
||||
self.pointID = self.pointID - 1
|
||||
self:GoHome()
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder01:Chat()
|
||||
if self.pointID < 2 then
|
||||
self:GoChat()
|
||||
elseif self.pointID == 2 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(Soilder01Data.Pos02Dir))
|
||||
elseif self.pointID == 3 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(Soilder01Data.Pos03Dir))
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder01:HourBehave(Hour)
|
||||
if Hour == 10 or Hour == 14 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 3
|
||||
self:GoChat()
|
||||
elseif Hour == 12 or Hour == 16 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 2
|
||||
self:GoChat()
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder01:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function Soilder01:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(Soilder01Data.HomeDir))
|
||||
self:DoDisappear()
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder01:GoHomeRoute()
|
||||
if self.pointID > 2 then
|
||||
self.pointID = 3
|
||||
self:WalkToTask(Soilder01Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(Soilder01Data.HomePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder01:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return Soilder01
|
157
soggy_resources/lua/Actor/Npc/Soilder02.lua
Normal file
157
soggy_resources/lua/Actor/Npc/Soilder02.lua
Normal file
@@ -0,0 +1,157 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local Soilder02 = class("Soilder02", NpcActorProxy)
|
||||
|
||||
Soilder02.defaultAlias = "Soilder02"
|
||||
Soilder02.pointID = 1
|
||||
Soilder02.currWeather = WeatherType.ClearSky
|
||||
|
||||
local Soilder02Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "Soilder02Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "Soilder02Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "Soilder02Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "Soilder02Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "Soilder02Pos01").pos,
|
||||
Pos01Dir = sceneData:GetDummyPoint(3, "Soilder02Pos01").rot,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "Soilder02Pos02").pos,
|
||||
Pos02Dir = sceneData:GetDummyPoint(3, "Soilder02Pos02").rot,
|
||||
Pos03Pos = sceneData:GetDummyPoint(3, "Soilder02Pos03").pos,
|
||||
Pos03Dir = sceneData:GetDummyPoint(3, "Soilder02Pos03").rot,
|
||||
}
|
||||
|
||||
|
||||
function Soilder02:Start()
|
||||
--print("start!Soilder02")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function Soilder02:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function Soilder02:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function Soilder02:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder02:StartDaily()
|
||||
--print("Soilder02 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfHour(self.HourBehave)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder02:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder02:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(Soilder02Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoChat)
|
||||
end
|
||||
|
||||
function Soilder02:GoChat()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(Soilder02Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(Soilder02Data.Pos02Pos, self.Chat, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(Soilder02Data.Pos03Pos, self.Chat, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder02:SelfPointUpdate()
|
||||
if globalActor.isDay then
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoChat()
|
||||
else
|
||||
self.pointID = self.pointID - 1
|
||||
self:GoHome()
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder02:Chat()
|
||||
if self.pointID < 2 then
|
||||
self:GoChat()
|
||||
elseif self.pointID == 2 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(Soilder02Data.Pos02Dir))
|
||||
elseif self.pointID == 3 then
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(Soilder02Data.Pos03Dir))
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder02:HourBehave(Hour)
|
||||
if Hour == 10 or Hour == 14 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 3
|
||||
self:GoChat()
|
||||
elseif Hour == 12 or Hour == 16 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 2
|
||||
self:GoChat()
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder02:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function Soilder02:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(Soilder02Data.HomeDir))
|
||||
self:DoDisappear()
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder02:GoHomeRoute()
|
||||
if self.pointID > 2 then
|
||||
self.pointID = 3
|
||||
self:WalkToTask(Soilder02Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(Soilder02Data.HomePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function Soilder02:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:HideSelf()
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return Soilder02
|
128
soggy_resources/lua/Actor/Npc/StoreKeeper01.lua
Normal file
128
soggy_resources/lua/Actor/Npc/StoreKeeper01.lua
Normal file
@@ -0,0 +1,128 @@
|
||||
require('Actor/ActorCommon')
|
||||
local BaseDailyNpc = require('Actor/Npc/BaseDailyNpc')
|
||||
local StoreKeeper01 = class("StoreKeeper01", BaseDailyNpc)
|
||||
|
||||
StoreKeeper01.defaultAlias = "StoreKeeper01"
|
||||
StoreKeeper01.pointID = 1
|
||||
|
||||
local StoreKeeper01Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "StoreKeeper01Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "StoreKeeper01Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "StoreKeeper01Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "StoreKeeper01Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "StoreKeeper01Pos01").pos,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "StoreKeeper01Pos02").pos,
|
||||
StorePos = sceneData:GetDummyPoint(3, "StoreKeeper01Store").pos,
|
||||
StoreDir = sceneData:GetDummyPoint(3, "StoreKeeper01Store").rot,
|
||||
ChatPos = sceneData:GetDummyPoint(3, "StoreKeeper01Chat").pos,
|
||||
ChatDir = sceneData:GetDummyPoint(3, "StoreKeeper01Chat").rot,
|
||||
--ScaredPos = sceneData:GetDummyPoint(3, "NPCScaredPoint05").pos,
|
||||
}
|
||||
|
||||
function StoreKeeper01:Register()
|
||||
self:RegisterMode(npcMode.MODE_DRAGON_ATTACK)
|
||||
end
|
||||
|
||||
function StoreKeeper01:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper01:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper01:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper01Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoStore)
|
||||
end
|
||||
|
||||
function StoreKeeper01:GoStore()
|
||||
if self.pointID == 4 then
|
||||
self:DoFreeStyle(331)
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper01Data.StoreDir))
|
||||
else
|
||||
self:GoStoreRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper01:GoStoreRoute()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(StoreKeeper01Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(StoreKeeper01Data.Pos02Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(StoreKeeper01Data.StorePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper01:SelfPointUpdate()
|
||||
if globalActor.isDay then
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoStore()
|
||||
else
|
||||
self.pointID = self.pointID - 1
|
||||
self:GoHome()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper01:HourBehave(Hour)
|
||||
if Hour == 10 or Hour == 14 then
|
||||
self:DoFreeStateTrigger()
|
||||
self:WalkToTask(StoreKeeper01Data.ChatPos, self.Chat, self.Standby)
|
||||
elseif Hour == 11 or Hour == 15 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 3
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper01:Chat()
|
||||
self:DoFreeStyle(51)
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper01Data.ChatDir))
|
||||
end
|
||||
|
||||
function StoreKeeper01:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function StoreKeeper01:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper01Data.HomeDir))
|
||||
self:DoDisappear()
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper01:GoHomeRoute()
|
||||
if self.pointID == 4 then
|
||||
self:WalkToTask(StoreKeeper01Data.Pos02Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(StoreKeeper01Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(StoreKeeper01Data.HomePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper01:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:SwitchMode(npcMode.MODE_DRAGON_ATTACK)
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return StoreKeeper01
|
143
soggy_resources/lua/Actor/Npc/StoreKeeper02.lua
Normal file
143
soggy_resources/lua/Actor/Npc/StoreKeeper02.lua
Normal file
@@ -0,0 +1,143 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local StoreKeeper02 = class("StoreKeeper02", NpcActorProxy)
|
||||
|
||||
StoreKeeper02.defaultAlias = "StoreKeeper02"
|
||||
StoreKeeper02.pointID = 1
|
||||
StoreKeeper02.currWeather = WeatherType.ClearSky
|
||||
|
||||
local StoreKeeper02Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "StoreKeeper02Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "StoreKeeper02Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "StoreKeeper02Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "StoreKeeper02Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "StoreKeeper02Pos01").pos,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "StoreKeeper02Pos02").pos,
|
||||
StorePos = sceneData:GetDummyPoint(3, "StoreKeeper02Store").pos,
|
||||
StoreDir = sceneData:GetDummyPoint(3, "StoreKeeper02Store").rot,
|
||||
ScaredPos = sceneData:GetDummyPoint(3, "NPCScaredPoint06").pos,
|
||||
}
|
||||
|
||||
|
||||
function StoreKeeper02:Start()
|
||||
--print("start!StoreKeeper02")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function StoreKeeper02:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function StoreKeeper02:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function StoreKeeper02:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper02:StartDaily()
|
||||
--print("StoreKeeper02 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper02:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper02:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper02Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoStore)
|
||||
end
|
||||
|
||||
function StoreKeeper02:GoStore()
|
||||
if self.pointID == 4 then
|
||||
self:DoFreeStyle(331)
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper02Data.StoreDir))
|
||||
else
|
||||
self:GoStoreRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper02:GoStoreRoute()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(StoreKeeper02Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(StoreKeeper02Data.Pos02Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(StoreKeeper02Data.StorePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper02:SelfPointUpdate()
|
||||
if globalActor.isDay then
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoStore()
|
||||
else
|
||||
self.pointID = self.pointID - 1
|
||||
self:GoHome()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper02:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function StoreKeeper02:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper02Data.HomeDir))
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper02:GoHomeRoute()
|
||||
if self.pointID == 4 then
|
||||
self:WalkToTask(StoreKeeper02Data.Pos02Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(StoreKeeper02Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(StoreKeeper02Data.HomePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper02:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:DoAppear()
|
||||
self:SetPos(StoreKeeper02Data.ScaredPos)
|
||||
self:DoFreeStyle(362)
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return StoreKeeper02
|
143
soggy_resources/lua/Actor/Npc/StoreKeeper03.lua
Normal file
143
soggy_resources/lua/Actor/Npc/StoreKeeper03.lua
Normal file
@@ -0,0 +1,143 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local StoreKeeper03 = class("StoreKeeper03", NpcActorProxy)
|
||||
|
||||
StoreKeeper03.defaultAlias = "StoreKeeper03"
|
||||
StoreKeeper03.pointID = 1
|
||||
StoreKeeper03.currWeather = WeatherType.ClearSky
|
||||
|
||||
local StoreKeeper03Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "StoreKeeper03Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "StoreKeeper03Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "StoreKeeper03Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "StoreKeeper03Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "StoreKeeper03Pos01").pos,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "StoreKeeper03Pos02").pos,
|
||||
StorePos = sceneData:GetDummyPoint(3, "StoreKeeper03Store").pos,
|
||||
StoreDir = sceneData:GetDummyPoint(3, "StoreKeeper03Store").rot,
|
||||
ScaredPos = sceneData:GetDummyPoint(3, "NPCScaredPoint07").pos,
|
||||
}
|
||||
|
||||
|
||||
function StoreKeeper03:Start()
|
||||
--print("start!StoreKeeper03")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function StoreKeeper03:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function StoreKeeper03:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function StoreKeeper03:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper03:StartDaily()
|
||||
--print("StoreKeeper03 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper03:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper03:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper03Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoStore)
|
||||
end
|
||||
|
||||
function StoreKeeper03:GoStore()
|
||||
if self.pointID == 4 then
|
||||
self:DoFreeStyle(331)
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper03Data.StoreDir))
|
||||
else
|
||||
self:GoStoreRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper03:GoStoreRoute()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(StoreKeeper03Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(StoreKeeper03Data.Pos02Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(StoreKeeper03Data.StorePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper03:SelfPointUpdate()
|
||||
if globalActor.isDay then
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoStore()
|
||||
else
|
||||
self.pointID = self.pointID - 1
|
||||
self:GoHome()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper03:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function StoreKeeper03:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper03Data.HomeDir))
|
||||
self:DoDisappear()
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper03:GoHomeRoute()
|
||||
if self.pointID == 4 then
|
||||
self:WalkToTask(StoreKeeper03Data.Pos02Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(StoreKeeper03Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(StoreKeeper03Data.HomePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper03:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:DoAppear()
|
||||
self:SetPos(StoreKeeper03Data.ScaredPos)
|
||||
self:DoFreeStyle(362)
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return StoreKeeper03
|
166
soggy_resources/lua/Actor/Npc/StoreKeeper04.lua
Normal file
166
soggy_resources/lua/Actor/Npc/StoreKeeper04.lua
Normal file
@@ -0,0 +1,166 @@
|
||||
require('Actor/ActorCommon')
|
||||
local NpcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
local StoreKeeper04 = class("StoreKeeper04", NpcActorProxy)
|
||||
|
||||
StoreKeeper04.defaultAlias = "StoreKeeper04"
|
||||
StoreKeeper04.pointID = 1
|
||||
StoreKeeper04.currWeather = WeatherType.ClearSky
|
||||
|
||||
local StoreKeeper04Data =
|
||||
{
|
||||
BornPos = sceneData:GetDummyPoint(3, "StoreKeeper04Born").pos,
|
||||
BornDir = sceneData:GetDummyPoint(3, "StoreKeeper04Born").rot,
|
||||
HomePos = sceneData:GetDummyPoint(3, "StoreKeeper04Home").pos,
|
||||
HomeDir = sceneData:GetDummyPoint(3, "StoreKeeper04Home").rot,
|
||||
Pos01Pos = sceneData:GetDummyPoint(3, "StoreKeeper04Pos01").pos,
|
||||
Pos02Pos = sceneData:GetDummyPoint(3, "StoreKeeper04Pos02").pos,
|
||||
StorePos = sceneData:GetDummyPoint(3, "StoreKeeper04Store").pos,
|
||||
StoreDir = sceneData:GetDummyPoint(3, "StoreKeeper04Store").rot,
|
||||
ChatPos = sceneData:GetDummyPoint(3, "StoreKeeper04Chat").pos,
|
||||
ChatDir = sceneData:GetDummyPoint(3, "StoreKeeper04Chat").rot,
|
||||
ScaredPos = sceneData:GetDummyPoint(3, "NPCScaredPoint08").pos,
|
||||
}
|
||||
|
||||
function StoreKeeper04:Start()
|
||||
--print("start!StoreKeeper04")
|
||||
self:StartDaily()
|
||||
end
|
||||
|
||||
function StoreKeeper04:DoAppear()
|
||||
self:ShowSelf()
|
||||
self:PerformDither(true, 2)
|
||||
end
|
||||
|
||||
function StoreKeeper04:DoDisappear()
|
||||
self:PerformDither(false, 2, self.HideSelf)
|
||||
end
|
||||
|
||||
function StoreKeeper04:InvokeOnResetFreeStyle(freeStyleType)
|
||||
if freeStyleType == 361 or freeStyleType == 141 or freeStyleType == 142 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper04:StartDaily()
|
||||
--print("StoreKeeper04 StartDaily")
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:RegisterSelfDayTime(self.StartDay)
|
||||
self:RegisterSelfHour(self.HourBehave)
|
||||
self:RegisterSelfNightTime(self.StartNight)
|
||||
self:RegisterActorEvent(self.OnEvent)
|
||||
if globalActor.isDay then
|
||||
self:StartDay()
|
||||
else
|
||||
self:StartNight()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper04:OnCollisionEnter(targetInfo)
|
||||
if targetInfo.isSprint or targetInfo.isRun then
|
||||
if targetInfo.isFromBack then
|
||||
self:DoFreeStyleTask(42, true, self.StartDaily)
|
||||
else
|
||||
self:DoFreeStyleTask(71, true, self.StartDaily)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper04:StartDay()
|
||||
self:ClearFollowTask()
|
||||
self:ShowSelf()
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper04Data.BornDir))
|
||||
self:PerformDither(true, 2, self.GoStore)
|
||||
end
|
||||
|
||||
function StoreKeeper04:GoStore()
|
||||
if self.pointID == 4 then
|
||||
self:DoFreeStyle(331)
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper04Data.StoreDir))
|
||||
else
|
||||
self:GoStoreRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper04:GoStoreRoute()
|
||||
if self.pointID == 1 then
|
||||
self:WalkToTask(StoreKeeper04Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(StoreKeeper04Data.Pos02Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(StoreKeeper04Data.StorePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper04:SelfPointUpdate()
|
||||
if globalActor.isDay then
|
||||
self.pointID = self.pointID + 1
|
||||
self:GoStore()
|
||||
else
|
||||
self.pointID = self.pointID - 1
|
||||
self:GoHome()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper04:HourBehave(Hour)
|
||||
if Hour == 10 or Hour == 14 then
|
||||
self:CallDelay(1, self.DelayChat)
|
||||
elseif Hour == 11 or Hour == 15 then
|
||||
self:DoFreeStateTrigger()
|
||||
self.pointID = 3
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper04:DelayChat()
|
||||
self:DoFreeStateTrigger()
|
||||
self:WalkToTask(StoreKeeper04Data.ChatPos, self.Chat, self.Standby)
|
||||
end
|
||||
|
||||
|
||||
function StoreKeeper04:Chat()
|
||||
self:DoFreeStyle(52)
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper04Data.ChatDir))
|
||||
end
|
||||
|
||||
function StoreKeeper04:StartNight()
|
||||
self:ClearFollowTask()
|
||||
self:DoFreeStateTrigger()
|
||||
self:GoHome()
|
||||
end
|
||||
|
||||
function StoreKeeper04:GoHome()
|
||||
if self.pointID == 1 then
|
||||
self:TurnTo(M.Euler2DirXZ(StoreKeeper04Data.HomeDir))
|
||||
self:DoDisappear()
|
||||
else
|
||||
self:GoHomeRoute()
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper04:GoHomeRoute()
|
||||
if self.pointID == 4 then
|
||||
self:WalkToTask(StoreKeeper04Data.Pos02Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 3 then
|
||||
self:WalkToTask(StoreKeeper04Data.Pos01Pos, self.SelfPointUpdate, self.Standby)
|
||||
elseif self.pointID == 2 then
|
||||
self:WalkToTask(StoreKeeper04Data.HomePos, self.SelfPointUpdate, self.Standby)
|
||||
end
|
||||
end
|
||||
|
||||
function StoreKeeper04:OnEvent(evt)
|
||||
if evt.evtType == 35701 then
|
||||
self:ClearAllTask()
|
||||
self:ClearOnCollisionEnter(self.OnCollisionEnter)
|
||||
self:UnregisterSelfDayTime(self.StartDay)
|
||||
self:UnregisterSelfHour(self.HourBehave)
|
||||
self:UnregisterSelfNightTime(self.StartNight)
|
||||
self:UnregisterActorEvent(self.OnEvent)
|
||||
self:DoAppear()
|
||||
self:SetPos(StoreKeeper04Data.ScaredPos)
|
||||
self:DoFreeStyle(362)
|
||||
elseif evt.evtType == 35702 then
|
||||
self:StartDaily()
|
||||
end
|
||||
end
|
||||
|
||||
return StoreKeeper04
|
12
soggy_resources/lua/Actor/Npc/TempNPC.lua
Normal file
12
soggy_resources/lua/Actor/Npc/TempNPC.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local TempNPC = class("TempNPC", npcActorProxy)
|
||||
|
||||
TempNPC.defaultAlias = "TempNPC"
|
||||
|
||||
function TempNPC:Start()
|
||||
|
||||
end
|
||||
|
||||
return TempNPC
|
8
soggy_resources/lua/Actor/Npc/TempNpcActor.lua
Normal file
8
soggy_resources/lua/Actor/Npc/TempNpcActor.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local TempNpcActor = class("TempNpcActor", npcActorProxy)
|
||||
|
||||
TempNpcActor.defaultAlias = actorMgr.tempDefaultAlias
|
||||
|
||||
return TempNpcActor
|
40
soggy_resources/lua/Actor/Npc/Test9001.lua
Normal file
40
soggy_resources/lua/Actor/Npc/Test9001.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
require('Actor/ActorCommon')
|
||||
local npcActorProxy = require('Actor/Npc/NpcActorProxy')
|
||||
|
||||
local Test9001 = class("Test9001", npcActorProxy)
|
||||
|
||||
Test9001.defaultAlias = "Test9001"
|
||||
|
||||
function Test9001:Start()
|
||||
print("###################_________________")
|
||||
--self:RunTo(M.Pos(22.0, 0.0, 43.0))
|
||||
self:CallOnCollisionEnter(self.OnCollisionEnter)
|
||||
end
|
||||
|
||||
function Test9001:OnCollisionEnter(targetInfo)
|
||||
print("Enter Collision")
|
||||
print(targetInfo.isSprint)
|
||||
|
||||
if targetInfo.isSprint then
|
||||
self:DoOnCollisionEnter()
|
||||
end
|
||||
end
|
||||
|
||||
function Test9001:DoOnCollisionEnter()
|
||||
if not self:DoingFreeStyle() then
|
||||
self:CallDelay(5, self.GoOn)
|
||||
self:DoFreeStyleTask(3, true, self.Walk)
|
||||
end
|
||||
end
|
||||
|
||||
function Test9001:GoOn(task)
|
||||
print("Go on")
|
||||
self:DoFreeStateTrigger()
|
||||
end
|
||||
|
||||
function Test9001:Walk(task)
|
||||
print("Walk To")
|
||||
self:WalkTo(M.Pos(22.0, 0.0, 43.0))
|
||||
end
|
||||
|
||||
return Test9001
|
Reference in New Issue
Block a user