mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:52:27 +08:00
场景LUA触发器
This commit is contained in:
@@ -1,177 +0,0 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
ActionReasonNone uint16 = 0
|
||||
ActionReasonQuestItem uint16 = 1
|
||||
ActionReasonQuestReward uint16 = 2
|
||||
ActionReasonTrifle uint16 = 3
|
||||
ActionReasonShop uint16 = 4
|
||||
ActionReasonPlayerUpgradeReward uint16 = 5
|
||||
ActionReasonAddAvatar uint16 = 6
|
||||
ActionReasonGadgetEnvAnimal uint16 = 7
|
||||
ActionReasonMonsterEnvAnimal uint16 = 8
|
||||
ActionReasonCompound uint16 = 9
|
||||
ActionReasonCook uint16 = 10
|
||||
ActionReasonGather uint16 = 11
|
||||
ActionReasonMailAttachment uint16 = 12
|
||||
ActionReasonCityLevelupReturn uint16 = 15
|
||||
ActionReasonCityLevelupReward uint16 = 17
|
||||
ActionReasonAreaExploreReward uint16 = 18
|
||||
ActionReasonUnlockPointReward uint16 = 19
|
||||
ActionReasonDungeonFirstPass uint16 = 20
|
||||
ActionReasonDungeonPass uint16 = 21
|
||||
ActionReasonChangeElemType uint16 = 23
|
||||
ActionReasonFetterOpen uint16 = 25
|
||||
ActionReasonDailyTaskScore uint16 = 26
|
||||
ActionReasonDailyTaskHost uint16 = 27
|
||||
ActionReasonRandTaskHost uint16 = 28
|
||||
ActionReasonExpedition uint16 = 29
|
||||
ActionReasonGacha uint16 = 30
|
||||
ActionReasonCombine uint16 = 31
|
||||
ActionReasonRandTaskGuest uint16 = 32
|
||||
ActionReasonDailyTaskGuest uint16 = 33
|
||||
ActionReasonForgeOutput uint16 = 34
|
||||
ActionReasonForgeReturn uint16 = 35
|
||||
ActionReasonInitAvatar uint16 = 36
|
||||
ActionReasonMonsterDie uint16 = 37
|
||||
ActionReasonGm uint16 = 38
|
||||
ActionReasonOpenChest uint16 = 39
|
||||
ActionReasonGadgetDie uint16 = 40
|
||||
ActionReasonMonsterChangeHp uint16 = 41
|
||||
ActionReasonSubfieldDrop uint16 = 42
|
||||
ActionReasonPushTipsReward uint16 = 43
|
||||
ActionReasonActivityMonsterDrop uint16 = 44
|
||||
ActionReasonActivityGather uint16 = 45
|
||||
ActionReasonActivitySubfieldDrop uint16 = 46
|
||||
ActionReasonTowerScheduleReward uint16 = 47
|
||||
ActionReasonTowerFloorStarReward uint16 = 48
|
||||
ActionReasonTowerFirstPassReward uint16 = 49
|
||||
ActionReasonTowerDailyReward uint16 = 50
|
||||
ActionReasonHitClientTrivialEntity uint16 = 51
|
||||
ActionReasonOpenWorldBossChest uint16 = 52
|
||||
ActionReasonMaterialDeleteReturn uint16 = 53
|
||||
ActionReasonSignInReward uint16 = 54
|
||||
ActionReasonOpenBlossomChest uint16 = 55
|
||||
ActionReasonRecharge uint16 = 56
|
||||
ActionReasonBonusActivityReward uint16 = 57
|
||||
ActionReasonTowerCommemorativeReward uint16 = 58
|
||||
ActionReasonTowerSkipFloorReward uint16 = 59
|
||||
ActionReasonRechargeBonus uint16 = 60
|
||||
ActionReasonRechargeCard uint16 = 61
|
||||
ActionReasonRechargeCardDaily uint16 = 62
|
||||
ActionReasonRechargeCardReplace uint16 = 63
|
||||
ActionReasonRechargeCardReplaceFree uint16 = 64
|
||||
ActionReasonRechargePlayReplace uint16 = 65
|
||||
ActionReasonMpPlayTakeReward uint16 = 66
|
||||
ActionReasonActivityWatcher uint16 = 67
|
||||
ActionReasonSalesmanDeliverItem uint16 = 68
|
||||
ActionReasonSalesmanReward uint16 = 69
|
||||
ActionReasonRebate uint16 = 70
|
||||
ActionReasonMcoinExchangeHcoin uint16 = 71
|
||||
ActionReasonDailyTaskExchangeLegendaryKey uint16 = 72
|
||||
ActionReasonUnlockPersonLine uint16 = 73
|
||||
ActionReasonFetterLevelReward uint16 = 74
|
||||
ActionReasonBuyResin uint16 = 75
|
||||
ActionReasonRechargePackage uint16 = 76
|
||||
ActionReasonDeliveryDailyReward uint16 = 77
|
||||
ActionReasonCityReputationLevel uint16 = 78
|
||||
ActionReasonCityReputationQuest uint16 = 79
|
||||
ActionReasonCityReputationRequest uint16 = 80
|
||||
ActionReasonCityReputationExplore uint16 = 81
|
||||
ActionReasonOffergingLevel uint16 = 82
|
||||
ActionReasonRoutineHost uint16 = 83
|
||||
ActionReasonRoutineGuest uint16 = 84
|
||||
ActionReasonTreasureMapSpotToken uint16 = 89
|
||||
ActionReasonTreasureMapBonusLevelReward uint16 = 90
|
||||
ActionReasonTreasureMapMpReward uint16 = 91
|
||||
ActionReasonConvert uint16 = 92
|
||||
ActionReasonOverflowTransform uint16 = 93
|
||||
ActionReasonActivityAvatarSelectionReward uint16 = 96
|
||||
ActionReasonActivityWatcherBatch uint16 = 97
|
||||
ActionReasonHitTreeDrop uint16 = 98
|
||||
ActionReasonGetHomeLevelupReward uint16 = 99
|
||||
ActionReasonHomeDefaultFurniture uint16 = 100
|
||||
ActionReasonActivityCond uint16 = 101
|
||||
ActionReasonBattlePassNotify uint16 = 102
|
||||
ActionReasonPlayerUseItem uint16 = 1001
|
||||
ActionReasonDropItem uint16 = 1002
|
||||
ActionReasonWeaponUpgrade uint16 = 1011
|
||||
ActionReasonWeaponPromote uint16 = 1012
|
||||
ActionReasonWeaponAwaken uint16 = 1013
|
||||
ActionReasonRelicUpgrade uint16 = 1014
|
||||
ActionReasonAbility uint16 = 1015
|
||||
ActionReasonDungeonStatueDrop uint16 = 1016
|
||||
ActionReasonOfflineMsg uint16 = 1017
|
||||
ActionReasonAvatarUpgrade uint16 = 1018
|
||||
ActionReasonAvatarPromote uint16 = 1019
|
||||
ActionReasonQuestAction uint16 = 1021
|
||||
ActionReasonCityLevelup uint16 = 1022
|
||||
ActionReasonUpgradeSkill uint16 = 1024
|
||||
ActionReasonUnlockTalent uint16 = 1025
|
||||
ActionReasonUpgradeProudSkill uint16 = 1026
|
||||
ActionReasonPlayerLevelLimitUp uint16 = 1027
|
||||
ActionReasonDungeonDaily uint16 = 1028
|
||||
ActionReasonItemGiving uint16 = 1030
|
||||
ActionReasonForgeCost uint16 = 1031
|
||||
ActionReasonInvestigationReward uint16 = 1032
|
||||
ActionReasonInvestigationTargetReward uint16 = 1033
|
||||
ActionReasonGadgetInteract uint16 = 1034
|
||||
ActionReasonSeaLampCiMaterial uint16 = 1036
|
||||
ActionReasonSeaLampContributionReward uint16 = 1037
|
||||
ActionReasonSeaLampPhaseReward uint16 = 1038
|
||||
ActionReasonSeaLampFlyLamp uint16 = 1039
|
||||
ActionReasonAutoRecover uint16 = 1040
|
||||
ActionReasonActivityExpireItem uint16 = 1041
|
||||
ActionReasonSubCoinNegative uint16 = 1042
|
||||
ActionReasonBargainDeduct uint16 = 1043
|
||||
ActionReasonBattlePassPaidReward uint16 = 1044
|
||||
ActionReasonBattlePassLevelReward uint16 = 1045
|
||||
ActionReasonTrialAvatarActivityFirstPassReward uint16 = 1046
|
||||
ActionReasonBuyBattlePassLevel uint16 = 1047
|
||||
ActionReasonGrantBirthdayBenefit uint16 = 1048
|
||||
ActionReasonAchievementReward uint16 = 1049
|
||||
ActionReasonAchievementGoalReward uint16 = 1050
|
||||
ActionReasonFirstShareToSocialNetwork uint16 = 1051
|
||||
ActionReasonDestroyMaterial uint16 = 1052
|
||||
ActionReasonCodexLevelupReward uint16 = 1053
|
||||
ActionReasonHuntingOfferReward uint16 = 1054
|
||||
ActionReasonUseWidgetAnchorPoint uint16 = 1055
|
||||
ActionReasonUseWidgetBonfire uint16 = 1056
|
||||
ActionReasonUngradeWeaponReturnMaterial uint16 = 1057
|
||||
ActionReasonUseWidgetOneoffGatherPointDetector uint16 = 1058
|
||||
ActionReasonUseWidgetClientCollector uint16 = 1059
|
||||
ActionReasonUseWidgetClientDetector uint16 = 1060
|
||||
ActionReasonTakeGeneralReward uint16 = 1061
|
||||
ActionReasonAsterTakeSpecialReward uint16 = 1062
|
||||
ActionReasonRemoveCodexBook uint16 = 1063
|
||||
ActionReasonOfferingItem uint16 = 1064
|
||||
ActionReasonUseWidgetGadgetBuilder uint16 = 1065
|
||||
ActionReasonEffigyFirstPassReward uint16 = 1066
|
||||
ActionReasonEffigyReward uint16 = 1067
|
||||
ActionReasonReunionFirstGiftReward uint16 = 1068
|
||||
ActionReasonReunionSignInReward uint16 = 1069
|
||||
ActionReasonReunionWatcherReward uint16 = 1070
|
||||
ActionReasonSalesmanMpReward uint16 = 1071
|
||||
ActionReasonActionReasionAvatarPromoteReward uint16 = 1072
|
||||
ActionReasonBlessingRedeemReward uint16 = 1073
|
||||
ActionReasonActionMiracleRingReward uint16 = 1074
|
||||
ActionReasonExpeditionReward uint16 = 1075
|
||||
ActionReasonTreasureMapRemoveDetector uint16 = 1076
|
||||
ActionReasonMechanicusDungeonTicket uint16 = 1077
|
||||
ActionReasonMechanicusLevelupGear uint16 = 1078
|
||||
ActionReasonMechanicusBattleSettle uint16 = 1079
|
||||
ActionReasonRegionSearchReward uint16 = 1080
|
||||
ActionReasonUnlockCoopChapter uint16 = 1081
|
||||
ActionReasonTakeCoopReward uint16 = 1082
|
||||
ActionReasonFleurFairDungeonReward uint16 = 1083
|
||||
ActionReasonActivityScore uint16 = 1084
|
||||
ActionReasonChannellerSlabOneoffDungeonReward uint16 = 1085
|
||||
ActionReasonFurnitureMakeStart uint16 = 1086
|
||||
ActionReasonFurnitureMakeTake uint16 = 1087
|
||||
ActionReasonFurnitureMakeCancel uint16 = 1088
|
||||
ActionReasonFurnitureMakeFastFinish uint16 = 1089
|
||||
ActionReasonChannellerSlabLoopDungeonFirstPassReward uint16 = 1090
|
||||
ActionReasonChannellerSlabLoopDungeonScoreReward uint16 = 1091
|
||||
ActionReasonHomeLimitedShopBuy uint16 = 1092
|
||||
ActionReasonHomeCoinCollect uint16 = 1093
|
||||
)
|
||||
@@ -1,11 +1,11 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
CLIMATE_TYPE_NONE uint16 = 0
|
||||
CLIMATE_TYPE_SUNNY uint16 = 1
|
||||
CLIMATE_TYPE_CLOUDY uint16 = 2
|
||||
CLIMATE_TYPE_RAIN uint16 = 3
|
||||
CLIMATE_TYPE_THUNDERSTORM uint16 = 4
|
||||
CLIMATE_TYPE_SNOW uint16 = 5
|
||||
CLIMATE_TYPE_MIST uint16 = 6
|
||||
CLIMATE_TYPE_NONE = 0
|
||||
CLIMATE_TYPE_SUNNY = 1
|
||||
CLIMATE_TYPE_CLOUDY = 2
|
||||
CLIMATE_TYPE_RAIN = 3
|
||||
CLIMATE_TYPE_THUNDERSTORM = 4
|
||||
CLIMATE_TYPE_SNOW = 5
|
||||
CLIMATE_TYPE_MIST = 6
|
||||
)
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
EnterReasonNone uint16 = 0
|
||||
EnterReasonLogin uint16 = 1 // 登录
|
||||
EnterReasonDungeonReplay uint16 = 11 // 秘境重新挑战
|
||||
EnterReasonDungeonReviveOnWaypoint uint16 = 12 // 秘境重生
|
||||
EnterReasonDungeonEnter uint16 = 13 // 秘境进入
|
||||
EnterReasonDungeonQuit uint16 = 14 // 秘境离开
|
||||
EnterReasonGm uint16 = 21 // 管理员
|
||||
EnterReasonQuestRollback uint16 = 31 // 任务回滚
|
||||
EnterReasonRevival uint16 = 32 // 重生
|
||||
EnterReasonPersonalScene uint16 = 41 // 个人场景
|
||||
EnterReasonTransPoint uint16 = 42 // 传送点
|
||||
EnterReasonClientTransmit uint16 = 43 // 客户端传送
|
||||
EnterReasonForceDragBack uint16 = 44 // 强制后退
|
||||
EnterReasonTeamKick uint16 = 51 // 队伍踢出
|
||||
EnterReasonTeamJoin uint16 = 52 // 队伍加入
|
||||
EnterReasonTeamBack uint16 = 53 // 队伍返回
|
||||
EnterReasonMuip uint16 = 54 // 与原神项目组的某个服务器组件相关
|
||||
EnterReasonDungeonInviteAccept uint16 = 55 // 秘境邀请接受
|
||||
EnterReasonLua uint16 = 56 // 脚本
|
||||
EnterReasonActivityLoadTerrain uint16 = 57 // 活动加载地形
|
||||
EnterReasonHostFromSingleToMp uint16 = 58 // 房主从单人到多人
|
||||
EnterReasonMpPlay uint16 = 59 // 多人游戏
|
||||
EnterReasonAnchorPoint uint16 = 60 // 迷你锚点
|
||||
EnterReasonLuaSkipUi uint16 = 61 // 脚本跳过UI
|
||||
EnterReasonReloadTerrain uint16 = 62 // 重载地形
|
||||
EnterReasonDraftTransfer uint16 = 63 // 某个东西传送 ??
|
||||
EnterReasonEnterHome uint16 = 64 // 进入尘歌壶
|
||||
EnterReasonExitHome uint16 = 65 // 离开尘歌壶
|
||||
EnterReasonChangeHomeModule uint16 = 66 // 更改尘歌壶模块
|
||||
EnterReasonGallery uint16 = 67 // ??
|
||||
EnterReasonHomeSceneJump uint16 = 68 // 尘歌壶场景跳转
|
||||
EnterReasonHideAndSeek uint16 = 69 // 捉迷藏也就是风行迷宗
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
ENTITY_ID_TYPE_AVATAR uint16 = 0x01
|
||||
ENTITY_ID_TYPE_MONSTER uint16 = 0x02
|
||||
ENTITY_ID_TYPE_NPC uint16 = 0x03
|
||||
ENTITY_ID_TYPE_GADGET uint16 = 0x04
|
||||
ENTITY_ID_TYPE_WEAPON uint16 = 0x06
|
||||
ENTITY_ID_TYPE_TEAM uint16 = 0x09
|
||||
ENTITY_ID_TYPE_MPLEVEL uint16 = 0x0b
|
||||
)
|
||||
@@ -1,59 +1,19 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
EntityTypeNone uint16 = 0
|
||||
EntityTypeAvatar uint16 = 1
|
||||
EntityTypeMonster uint16 = 2
|
||||
EntityTypeBullet uint16 = 3
|
||||
EntityTypeAttackPhyisicalUnit uint16 = 4
|
||||
EntityTypeAOE uint16 = 5
|
||||
EntityTypeCamera uint16 = 6
|
||||
EntityTypeEnviroArea uint16 = 7
|
||||
EntityTypeEquip uint16 = 8
|
||||
EntityTypeMonsterEquip uint16 = 9
|
||||
EntityTypeGrass uint16 = 10
|
||||
EntityTypeLevel uint16 = 11
|
||||
EntityTypeNPC uint16 = 12
|
||||
EntityTypeTransPointFirst uint16 = 13
|
||||
EntityTypeTransPointFirstGadget uint16 = 14
|
||||
EntityTypeTransPointSecond uint16 = 15
|
||||
EntityTypeTransPointSecondGadget uint16 = 16
|
||||
EntityTypeDropItem uint16 = 17
|
||||
EntityTypeField uint16 = 18
|
||||
EntityTypeGadget uint16 = 19
|
||||
EntityTypeWater uint16 = 20
|
||||
EntityTypeGatherPoint uint16 = 21
|
||||
EntityTypeGatherObject uint16 = 22
|
||||
EntityTypeAirflowField uint16 = 23
|
||||
EntityTypeSpeedupField uint16 = 24
|
||||
EntityTypeGear uint16 = 25
|
||||
EntityTypeChest uint16 = 26
|
||||
EntityTypeEnergyBall uint16 = 27
|
||||
EntityTypeElemCrystal uint16 = 28
|
||||
EntityTypeTimeline uint16 = 29
|
||||
EntityTypeWorktop uint16 = 30
|
||||
EntityTypeTeam uint16 = 31
|
||||
EntityTypePlatform uint16 = 32
|
||||
EntityTypeAmberWind uint16 = 33
|
||||
EntityTypeEnvAnimal uint16 = 34
|
||||
EntityTypeSealGadget uint16 = 35
|
||||
EntityTypeTree uint16 = 36
|
||||
EntityTypeBush uint16 = 37
|
||||
EntityTypeQuestGadget uint16 = 38
|
||||
EntityTypeLightning uint16 = 39
|
||||
EntityTypeRewardPoint uint16 = 40
|
||||
EntityTypeRewardStatue uint16 = 41
|
||||
EntityTypeMPLevel uint16 = 42
|
||||
EntityTypeWindSeed uint16 = 43
|
||||
EntityTypeMpPlayRewardPoint uint16 = 44
|
||||
EntityTypeViewPoint uint16 = 45
|
||||
EntityTypeRemoteAvatar uint16 = 46
|
||||
EntityTypeGeneralRewardPoint uint16 = 47
|
||||
EntityTypePlayTeam uint16 = 48
|
||||
EntityTypeOfferingGadget uint16 = 49
|
||||
EntityTypeEyePoint uint16 = 50
|
||||
EntityTypeMiracleRing uint16 = 51
|
||||
EntityTypeFoundation uint16 = 52
|
||||
EntityTypeWidgetGadget uint16 = 53
|
||||
EntityTypePlaceHolder uint16 = 99
|
||||
ENTITY_TYPE_NONE = 0
|
||||
ENTITY_TYPE_AVATAR = 1
|
||||
ENTITY_TYPE_MONSTER = 2
|
||||
ENTITY_TYPE_NPC = 3
|
||||
ENTITY_TYPE_GADGET = 4
|
||||
ENTITY_TYPE_REGION = 5
|
||||
ENTITY_TYPE_WEAPON = 6
|
||||
ENTITY_TYPE_WEATHER = 7
|
||||
ENTITY_TYPE_SCENE = 8
|
||||
ENTITY_TYPE_TEAM = 9
|
||||
ENTITY_TYPE_MASSIVE_ENTITY = 10
|
||||
ENTITY_TYPE_MP_LEVEL = 11
|
||||
ENTITY_TYPE_PLAY_TEAM_ENTITY = 12
|
||||
ENTITY_TYPE_EYE_POINT = 13
|
||||
ENTITY_TYPE_MAX = 14
|
||||
)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
EQUIP_TYPE_NONE uint16 = 0
|
||||
EQUIP_TYPE_BRACER uint16 = 1
|
||||
EQUIP_TYPE_NECKLACE uint16 = 2
|
||||
EQUIP_TYPE_SHOES uint16 = 3
|
||||
EQUIP_TYPE_RING uint16 = 4
|
||||
EQUIP_TYPE_DRESS uint16 = 5
|
||||
EQUIP_TYPE_WEAPON uint16 = 6
|
||||
EQUIP_TYPE_NONE = 0
|
||||
EQUIP_TYPE_BRACER = 1
|
||||
EQUIP_TYPE_NECKLACE = 2
|
||||
EQUIP_TYPE_SHOES = 3
|
||||
EQUIP_TYPE_RING = 4
|
||||
EQUIP_TYPE_DRESS = 5
|
||||
EQUIP_TYPE_WEAPON = 6
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
FETTER_STATE_NONE uint16 = 0
|
||||
FETTER_STATE_NOT_OPEN uint16 = 1
|
||||
FETTER_STATE_OPEN uint16 = 1
|
||||
FETTER_STATE_FINISH uint16 = 3
|
||||
FETTER_STATE_NONE = 0
|
||||
FETTER_STATE_NOT_OPEN = 1
|
||||
FETTER_STATE_OPEN = 1
|
||||
FETTER_STATE_FINISH = 3
|
||||
)
|
||||
|
||||
@@ -1,100 +1,100 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
FIGHT_PROP_NONE uint16 = 0
|
||||
FIGHT_PROP_BASE_HP uint16 = 1
|
||||
FIGHT_PROP_HP uint16 = 2
|
||||
FIGHT_PROP_HP_PERCENT uint16 = 3
|
||||
FIGHT_PROP_BASE_ATTACK uint16 = 4
|
||||
FIGHT_PROP_ATTACK uint16 = 5
|
||||
FIGHT_PROP_ATTACK_PERCENT uint16 = 6
|
||||
FIGHT_PROP_BASE_DEFENSE uint16 = 7
|
||||
FIGHT_PROP_DEFENSE uint16 = 8
|
||||
FIGHT_PROP_DEFENSE_PERCENT uint16 = 9
|
||||
FIGHT_PROP_BASE_SPEED uint16 = 10
|
||||
FIGHT_PROP_SPEED_PERCENT uint16 = 11
|
||||
FIGHT_PROP_HP_MP_PERCENT uint16 = 12
|
||||
FIGHT_PROP_ATTACK_MP_PERCENT uint16 = 13
|
||||
FIGHT_PROP_CRITICAL uint16 = 20
|
||||
FIGHT_PROP_ANTI_CRITICAL uint16 = 21
|
||||
FIGHT_PROP_CRITICAL_HURT uint16 = 22
|
||||
FIGHT_PROP_CHARGE_EFFICIENCY uint16 = 23
|
||||
FIGHT_PROP_ADD_HURT uint16 = 24
|
||||
FIGHT_PROP_SUB_HURT uint16 = 25
|
||||
FIGHT_PROP_HEAL_ADD uint16 = 26
|
||||
FIGHT_PROP_HEALED_ADD uint16 = 27
|
||||
FIGHT_PROP_ELEMENT_MASTERY uint16 = 28
|
||||
FIGHT_PROP_PHYSICAL_SUB_HURT uint16 = 29
|
||||
FIGHT_PROP_PHYSICAL_ADD_HURT uint16 = 30
|
||||
FIGHT_PROP_DEFENCE_IGNORE_RATIO uint16 = 31
|
||||
FIGHT_PROP_DEFENCE_IGNORE_DELTA uint16 = 32
|
||||
FIGHT_PROP_FIRE_ADD_HURT uint16 = 40
|
||||
FIGHT_PROP_ELEC_ADD_HURT uint16 = 41
|
||||
FIGHT_PROP_WATER_ADD_HURT uint16 = 42
|
||||
FIGHT_PROP_GRASS_ADD_HURT uint16 = 43
|
||||
FIGHT_PROP_WIND_ADD_HURT uint16 = 44
|
||||
FIGHT_PROP_ROCK_ADD_HURT uint16 = 45
|
||||
FIGHT_PROP_ICE_ADD_HURT uint16 = 46
|
||||
FIGHT_PROP_HIT_HEAD_ADD_HURT uint16 = 47
|
||||
FIGHT_PROP_FIRE_SUB_HURT uint16 = 50
|
||||
FIGHT_PROP_ELEC_SUB_HURT uint16 = 51
|
||||
FIGHT_PROP_WATER_SUB_HURT uint16 = 52
|
||||
FIGHT_PROP_GRASS_SUB_HURT uint16 = 53
|
||||
FIGHT_PROP_WIND_SUB_HURT uint16 = 54
|
||||
FIGHT_PROP_ROCK_SUB_HURT uint16 = 55
|
||||
FIGHT_PROP_ICE_SUB_HURT uint16 = 56
|
||||
FIGHT_PROP_EFFECT_HIT uint16 = 60
|
||||
FIGHT_PROP_EFFECT_RESIST uint16 = 61
|
||||
FIGHT_PROP_FREEZE_RESIST uint16 = 62
|
||||
FIGHT_PROP_TORPOR_RESIST uint16 = 63
|
||||
FIGHT_PROP_DIZZY_RESIST uint16 = 64
|
||||
FIGHT_PROP_FREEZE_SHORTEN uint16 = 65
|
||||
FIGHT_PROP_TORPOR_SHORTEN uint16 = 66
|
||||
FIGHT_PROP_DIZZY_SHORTEN uint16 = 67
|
||||
FIGHT_PROP_MAX_FIRE_ENERGY uint16 = 70
|
||||
FIGHT_PROP_MAX_ELEC_ENERGY uint16 = 71
|
||||
FIGHT_PROP_MAX_WATER_ENERGY uint16 = 72
|
||||
FIGHT_PROP_MAX_GRASS_ENERGY uint16 = 73
|
||||
FIGHT_PROP_MAX_WIND_ENERGY uint16 = 74
|
||||
FIGHT_PROP_MAX_ICE_ENERGY uint16 = 75
|
||||
FIGHT_PROP_MAX_ROCK_ENERGY uint16 = 76
|
||||
FIGHT_PROP_SKILL_CD_MINUS_RATIO uint16 = 80
|
||||
FIGHT_PROP_SHIELD_COST_MINUS_RATIO uint16 = 81
|
||||
FIGHT_PROP_CUR_FIRE_ENERGY uint16 = 1000
|
||||
FIGHT_PROP_CUR_ELEC_ENERGY uint16 = 1001
|
||||
FIGHT_PROP_CUR_WATER_ENERGY uint16 = 1002
|
||||
FIGHT_PROP_CUR_GRASS_ENERGY uint16 = 1003
|
||||
FIGHT_PROP_CUR_WIND_ENERGY uint16 = 1004
|
||||
FIGHT_PROP_CUR_ICE_ENERGY uint16 = 1005
|
||||
FIGHT_PROP_CUR_ROCK_ENERGY uint16 = 1006
|
||||
FIGHT_PROP_CUR_HP uint16 = 1010
|
||||
FIGHT_PROP_MAX_HP uint16 = 2000
|
||||
FIGHT_PROP_CUR_ATTACK uint16 = 2001
|
||||
FIGHT_PROP_CUR_DEFENSE uint16 = 2002
|
||||
FIGHT_PROP_CUR_SPEED uint16 = 2003
|
||||
FIGHT_PROP_NONEXTRA_ATTACK uint16 = 3000
|
||||
FIGHT_PROP_NONEXTRA_DEFENSE uint16 = 3001
|
||||
FIGHT_PROP_NONEXTRA_CRITICAL uint16 = 3002
|
||||
FIGHT_PROP_NONEXTRA_ANTI_CRITICAL uint16 = 3003
|
||||
FIGHT_PROP_NONEXTRA_CRITICAL_HURT uint16 = 3004
|
||||
FIGHT_PROP_NONEXTRA_CHARGE_EFFICIENCY uint16 = 3005
|
||||
FIGHT_PROP_NONEXTRA_ELEMENT_MASTERY uint16 = 3006
|
||||
FIGHT_PROP_NONEXTRA_PHYSICAL_SUB_HURT uint16 = 3007
|
||||
FIGHT_PROP_NONEXTRA_FIRE_ADD_HURT uint16 = 3008
|
||||
FIGHT_PROP_NONEXTRA_ELEC_ADD_HURT uint16 = 3009
|
||||
FIGHT_PROP_NONEXTRA_WATER_ADD_HURT uint16 = 3010
|
||||
FIGHT_PROP_NONEXTRA_GRASS_ADD_HURT uint16 = 3011
|
||||
FIGHT_PROP_NONEXTRA_WIND_ADD_HURT uint16 = 3012
|
||||
FIGHT_PROP_NONEXTRA_ROCK_ADD_HURT uint16 = 3013
|
||||
FIGHT_PROP_NONEXTRA_ICE_ADD_HURT uint16 = 3014
|
||||
FIGHT_PROP_NONEXTRA_FIRE_SUB_HURT uint16 = 3015
|
||||
FIGHT_PROP_NONEXTRA_ELEC_SUB_HURT uint16 = 3016
|
||||
FIGHT_PROP_NONEXTRA_WATER_SUB_HURT uint16 = 3017
|
||||
FIGHT_PROP_NONEXTRA_GRASS_SUB_HURT uint16 = 3018
|
||||
FIGHT_PROP_NONEXTRA_WIND_SUB_HURT uint16 = 3019
|
||||
FIGHT_PROP_NONEXTRA_ROCK_SUB_HURT uint16 = 3020
|
||||
FIGHT_PROP_NONEXTRA_ICE_SUB_HURT uint16 = 3021
|
||||
FIGHT_PROP_NONEXTRA_SKILL_CD_MINUS_RATIO uint16 = 3022
|
||||
FIGHT_PROP_NONEXTRA_SHIELD_COST_MINUS_RATIO uint16 = 3023
|
||||
FIGHT_PROP_NONEXTRA_PHYSICAL_ADD_HURT uint16 = 3024
|
||||
FIGHT_PROP_NONE = 0
|
||||
FIGHT_PROP_BASE_HP = 1
|
||||
FIGHT_PROP_HP = 2
|
||||
FIGHT_PROP_HP_PERCENT = 3
|
||||
FIGHT_PROP_BASE_ATTACK = 4
|
||||
FIGHT_PROP_ATTACK = 5
|
||||
FIGHT_PROP_ATTACK_PERCENT = 6
|
||||
FIGHT_PROP_BASE_DEFENSE = 7
|
||||
FIGHT_PROP_DEFENSE = 8
|
||||
FIGHT_PROP_DEFENSE_PERCENT = 9
|
||||
FIGHT_PROP_BASE_SPEED = 10
|
||||
FIGHT_PROP_SPEED_PERCENT = 11
|
||||
FIGHT_PROP_HP_MP_PERCENT = 12
|
||||
FIGHT_PROP_ATTACK_MP_PERCENT = 13
|
||||
FIGHT_PROP_CRITICAL = 20
|
||||
FIGHT_PROP_ANTI_CRITICAL = 21
|
||||
FIGHT_PROP_CRITICAL_HURT = 22
|
||||
FIGHT_PROP_CHARGE_EFFICIENCY = 23
|
||||
FIGHT_PROP_ADD_HURT = 24
|
||||
FIGHT_PROP_SUB_HURT = 25
|
||||
FIGHT_PROP_HEAL_ADD = 26
|
||||
FIGHT_PROP_HEALED_ADD = 27
|
||||
FIGHT_PROP_ELEMENT_MASTERY = 28
|
||||
FIGHT_PROP_PHYSICAL_SUB_HURT = 29
|
||||
FIGHT_PROP_PHYSICAL_ADD_HURT = 30
|
||||
FIGHT_PROP_DEFENCE_IGNORE_RATIO = 31
|
||||
FIGHT_PROP_DEFENCE_IGNORE_DELTA = 32
|
||||
FIGHT_PROP_FIRE_ADD_HURT = 40
|
||||
FIGHT_PROP_ELEC_ADD_HURT = 41
|
||||
FIGHT_PROP_WATER_ADD_HURT = 42
|
||||
FIGHT_PROP_GRASS_ADD_HURT = 43
|
||||
FIGHT_PROP_WIND_ADD_HURT = 44
|
||||
FIGHT_PROP_ROCK_ADD_HURT = 45
|
||||
FIGHT_PROP_ICE_ADD_HURT = 46
|
||||
FIGHT_PROP_HIT_HEAD_ADD_HURT = 47
|
||||
FIGHT_PROP_FIRE_SUB_HURT = 50
|
||||
FIGHT_PROP_ELEC_SUB_HURT = 51
|
||||
FIGHT_PROP_WATER_SUB_HURT = 52
|
||||
FIGHT_PROP_GRASS_SUB_HURT = 53
|
||||
FIGHT_PROP_WIND_SUB_HURT = 54
|
||||
FIGHT_PROP_ROCK_SUB_HURT = 55
|
||||
FIGHT_PROP_ICE_SUB_HURT = 56
|
||||
FIGHT_PROP_EFFECT_HIT = 60
|
||||
FIGHT_PROP_EFFECT_RESIST = 61
|
||||
FIGHT_PROP_FREEZE_RESIST = 62
|
||||
FIGHT_PROP_TORPOR_RESIST = 63
|
||||
FIGHT_PROP_DIZZY_RESIST = 64
|
||||
FIGHT_PROP_FREEZE_SHORTEN = 65
|
||||
FIGHT_PROP_TORPOR_SHORTEN = 66
|
||||
FIGHT_PROP_DIZZY_SHORTEN = 67
|
||||
FIGHT_PROP_MAX_FIRE_ENERGY = 70
|
||||
FIGHT_PROP_MAX_ELEC_ENERGY = 71
|
||||
FIGHT_PROP_MAX_WATER_ENERGY = 72
|
||||
FIGHT_PROP_MAX_GRASS_ENERGY = 73
|
||||
FIGHT_PROP_MAX_WIND_ENERGY = 74
|
||||
FIGHT_PROP_MAX_ICE_ENERGY = 75
|
||||
FIGHT_PROP_MAX_ROCK_ENERGY = 76
|
||||
FIGHT_PROP_SKILL_CD_MINUS_RATIO = 80
|
||||
FIGHT_PROP_SHIELD_COST_MINUS_RATIO = 81
|
||||
FIGHT_PROP_CUR_FIRE_ENERGY = 1000
|
||||
FIGHT_PROP_CUR_ELEC_ENERGY = 1001
|
||||
FIGHT_PROP_CUR_WATER_ENERGY = 1002
|
||||
FIGHT_PROP_CUR_GRASS_ENERGY = 1003
|
||||
FIGHT_PROP_CUR_WIND_ENERGY = 1004
|
||||
FIGHT_PROP_CUR_ICE_ENERGY = 1005
|
||||
FIGHT_PROP_CUR_ROCK_ENERGY = 1006
|
||||
FIGHT_PROP_CUR_HP = 1010
|
||||
FIGHT_PROP_MAX_HP = 2000
|
||||
FIGHT_PROP_CUR_ATTACK = 2001
|
||||
FIGHT_PROP_CUR_DEFENSE = 2002
|
||||
FIGHT_PROP_CUR_SPEED = 2003
|
||||
FIGHT_PROP_NONEXTRA_ATTACK = 3000
|
||||
FIGHT_PROP_NONEXTRA_DEFENSE = 3001
|
||||
FIGHT_PROP_NONEXTRA_CRITICAL = 3002
|
||||
FIGHT_PROP_NONEXTRA_ANTI_CRITICAL = 3003
|
||||
FIGHT_PROP_NONEXTRA_CRITICAL_HURT = 3004
|
||||
FIGHT_PROP_NONEXTRA_CHARGE_EFFICIENCY = 3005
|
||||
FIGHT_PROP_NONEXTRA_ELEMENT_MASTERY = 3006
|
||||
FIGHT_PROP_NONEXTRA_PHYSICAL_SUB_HURT = 3007
|
||||
FIGHT_PROP_NONEXTRA_FIRE_ADD_HURT = 3008
|
||||
FIGHT_PROP_NONEXTRA_ELEC_ADD_HURT = 3009
|
||||
FIGHT_PROP_NONEXTRA_WATER_ADD_HURT = 3010
|
||||
FIGHT_PROP_NONEXTRA_GRASS_ADD_HURT = 3011
|
||||
FIGHT_PROP_NONEXTRA_WIND_ADD_HURT = 3012
|
||||
FIGHT_PROP_NONEXTRA_ROCK_ADD_HURT = 3013
|
||||
FIGHT_PROP_NONEXTRA_ICE_ADD_HURT = 3014
|
||||
FIGHT_PROP_NONEXTRA_FIRE_SUB_HURT = 3015
|
||||
FIGHT_PROP_NONEXTRA_ELEC_SUB_HURT = 3016
|
||||
FIGHT_PROP_NONEXTRA_WATER_SUB_HURT = 3017
|
||||
FIGHT_PROP_NONEXTRA_GRASS_SUB_HURT = 3018
|
||||
FIGHT_PROP_NONEXTRA_WIND_SUB_HURT = 3019
|
||||
FIGHT_PROP_NONEXTRA_ROCK_SUB_HURT = 3020
|
||||
FIGHT_PROP_NONEXTRA_ICE_SUB_HURT = 3021
|
||||
FIGHT_PROP_NONEXTRA_SKILL_CD_MINUS_RATIO = 3022
|
||||
FIGHT_PROP_NONEXTRA_SHIELD_COST_MINUS_RATIO = 3023
|
||||
FIGHT_PROP_NONEXTRA_PHYSICAL_ADD_HURT = 3024
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
GCG_TOKEN_TYPE_CUR_HEALTH uint32 = 1 // 现行血量
|
||||
GCG_TOKEN_TYPE_MAX_HEALTH uint32 = 2 // 最大血量(不确定)
|
||||
GCG_TOKEN_TYPE_CUR_ELEM uint32 = 4 // 现行充能
|
||||
GCG_TOKEN_TYPE_MAX_ELEM uint32 = 5 // 最大充能(充能条长度)
|
||||
GCG_TOKEN_TYPE_CUR_HEALTH = 1 // 现行血量
|
||||
GCG_TOKEN_TYPE_MAX_HEALTH = 2 // 最大血量(不确定)
|
||||
GCG_TOKEN_TYPE_CUR_ELEM = 4 // 现行充能
|
||||
GCG_TOKEN_TYPE_MAX_ELEM = 5 // 最大充能(充能条长度)
|
||||
)
|
||||
|
||||
@@ -1,64 +1,64 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
GROW_CURVE_NONE uint16 = 0
|
||||
GROW_CURVE_HP uint16 = 1
|
||||
GROW_CURVE_ATTACK uint16 = 2
|
||||
GROW_CURVE_STAMINA uint16 = 3
|
||||
GROW_CURVE_STRIKE uint16 = 4
|
||||
GROW_CURVE_ANTI_STRIKE uint16 = 5
|
||||
GROW_CURVE_ANTI_STRIKE1 uint16 = 6
|
||||
GROW_CURVE_ANTI_STRIKE2 uint16 = 7
|
||||
GROW_CURVE_ANTI_STRIKE3 uint16 = 8
|
||||
GROW_CURVE_STRIKE_HURT uint16 = 9
|
||||
GROW_CURVE_ELEMENT uint16 = 10
|
||||
GROW_CURVE_KILL_EXP uint16 = 11
|
||||
GROW_CURVE_DEFENSE uint16 = 12
|
||||
GROW_CURVE_ATTACK_BOMB uint16 = 13
|
||||
GROW_CURVE_HP_LITTLEMONSTER uint16 = 14
|
||||
GROW_CURVE_ELEMENT_MASTERY uint16 = 15
|
||||
GROW_CURVE_PROGRESSION uint16 = 16
|
||||
GROW_CURVE_DEFENDING uint16 = 17
|
||||
GROW_CURVE_MHP uint16 = 18
|
||||
GROW_CURVE_MATK uint16 = 19
|
||||
GROW_CURVE_TOWERATK uint16 = 20
|
||||
GROW_CURVE_HP_S5 uint16 = 21
|
||||
GROW_CURVE_HP_S4 uint16 = 22
|
||||
GROW_CURVE_HP_2 uint16 = 23
|
||||
GROW_CURVE_ATTACK_S5 uint16 = 31
|
||||
GROW_CURVE_ATTACK_S4 uint16 = 32
|
||||
GROW_CURVE_ATTACK_S3 uint16 = 33
|
||||
GROW_CURVE_STRIKE_S5 uint16 = 34
|
||||
GROW_CURVE_DEFENSE_S5 uint16 = 41
|
||||
GROW_CURVE_DEFENSE_S4 uint16 = 42
|
||||
GROW_CURVE_ATTACK_101 uint16 = 1101
|
||||
GROW_CURVE_ATTACK_102 uint16 = 1102
|
||||
GROW_CURVE_ATTACK_103 uint16 = 1103
|
||||
GROW_CURVE_ATTACK_104 uint16 = 1104
|
||||
GROW_CURVE_ATTACK_105 uint16 = 1105
|
||||
GROW_CURVE_ATTACK_201 uint16 = 1201
|
||||
GROW_CURVE_ATTACK_202 uint16 = 1202
|
||||
GROW_CURVE_ATTACK_203 uint16 = 1203
|
||||
GROW_CURVE_ATTACK_204 uint16 = 1204
|
||||
GROW_CURVE_ATTACK_205 uint16 = 1205
|
||||
GROW_CURVE_ATTACK_301 uint16 = 1301
|
||||
GROW_CURVE_ATTACK_302 uint16 = 1302
|
||||
GROW_CURVE_ATTACK_303 uint16 = 1303
|
||||
GROW_CURVE_ATTACK_304 uint16 = 1304
|
||||
GROW_CURVE_ATTACK_305 uint16 = 1305
|
||||
GROW_CURVE_CRITICAL_101 uint16 = 2101
|
||||
GROW_CURVE_CRITICAL_102 uint16 = 2102
|
||||
GROW_CURVE_CRITICAL_103 uint16 = 2103
|
||||
GROW_CURVE_CRITICAL_104 uint16 = 2104
|
||||
GROW_CURVE_CRITICAL_105 uint16 = 2105
|
||||
GROW_CURVE_CRITICAL_201 uint16 = 2201
|
||||
GROW_CURVE_CRITICAL_202 uint16 = 2202
|
||||
GROW_CURVE_CRITICAL_203 uint16 = 2203
|
||||
GROW_CURVE_CRITICAL_204 uint16 = 2204
|
||||
GROW_CURVE_CRITICAL_205 uint16 = 2205
|
||||
GROW_CURVE_CRITICAL_301 uint16 = 2301
|
||||
GROW_CURVE_CRITICAL_302 uint16 = 2302
|
||||
GROW_CURVE_CRITICAL_303 uint16 = 2303
|
||||
GROW_CURVE_CRITICAL_304 uint16 = 2304
|
||||
GROW_CURVE_CRITICAL_305 uint16 = 2305
|
||||
GROW_CURVE_NONE = 0
|
||||
GROW_CURVE_HP = 1
|
||||
GROW_CURVE_ATTACK = 2
|
||||
GROW_CURVE_STAMINA = 3
|
||||
GROW_CURVE_STRIKE = 4
|
||||
GROW_CURVE_ANTI_STRIKE = 5
|
||||
GROW_CURVE_ANTI_STRIKE1 = 6
|
||||
GROW_CURVE_ANTI_STRIKE2 = 7
|
||||
GROW_CURVE_ANTI_STRIKE3 = 8
|
||||
GROW_CURVE_STRIKE_HURT = 9
|
||||
GROW_CURVE_ELEMENT = 10
|
||||
GROW_CURVE_KILL_EXP = 11
|
||||
GROW_CURVE_DEFENSE = 12
|
||||
GROW_CURVE_ATTACK_BOMB = 13
|
||||
GROW_CURVE_HP_LITTLEMONSTER = 14
|
||||
GROW_CURVE_ELEMENT_MASTERY = 15
|
||||
GROW_CURVE_PROGRESSION = 16
|
||||
GROW_CURVE_DEFENDING = 17
|
||||
GROW_CURVE_MHP = 18
|
||||
GROW_CURVE_MATK = 19
|
||||
GROW_CURVE_TOWERATK = 20
|
||||
GROW_CURVE_HP_S5 = 21
|
||||
GROW_CURVE_HP_S4 = 22
|
||||
GROW_CURVE_HP_2 = 23
|
||||
GROW_CURVE_ATTACK_S5 = 31
|
||||
GROW_CURVE_ATTACK_S4 = 32
|
||||
GROW_CURVE_ATTACK_S3 = 33
|
||||
GROW_CURVE_STRIKE_S5 = 34
|
||||
GROW_CURVE_DEFENSE_S5 = 41
|
||||
GROW_CURVE_DEFENSE_S4 = 42
|
||||
GROW_CURVE_ATTACK_101 = 1101
|
||||
GROW_CURVE_ATTACK_102 = 1102
|
||||
GROW_CURVE_ATTACK_103 = 1103
|
||||
GROW_CURVE_ATTACK_104 = 1104
|
||||
GROW_CURVE_ATTACK_105 = 1105
|
||||
GROW_CURVE_ATTACK_201 = 1201
|
||||
GROW_CURVE_ATTACK_202 = 1202
|
||||
GROW_CURVE_ATTACK_203 = 1203
|
||||
GROW_CURVE_ATTACK_204 = 1204
|
||||
GROW_CURVE_ATTACK_205 = 1205
|
||||
GROW_CURVE_ATTACK_301 = 1301
|
||||
GROW_CURVE_ATTACK_302 = 1302
|
||||
GROW_CURVE_ATTACK_303 = 1303
|
||||
GROW_CURVE_ATTACK_304 = 1304
|
||||
GROW_CURVE_ATTACK_305 = 1305
|
||||
GROW_CURVE_CRITICAL_101 = 2101
|
||||
GROW_CURVE_CRITICAL_102 = 2102
|
||||
GROW_CURVE_CRITICAL_103 = 2103
|
||||
GROW_CURVE_CRITICAL_104 = 2104
|
||||
GROW_CURVE_CRITICAL_105 = 2105
|
||||
GROW_CURVE_CRITICAL_201 = 2201
|
||||
GROW_CURVE_CRITICAL_202 = 2202
|
||||
GROW_CURVE_CRITICAL_203 = 2203
|
||||
GROW_CURVE_CRITICAL_204 = 2204
|
||||
GROW_CURVE_CRITICAL_205 = 2205
|
||||
GROW_CURVE_CRITICAL_301 = 2301
|
||||
GROW_CURVE_CRITICAL_302 = 2302
|
||||
GROW_CURVE_CRITICAL_303 = 2303
|
||||
GROW_CURVE_CRITICAL_304 = 2304
|
||||
GROW_CURVE_CRITICAL_305 = 2305
|
||||
)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
ITEM_TYPE_NONE uint16 = 0
|
||||
ITEM_TYPE_VIRTUAL uint16 = 1
|
||||
ITEM_TYPE_MATERIAL uint16 = 2
|
||||
ITEM_TYPE_RELIQUARY uint16 = 3
|
||||
ITEM_TYPE_WEAPON uint16 = 4
|
||||
ITEM_TYPE_DISPLAY uint16 = 5
|
||||
ITEM_TYPE_FURNITURE uint16 = 6
|
||||
ITEM_TYPE_NONE = 0
|
||||
ITEM_TYPE_VIRTUAL = 1
|
||||
ITEM_TYPE_MATERIAL = 2
|
||||
ITEM_TYPE_RELIQUARY = 3
|
||||
ITEM_TYPE_WEAPON = 4
|
||||
ITEM_TYPE_DISPLAY = 5
|
||||
ITEM_TYPE_FURNITURE = 6
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
LIFE_STATE_NONE uint16 = 0
|
||||
LIFE_STATE_ALIVE uint16 = 1
|
||||
LIFE_STATE_DEAD uint16 = 2
|
||||
LIFE_STATE_REVIVE uint16 = 3
|
||||
LIFE_STATE_NONE = 0
|
||||
LIFE_STATE_ALIVE = 1
|
||||
LIFE_STATE_DEAD = 2
|
||||
LIFE_STATE_REVIVE = 3
|
||||
)
|
||||
|
||||
132
common/constant/lua_type.go
Normal file
132
common/constant/lua_type.go
Normal file
@@ -0,0 +1,132 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
LUA_EVENT_NONE = 0
|
||||
LUA_EVENT_ANY_MONSTER_DIE = 1
|
||||
LUA_EVENT_ANY_GADGET_DIE = 2
|
||||
LUA_EVENT_VARIABLE_CHANGE = 3
|
||||
LUA_EVENT_ENTER_REGION = 4
|
||||
LUA_EVENT_LEAVE_REGION = 5
|
||||
LUA_EVENT_GADGET_CREATE = 6
|
||||
LUA_EVENT_GADGET_STATE_CHANGE = 7
|
||||
LUA_EVENT_DUNGEON_SETTLE = 8
|
||||
LUA_EVENT_SELECT_OPTION = 9
|
||||
LUA_EVENT_CLIENT_EXECUTE = 10
|
||||
LUA_EVENT_ANY_MONSTER_LIVE = 11
|
||||
LUA_EVENT_SPECIFIC_MONSTER_HP_CHANGE = 12
|
||||
LUA_EVENT_CITY_LEVELUP_UNLOCK_DUNGEON_ENTRY = 13
|
||||
LUA_EVENT_DUNGEON_BROADCAST_ONTIMER = 14
|
||||
LUA_EVENT_TIMER_EVENT = 15
|
||||
LUA_EVENT_CHALLENGE_SUCCESS = 16
|
||||
LUA_EVENT_CHALLENGE_FAIL = 17
|
||||
LUA_EVENT_SEAL_BATTLE_BEGIN = 18
|
||||
LUA_EVENT_SEAL_BATTLE_END = 19
|
||||
LUA_EVENT_GATHER = 20
|
||||
LUA_EVENT_QUEST_FINISH = 21
|
||||
LUA_EVENT_MONSTER_BATTLE = 22
|
||||
LUA_EVENT_CITY_LEVELUP = 23
|
||||
LUA_EVENT_CUTSCENE_END = 24
|
||||
LUA_EVENT_AVATAR_NEAR_PLATFORM = 25
|
||||
LUA_EVENT_PLATFORM_REACH_POINT = 26
|
||||
LUA_EVENT_UNLOCK_TRANS_POINT = 27
|
||||
LUA_EVENT_QUEST_START = 28
|
||||
LUA_EVENT_GROUP_LOAD = 29
|
||||
LUA_EVENT_GROUP_WILL_UNLOAD = 30
|
||||
LUA_EVENT_GROUP_WILL_REFRESH = 31
|
||||
LUA_EVENT_GROUP_REFRESH = 32
|
||||
LUA_EVENT_DUNGEON_REWARD_GET = 33
|
||||
LUA_EVENT_SPECIFIC_GADGET_HP_CHANGE = 34
|
||||
LUA_EVENT_MONSTER_TIDE_OVER = 35
|
||||
LUA_EVENT_MONSTER_TIDE_CREATE = 36
|
||||
LUA_EVENT_MONSTER_TIDE_DIE = 37
|
||||
LUA_EVENT_SEALAMP_PHASE_CHANGE = 38
|
||||
LUA_EVENT_BLOSSOM_PROGRESS_FINISH = 39
|
||||
LUA_EVENT_BLOSSOM_CHEST_DIE = 40
|
||||
LUA_EVENT_GADGET_PLAY_START = 41
|
||||
LUA_EVENT_GADGET_PLAY_START_CD = 42
|
||||
LUA_EVENT_GADGET_PLAY_STOP = 43
|
||||
LUA_EVENT_GADGET_LUA_NOTIFY = 44
|
||||
LUA_EVENT_MP_PLAY_PREPARE = 45
|
||||
LUA_EVENT_MP_PLAY_BATTLE = 46
|
||||
LUA_EVENT_MP_PLAY_PREPARE_INTERRUPT = 47
|
||||
LUA_EVENT_SELECT_DIFFICULTY = 48
|
||||
LUA_EVENT_SCENE_MP_PLAY_BATTLE_STATE = 49
|
||||
LUA_EVENT_SCENE_MP_PLAY_BATTLE_STAGE_CHANGE = 50
|
||||
LUA_EVENT_SCENE_MP_PLAY_BATTLE_RESULT = 51
|
||||
LUA_EVENT_SEAL_BATTLE_PROGRESS_DECREASE = 52
|
||||
LUA_EVENT_GENERAL_REWARD_DIE = 53
|
||||
LUA_EVENT_SCENE_MP_PLAY_BATTLE_INTERRUPT = 54
|
||||
LUA_EVENT_MONSTER_DIE_BEFORE_LEAVE_SCENE = 55
|
||||
LUA_EVENT_SCENE_MP_PLAY_OPEN = 56
|
||||
LUA_EVENT_OFFERING_LEVELUP = 57
|
||||
LUA_EVENT_DUNGEON_REVIVE = 58
|
||||
LUA_EVENT_SCENE_MP_PLAY_ALL_AVATAR_DIE = 59
|
||||
LUA_EVENT_DUNGEON_ALL_AVATAR_DIE = 60
|
||||
LUA_EVENT_GENERAL_REWARD_TAKEN = 61
|
||||
LUA_EVENT_PLATFORM_REACH_ARRAYPOINT = 62
|
||||
LUA_EVENT_SCENE_MULTISTAGE_PLAY_STAGE_END = 63
|
||||
LUA_EVENT_SCENE_MULTISTAGE_PLAY_END_STAGE_REQ = 64
|
||||
LUA_EVENT_MECHANICUS_PICKED_CARD = 65
|
||||
LUA_EVENT_POOL_MONSTER_TIDE_OVER = 66
|
||||
LUA_EVENT_POOL_MONSTER_TIDE_CREATE = 67
|
||||
LUA_EVENT_POOL_MONSTER_TIDE_DIE = 68
|
||||
LUA_EVENT_DUNGEON_AVATAR_SLIP_DIE = 69
|
||||
LUA_EVENT_GALLERY_START = 70
|
||||
LUA_EVENT_GALLERY_STOP = 71
|
||||
LUA_EVENT_TIME_AXIS_PASS = 72
|
||||
LUA_EVENT_FLEUR_FAIR_DUNGEON_ALL_PLAYER_ENTER = 73
|
||||
LUA_EVENT_GADGETTALK_DONE = 74
|
||||
LUA_EVENT_SET_GAME_TIME = 75
|
||||
LUA_EVENT_HIDE_AND_SEEK_PLAYER_QUIT = 76
|
||||
LUA_EVENT_AVATAR_DIE = 77
|
||||
LUA_EVENT_SCENE_MULTISTAGE_PLAY_STAGE_START = 78
|
||||
LUA_EVENT_GALLERY_PROGRESS_PASS = 79
|
||||
LUA_EVENT_GALLERY_PROGRESS_EMPTY = 80
|
||||
LUA_EVENT_GALLERY_PROGRESS_FULL = 81
|
||||
LUA_EVENT_HUNTING_FINISH_FINAL = 82
|
||||
LUA_EVENT_USE_WIDGET_TOY_FOX_CAMERA = 83
|
||||
LUA_EVENT_LUNA_RITE_SACRIFICE = 84
|
||||
LUA_EVENT_SUMO_SWITCH_TEAM_EVENT = 85
|
||||
LUA_EVENT_FISHING_START = 86
|
||||
LUA_EVENT_FISHING_STOP = 87
|
||||
LUA_EVENT_FISHING_QTE_FINISH = 88
|
||||
LUA_EVENT_FISHING_TIMEOUT_FLEE = 89
|
||||
LUA_EVENT_ROGUE_CELL_STATE_CHANGE = 90
|
||||
LUA_EVENT_ROGUE_CELL_CONSTRUCT = 91
|
||||
LUA_EVENT_ROGUE_CELL_FINISH_SELECT_CARD = 92
|
||||
LUA_EVENT_ANY_MONSTER_CAPTURE = 93
|
||||
LUA_EVENT_ACTIVITY_INTERACT_GADGET = 94
|
||||
LUA_EVENT_CHALLENGE_PAUSE = 95
|
||||
LUA_EVENT_LEVEL_TAG_CHANGE = 96
|
||||
LUA_EVENT_CUSTOM_DUNGEON_START = 97
|
||||
LUA_EVENT_CUSTOM_DUNGEON_RESTART = 98
|
||||
LUA_EVENT_CUSTOM_DUNGEON_REACTIVE = 99
|
||||
LUA_EVENT_CUSTOM_DUNGEON_OUT_STUCK = 100
|
||||
LUA_EVENT_CUSTOM_DUNGEON_EXIT_TRY = 101
|
||||
LUA_EVENT_CUSTOM_DUNGEON_OFFICIAL_RESTART = 102
|
||||
LUA_EVENT_ANY_MONSTER_CAPTURE_AND_DISAPPEAR = 103
|
||||
LUA_EVENT_MICHIAE_INTERACT = 104
|
||||
LUA_EVENT_SELECT_UIINTERACT = 105
|
||||
LUA_EVENT_LUA_NOTIFY = 106
|
||||
LUA_EVENT_PHOTO_FINISH = 107
|
||||
LUA_EVENT_IRODORI_MASTER_READY = 108
|
||||
LUA_EVENT_ROGUE_START_FIGHT = 109
|
||||
LUA_EVENT_ROGUE_CREAGE_FIGHT_GADGET = 110
|
||||
LUA_EVENT_ROGUE_CREAGE_REPAIR_GADGET = 111
|
||||
LUA_EVENT_ROGUE_OPEN_ACCESS = 112
|
||||
LUA_EVENT_GADGET_GIVING_FINISHED = 113
|
||||
LUA_EVENT_OBSERVATION_POINT_NOTIFY = 114
|
||||
LUA_EVENT_GADGET_GIVING_TAKEBACK = 115
|
||||
LUA_EVENT_ECHO_SHELL_INTERACT = 116
|
||||
LUA_EVENT_PLATFORM_ARRIVAL = 2701
|
||||
LUA_EVENT_PLAYER_BACK_GALLERY_REVIVE_POINT = 2800
|
||||
LUA_EVENT_GALLERY_CANNOT_START_AFTER_COUNTDOWN = 2801
|
||||
)
|
||||
|
||||
const (
|
||||
REGION_SHAPE_NONE = 0
|
||||
REGION_SHAPE_SPHERE = 1
|
||||
REGION_SHAPE_CUBIC = 2
|
||||
REGION_SHAPE_CYLINDER = 3
|
||||
REGION_SHAPE_POLYGON = 4
|
||||
)
|
||||
@@ -1,33 +1,33 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
MATERIAL_TYPE_NONE uint16 = 0
|
||||
MATERIAL_TYPE_FOOD uint16 = 1
|
||||
MATERIAL_TYPE_QUEST uint16 = 2
|
||||
MATERIAL_TYPE_EXCHANGE uint16 = 4
|
||||
MATERIAL_TYPE_CONSUME uint16 = 5
|
||||
MATERIAL_TYPE_EXP_FRUIT uint16 = 6
|
||||
MATERIAL_TYPE_AVATAR uint16 = 7
|
||||
MATERIAL_TYPE_ADSORBATE uint16 = 8
|
||||
MATERIAL_TYPE_CRICKET uint16 = 9
|
||||
MATERIAL_TYPE_ELEM_CRYSTAL uint16 = 10
|
||||
MATERIAL_TYPE_WEAPON_EXP_STONE uint16 = 11
|
||||
MATERIAL_TYPE_CHEST uint16 = 12
|
||||
MATERIAL_TYPE_RELIQUARY_MATERIAL uint16 = 13
|
||||
MATERIAL_TYPE_AVATAR_MATERIAL uint16 = 14
|
||||
MATERIAL_TYPE_NOTICE_ADD_HP uint16 = 15
|
||||
MATERIAL_TYPE_SEA_LAMP uint16 = 16
|
||||
MATERIAL_TYPE_SELECTABLE_CHEST uint16 = 17
|
||||
MATERIAL_TYPE_FLYCLOAK uint16 = 18
|
||||
MATERIAL_TYPE_NAMECARD uint16 = 19
|
||||
MATERIAL_TYPE_TALENT uint16 = 20
|
||||
MATERIAL_TYPE_WIDGET uint16 = 21
|
||||
MATERIAL_TYPE_CHEST_BATCH_USE uint16 = 22
|
||||
MATERIAL_TYPE_FAKE_ABSORBATE uint16 = 23
|
||||
MATERIAL_TYPE_CONSUME_BATCH_USE uint16 = 24
|
||||
MATERIAL_TYPE_WOOD uint16 = 25
|
||||
MATERIAL_TYPE_FURNITURE_FORMULA uint16 = 27
|
||||
MATERIAL_TYPE_CHANNELLER_SLAB_BUFF uint16 = 28
|
||||
MATERIAL_TYPE_FURNITURE_SUITE_FORMULA uint16 = 29
|
||||
MATERIAL_TYPE_COSTUME uint16 = 30
|
||||
MATERIAL_TYPE_NONE = 0
|
||||
MATERIAL_TYPE_FOOD = 1
|
||||
MATERIAL_TYPE_QUEST = 2
|
||||
MATERIAL_TYPE_EXCHANGE = 4
|
||||
MATERIAL_TYPE_CONSUME = 5
|
||||
MATERIAL_TYPE_EXP_FRUIT = 6
|
||||
MATERIAL_TYPE_AVATAR = 7
|
||||
MATERIAL_TYPE_ADSORBATE = 8
|
||||
MATERIAL_TYPE_CRICKET = 9
|
||||
MATERIAL_TYPE_ELEM_CRYSTAL = 10
|
||||
MATERIAL_TYPE_WEAPON_EXP_STONE = 11
|
||||
MATERIAL_TYPE_CHEST = 12
|
||||
MATERIAL_TYPE_RELIQUARY_MATERIAL = 13
|
||||
MATERIAL_TYPE_AVATAR_MATERIAL = 14
|
||||
MATERIAL_TYPE_NOTICE_ADD_HP = 15
|
||||
MATERIAL_TYPE_SEA_LAMP = 16
|
||||
MATERIAL_TYPE_SELECTABLE_CHEST = 17
|
||||
MATERIAL_TYPE_FLYCLOAK = 18
|
||||
MATERIAL_TYPE_NAMECARD = 19
|
||||
MATERIAL_TYPE_TALENT = 20
|
||||
MATERIAL_TYPE_WIDGET = 21
|
||||
MATERIAL_TYPE_CHEST_BATCH_USE = 22
|
||||
MATERIAL_TYPE_FAKE_ABSORBATE = 23
|
||||
MATERIAL_TYPE_CONSUME_BATCH_USE = 24
|
||||
MATERIAL_TYPE_WOOD = 25
|
||||
MATERIAL_TYPE_FURNITURE_FORMULA = 27
|
||||
MATERIAL_TYPE_CHANNELLER_SLAB_BUFF = 28
|
||||
MATERIAL_TYPE_FURNITURE_SUITE_FORMULA = 29
|
||||
MATERIAL_TYPE_COSTUME = 30
|
||||
)
|
||||
|
||||
@@ -1,15 +1,166 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
QUEST_STATE_TYPE_ACCEPT uint32 = 1
|
||||
QUEST_STATE_TYPE_EXEC uint32 = 2
|
||||
QUEST_STATE_TYPE_FINISH uint32 = 3
|
||||
QUEST_STATE_NONE = 0
|
||||
QUEST_STATE_UNSTARTED = 1
|
||||
QUEST_STATE_UNFINISHED = 2
|
||||
QUEST_STATE_FINISHED = 3
|
||||
QUEST_STATE_FAILED = 4
|
||||
)
|
||||
|
||||
const (
|
||||
QUEST_ACCEPT_COND_TYPE_QUEST_STATE_EQ int32 = 1
|
||||
QUEST_ACCEPT_COND_TYPE_NONE = 0
|
||||
QUEST_ACCEPT_COND_TYPE_STATE_EQUAL = 1
|
||||
QUEST_ACCEPT_COND_TYPE_STATE_NOT_EQUAL = 2
|
||||
QUEST_ACCEPT_COND_TYPE_PACK_HAVE_ITEM = 3
|
||||
QUEST_ACCEPT_COND_TYPE_AVATAR_ELEMENT_EQUAL = 4
|
||||
QUEST_ACCEPT_COND_TYPE_AVATAR_ELEMENT_NOT_EQUAL = 5
|
||||
QUEST_ACCEPT_COND_TYPE_AVATAR_CAN_CHANGE_ELEMENT = 6
|
||||
QUEST_ACCEPT_COND_TYPE_CITY_LEVEL_EQUAL_GREATER = 7
|
||||
QUEST_ACCEPT_COND_TYPE_ITEM_NUM_LESS_THAN = 8
|
||||
QUEST_ACCEPT_COND_TYPE_DAILY_TASK_START = 9
|
||||
QUEST_ACCEPT_COND_TYPE_OPEN_STATE_EQUAL = 10
|
||||
QUEST_ACCEPT_COND_TYPE_DAILY_TASK_OPEN = 11
|
||||
QUEST_ACCEPT_COND_TYPE_DAILY_TASK_REWARD_CAN_GET = 12
|
||||
QUEST_ACCEPT_COND_TYPE_DAILY_TASK_REWARD_RECEIVED = 13
|
||||
QUEST_ACCEPT_COND_TYPE_PLAYER_LEVEL_REWARD_CAN_GET = 14
|
||||
QUEST_ACCEPT_COND_TYPE_EXPLORATION_REWARD_CAN_GET = 15
|
||||
QUEST_ACCEPT_COND_TYPE_IS_WORLD_OWNER = 16
|
||||
QUEST_ACCEPT_COND_TYPE_PLAYER_LEVEL_EQUAL_GREATER = 17
|
||||
QUEST_ACCEPT_COND_TYPE_SCENE_AREA_UNLOCKED = 18
|
||||
QUEST_ACCEPT_COND_TYPE_ITEM_GIVING_ACTIVED = 19
|
||||
QUEST_ACCEPT_COND_TYPE_ITEM_GIVING_FINISHED = 20
|
||||
QUEST_ACCEPT_COND_TYPE_IS_DAYTIME = 21
|
||||
QUEST_ACCEPT_COND_TYPE_CURRENT_AVATAR = 22
|
||||
QUEST_ACCEPT_COND_TYPE_CURRENT_AREA = 23
|
||||
QUEST_ACCEPT_COND_TYPE_QUEST_VAR_EQUAL = 24
|
||||
QUEST_ACCEPT_COND_TYPE_QUEST_VAR_GREATER = 25
|
||||
QUEST_ACCEPT_COND_TYPE_QUEST_VAR_LESS = 26
|
||||
QUEST_ACCEPT_COND_TYPE_FORGE_HAVE_FINISH = 27
|
||||
QUEST_ACCEPT_COND_TYPE_DAILY_TASK_IN_PROGRESS = 28
|
||||
QUEST_ACCEPT_COND_TYPE_DAILY_TASK_FINISHED = 29
|
||||
QUEST_ACCEPT_COND_TYPE_ACTIVITY_COND = 30
|
||||
QUEST_ACCEPT_COND_TYPE_ACTIVITY_OPEN = 31
|
||||
QUEST_ACCEPT_COND_TYPE_DAILY_TASK_VAR_GT = 32
|
||||
QUEST_ACCEPT_COND_TYPE_DAILY_TASK_VAR_EQ = 33
|
||||
QUEST_ACCEPT_COND_TYPE_DAILY_TASK_VAR_LT = 34
|
||||
QUEST_ACCEPT_COND_TYPE_BARGAIN_ITEM_GT = 35
|
||||
QUEST_ACCEPT_COND_TYPE_BARGAIN_ITEM_EQ = 36
|
||||
QUEST_ACCEPT_COND_TYPE_BARGAIN_ITEM_LT = 37
|
||||
QUEST_ACCEPT_COND_TYPE_COMPLETE_TALK = 38
|
||||
QUEST_ACCEPT_COND_TYPE_NOT_HAVE_BLOSSOM_TALK = 39
|
||||
QUEST_ACCEPT_COND_TYPE_IS_CUR_BLOSSOM_TALK = 40
|
||||
QUEST_ACCEPT_COND_TYPE_QUEST_NOT_RECEIVE = 41
|
||||
QUEST_ACCEPT_COND_TYPE_QUEST_SERVER_COND_VALID = 42
|
||||
QUEST_ACCEPT_COND_TYPE_ACTIVITY_CLIENT_COND = 43
|
||||
QUEST_ACCEPT_COND_TYPE_QUEST_GLOBAL_VAR_EQUAL = 44
|
||||
QUEST_ACCEPT_COND_TYPE_QUEST_GLOBAL_VAR_GREATER = 45
|
||||
QUEST_ACCEPT_COND_TYPE_QUEST_GLOBAL_VAR_LESS = 46
|
||||
QUEST_ACCEPT_COND_TYPE_PERSONAL_LINE_UNLOCK = 47
|
||||
QUEST_ACCEPT_COND_TYPE_CITY_REPUTATION_REQUEST = 48
|
||||
QUEST_ACCEPT_COND_TYPE_MAIN_COOP_START = 49
|
||||
QUEST_ACCEPT_COND_TYPE_MAIN_COOP_ENTER_SAVE_POINT = 50
|
||||
QUEST_ACCEPT_COND_TYPE_CITY_REPUTATION_LEVEL = 51
|
||||
QUEST_ACCEPT_COND_TYPE_CITY_REPUTATION_UNLOCK = 52
|
||||
QUEST_ACCEPT_COND_TYPE_LUA_NOTIFY = 53
|
||||
QUEST_ACCEPT_COND_TYPE_CUR_CLIMATE = 54
|
||||
QUEST_ACCEPT_COND_TYPE_ACTIVITY_END = 55
|
||||
QUEST_ACCEPT_COND_TYPE_COOP_POINT_RUNNING = 56
|
||||
QUEST_ACCEPT_COND_TYPE_GADGET_TALK_STATE_EQUAL = 57
|
||||
QUEST_ACCEPT_COND_TYPE_AVATAR_FETTER_GT = 58
|
||||
QUEST_ACCEPT_COND_TYPE_AVATAR_FETTER_EQ = 59
|
||||
QUEST_ACCEPT_COND_TYPE_AVATAR_FETTER_LT = 60
|
||||
QUEST_ACCEPT_COND_TYPE_NEW_HOMEWORLD_MOUDLE_UNLOCK = 61
|
||||
QUEST_ACCEPT_COND_TYPE_NEW_HOMEWORLD_LEVEL_REWARD = 62
|
||||
QUEST_ACCEPT_COND_TYPE_NEW_HOMEWORLD_MAKE_FINISH = 63
|
||||
QUEST_ACCEPT_COND_TYPE_HOMEWORLD_NPC_EVENT = 64
|
||||
QUEST_ACCEPT_COND_TYPE_TIME_VAR_GT_EQ = 65
|
||||
QUEST_ACCEPT_COND_TYPE_TIME_VAR_PASS_DAY = 66
|
||||
QUEST_ACCEPT_COND_TYPE_HOMEWORLD_NPC_NEW_TALK = 67
|
||||
QUEST_ACCEPT_COND_TYPE_PLAYER_CHOOSE_MALE = 68
|
||||
QUEST_ACCEPT_COND_TYPE_HISTORY_GOT_ANY_ITEM = 69
|
||||
QUEST_ACCEPT_COND_TYPE_LEARNED_RECIPE = 70
|
||||
QUEST_ACCEPT_COND_TYPE_LUNARITE_REGION_UNLOCKED = 71
|
||||
QUEST_ACCEPT_COND_TYPE_LUNARITE_HAS_REGION_HINT_COUNT = 72
|
||||
QUEST_ACCEPT_COND_TYPE_LUNARITE_COLLECT_FINISH = 73
|
||||
QUEST_ACCEPT_COND_TYPE_LUNARITE_MARK_ALL_FINISH = 74
|
||||
QUEST_ACCEPT_COND_TYPE_NEW_HOMEWORLD_SHOP_ITEM = 75
|
||||
QUEST_ACCEPT_COND_TYPE_SCENE_POINT_UNLOCK = 76
|
||||
QUEST_ACCEPT_COND_TYPE_SCENE_LEVEL_TAG_EQ = 77
|
||||
)
|
||||
|
||||
const (
|
||||
QUEST_FINISH_COND_TYPE_SCENE_TRIGGER = 6
|
||||
QUEST_FINISH_COND_TYPE_NONE = 0
|
||||
QUEST_FINISH_COND_TYPE_KILL_MONSTER = 1
|
||||
QUEST_FINISH_COND_TYPE_COMPLETE_TALK = 2
|
||||
QUEST_FINISH_COND_TYPE_MONSTER_DIE = 3
|
||||
QUEST_FINISH_COND_TYPE_FINISH_PLOT = 4
|
||||
QUEST_FINISH_COND_TYPE_OBTAIN_ITEM = 5
|
||||
QUEST_FINISH_COND_TYPE_TRIGGER_FIRE = 6
|
||||
QUEST_FINISH_COND_TYPE_CLEAR_GROUP_MONSTER = 7
|
||||
QUEST_FINISH_COND_TYPE_NOT_FINISH_PLOT = 8
|
||||
QUEST_FINISH_COND_TYPE_ENTER_DUNGEON = 9
|
||||
QUEST_FINISH_COND_TYPE_ENTER_MY_WORLD = 10
|
||||
QUEST_FINISH_COND_TYPE_FINISH_DUNGEON = 11
|
||||
QUEST_FINISH_COND_TYPE_DESTROY_GADGET = 12
|
||||
QUEST_FINISH_COND_TYPE_OBTAIN_MATERIAL_WITH_SUBTYPE = 13
|
||||
QUEST_FINISH_COND_TYPE_NICK_NAME = 14
|
||||
QUEST_FINISH_COND_TYPE_WORKTOP_SELECT = 15
|
||||
QUEST_FINISH_COND_TYPE_SEAL_BATTLE_RESULT = 16
|
||||
QUEST_FINISH_COND_TYPE_ENTER_ROOM = 17
|
||||
QUEST_FINISH_COND_TYPE_GAME_TIME_TICK = 18
|
||||
QUEST_FINISH_COND_TYPE_FAIL_DUNGEON = 19
|
||||
QUEST_FINISH_COND_TYPE_LUA_NOTIFY = 20
|
||||
QUEST_FINISH_COND_TYPE_TEAM_DEAD = 21
|
||||
QUEST_FINISH_COND_TYPE_COMPLETE_ANY_TALK = 22
|
||||
QUEST_FINISH_COND_TYPE_UNLOCK_TRANS_POINT = 23
|
||||
QUEST_FINISH_COND_TYPE_ADD_QUEST_PROGRESS = 24
|
||||
QUEST_FINISH_COND_TYPE_INTERACT_GADGET = 25
|
||||
QUEST_FINISH_COND_TYPE_DAILY_TASK_COMP_FINISH = 26
|
||||
QUEST_FINISH_COND_TYPE_FINISH_ITEM_GIVING = 27
|
||||
QUEST_FINISH_COND_TYPE_SKILL = 107
|
||||
QUEST_FINISH_COND_TYPE_CITY_LEVEL_UP = 109
|
||||
QUEST_FINISH_COND_TYPE_PATTERN_GROUP_CLEAR_MONSTER = 110
|
||||
QUEST_FINISH_COND_TYPE_ITEM_LESS_THAN = 111
|
||||
QUEST_FINISH_COND_TYPE_PLAYER_LEVEL_UP = 112
|
||||
QUEST_FINISH_COND_TYPE_DUNGEON_OPEN_STATUE = 113
|
||||
QUEST_FINISH_COND_TYPE_UNLOCK_AREA = 114
|
||||
QUEST_FINISH_COND_TYPE_OPEN_CHEST_WITH_GADGET_ID = 115
|
||||
QUEST_FINISH_COND_TYPE_UNLOCK_TRANS_POINT_WITH_TYPE = 116
|
||||
QUEST_FINISH_COND_TYPE_FINISH_DAILY_DUNGEON = 117
|
||||
QUEST_FINISH_COND_TYPE_FINISH_WEEKLY_DUNGEON = 118
|
||||
QUEST_FINISH_COND_TYPE_QUEST_VAR_EQUAL = 119
|
||||
QUEST_FINISH_COND_TYPE_QUEST_VAR_GREATER = 120
|
||||
QUEST_FINISH_COND_TYPE_QUEST_VAR_LESS = 121
|
||||
QUEST_FINISH_COND_TYPE_OBTAIN_VARIOUS_ITEM = 122
|
||||
QUEST_FINISH_COND_TYPE_FINISH_TOWER_LEVEL = 123
|
||||
QUEST_FINISH_COND_TYPE_BARGAIN_SUCC = 124
|
||||
QUEST_FINISH_COND_TYPE_BARGAIN_FAIL = 125
|
||||
QUEST_FINISH_COND_TYPE_ITEM_LESS_THAN_BARGAIN = 126
|
||||
QUEST_FINISH_COND_TYPE_ACTIVITY_TRIGGER_FAILED = 127
|
||||
QUEST_FINISH_COND_TYPE_MAIN_COOP_ENTER_SAVE_POINT = 128
|
||||
QUEST_FINISH_COND_TYPE_ANY_MANUAL_TRANSPORT = 129
|
||||
QUEST_FINISH_COND_TYPE_USE_ITEM = 130
|
||||
QUEST_FINISH_COND_TYPE_MAIN_COOP_ENTER_ANY_SAVE_POINT = 131
|
||||
QUEST_FINISH_COND_TYPE_ENTER_MY_HOME_WORLD = 132
|
||||
QUEST_FINISH_COND_TYPE_ENTER_MY_WORLD_SCENE = 133
|
||||
QUEST_FINISH_COND_TYPE_TIME_VAR_GT_EQ = 134
|
||||
QUEST_FINISH_COND_TYPE_TIME_VAR_PASS_DAY = 135
|
||||
QUEST_FINISH_COND_TYPE_QUEST_STATE_EQUAL = 136
|
||||
QUEST_FINISH_COND_TYPE_QUEST_STATE_NOT_EQUAL = 137
|
||||
QUEST_FINISH_COND_TYPE_UNLOCKED_RECIPE = 138
|
||||
QUEST_FINISH_COND_TYPE_NOT_UNLOCKED_RECIPE = 139
|
||||
QUEST_FINISH_COND_TYPE_FISHING_SUCC = 140
|
||||
QUEST_FINISH_COND_TYPE_ENTER_ROGUE_DUNGEON = 141
|
||||
QUEST_FINISH_COND_TYPE_USE_WIDGET = 142
|
||||
QUEST_FINISH_COND_TYPE_CAPTURE_SUCC = 143
|
||||
QUEST_FINISH_COND_TYPE_CAPTURE_USE_CAPTURETAG_LIST = 144
|
||||
QUEST_FINISH_COND_TYPE_CAPTURE_USE_MATERIAL_LIST = 145
|
||||
QUEST_FINISH_COND_TYPE_ENTER_VEHICLE = 147
|
||||
QUEST_FINISH_COND_TYPE_SCENE_LEVEL_TAG_EQ = 148
|
||||
QUEST_FINISH_COND_TYPE_LEAVE_SCENE = 149
|
||||
QUEST_FINISH_COND_TYPE_LEAVE_SCENE_RANGE = 150
|
||||
QUEST_FINISH_COND_TYPE_IRODORI_FINISH_FLOWER_COMBINATION = 151
|
||||
QUEST_FINISH_COND_TYPE_IRODORI_POETRY_REACH_MIN_PROGRESS = 152
|
||||
QUEST_FINISH_COND_TYPE_IRODORI_POETRY_FINISH_FILL_POETRY = 153
|
||||
)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
RELIQUARY_TYPE_NONE int32 = 0
|
||||
RELIQUARY_TYPE_FLOWER int32 = 1 // 生之花
|
||||
RELIQUARY_TYPE_FEATHER int32 = 2 // 死之羽
|
||||
RELIQUARY_TYPE_SAND int32 = 3 // 时之沙
|
||||
RELIQUARY_TYPE_CUP int32 = 4 // 空之杯
|
||||
RELIQUARY_TYPE_CROWN int32 = 5 // 理之冠
|
||||
RELIQUARY_TYPE_NONE = 0
|
||||
RELIQUARY_TYPE_FLOWER = 1 // 生之花
|
||||
RELIQUARY_TYPE_FEATHER = 2 // 死之羽
|
||||
RELIQUARY_TYPE_SAND = 3 // 时之沙
|
||||
RELIQUARY_TYPE_CUP = 4 // 空之杯
|
||||
RELIQUARY_TYPE_CROWN = 5 // 理之冠
|
||||
)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
SCENE_TYPE_NONE uint16 = 0
|
||||
SCENE_TYPE_WORLD uint16 = 1
|
||||
SCENE_TYPE_DUNGEON uint16 = 2
|
||||
SCENE_TYPE_ROOM uint16 = 3
|
||||
SCENE_TYPE_HOME_WORLD uint16 = 4
|
||||
SCENE_TYPE_HOME_ROOM uint16 = 5
|
||||
SCENE_TYPE_ACTIVITY uint16 = 6
|
||||
SCENE_TYPE_NONE = 0
|
||||
SCENE_TYPE_WORLD = 1
|
||||
SCENE_TYPE_DUNGEON = 2
|
||||
SCENE_TYPE_ROOM = 3
|
||||
SCENE_TYPE_HOME_WORLD = 4
|
||||
SCENE_TYPE_HOME_ROOM = 5
|
||||
SCENE_TYPE_ACTIVITY = 6
|
||||
)
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
WEAPON_TYPE_NONE int32 = 0
|
||||
WEAPON_TYPE_SWORD_ONE_HAND int32 = 1 // 单手剑
|
||||
WEAPON_TYPE_CROSSBOW int32 = 2 // 弩
|
||||
WEAPON_TYPE_STAFF int32 = 3 // 权杖
|
||||
WEAPON_TYPE_DOUBLE_DAGGER int32 = 4 // 双刀
|
||||
WEAPON_TYPE_KATANA int32 = 5 // 武士刀
|
||||
WEAPON_TYPE_SHURIKEN int32 = 6 // 手里剑
|
||||
WEAPON_TYPE_STICK int32 = 7 // 棍
|
||||
WEAPON_TYPE_SPEAR int32 = 8 // 矛
|
||||
WEAPON_TYPE_SHIELD_SMALL int32 = 9 // 小盾牌
|
||||
WEAPON_TYPE_CATALYST int32 = 10 // 法器
|
||||
WEAPON_TYPE_CLAYMORE int32 = 11 // 双手剑
|
||||
WEAPON_TYPE_BOW int32 = 12 // 弓
|
||||
WEAPON_TYPE_POLE int32 = 13 // 长枪
|
||||
WEAPON_TYPE_NONE = 0
|
||||
WEAPON_TYPE_SWORD_ONE_HAND = 1 // 单手剑
|
||||
WEAPON_TYPE_CROSSBOW = 2 // 弩
|
||||
WEAPON_TYPE_STAFF = 3 // 权杖
|
||||
WEAPON_TYPE_DOUBLE_DAGGER = 4 // 双刀
|
||||
WEAPON_TYPE_KATANA = 5 // 武士刀
|
||||
WEAPON_TYPE_SHURIKEN = 6 // 手里剑
|
||||
WEAPON_TYPE_STICK = 7 // 棍
|
||||
WEAPON_TYPE_SPEAR = 8 // 矛
|
||||
WEAPON_TYPE_SHIELD_SMALL = 9 // 小盾牌
|
||||
WEAPON_TYPE_CATALYST = 10 // 法器
|
||||
WEAPON_TYPE_CLAYMORE = 11 // 双手剑
|
||||
WEAPON_TYPE_BOW = 12 // 弓
|
||||
WEAPON_TYPE_POLE = 13 // 长枪
|
||||
)
|
||||
|
||||
@@ -201,8 +201,8 @@ func (f *FightRoutine) onTickSecond(now int64) {
|
||||
if entity.uid == 0 {
|
||||
continue
|
||||
}
|
||||
entity.fightPropMap[uint32(constant.FIGHT_PROP_CUR_ATTACK)] = 1000000
|
||||
entity.fightPropMap[uint32(constant.FIGHT_PROP_CRITICAL)] = 1.0
|
||||
entity.fightPropMap[constant.FIGHT_PROP_CUR_ATTACK] = 1000000
|
||||
entity.fightPropMap[constant.FIGHT_PROP_CRITICAL] = 1.0
|
||||
avatarFightPropNotify := &proto.AvatarFightPropNotify{
|
||||
AvatarGuid: entity.avatarGuid,
|
||||
FightPropMap: entity.fightPropMap,
|
||||
@@ -262,17 +262,17 @@ func (f *FightRoutine) attackHandle(gameMsg *mq.GameMsg) {
|
||||
_ = attackerId
|
||||
currHp := float32(0)
|
||||
if target.fightPropMap != nil {
|
||||
currHp = target.fightPropMap[uint32(constant.FIGHT_PROP_CUR_HP)]
|
||||
currHp = target.fightPropMap[constant.FIGHT_PROP_CUR_HP]
|
||||
currHp -= damage
|
||||
if currHp < 0 {
|
||||
currHp = 0
|
||||
}
|
||||
target.fightPropMap[uint32(constant.FIGHT_PROP_CUR_HP)] = currHp
|
||||
target.fightPropMap[constant.FIGHT_PROP_CUR_HP] = currHp
|
||||
}
|
||||
entityFightPropUpdateNotify := new(proto.EntityFightPropUpdateNotify)
|
||||
entityFightPropUpdateNotify.EntityId = target.entityId
|
||||
entityFightPropUpdateNotify.FightPropMap = make(map[uint32]float32)
|
||||
entityFightPropUpdateNotify.FightPropMap[uint32(constant.FIGHT_PROP_CUR_HP)] = currHp
|
||||
entityFightPropUpdateNotify.FightPropMap[constant.FIGHT_PROP_CUR_HP] = currHp
|
||||
for _, uid := range f.getAllPlayer(f.entityMap) {
|
||||
SendMsg(f.messageQueue, cmd.EntityFightPropUpdateNotify, uid, f.gateAppId, entityFightPropUpdateNotify)
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ import (
|
||||
// AvatarData 角色配置表
|
||||
type AvatarData struct {
|
||||
AvatarId int32 `csv:"AvatarId"` // ID
|
||||
HpBase float64 `csv:"HpBase,omitempty"` // 基础生命值
|
||||
AttackBase float64 `csv:"AttackBase,omitempty"` // 基础攻击力
|
||||
DefenseBase float64 `csv:"DefenseBase,omitempty"` // 基础防御力
|
||||
Critical float64 `csv:"Critical,omitempty"` // 暴击率
|
||||
CriticalHurt float64 `csv:"CriticalHurt,omitempty"` // 暴击伤害
|
||||
HpBase float32 `csv:"HpBase,omitempty"` // 基础生命值
|
||||
AttackBase float32 `csv:"AttackBase,omitempty"` // 基础攻击力
|
||||
DefenseBase float32 `csv:"DefenseBase,omitempty"` // 基础防御力
|
||||
Critical float32 `csv:"Critical,omitempty"` // 暴击率
|
||||
CriticalHurt float32 `csv:"CriticalHurt,omitempty"` // 暴击伤害
|
||||
QualityType int32 `csv:"QualityType,omitempty"` // 角色品质
|
||||
ConfigJson string `csv:"ConfigJson,omitempty"` // 战斗config
|
||||
InitialWeapon int32 `csv:"InitialWeapon,omitempty"` // 初始武器
|
||||
@@ -107,14 +107,14 @@ func GetAvatarDataMap() map[int32]*AvatarData {
|
||||
|
||||
// TODO 成长属性要读表
|
||||
|
||||
func (a *AvatarData) GetBaseHpByLevel(level uint8) float64 {
|
||||
return a.HpBase * float64(level)
|
||||
func (a *AvatarData) GetBaseHpByLevel(level uint8) float32 {
|
||||
return a.HpBase * float32(level)
|
||||
}
|
||||
|
||||
func (a *AvatarData) GetBaseAttackByLevel(level uint8) float64 {
|
||||
return a.AttackBase * float64(level)
|
||||
func (a *AvatarData) GetBaseAttackByLevel(level uint8) float32 {
|
||||
return a.AttackBase * float32(level)
|
||||
}
|
||||
|
||||
func (a *AvatarData) GetBaseDefenseByLevel(level uint8) float64 {
|
||||
return a.DefenseBase * float64(level)
|
||||
func (a *AvatarData) GetBaseDefenseByLevel(level uint8) float32 {
|
||||
return a.DefenseBase * float32(level)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"time"
|
||||
|
||||
"hk4e/common/config"
|
||||
"hk4e/common/constant"
|
||||
"hk4e/pkg/logger"
|
||||
|
||||
lua "github.com/yuin/gopher-lua"
|
||||
@@ -172,18 +173,22 @@ func RegScriptLib(fnName string, fn lua.LGFunction) {
|
||||
func initLuaState(luaState *lua.LState) {
|
||||
eventType := luaState.NewTable()
|
||||
luaState.SetGlobal("EventType", eventType)
|
||||
luaState.SetField(eventType, "NONE", lua.LNumber(0))
|
||||
luaState.SetField(eventType, "EVENT_ENTER_REGION", lua.LNumber(1))
|
||||
luaState.SetField(eventType, "EVENT_NONE", lua.LNumber(constant.LUA_EVENT_NONE))
|
||||
luaState.SetField(eventType, "EVENT_ENTER_REGION", lua.LNumber(constant.LUA_EVENT_ENTER_REGION))
|
||||
luaState.SetField(eventType, "EVENT_LEAVE_REGION", lua.LNumber(constant.LUA_EVENT_LEAVE_REGION))
|
||||
|
||||
entityType := luaState.NewTable()
|
||||
luaState.SetGlobal("EntityType", entityType)
|
||||
luaState.SetField(entityType, "NONE", lua.LNumber(0))
|
||||
luaState.SetField(entityType, "AVATAR", lua.LNumber(1))
|
||||
luaState.SetField(entityType, "NONE", lua.LNumber(constant.ENTITY_TYPE_NONE))
|
||||
luaState.SetField(entityType, "AVATAR", lua.LNumber(constant.ENTITY_TYPE_AVATAR))
|
||||
|
||||
regionShape := luaState.NewTable()
|
||||
luaState.SetGlobal("RegionShape", regionShape)
|
||||
luaState.SetField(regionShape, "NONE", lua.LNumber(0))
|
||||
luaState.SetField(regionShape, "SPHERE", lua.LNumber(1))
|
||||
luaState.SetField(regionShape, "NONE", lua.LNumber(constant.REGION_SHAPE_NONE))
|
||||
luaState.SetField(regionShape, "SPHERE", lua.LNumber(constant.REGION_SHAPE_SPHERE))
|
||||
luaState.SetField(regionShape, "CUBIC", lua.LNumber(constant.REGION_SHAPE_CUBIC))
|
||||
luaState.SetField(regionShape, "CYLINDER", lua.LNumber(constant.REGION_SHAPE_CYLINDER))
|
||||
luaState.SetField(regionShape, "POLYGON", lua.LNumber(constant.REGION_SHAPE_POLYGON))
|
||||
|
||||
questState := luaState.NewTable()
|
||||
luaState.SetGlobal("QuestState", questState)
|
||||
|
||||
@@ -62,7 +62,7 @@ func (g *GameDataConfig) loadItemData() {
|
||||
itemData.SkillAffix = append(itemData.SkillAffix, itemData.SkillAffix2)
|
||||
}
|
||||
// 武器精炼摩拉消耗列表读取转换
|
||||
if itemData.Type == int32(constant.ITEM_TYPE_WEAPON) && itemData.AwakenCoinCostStr != "" {
|
||||
if itemData.Type == constant.ITEM_TYPE_WEAPON && itemData.AwakenCoinCostStr != "" {
|
||||
tempCostList := strings.Split(strings.ReplaceAll(itemData.AwakenCoinCostStr, " ", ""), "#")
|
||||
itemData.AwakenCoinCostList = make([]uint32, 0, len(tempCostList))
|
||||
for _, s := range tempCostList {
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"hk4e/pkg/logger"
|
||||
|
||||
@@ -16,6 +17,8 @@ const (
|
||||
SceneGroupLoaderLimit = 4 // 加载文件的并发数 此操作很耗内存 调大之前请确保你的机器内存足够
|
||||
)
|
||||
|
||||
var OBJECT_ID_COUNTER uint64
|
||||
|
||||
type SceneLuaConfig struct {
|
||||
Id int32
|
||||
SceneConfig *SceneConfig // 地图配置
|
||||
@@ -54,14 +57,15 @@ type Group struct {
|
||||
RefreshId int32 `json:"refresh_id"`
|
||||
Area int32 `json:"area"`
|
||||
Pos *Vector `json:"pos"`
|
||||
DynamicLoad bool `json:"dynamic_load"`
|
||||
IsReplaceable *Replaceable `json:"is_replaceable"`
|
||||
MonsterList []*Monster `json:"monsters"` // 怪物
|
||||
NpcList []*Npc `json:"npcs"` // NPC
|
||||
GadgetList []*Gadget `json:"gadgets"` // 物件
|
||||
RegionList []*Region `json:"regions"`
|
||||
TriggerList []*Trigger `json:"triggers"`
|
||||
LuaStr string
|
||||
LuaState *lua.LState
|
||||
LuaStr string `json:"-"`
|
||||
LuaState *lua.LState `json:"-"`
|
||||
}
|
||||
|
||||
type Replaceable struct {
|
||||
@@ -77,6 +81,7 @@ type Monster struct {
|
||||
Rot *Vector `json:"rot"`
|
||||
Level int32 `json:"level"`
|
||||
AreaId int32 `json:"area_id"`
|
||||
ObjectId uint64 `json:"-"`
|
||||
}
|
||||
|
||||
type Npc struct {
|
||||
@@ -85,6 +90,7 @@ type Npc struct {
|
||||
Pos *Vector `json:"pos"`
|
||||
Rot *Vector `json:"rot"`
|
||||
AreaId int32 `json:"area_id"`
|
||||
ObjectId uint64 `json:"-"`
|
||||
}
|
||||
|
||||
type Gadget struct {
|
||||
@@ -95,15 +101,18 @@ type Gadget struct {
|
||||
Level int32 `json:"level"`
|
||||
AreaId int32 `json:"area_id"`
|
||||
PointType int32 `json:"point_type"` // 关联GatherData表
|
||||
ObjectId uint64 `json:"-"`
|
||||
}
|
||||
|
||||
type Region struct {
|
||||
ConfigId int32 `json:"config_id"`
|
||||
Shape int32 `json:"shape"`
|
||||
Radius float32 `json:"radius"`
|
||||
Size *Vector `json:"size"`
|
||||
Pos *Vector `json:"pos"`
|
||||
AreaId int32 `json:"area_id"`
|
||||
ConfigId int32 `json:"config_id"`
|
||||
Shape int32 `json:"shape"`
|
||||
Radius float32 `json:"radius"`
|
||||
Size *Vector `json:"size"`
|
||||
Pos *Vector `json:"pos"`
|
||||
Height float32 `json:"height"`
|
||||
PointArray []*Vector `json:"point_array"`
|
||||
AreaId int32 `json:"area_id"`
|
||||
}
|
||||
|
||||
type Trigger struct {
|
||||
@@ -136,6 +145,9 @@ func (g *GameDataConfig) loadGroup(group *Group, block *Block, sceneId int32, bl
|
||||
logger.Error("get monsters object error, sceneId: %v, blockId: %v, groupId: %v", sceneId, blockId, groupId)
|
||||
return
|
||||
}
|
||||
for _, monster := range group.MonsterList {
|
||||
monster.ObjectId = atomic.AddUint64(&OBJECT_ID_COUNTER, 1)
|
||||
}
|
||||
// npcs
|
||||
group.NpcList = make([]*Npc, 0)
|
||||
ok = parseLuaTableToObject[*[]*Npc](luaState, "npcs", &group.NpcList)
|
||||
@@ -143,6 +155,9 @@ func (g *GameDataConfig) loadGroup(group *Group, block *Block, sceneId int32, bl
|
||||
logger.Error("get npcs object error, sceneId: %v, blockId: %v, groupId: %v", sceneId, blockId, groupId)
|
||||
return
|
||||
}
|
||||
for _, npc := range group.NpcList {
|
||||
npc.ObjectId = atomic.AddUint64(&OBJECT_ID_COUNTER, 1)
|
||||
}
|
||||
// gadgets
|
||||
group.GadgetList = make([]*Gadget, 0)
|
||||
ok = parseLuaTableToObject[*[]*Gadget](luaState, "gadgets", &group.GadgetList)
|
||||
@@ -150,6 +165,9 @@ func (g *GameDataConfig) loadGroup(group *Group, block *Block, sceneId int32, bl
|
||||
logger.Error("get gadgets object error, sceneId: %v, blockId: %v, groupId: %v", sceneId, blockId, groupId)
|
||||
return
|
||||
}
|
||||
for _, gadget := range group.GadgetList {
|
||||
gadget.ObjectId = atomic.AddUint64(&OBJECT_ID_COUNTER, 1)
|
||||
}
|
||||
// regions
|
||||
group.RegionList = make([]*Region, 0)
|
||||
ok = parseLuaTableToObject[*[]*Region](luaState, "regions", &group.RegionList)
|
||||
@@ -170,6 +188,7 @@ func (g *GameDataConfig) loadGroup(group *Group, block *Block, sceneId int32, bl
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) loadSceneLuaConfig() {
|
||||
OBJECT_ID_COUNTER = 0
|
||||
g.SceneLuaConfigMap = make(map[int32]*SceneLuaConfig)
|
||||
sceneLuaPrefix := g.luaPrefix + "scene/"
|
||||
for _, sceneData := range g.SceneDataMap {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
"hk4e/common/constant"
|
||||
"hk4e/gdconf"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/proto"
|
||||
)
|
||||
|
||||
// GMTeleportPlayer 传送玩家
|
||||
@@ -14,7 +14,7 @@ func (c *CommandManager) GMTeleportPlayer(userId, sceneId uint32, posX, posY, po
|
||||
logger.Error("player is nil, uid: %v", userId)
|
||||
return
|
||||
}
|
||||
GAME_MANAGER.TeleportPlayer(player, constant.EnterReasonGm, sceneId, &model.Vector{
|
||||
GAME_MANAGER.TeleportPlayer(player, uint16(proto.EnterReason_ENTER_REASON_GM), sceneId, &model.Vector{
|
||||
X: posX,
|
||||
Y: posY,
|
||||
Z: posZ,
|
||||
|
||||
@@ -167,5 +167,7 @@ func (l *LocalEventManager) LocalEventHandle(localEvent *LocalEvent) {
|
||||
}()
|
||||
case ReloadGameDataConfigFinish:
|
||||
gdconf.ReplaceGameDataConfig()
|
||||
// TODO 参考更表一样改成异步加载
|
||||
WORLD_MANAGER.LoadSceneBlockAoiMap()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,14 +440,14 @@ func (g *GameManager) PacketAvatarInfo(avatar *model.Avatar) *proto.AvatarInfo {
|
||||
for _, v := range avatar.FetterList {
|
||||
pbAvatar.FetterInfo.FetterList = append(pbAvatar.FetterInfo.FetterList, &proto.FetterData{
|
||||
FetterId: v,
|
||||
FetterState: uint32(constant.FETTER_STATE_FINISH),
|
||||
FetterState: constant.FETTER_STATE_FINISH,
|
||||
})
|
||||
}
|
||||
// 解锁全部资料
|
||||
for _, v := range gdconf.GetFetterIdListByAvatarId(int32(avatar.AvatarId)) {
|
||||
pbAvatar.FetterInfo.FetterList = append(pbAvatar.FetterInfo.FetterList, &proto.FetterData{
|
||||
FetterId: uint32(v),
|
||||
FetterState: uint32(constant.FETTER_STATE_FINISH),
|
||||
FetterState: constant.FETTER_STATE_FINISH,
|
||||
})
|
||||
}
|
||||
// 突破等级奖励
|
||||
|
||||
@@ -314,7 +314,7 @@ func (g *GameManager) PacketAvatarEquipChangeNotifyByWeapon(avatar *model.Avatar
|
||||
AvatarGuid: avatar.Guid,
|
||||
ItemId: weapon.ItemId,
|
||||
EquipGuid: weapon.Guid,
|
||||
EquipType: uint32(constant.EQUIP_TYPE_WEAPON),
|
||||
EquipType: constant.EQUIP_TYPE_WEAPON,
|
||||
Weapon: &proto.SceneWeaponInfo{
|
||||
EntityId: entityId,
|
||||
GadgetId: uint32(weaponConfig.GadgetId),
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
"math"
|
||||
|
||||
"hk4e/common/config"
|
||||
"hk4e/common/constant"
|
||||
"hk4e/common/utils"
|
||||
"hk4e/gdconf"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/pkg/alg"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/pkg/reflection"
|
||||
"hk4e/protocol/cmd"
|
||||
@@ -147,19 +151,19 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
|
||||
currHp := float32(0)
|
||||
fightProp := target.GetFightProp()
|
||||
if fightProp != nil {
|
||||
currHp = fightProp[uint32(constant.FIGHT_PROP_CUR_HP)]
|
||||
currHp = fightProp[constant.FIGHT_PROP_CUR_HP]
|
||||
currHp -= damage
|
||||
if currHp < 0 {
|
||||
currHp = 0
|
||||
}
|
||||
fightProp[uint32(constant.FIGHT_PROP_CUR_HP)] = currHp
|
||||
fightProp[constant.FIGHT_PROP_CUR_HP] = currHp
|
||||
}
|
||||
entityFightPropUpdateNotify := &proto.EntityFightPropUpdateNotify{
|
||||
FightPropMap: fightProp,
|
||||
EntityId: target.GetId(),
|
||||
}
|
||||
g.SendToWorldA(world, cmd.EntityFightPropUpdateNotify, player.ClientSeq, entityFightPropUpdateNotify)
|
||||
if currHp == 0 && target.GetAvatarEntity() == nil {
|
||||
if currHp == 0 && target.GetEntityType() != constant.ENTITY_TYPE_AVATAR {
|
||||
scene.SetEntityLifeState(target, constant.LIFE_STATE_DEAD, proto.PlayerDieType_PLAYER_DIE_GM)
|
||||
}
|
||||
combatData, err := pb.Marshal(hitInfo)
|
||||
@@ -195,13 +199,13 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
|
||||
if sceneEntity == nil {
|
||||
continue
|
||||
}
|
||||
if sceneEntity.GetAvatarEntity() != nil {
|
||||
if sceneEntity.GetEntityType() == constant.ENTITY_TYPE_AVATAR {
|
||||
// 玩家实体在移动
|
||||
g.AoiPlayerMove(player, player.Pos, &model.Vector{
|
||||
X: float64(motionInfo.Pos.X),
|
||||
Y: float64(motionInfo.Pos.Y),
|
||||
Z: float64(motionInfo.Pos.Z),
|
||||
})
|
||||
}, sceneEntity.GetId())
|
||||
// 更新玩家的位置信息
|
||||
player.Pos.X = float64(motionInfo.Pos.X)
|
||||
player.Pos.Y = float64(motionInfo.Pos.Y)
|
||||
@@ -223,13 +227,15 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
|
||||
rot.X = float64(motionInfo.Rot.X)
|
||||
rot.Y = float64(motionInfo.Rot.Y)
|
||||
rot.Z = float64(motionInfo.Rot.Z)
|
||||
// 载具耐力消耗
|
||||
gadgetEntity := sceneEntity.GetGadgetEntity()
|
||||
if gadgetEntity != nil && gadgetEntity.GetGadgetVehicleEntity() != nil {
|
||||
// 处理耐力消耗
|
||||
g.ImmediateStamina(player, motionInfo.State)
|
||||
// 处理载具销毁请求
|
||||
g.VehicleDestroyMotion(player, sceneEntity, motionInfo.State)
|
||||
if sceneEntity.GetEntityType() == constant.ENTITY_TYPE_GADGET {
|
||||
// 载具耐力消耗
|
||||
gadgetEntity := sceneEntity.GetGadgetEntity()
|
||||
if gadgetEntity.GetGadgetVehicleEntity() != nil {
|
||||
// 处理耐力消耗
|
||||
g.ImmediateStamina(player, motionInfo.State)
|
||||
// 处理载具销毁请求
|
||||
g.VehicleDestroyMotion(player, sceneEntity, motionInfo.State)
|
||||
}
|
||||
}
|
||||
}
|
||||
sceneEntity.SetMoveState(uint16(motionInfo.State))
|
||||
@@ -278,67 +284,181 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
|
||||
}
|
||||
}
|
||||
|
||||
func (g *GameManager) AoiPlayerMove(player *model.Player, oldPos *model.Vector, newPos *model.Vector) {
|
||||
sceneBlockAoiMap := WORLD_MANAGER.GetSceneBlockAoiMap()
|
||||
aoiManager, exist := sceneBlockAoiMap[player.SceneId]
|
||||
func (g *GameManager) AoiPlayerMove(player *model.Player, oldPos *model.Vector, newPos *model.Vector, entityId uint32) {
|
||||
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
||||
scene := world.GetSceneById(player.SceneId)
|
||||
if scene == nil {
|
||||
logger.Error("scene is nil, sceneId: %v", player.SceneId)
|
||||
if world == nil {
|
||||
logger.Error("get player world is nil, uid: %v", player.PlayerID)
|
||||
return
|
||||
}
|
||||
if exist {
|
||||
oldGid := aoiManager.GetGidByPos(float32(oldPos.X), 0.0, float32(oldPos.Z))
|
||||
newGid := aoiManager.GetGidByPos(float32(newPos.X), 0.0, float32(newPos.Z))
|
||||
if oldGid != newGid {
|
||||
// 跨越了格子
|
||||
oldGridList := aoiManager.GetSurrGridListByGid(oldGid)
|
||||
oldObjectMap := make(map[int64]any)
|
||||
for _, grid := range oldGridList {
|
||||
tmp := grid.GetObjectList()
|
||||
for k, v := range tmp {
|
||||
oldObjectMap[k] = v
|
||||
}
|
||||
scene := world.GetSceneById(player.SceneId)
|
||||
sceneBlockAoiMap := WORLD_MANAGER.GetSceneBlockAoiMap()
|
||||
aoiManager, exist := sceneBlockAoiMap[player.SceneId]
|
||||
if !exist {
|
||||
logger.Error("get scene block aoi is nil, sceneId: %v, uid: %v", player.SceneId, player.PlayerID)
|
||||
return
|
||||
}
|
||||
oldGid := aoiManager.GetGidByPos(float32(oldPos.X), 0.0, float32(oldPos.Z))
|
||||
newGid := aoiManager.GetGidByPos(float32(newPos.X), 0.0, float32(newPos.Z))
|
||||
if oldGid != newGid {
|
||||
// 跨越了block格子
|
||||
logger.Debug("player cross grid, oldGid: %v, newGid: %v, uid: %v", oldGid, newGid, player.PlayerID)
|
||||
}
|
||||
// 旧位置视野范围内的group
|
||||
oldVisionGroupMap := make(map[uint32]*gdconf.Group)
|
||||
oldGroupList := aoiManager.GetObjectListByPos(float32(oldPos.X), 0.0, float32(oldPos.Z))
|
||||
for groupId, groupAny := range oldGroupList {
|
||||
group := groupAny.(*gdconf.Group)
|
||||
distance2D := math.Sqrt(math.Pow(oldPos.X-float64(group.Pos.X), 2.0) + math.Pow(oldPos.Z-float64(group.Pos.Z), 2.0))
|
||||
if distance2D > ENTITY_LOD {
|
||||
continue
|
||||
}
|
||||
oldVisionGroupMap[uint32(groupId)] = group
|
||||
}
|
||||
// 新位置视野范围内的group
|
||||
newVisionGroupMap := make(map[uint32]*gdconf.Group)
|
||||
newGroupList := aoiManager.GetObjectListByPos(float32(newPos.X), 0.0, float32(newPos.Z))
|
||||
for groupId, groupAny := range newGroupList {
|
||||
group := groupAny.(*gdconf.Group)
|
||||
distance2D := math.Sqrt(math.Pow(newPos.X-float64(group.Pos.X), 2.0) + math.Pow(newPos.Z-float64(group.Pos.Z), 2.0))
|
||||
if distance2D > ENTITY_LOD {
|
||||
continue
|
||||
}
|
||||
newVisionGroupMap[uint32(groupId)] = group
|
||||
}
|
||||
// 消失的场景实体
|
||||
delEntityIdList := make([]uint32, 0)
|
||||
for groupId, group := range oldVisionGroupMap {
|
||||
_, exist := newVisionGroupMap[groupId]
|
||||
if exist {
|
||||
continue
|
||||
}
|
||||
// 旧有新没有的group即为消失的
|
||||
for _, monster := range group.MonsterList {
|
||||
entity := scene.GetEntityByObjectId(monster.ObjectId)
|
||||
if entity == nil {
|
||||
continue
|
||||
}
|
||||
newGridList := aoiManager.GetSurrGridListByGid(newGid)
|
||||
newObjectMap := make(map[int64]any)
|
||||
for _, grid := range newGridList {
|
||||
tmp := grid.GetObjectList()
|
||||
for k, v := range tmp {
|
||||
newObjectMap[k] = v
|
||||
}
|
||||
scene.DestroyEntity(entity.GetId())
|
||||
delEntityIdList = append(delEntityIdList, entity.GetId())
|
||||
}
|
||||
for _, npc := range group.NpcList {
|
||||
entity := scene.GetEntityByObjectId(npc.ObjectId)
|
||||
if entity == nil {
|
||||
continue
|
||||
}
|
||||
delEntityIdList := make([]uint32, 0)
|
||||
for oldObjectId := range oldObjectMap {
|
||||
_, exist := newObjectMap[oldObjectId]
|
||||
if exist {
|
||||
continue
|
||||
}
|
||||
entity := scene.GetEntityByObjectId(oldObjectId)
|
||||
if entity == nil {
|
||||
continue
|
||||
}
|
||||
scene.DestroyEntity(entity.GetId())
|
||||
delEntityIdList = append(delEntityIdList, entity.GetId())
|
||||
scene.DestroyEntity(entity.GetId())
|
||||
delEntityIdList = append(delEntityIdList, entity.GetId())
|
||||
}
|
||||
for _, gadget := range group.GadgetList {
|
||||
entity := scene.GetEntityByObjectId(gadget.ObjectId)
|
||||
if entity == nil {
|
||||
continue
|
||||
}
|
||||
addEntityIdList := make([]uint32, 0)
|
||||
for newObjectId, newObject := range newObjectMap {
|
||||
_, exist := oldObjectMap[newObjectId]
|
||||
if exist {
|
||||
continue
|
||||
}
|
||||
entityId := g.CreateConfigEntity(scene, newObjectId, newObject)
|
||||
if entityId == 0 {
|
||||
continue
|
||||
}
|
||||
addEntityIdList = append(addEntityIdList, entityId)
|
||||
}
|
||||
// 发送已消失格子里的实体消失通知
|
||||
g.RemoveSceneEntityNotifyToPlayer(player, proto.VisionType_VISION_MISS, delEntityIdList)
|
||||
// 发送新出现格子里的实体出现通知
|
||||
g.AddSceneEntityNotify(player, proto.VisionType_VISION_MEET, addEntityIdList, false, false)
|
||||
scene.DestroyEntity(entity.GetId())
|
||||
delEntityIdList = append(delEntityIdList, entity.GetId())
|
||||
}
|
||||
}
|
||||
// 出现的场景实体
|
||||
addEntityIdList := make([]uint32, 0)
|
||||
for groupId, group := range newVisionGroupMap {
|
||||
_, exist := oldVisionGroupMap[groupId]
|
||||
if exist {
|
||||
continue
|
||||
}
|
||||
// 新有旧没有的group即为出现的
|
||||
for _, monster := range group.MonsterList {
|
||||
entityId := g.CreateConfigEntity(scene, monster.ObjectId, monster)
|
||||
addEntityIdList = append(addEntityIdList, entityId)
|
||||
}
|
||||
for _, npc := range group.NpcList {
|
||||
entityId := g.CreateConfigEntity(scene, npc.ObjectId, npc)
|
||||
addEntityIdList = append(addEntityIdList, entityId)
|
||||
}
|
||||
for _, gadget := range group.GadgetList {
|
||||
entityId := g.CreateConfigEntity(scene, gadget.ObjectId, gadget)
|
||||
addEntityIdList = append(addEntityIdList, entityId)
|
||||
}
|
||||
}
|
||||
// 同步客户端消失和出现的场景实体
|
||||
g.RemoveSceneEntityNotifyToPlayer(player, proto.VisionType_VISION_MISS, delEntityIdList)
|
||||
g.AddSceneEntityNotify(player, proto.VisionType_VISION_MEET, addEntityIdList, false, false)
|
||||
// 场景区域触发器
|
||||
dbQuest := player.GetDbQuest()
|
||||
for _, group := range newVisionGroupMap {
|
||||
for _, region := range group.RegionList {
|
||||
shape := alg.NewShape()
|
||||
switch uint8(region.Shape) {
|
||||
case constant.REGION_SHAPE_SPHERE:
|
||||
shape.NewSphere(&alg.Vector3{X: region.Pos.X, Y: region.Pos.Y, Z: region.Pos.Z}, region.Radius)
|
||||
case constant.REGION_SHAPE_CUBIC:
|
||||
shape.NewCubic(&alg.Vector3{X: region.Pos.X, Y: region.Pos.Y, Z: region.Pos.Z},
|
||||
&alg.Vector3{X: region.Size.X, Y: region.Size.Y, Z: region.Size.Z})
|
||||
case constant.REGION_SHAPE_CYLINDER:
|
||||
shape.NewCylinder(&alg.Vector3{X: region.Pos.X, Y: region.Pos.Y, Z: region.Pos.Z},
|
||||
region.Radius, region.Height)
|
||||
case constant.REGION_SHAPE_POLYGON:
|
||||
vector2PointArray := make([]*alg.Vector2, 0)
|
||||
for _, vector := range region.PointArray {
|
||||
// z就是y
|
||||
vector2PointArray = append(vector2PointArray, &alg.Vector2{X: vector.X, Z: vector.Y})
|
||||
}
|
||||
shape.NewPolygon(&alg.Vector3{X: region.Pos.X, Y: region.Pos.Y, Z: region.Pos.Z},
|
||||
vector2PointArray, region.Height)
|
||||
}
|
||||
oldPosInRegion := shape.Contain(&alg.Vector3{
|
||||
X: float32(oldPos.X),
|
||||
Y: float32(oldPos.Y),
|
||||
Z: float32(oldPos.Z),
|
||||
})
|
||||
newPosInRegion := shape.Contain(&alg.Vector3{
|
||||
X: float32(newPos.X),
|
||||
Y: float32(newPos.Y),
|
||||
Z: float32(newPos.Z),
|
||||
})
|
||||
if !oldPosInRegion && newPosInRegion {
|
||||
// EVENT_ENTER_REGION
|
||||
logger.Debug("player enter region: %v, uid: %v", region, player.PlayerID)
|
||||
for _, trigger := range group.TriggerList {
|
||||
if trigger.Event != constant.LUA_EVENT_ENTER_REGION {
|
||||
continue
|
||||
}
|
||||
cond := CallLuaFunc(group.LuaState, trigger.Condition, &LuaCtx{
|
||||
uid: player.PlayerID,
|
||||
}, &LuaEvt{
|
||||
param1: region.ConfigId,
|
||||
targetEntityId: entityId,
|
||||
})
|
||||
if !cond {
|
||||
continue
|
||||
}
|
||||
// TODO 这一块写得太炸裂了需要优化
|
||||
for _, triggerDataConfig := range gdconf.GetTriggerDataMap() {
|
||||
if triggerDataConfig.TriggerName == trigger.Name {
|
||||
for _, quest := range dbQuest.GetQuestMap() {
|
||||
questDataConfig := gdconf.GetQuestDataById(int32(quest.QuestId))
|
||||
if questDataConfig == nil {
|
||||
continue
|
||||
}
|
||||
for _, questCond := range questDataConfig.FinishCondList {
|
||||
if questCond.Type != constant.QUEST_FINISH_COND_TYPE_TRIGGER_FIRE {
|
||||
continue
|
||||
}
|
||||
if questCond.Param[0] != triggerDataConfig.TriggerId {
|
||||
continue
|
||||
}
|
||||
dbQuest.ForceFinishQuest(quest.QuestId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if oldPosInRegion && !newPosInRegion {
|
||||
// EVENT_LEAVE_REGION
|
||||
logger.Debug("player leave region: %v, uid: %v", region, player.PlayerID)
|
||||
}
|
||||
}
|
||||
}
|
||||
g.AcceptQuest(player, true)
|
||||
}
|
||||
|
||||
func (g *GameManager) AbilityInvocationsNotify(player *model.Player, payloadMsg pb.Message) {
|
||||
|
||||
@@ -63,7 +63,7 @@ func (g *GameManager) GCGStartChallenge(player *model.Player) {
|
||||
g.PacketGCGGameBriefDataNotify(player, proto.GCGGameBusinessType_GCG_GAME_GUIDE_GROUP, game))
|
||||
|
||||
// 玩家进入GCG界面
|
||||
g.TeleportPlayer(player, constant.EnterReasonDungeonEnter, 79999, new(model.Vector), new(model.Vector), 2162)
|
||||
g.TeleportPlayer(player, uint16(proto.EnterReason_ENTER_REASON_DUNGEON_ENTER), 79999, new(model.Vector), new(model.Vector), 2162)
|
||||
}
|
||||
|
||||
// GCGAskDuelReq GCG决斗请求
|
||||
|
||||
@@ -16,11 +16,11 @@ type ChangeItem struct {
|
||||
func (g *GameManager) GetAllItemDataConfig() map[int32]*gdconf.ItemData {
|
||||
allItemDataConfig := make(map[int32]*gdconf.ItemData)
|
||||
for itemId, itemData := range gdconf.GetItemDataMap() {
|
||||
if uint16(itemData.Type) == constant.ITEM_TYPE_WEAPON {
|
||||
if itemData.Type == constant.ITEM_TYPE_WEAPON {
|
||||
// 排除武器
|
||||
continue
|
||||
}
|
||||
if uint16(itemData.Type) == constant.ITEM_TYPE_RELIQUARY {
|
||||
if itemData.Type == constant.ITEM_TYPE_RELIQUARY {
|
||||
// 排除圣遗物
|
||||
continue
|
||||
}
|
||||
@@ -111,7 +111,7 @@ func (g *GameManager) AddUserItem(userId uint32, itemList []*ChangeItem, isHint
|
||||
|
||||
if isHint {
|
||||
if hintReason == 0 {
|
||||
hintReason = constant.ActionReasonSubfieldDrop
|
||||
hintReason = uint16(proto.ActionReasonType_ACTION_REASON_SUBFIELD_DROP)
|
||||
}
|
||||
itemAddHintNotify := &proto.ItemAddHintNotify{
|
||||
Reason: uint32(hintReason),
|
||||
|
||||
@@ -215,7 +215,7 @@ func (g *GameManager) PacketPlayerStoreNotify(player *model.Player) *proto.Playe
|
||||
logger.Error("get item data config is nil, itemId: %v", weapon.ItemId)
|
||||
continue
|
||||
}
|
||||
if uint16(itemDataConfig.Type) != constant.ITEM_TYPE_WEAPON {
|
||||
if itemDataConfig.Type != constant.ITEM_TYPE_WEAPON {
|
||||
continue
|
||||
}
|
||||
affixMap := make(map[uint32]uint32)
|
||||
@@ -247,7 +247,7 @@ func (g *GameManager) PacketPlayerStoreNotify(player *model.Player) *proto.Playe
|
||||
logger.Error("get item data config is nil, itemId: %v", reliquary.ItemId)
|
||||
continue
|
||||
}
|
||||
if uint16(itemDataConfig.Type) != constant.ITEM_TYPE_RELIQUARY {
|
||||
if itemDataConfig.Type != constant.ITEM_TYPE_RELIQUARY {
|
||||
continue
|
||||
}
|
||||
pbItem := &proto.Item{
|
||||
@@ -281,7 +281,7 @@ func (g *GameManager) PacketPlayerStoreNotify(player *model.Player) *proto.Playe
|
||||
Guid: item.Guid,
|
||||
Detail: nil,
|
||||
}
|
||||
if itemDataConfig != nil && uint16(itemDataConfig.Type) == constant.ITEM_TYPE_FURNITURE {
|
||||
if itemDataConfig != nil && itemDataConfig.Type == constant.ITEM_TYPE_FURNITURE {
|
||||
pbItem.Detail = &proto.Item_Furniture{
|
||||
Furniture: &proto.Furniture{
|
||||
Count: item.Count,
|
||||
|
||||
@@ -3,7 +3,6 @@ package game
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"hk4e/common/constant"
|
||||
"hk4e/gdconf"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/pkg/logger"
|
||||
@@ -25,7 +24,7 @@ func (g *GameManager) SceneTransToPointReq(player *model.Player, payloadMsg pb.M
|
||||
|
||||
// 传送玩家
|
||||
sceneId := req.SceneId
|
||||
g.TeleportPlayer(player, constant.EnterReasonTransPoint, sceneId, &model.Vector{
|
||||
g.TeleportPlayer(player, uint16(proto.EnterReason_ENTER_REASON_TRANS_POINT), sceneId, &model.Vector{
|
||||
X: pointDataConfig.TranPos.X,
|
||||
Y: pointDataConfig.TranPos.Y,
|
||||
Z: pointDataConfig.TranPos.Z,
|
||||
@@ -55,7 +54,7 @@ func (g *GameManager) MarkMapReq(player *model.Player, payloadMsg pb.Message) {
|
||||
posYInt = 300
|
||||
}
|
||||
// 传送玩家
|
||||
g.TeleportPlayer(player, constant.EnterReasonGm, req.Mark.SceneId, &model.Vector{
|
||||
g.TeleportPlayer(player, uint16(proto.EnterReason_ENTER_REASON_GM), req.Mark.SceneId, &model.Vector{
|
||||
X: float64(req.Mark.Pos.X),
|
||||
Y: float64(posYInt),
|
||||
Z: float64(req.Mark.Pos.Z),
|
||||
@@ -110,8 +109,8 @@ func (g *GameManager) TeleportPlayer(player *model.Player, enterReason uint16, s
|
||||
|
||||
var enterType proto.EnterType
|
||||
switch enterReason {
|
||||
case constant.EnterReasonDungeonEnter:
|
||||
logger.Debug("player dungeon scene, scene: %v, pos: %v", player.SceneId, player.Pos)
|
||||
case uint16(proto.EnterReason_ENTER_REASON_DUNGEON_ENTER):
|
||||
logger.Debug("player tp to dungeon scene, sceneId: %v, pos: %v", player.SceneId, player.Pos)
|
||||
enterType = proto.EnterType_ENTER_DUNGEON
|
||||
default:
|
||||
if jumpScene {
|
||||
|
||||
@@ -340,7 +340,7 @@ func (g *GameManager) HostEnterMpWorld(hostPlayer *model.Player, otherUid uint32
|
||||
hostPlayer,
|
||||
hostPlayer,
|
||||
proto.EnterType_ENTER_GOTO,
|
||||
uint32(constant.EnterReasonHostFromSingleToMp),
|
||||
uint32(proto.EnterReason_ENTER_REASON_HOST_FROM_SINGLE_TO_MP),
|
||||
hostPlayer.SceneId,
|
||||
hostPlayer.Pos,
|
||||
0,
|
||||
|
||||
@@ -72,7 +72,7 @@ func (g *GameManager) AcceptQuest(player *model.Player, isNtfClient bool) {
|
||||
canAccept := true
|
||||
for _, acceptCond := range questData.AcceptCondList {
|
||||
switch acceptCond.Type {
|
||||
case constant.QUEST_ACCEPT_COND_TYPE_QUEST_STATE_EQ:
|
||||
case constant.QUEST_ACCEPT_COND_TYPE_STATE_EQUAL:
|
||||
// 某个任务状态等于 参数1:任务id 参数2:任务状态
|
||||
if len(acceptCond.Param) != 2 {
|
||||
logger.Error("quest accept cond config format error, questId: %v", questData.QuestId)
|
||||
@@ -84,7 +84,7 @@ func (g *GameManager) AcceptQuest(player *model.Player, isNtfClient bool) {
|
||||
canAccept = false
|
||||
break
|
||||
}
|
||||
if quest.State != uint32(acceptCond.Param[1]) {
|
||||
if quest.State != uint8(acceptCond.Param[1]) {
|
||||
canAccept = false
|
||||
break
|
||||
}
|
||||
@@ -130,7 +130,7 @@ func (g *GameManager) PacketQuest(player *model.Player, questId uint32) *proto.Q
|
||||
}
|
||||
pbQuest := &proto.Quest{
|
||||
QuestId: quest.QuestId,
|
||||
State: quest.State,
|
||||
State: uint32(quest.State),
|
||||
StartTime: quest.StartTime,
|
||||
ParentQuestId: uint32(questDataConfig.ParentQuestId),
|
||||
StartGameTime: 0,
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
func (g *GameManager) GetAllReliquaryDataConfig() map[int32]*gdconf.ItemData {
|
||||
allReliquaryDataConfig := make(map[int32]*gdconf.ItemData)
|
||||
for itemId, itemData := range gdconf.GetItemDataMap() {
|
||||
if uint16(itemData.Type) != constant.ITEM_TYPE_RELIQUARY {
|
||||
if itemData.Type != constant.ITEM_TYPE_RELIQUARY {
|
||||
continue
|
||||
}
|
||||
if (itemId >= 20002 && itemId <= 20004) ||
|
||||
|
||||
@@ -19,6 +19,7 @@ import (
|
||||
|
||||
const (
|
||||
ENTITY_MAX_BATCH_SEND_NUM = 1000 // 单次同步的最大实体数量
|
||||
ENTITY_LOD = 300 // 实体加载视野距离
|
||||
)
|
||||
|
||||
func (g *GameManager) EnterSceneReadyReq(player *model.Player, payloadMsg pb.Message) {
|
||||
@@ -172,7 +173,7 @@ func (g *GameManager) SceneInitFinishReq(player *model.Player, payloadMsg pb.Mes
|
||||
|
||||
sceneAreaWeatherNotify := &proto.SceneAreaWeatherNotify{
|
||||
WeatherAreaId: 0,
|
||||
ClimateType: uint32(constant.CLIMATE_TYPE_SUNNY),
|
||||
ClimateType: constant.CLIMATE_TYPE_SUNNY,
|
||||
}
|
||||
g.SendMsg(cmd.SceneAreaWeatherNotify, player.PlayerID, player.ClientSeq, sceneAreaWeatherNotify)
|
||||
}
|
||||
@@ -272,8 +273,21 @@ func (g *GameManager) EnterSceneDoneReq(player *model.Player, payloadMsg pb.Mess
|
||||
aoiManager, exist := WORLD_MANAGER.GetSceneBlockAoiMap()[scene.GetId()]
|
||||
if exist {
|
||||
objectList := aoiManager.GetObjectListByPos(float32(player.Pos.X), 0.0, float32(player.Pos.Z))
|
||||
for objectId, entityConfig := range objectList {
|
||||
g.CreateConfigEntity(scene, objectId, entityConfig)
|
||||
for _, groupAny := range objectList {
|
||||
group := groupAny.(*gdconf.Group)
|
||||
distance2D := math.Sqrt(math.Pow(player.Pos.X-float64(group.Pos.X), 2.0) + math.Pow(player.Pos.Z-float64(group.Pos.Z), 2.0))
|
||||
if distance2D > ENTITY_LOD {
|
||||
continue
|
||||
}
|
||||
for _, monster := range group.MonsterList {
|
||||
g.CreateConfigEntity(scene, monster.ObjectId, monster)
|
||||
}
|
||||
for _, npc := range group.NpcList {
|
||||
g.CreateConfigEntity(scene, npc.ObjectId, npc)
|
||||
}
|
||||
for _, gadget := range group.GadgetList {
|
||||
g.CreateConfigEntity(scene, gadget.ObjectId, gadget)
|
||||
}
|
||||
}
|
||||
}
|
||||
if player.SceneJump {
|
||||
@@ -293,7 +307,7 @@ func (g *GameManager) EnterSceneDoneReq(player *model.Player, payloadMsg pb.Mess
|
||||
|
||||
sceneAreaWeatherNotify := &proto.SceneAreaWeatherNotify{
|
||||
WeatherAreaId: 0,
|
||||
ClimateType: uint32(constant.CLIMATE_TYPE_SUNNY),
|
||||
ClimateType: constant.CLIMATE_TYPE_SUNNY,
|
||||
}
|
||||
g.SendMsg(cmd.SceneAreaWeatherNotify, player.PlayerID, player.ClientSeq, sceneAreaWeatherNotify)
|
||||
|
||||
@@ -365,7 +379,7 @@ func (g *GameManager) SceneEntityDrownReq(player *model.Player, payloadMsg pb.Me
|
||||
}
|
||||
|
||||
// CreateConfigEntity 创建配置表里的实体
|
||||
func (g *GameManager) CreateConfigEntity(scene *Scene, objectId int64, entityConfig any) uint32 {
|
||||
func (g *GameManager) CreateConfigEntity(scene *Scene, objectId uint64, entityConfig any) uint32 {
|
||||
switch entityConfig.(type) {
|
||||
case *gdconf.Monster:
|
||||
monster := entityConfig.(*gdconf.Monster)
|
||||
@@ -438,7 +452,7 @@ func (g *GameManager) PacketPlayerEnterSceneNotifyLogin(player *model.Player, en
|
||||
TargetUid: player.PlayerID,
|
||||
EnterSceneToken: player.EnterSceneToken,
|
||||
WorldLevel: player.PropertiesMap[constant.PLAYER_PROP_PLAYER_WORLD_LEVEL],
|
||||
EnterReason: uint32(constant.EnterReasonLogin),
|
||||
EnterReason: uint32(proto.EnterReason_ENTER_REASON_LOGIN),
|
||||
IsFirstLoginEnterScene: true,
|
||||
WorldType: 1,
|
||||
SceneTagIdList: make([]uint32, 0),
|
||||
@@ -580,7 +594,7 @@ func (g *GameManager) AddSceneEntityNotify(player *model.Player, visionType prot
|
||||
continue
|
||||
}
|
||||
switch entity.GetEntityType() {
|
||||
case uint32(proto.ProtEntityType_PROT_ENTITY_AVATAR):
|
||||
case constant.ENTITY_TYPE_AVATAR:
|
||||
if visionType == proto.VisionType_VISION_MEET && entity.GetAvatarEntity().GetUid() == player.PlayerID {
|
||||
continue
|
||||
}
|
||||
@@ -594,14 +608,14 @@ func (g *GameManager) AddSceneEntityNotify(player *model.Player, visionType prot
|
||||
}
|
||||
sceneEntityInfoAvatar := g.PacketSceneEntityInfoAvatar(scene, scenePlayer, world.GetPlayerActiveAvatarId(scenePlayer))
|
||||
entityList = append(entityList, sceneEntityInfoAvatar)
|
||||
case uint32(proto.ProtEntityType_PROT_ENTITY_WEAPON):
|
||||
case uint32(proto.ProtEntityType_PROT_ENTITY_MONSTER):
|
||||
case constant.ENTITY_TYPE_WEAPON:
|
||||
case constant.ENTITY_TYPE_MONSTER:
|
||||
sceneEntityInfoMonster := g.PacketSceneEntityInfoMonster(scene, entity.GetId())
|
||||
entityList = append(entityList, sceneEntityInfoMonster)
|
||||
case uint32(proto.ProtEntityType_PROT_ENTITY_NPC):
|
||||
case constant.ENTITY_TYPE_NPC:
|
||||
sceneEntityInfoNpc := g.PacketSceneEntityInfoNpc(scene, entity.GetId())
|
||||
entityList = append(entityList, sceneEntityInfoNpc)
|
||||
case uint32(proto.ProtEntityType_PROT_ENTITY_GADGET):
|
||||
case constant.ENTITY_TYPE_GADGET:
|
||||
sceneEntityInfoGadget := g.PacketSceneEntityInfoGadget(scene, entity.GetId())
|
||||
entityList = append(entityList, sceneEntityInfoGadget)
|
||||
}
|
||||
@@ -628,16 +642,16 @@ func (g *GameManager) EntityFightPropUpdateNotifyBroadcast(scene *Scene, entity
|
||||
|
||||
func (g *GameManager) PacketFightPropMapToPbFightPropList(fightPropMap map[uint32]float32) []*proto.FightPropPair {
|
||||
fightPropList := []*proto.FightPropPair{
|
||||
{PropType: uint32(constant.FIGHT_PROP_BASE_HP), PropValue: fightPropMap[uint32(constant.FIGHT_PROP_BASE_HP)]},
|
||||
{PropType: uint32(constant.FIGHT_PROP_BASE_ATTACK), PropValue: fightPropMap[uint32(constant.FIGHT_PROP_BASE_ATTACK)]},
|
||||
{PropType: uint32(constant.FIGHT_PROP_BASE_DEFENSE), PropValue: fightPropMap[uint32(constant.FIGHT_PROP_BASE_DEFENSE)]},
|
||||
{PropType: uint32(constant.FIGHT_PROP_CRITICAL), PropValue: fightPropMap[uint32(constant.FIGHT_PROP_CRITICAL)]},
|
||||
{PropType: uint32(constant.FIGHT_PROP_CRITICAL_HURT), PropValue: fightPropMap[uint32(constant.FIGHT_PROP_CRITICAL_HURT)]},
|
||||
{PropType: uint32(constant.FIGHT_PROP_CHARGE_EFFICIENCY), PropValue: fightPropMap[uint32(constant.FIGHT_PROP_CHARGE_EFFICIENCY)]},
|
||||
{PropType: uint32(constant.FIGHT_PROP_CUR_HP), PropValue: fightPropMap[uint32(constant.FIGHT_PROP_CUR_HP)]},
|
||||
{PropType: uint32(constant.FIGHT_PROP_MAX_HP), PropValue: fightPropMap[uint32(constant.FIGHT_PROP_MAX_HP)]},
|
||||
{PropType: uint32(constant.FIGHT_PROP_CUR_ATTACK), PropValue: fightPropMap[uint32(constant.FIGHT_PROP_CUR_ATTACK)]},
|
||||
{PropType: uint32(constant.FIGHT_PROP_CUR_DEFENSE), PropValue: fightPropMap[uint32(constant.FIGHT_PROP_CUR_DEFENSE)]},
|
||||
{PropType: constant.FIGHT_PROP_BASE_HP, PropValue: fightPropMap[constant.FIGHT_PROP_BASE_HP]},
|
||||
{PropType: constant.FIGHT_PROP_BASE_ATTACK, PropValue: fightPropMap[constant.FIGHT_PROP_BASE_ATTACK]},
|
||||
{PropType: constant.FIGHT_PROP_BASE_DEFENSE, PropValue: fightPropMap[constant.FIGHT_PROP_BASE_DEFENSE]},
|
||||
{PropType: constant.FIGHT_PROP_CRITICAL, PropValue: fightPropMap[constant.FIGHT_PROP_CRITICAL]},
|
||||
{PropType: constant.FIGHT_PROP_CRITICAL_HURT, PropValue: fightPropMap[constant.FIGHT_PROP_CRITICAL_HURT]},
|
||||
{PropType: constant.FIGHT_PROP_CHARGE_EFFICIENCY, PropValue: fightPropMap[constant.FIGHT_PROP_CHARGE_EFFICIENCY]},
|
||||
{PropType: constant.FIGHT_PROP_CUR_HP, PropValue: fightPropMap[constant.FIGHT_PROP_CUR_HP]},
|
||||
{PropType: constant.FIGHT_PROP_MAX_HP, PropValue: fightPropMap[constant.FIGHT_PROP_MAX_HP]},
|
||||
{PropType: constant.FIGHT_PROP_CUR_ATTACK, PropValue: fightPropMap[constant.FIGHT_PROP_CUR_ATTACK]},
|
||||
{PropType: constant.FIGHT_PROP_CUR_DEFENSE, PropValue: fightPropMap[constant.FIGHT_PROP_CUR_DEFENSE]},
|
||||
}
|
||||
return fightPropList
|
||||
}
|
||||
@@ -1053,21 +1067,21 @@ func (g *GameManager) PacketDelTeamEntityNotify(scene *Scene, player *model.Play
|
||||
|
||||
func (g *GameManager) GetTempFightPropMap() map[uint32]float32 {
|
||||
fpm := map[uint32]float32{
|
||||
uint32(constant.FIGHT_PROP_CUR_HP): float32(72.91699),
|
||||
uint32(constant.FIGHT_PROP_PHYSICAL_SUB_HURT): float32(0.1),
|
||||
uint32(constant.FIGHT_PROP_CUR_DEFENSE): float32(505.0),
|
||||
uint32(constant.FIGHT_PROP_CUR_ATTACK): float32(45.679916),
|
||||
uint32(constant.FIGHT_PROP_ICE_SUB_HURT): float32(0.1),
|
||||
uint32(constant.FIGHT_PROP_BASE_ATTACK): float32(45.679916),
|
||||
uint32(constant.FIGHT_PROP_MAX_HP): float32(72.91699),
|
||||
uint32(constant.FIGHT_PROP_FIRE_SUB_HURT): float32(0.1),
|
||||
uint32(constant.FIGHT_PROP_ELEC_SUB_HURT): float32(0.1),
|
||||
uint32(constant.FIGHT_PROP_WIND_SUB_HURT): float32(0.1),
|
||||
uint32(constant.FIGHT_PROP_ROCK_SUB_HURT): float32(0.1),
|
||||
uint32(constant.FIGHT_PROP_GRASS_SUB_HURT): float32(0.1),
|
||||
uint32(constant.FIGHT_PROP_WATER_SUB_HURT): float32(0.1),
|
||||
uint32(constant.FIGHT_PROP_BASE_HP): float32(72.91699),
|
||||
uint32(constant.FIGHT_PROP_BASE_DEFENSE): float32(505.0),
|
||||
constant.FIGHT_PROP_CUR_HP: float32(72.91699),
|
||||
constant.FIGHT_PROP_PHYSICAL_SUB_HURT: float32(0.1),
|
||||
constant.FIGHT_PROP_CUR_DEFENSE: float32(505.0),
|
||||
constant.FIGHT_PROP_CUR_ATTACK: float32(45.679916),
|
||||
constant.FIGHT_PROP_ICE_SUB_HURT: float32(0.1),
|
||||
constant.FIGHT_PROP_BASE_ATTACK: float32(45.679916),
|
||||
constant.FIGHT_PROP_MAX_HP: float32(72.91699),
|
||||
constant.FIGHT_PROP_FIRE_SUB_HURT: float32(0.1),
|
||||
constant.FIGHT_PROP_ELEC_SUB_HURT: float32(0.1),
|
||||
constant.FIGHT_PROP_WIND_SUB_HURT: float32(0.1),
|
||||
constant.FIGHT_PROP_ROCK_SUB_HURT: float32(0.1),
|
||||
constant.FIGHT_PROP_GRASS_SUB_HURT: float32(0.1),
|
||||
constant.FIGHT_PROP_WATER_SUB_HURT: float32(0.1),
|
||||
constant.FIGHT_PROP_BASE_HP: float32(72.91699),
|
||||
constant.FIGHT_PROP_BASE_DEFENSE: float32(505.0),
|
||||
}
|
||||
return fpm
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package game
|
||||
import (
|
||||
"time"
|
||||
|
||||
"hk4e/common/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
@@ -92,7 +91,7 @@ func (g *GameManager) BuyGoodsReq(player *model.Player, payloadMsg pb.Message) {
|
||||
g.AddUserItem(player.PlayerID, []*ChangeItem{{
|
||||
ItemId: buyItemId,
|
||||
ChangeCount: buyItemCount,
|
||||
}}, true, constant.ActionReasonShop)
|
||||
}}, true, uint16(proto.ActionReasonType_ACTION_REASON_SHOP))
|
||||
req.Goods.BoughtNum = dbItem.GetItemCount(player, buyItemId)
|
||||
|
||||
buyGoodsRsp := &proto.BuyGoodsRsp{
|
||||
|
||||
@@ -520,7 +520,7 @@ func (g *GameManager) DrownBackHandler(player *model.Player) {
|
||||
// }
|
||||
// }
|
||||
// 传送玩家至安全位置
|
||||
g.TeleportPlayer(player, constant.EnterReasonRevival, player.SceneId, pos, new(model.Vector), 0)
|
||||
g.TeleportPlayer(player, uint16(proto.EnterReason_ENTER_REASON_REVIVAL), player.SceneId, pos, new(model.Vector), 0)
|
||||
}
|
||||
// 防止重置后又被修改
|
||||
if player.StaminaInfo.DrownBackDelay != 0 {
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
func (g *GameManager) GetAllWeaponDataConfig() map[int32]*gdconf.ItemData {
|
||||
allWeaponDataConfig := make(map[int32]*gdconf.ItemData)
|
||||
for itemId, itemData := range gdconf.GetItemDataMap() {
|
||||
if uint16(itemData.Type) != constant.ITEM_TYPE_WEAPON {
|
||||
if itemData.Type != constant.ITEM_TYPE_WEAPON {
|
||||
continue
|
||||
}
|
||||
if (itemId >= 10000 && itemId <= 10008) ||
|
||||
@@ -188,7 +188,7 @@ func (g *GameManager) WeaponAwakenReq(player *model.Player, payloadMsg pb.Messag
|
||||
}
|
||||
// 根据精炼材料的类型做不同操作
|
||||
switch itemDataConfig.Type {
|
||||
case int32(constant.ITEM_TYPE_WEAPON):
|
||||
case constant.ITEM_TYPE_WEAPON:
|
||||
// 精炼材料为武器
|
||||
// 是否拥有将被用于精炼的武器
|
||||
foodWeapon, ok := player.GameObjectGuidMap[req.ItemGuid].(*model.Weapon)
|
||||
@@ -211,7 +211,7 @@ func (g *GameManager) WeaponAwakenReq(player *model.Player, payloadMsg pb.Messag
|
||||
}
|
||||
// 消耗作为精炼材料的武器
|
||||
g.CostUserWeapon(player.PlayerID, []uint64{foodWeapon.WeaponId})
|
||||
case int32(constant.ITEM_TYPE_MATERIAL):
|
||||
case constant.ITEM_TYPE_MATERIAL:
|
||||
// 精炼材料为道具
|
||||
// 是否拥有将被用于精炼的道具
|
||||
item, ok := player.GameObjectGuidMap[req.ItemGuid].(*model.Item)
|
||||
|
||||
@@ -292,7 +292,7 @@ func (t *TickManager) onTick5Second(now int64) {
|
||||
for _, entityId := range scenePlayer.VehicleInfo.LastCreateEntityIdMap {
|
||||
entity := scene.GetEntity(entityId)
|
||||
// 确保实体类型是否为载具
|
||||
if entity != nil && entity.gadgetEntity != nil && entity.gadgetEntity.gadgetVehicleEntity != nil {
|
||||
if entity != nil && entity.GetEntityType() == constant.ENTITY_TYPE_GADGET && entity.gadgetEntity.gadgetVehicleEntity != nil {
|
||||
vehicleLocationInfo := &proto.VehicleLocationInfo{
|
||||
Rot: &proto.Vector{
|
||||
X: float32(entity.rot.X),
|
||||
@@ -300,7 +300,7 @@ func (t *TickManager) onTick5Second(now int64) {
|
||||
Z: float32(entity.rot.Z),
|
||||
},
|
||||
EntityId: entity.id,
|
||||
CurHp: entity.fightProp[uint32(constant.FIGHT_PROP_CUR_HP)],
|
||||
CurHp: entity.fightProp[constant.FIGHT_PROP_CUR_HP],
|
||||
OwnerUid: entity.gadgetEntity.gadgetVehicleEntity.owner.PlayerID,
|
||||
Pos: &proto.Vector{
|
||||
X: float32(entity.pos.X),
|
||||
@@ -309,7 +309,7 @@ func (t *TickManager) onTick5Second(now int64) {
|
||||
},
|
||||
UidList: make([]uint32, 0, len(entity.gadgetEntity.gadgetVehicleEntity.memberMap)),
|
||||
GadgetId: entity.gadgetEntity.gadgetVehicleEntity.vehicleId,
|
||||
MaxHp: entity.fightProp[uint32(constant.FIGHT_PROP_MAX_HP)],
|
||||
MaxHp: entity.fightProp[constant.FIGHT_PROP_MAX_HP],
|
||||
}
|
||||
for _, p := range entity.gadgetEntity.gadgetVehicleEntity.memberMap {
|
||||
vehicleLocationInfo.UidList = append(vehicleLocationInfo.UidList, p.PlayerID)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
"hk4e/pkg/logger"
|
||||
"image"
|
||||
"image/color"
|
||||
"image/jpeg"
|
||||
@@ -10,6 +9,8 @@ import (
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"hk4e/pkg/logger"
|
||||
|
||||
"hk4e/gs/model"
|
||||
"hk4e/protocol/proto"
|
||||
|
||||
@@ -215,7 +216,7 @@ func LoadVideoPlayerFile() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var OBJECT_ID_COUNTER int64 = math.MaxUint32
|
||||
var OBJECT_ID_COUNTER uint64 = math.MaxUint64
|
||||
|
||||
func (g *GameManager) VideoPlayerUpdate(rgb bool) {
|
||||
err := LoadVideoPlayerFile()
|
||||
|
||||
@@ -31,8 +31,85 @@ func NewWorldManager(snowflake *alg.SnowflakeWorker) (r *WorldManager) {
|
||||
r = new(WorldManager)
|
||||
r.worldMap = make(map[uint32]*World)
|
||||
r.snowflake = snowflake
|
||||
r.sceneBlockAoiMap = make(map[uint32]*alg.AoiManager)
|
||||
r.LoadSceneBlockAoiMap()
|
||||
r.multiplayerWorldNum = 0
|
||||
return r
|
||||
}
|
||||
|
||||
func (w *WorldManager) GetWorldByID(worldId uint32) *World {
|
||||
return w.worldMap[worldId]
|
||||
}
|
||||
|
||||
func (w *WorldManager) GetAllWorld() map[uint32]*World {
|
||||
return w.worldMap
|
||||
}
|
||||
|
||||
func (w *WorldManager) CreateWorld(owner *model.Player) *World {
|
||||
worldId := uint32(w.snowflake.GenId())
|
||||
world := &World{
|
||||
id: worldId,
|
||||
owner: owner,
|
||||
playerMap: make(map[uint32]*model.Player),
|
||||
sceneMap: make(map[uint32]*Scene),
|
||||
entityIdCounter: 0,
|
||||
worldLevel: 0,
|
||||
multiplayer: false,
|
||||
mpLevelEntityId: 0,
|
||||
chatMsgList: make([]*proto.ChatInfo, 0),
|
||||
playerFirstEnterMap: make(map[uint32]int64),
|
||||
waitEnterPlayerMap: make(map[uint32]int64),
|
||||
multiplayerTeam: CreateMultiplayerTeam(),
|
||||
peerList: make([]*model.Player, 0),
|
||||
}
|
||||
world.mpLevelEntityId = world.GetNextWorldEntityId(constant.ENTITY_TYPE_MP_LEVEL)
|
||||
w.worldMap[worldId] = world
|
||||
return world
|
||||
}
|
||||
|
||||
func (w *WorldManager) DestroyWorld(worldId uint32) {
|
||||
world := w.GetWorldByID(worldId)
|
||||
for _, player := range world.playerMap {
|
||||
world.RemovePlayer(player)
|
||||
player.WorldId = 0
|
||||
}
|
||||
delete(w.worldMap, worldId)
|
||||
if world.multiplayer {
|
||||
w.multiplayerWorldNum--
|
||||
}
|
||||
}
|
||||
|
||||
// GetAiWorld 获取本服务器的Ai世界
|
||||
func (w *WorldManager) GetAiWorld() *World {
|
||||
return w.aiWorld
|
||||
}
|
||||
|
||||
// InitAiWorld 初始化Ai世界
|
||||
func (w *WorldManager) InitAiWorld(owner *model.Player) {
|
||||
w.aiWorld = w.GetWorldByID(owner.WorldId)
|
||||
w.aiWorld.ChangeToMultiplayer()
|
||||
go RunPlayAudio()
|
||||
}
|
||||
|
||||
func (w *WorldManager) IsAiWorld(world *World) bool {
|
||||
return world.id == w.aiWorld.id
|
||||
}
|
||||
|
||||
func (w *WorldManager) IsRobotWorld(world *World) bool {
|
||||
return world.owner.PlayerID < PlayerBaseUid
|
||||
}
|
||||
|
||||
func (w *WorldManager) IsBigWorld(world *World) bool {
|
||||
return (world.id == w.aiWorld.id) && (w.aiWorld.owner.PlayerID == BigWorldAiUid)
|
||||
}
|
||||
|
||||
func (w *WorldManager) GetSceneBlockAoiMap() map[uint32]*alg.AoiManager {
|
||||
return w.sceneBlockAoiMap
|
||||
}
|
||||
|
||||
func (w *WorldManager) LoadSceneBlockAoiMap() {
|
||||
w.sceneBlockAoiMap = make(map[uint32]*alg.AoiManager)
|
||||
for _, sceneLuaConfig := range gdconf.GetSceneLuaConfigMap() {
|
||||
// 检查各block大小是否相同 并提取出block大小
|
||||
minX := int16(0)
|
||||
maxX := int16(0)
|
||||
minZ := int16(0)
|
||||
@@ -83,13 +160,11 @@ func NewWorldManager(snowflake *alg.SnowflakeWorker) (r *WorldManager) {
|
||||
}
|
||||
}
|
||||
if !ok {
|
||||
logger.Error("config scene block size not same, scene id: %v", sceneLuaConfig.Id)
|
||||
continue
|
||||
}
|
||||
numX := int16(0)
|
||||
if blockXLen != 0 {
|
||||
if blockXLen > 32 {
|
||||
blockXLen = 32
|
||||
}
|
||||
numX = (maxX - minX) / blockXLen
|
||||
} else {
|
||||
numX = 1
|
||||
@@ -99,9 +174,6 @@ func NewWorldManager(snowflake *alg.SnowflakeWorker) (r *WorldManager) {
|
||||
}
|
||||
numZ := int16(0)
|
||||
if blockZLen != 0 {
|
||||
if blockZLen > 32 {
|
||||
blockZLen = 32
|
||||
}
|
||||
numZ = (maxZ - minZ) / blockZLen
|
||||
} else {
|
||||
numZ = 1
|
||||
@@ -109,105 +181,20 @@ func NewWorldManager(snowflake *alg.SnowflakeWorker) (r *WorldManager) {
|
||||
if numZ == 0 {
|
||||
numZ = 1
|
||||
}
|
||||
// 将每个block作为aoi格子 并在格子中放入block拥有的所有group
|
||||
aoiManager := alg.NewAoiManager()
|
||||
aoiManager.SetAoiRange(minX, maxX, -1.0, 1.0, minZ, maxZ)
|
||||
aoiManager.Init3DRectAoiManager(numX, 1, numZ)
|
||||
for _, blockConfig := range sceneLuaConfig.BlockMap {
|
||||
for _, groupConfig := range blockConfig.GroupMap {
|
||||
for _, monsterConfig := range groupConfig.MonsterList {
|
||||
aoiManager.AddObjectToGridByPos(r.snowflake.GenId(), monsterConfig,
|
||||
float32(monsterConfig.Pos.X),
|
||||
float32(0.0),
|
||||
float32(monsterConfig.Pos.Z))
|
||||
}
|
||||
for _, npcConfig := range groupConfig.NpcList {
|
||||
aoiManager.AddObjectToGridByPos(r.snowflake.GenId(), npcConfig,
|
||||
float32(npcConfig.Pos.X),
|
||||
float32(0.0),
|
||||
float32(npcConfig.Pos.Z))
|
||||
}
|
||||
for _, gadgetConfig := range groupConfig.GadgetList {
|
||||
aoiManager.AddObjectToGridByPos(r.snowflake.GenId(), gadgetConfig,
|
||||
float32(gadgetConfig.Pos.X),
|
||||
float32(0.0),
|
||||
float32(gadgetConfig.Pos.Z))
|
||||
}
|
||||
for _, block := range sceneLuaConfig.BlockMap {
|
||||
for _, group := range block.GroupMap {
|
||||
aoiManager.AddObjectToGridByPos(int64(group.Id), group,
|
||||
group.Pos.X,
|
||||
0.0,
|
||||
group.Pos.Z)
|
||||
}
|
||||
}
|
||||
r.sceneBlockAoiMap[uint32(sceneLuaConfig.Id)] = aoiManager
|
||||
w.sceneBlockAoiMap[uint32(sceneLuaConfig.Id)] = aoiManager
|
||||
}
|
||||
r.multiplayerWorldNum = 0
|
||||
return r
|
||||
}
|
||||
|
||||
func (w *WorldManager) GetWorldByID(worldId uint32) *World {
|
||||
return w.worldMap[worldId]
|
||||
}
|
||||
|
||||
func (w *WorldManager) GetAllWorld() map[uint32]*World {
|
||||
return w.worldMap
|
||||
}
|
||||
|
||||
func (w *WorldManager) CreateWorld(owner *model.Player) *World {
|
||||
worldId := uint32(w.snowflake.GenId())
|
||||
world := &World{
|
||||
id: worldId,
|
||||
owner: owner,
|
||||
playerMap: make(map[uint32]*model.Player),
|
||||
sceneMap: make(map[uint32]*Scene),
|
||||
entityIdCounter: 0,
|
||||
worldLevel: 0,
|
||||
multiplayer: false,
|
||||
mpLevelEntityId: 0,
|
||||
chatMsgList: make([]*proto.ChatInfo, 0),
|
||||
playerFirstEnterMap: make(map[uint32]int64),
|
||||
waitEnterPlayerMap: make(map[uint32]int64),
|
||||
multiplayerTeam: CreateMultiplayerTeam(),
|
||||
peerList: make([]*model.Player, 0),
|
||||
}
|
||||
world.mpLevelEntityId = world.GetNextWorldEntityId(constant.ENTITY_ID_TYPE_MPLEVEL)
|
||||
w.worldMap[worldId] = world
|
||||
return world
|
||||
}
|
||||
|
||||
func (w *WorldManager) DestroyWorld(worldId uint32) {
|
||||
world := w.GetWorldByID(worldId)
|
||||
for _, player := range world.playerMap {
|
||||
world.RemovePlayer(player)
|
||||
player.WorldId = 0
|
||||
}
|
||||
delete(w.worldMap, worldId)
|
||||
if world.multiplayer {
|
||||
w.multiplayerWorldNum--
|
||||
}
|
||||
}
|
||||
|
||||
// GetAiWorld 获取本服务器的Ai世界
|
||||
func (w *WorldManager) GetAiWorld() *World {
|
||||
return w.aiWorld
|
||||
}
|
||||
|
||||
// InitAiWorld 初始化Ai世界
|
||||
func (w *WorldManager) InitAiWorld(owner *model.Player) {
|
||||
w.aiWorld = w.GetWorldByID(owner.WorldId)
|
||||
w.aiWorld.ChangeToMultiplayer()
|
||||
go RunPlayAudio()
|
||||
}
|
||||
|
||||
func (w *WorldManager) IsAiWorld(world *World) bool {
|
||||
return world.id == w.aiWorld.id
|
||||
}
|
||||
|
||||
func (w *WorldManager) IsRobotWorld(world *World) bool {
|
||||
return world.owner.PlayerID < PlayerBaseUid
|
||||
}
|
||||
|
||||
func (w *WorldManager) IsBigWorld(world *World) bool {
|
||||
return (world.id == w.aiWorld.id) && (w.aiWorld.owner.PlayerID == BigWorldAiUid)
|
||||
}
|
||||
|
||||
func (w *WorldManager) GetSceneBlockAoiMap() map[uint32]*alg.AoiManager {
|
||||
return w.sceneBlockAoiMap
|
||||
}
|
||||
|
||||
func (w *WorldManager) GetMultiplayerWorldNum() uint32 {
|
||||
@@ -259,7 +246,7 @@ func (w *World) GetMpLevelEntityId() uint32 {
|
||||
return w.mpLevelEntityId
|
||||
}
|
||||
|
||||
func (w *World) GetNextWorldEntityId(entityType uint16) uint32 {
|
||||
func (w *World) GetNextWorldEntityId(entityType uint8) uint32 {
|
||||
for {
|
||||
w.entityIdCounter++
|
||||
ret := (uint32(entityType) << 24) + w.entityIdCounter
|
||||
@@ -484,7 +471,7 @@ func (w *World) GetPlayerTeamEntityId(player *model.Player) uint32 {
|
||||
|
||||
// InitPlayerTeamEntityId 初始化某玩家的本地队伍实体id
|
||||
func (w *World) InitPlayerTeamEntityId(player *model.Player) {
|
||||
w.multiplayerTeam.localTeamEntityMap[player.PlayerID] = w.GetNextWorldEntityId(constant.ENTITY_ID_TYPE_TEAM)
|
||||
w.multiplayerTeam.localTeamEntityMap[player.PlayerID] = w.GetNextWorldEntityId(constant.ENTITY_TYPE_TEAM)
|
||||
}
|
||||
|
||||
// GetPlayerWorldAvatarEntityId 获取某玩家在世界队伍中的某角色的实体id
|
||||
@@ -735,7 +722,7 @@ func (w *World) CreateScene(sceneId uint32) *Scene {
|
||||
world: w,
|
||||
playerMap: make(map[uint32]*model.Player),
|
||||
entityMap: make(map[uint32]*Entity),
|
||||
objectIdEntityMap: make(map[int64]*Entity),
|
||||
objectIdEntityMap: make(map[uint64]*Entity),
|
||||
gameTime: 18 * 60,
|
||||
createTime: time.Now().UnixMilli(),
|
||||
meeoIndex: 0,
|
||||
@@ -745,6 +732,7 @@ func (w *World) CreateScene(sceneId uint32) *Scene {
|
||||
}
|
||||
|
||||
func (w *World) GetSceneById(sceneId uint32) *Scene {
|
||||
// 场景是取时创建 可以简化代码不判空
|
||||
scene, exist := w.sceneMap[sceneId]
|
||||
if !exist {
|
||||
scene = w.CreateScene(sceneId)
|
||||
|
||||
@@ -18,10 +18,10 @@ type Scene struct {
|
||||
world *World
|
||||
playerMap map[uint32]*model.Player
|
||||
entityMap map[uint32]*Entity
|
||||
objectIdEntityMap map[int64]*Entity // 用于标识配置档里的唯一实体是否已被创建
|
||||
gameTime uint32 // 游戏内提瓦特大陆的时间
|
||||
createTime int64 // 场景创建时间
|
||||
meeoIndex uint32 // 客户端风元素染色同步协议的计数器
|
||||
objectIdEntityMap map[uint64]*Entity // 用于标识配置档里的唯一实体是否已被创建
|
||||
gameTime uint32 // 游戏内提瓦特大陆的时间
|
||||
createTime int64 // 场景创建时间
|
||||
meeoIndex uint32 // 客户端风元素染色同步协议的计数器
|
||||
}
|
||||
|
||||
func (s *Scene) GetId() uint32 {
|
||||
@@ -80,7 +80,7 @@ func (s *Scene) RemovePlayer(player *model.Player) {
|
||||
}
|
||||
|
||||
func (s *Scene) SetEntityLifeState(entity *Entity, lifeState uint16, dieType proto.PlayerDieType) {
|
||||
if entity.avatarEntity != nil {
|
||||
if entity.GetEntityType() == constant.ENTITY_TYPE_AVATAR {
|
||||
// 获取玩家对象
|
||||
player := USER_MANAGER.GetOnlineUser(entity.avatarEntity.uid)
|
||||
if player == nil {
|
||||
@@ -98,8 +98,8 @@ func (s *Scene) SetEntityLifeState(entity *Entity, lifeState uint16, dieType pro
|
||||
if lifeState == constant.LIFE_STATE_REVIVE {
|
||||
avatar.LifeState = constant.LIFE_STATE_ALIVE
|
||||
// 设置血量
|
||||
entity.fightProp[uint32(constant.FIGHT_PROP_CUR_HP)] = 110
|
||||
GAME_MANAGER.EntityFightPropUpdateNotifyBroadcast(s, entity, uint32(constant.FIGHT_PROP_CUR_HP))
|
||||
entity.fightProp[constant.FIGHT_PROP_CUR_HP] = 110
|
||||
GAME_MANAGER.EntityFightPropUpdateNotifyBroadcast(s, entity, constant.FIGHT_PROP_CUR_HP)
|
||||
}
|
||||
|
||||
avatarLifeStateChangeNotify := &proto.AvatarLifeStateChangeNotify{
|
||||
@@ -118,8 +118,8 @@ func (s *Scene) SetEntityLifeState(entity *Entity, lifeState uint16, dieType pro
|
||||
|
||||
if lifeState == constant.LIFE_STATE_DEAD {
|
||||
// 设置血量
|
||||
entity.fightProp[uint32(constant.FIGHT_PROP_CUR_HP)] = 0
|
||||
GAME_MANAGER.EntityFightPropUpdateNotifyBroadcast(s, entity, uint32(constant.FIGHT_PROP_CUR_HP))
|
||||
entity.fightProp[constant.FIGHT_PROP_CUR_HP] = 0
|
||||
GAME_MANAGER.EntityFightPropUpdateNotifyBroadcast(s, entity, constant.FIGHT_PROP_CUR_HP)
|
||||
}
|
||||
|
||||
lifeStateChangeNotify := &proto.LifeStateChangeNotify{
|
||||
@@ -139,7 +139,7 @@ func (s *Scene) SetEntityLifeState(entity *Entity, lifeState uint16, dieType pro
|
||||
}
|
||||
|
||||
func (s *Scene) CreateEntityAvatar(player *model.Player, avatarId uint32) uint32 {
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_ID_TYPE_AVATAR)
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_TYPE_AVATAR)
|
||||
dbAvatar := player.GetDbAvatar()
|
||||
avatar, ok := dbAvatar.AvatarMap[avatarId]
|
||||
if !ok {
|
||||
@@ -156,7 +156,7 @@ func (s *Scene) CreateEntityAvatar(player *model.Player, avatarId uint32) uint32
|
||||
lastMoveSceneTimeMs: 0,
|
||||
lastMoveReliableSeq: 0,
|
||||
fightProp: dbAvatar.AvatarMap[avatarId].FightPropMap, // 使用角色结构的数据
|
||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_AVATAR),
|
||||
entityType: constant.ENTITY_TYPE_AVATAR,
|
||||
avatarEntity: &AvatarEntity{
|
||||
uid: player.PlayerID,
|
||||
avatarId: avatarId,
|
||||
@@ -178,7 +178,7 @@ func (s *Scene) CreateEntityAvatar(player *model.Player, avatarId uint32) uint32
|
||||
}
|
||||
|
||||
func (s *Scene) CreateEntityWeapon() uint32 {
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_ID_TYPE_WEAPON)
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_TYPE_WEAPON)
|
||||
entity := &Entity{
|
||||
id: entityId,
|
||||
scene: s,
|
||||
@@ -189,18 +189,18 @@ func (s *Scene) CreateEntityWeapon() uint32 {
|
||||
lastMoveSceneTimeMs: 0,
|
||||
lastMoveReliableSeq: 0,
|
||||
fightProp: nil,
|
||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_WEAPON),
|
||||
entityType: constant.ENTITY_TYPE_WEAPON,
|
||||
}
|
||||
s.CreateEntity(entity, 0)
|
||||
return entity.id
|
||||
}
|
||||
|
||||
func (s *Scene) CreateEntityMonster(pos, rot *model.Vector, monsterId uint32, level uint8, fightProp map[uint32]float32, configId uint32, objectId int64) uint32 {
|
||||
func (s *Scene) CreateEntityMonster(pos, rot *model.Vector, monsterId uint32, level uint8, fightProp map[uint32]float32, configId uint32, objectId uint64) uint32 {
|
||||
_, exist := s.objectIdEntityMap[objectId]
|
||||
if exist {
|
||||
return 0
|
||||
}
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_ID_TYPE_MONSTER)
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_TYPE_MONSTER)
|
||||
entity := &Entity{
|
||||
id: entityId,
|
||||
scene: s,
|
||||
@@ -211,7 +211,7 @@ func (s *Scene) CreateEntityMonster(pos, rot *model.Vector, monsterId uint32, le
|
||||
lastMoveSceneTimeMs: 0,
|
||||
lastMoveReliableSeq: 0,
|
||||
fightProp: fightProp,
|
||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_MONSTER),
|
||||
entityType: constant.ENTITY_TYPE_MONSTER,
|
||||
level: level,
|
||||
monsterEntity: &MonsterEntity{
|
||||
monsterId: monsterId,
|
||||
@@ -232,12 +232,12 @@ func (s *Scene) CreateEntityMonster(pos, rot *model.Vector, monsterId uint32, le
|
||||
return entity.id
|
||||
}
|
||||
|
||||
func (s *Scene) CreateEntityNpc(pos, rot *model.Vector, npcId, roomId, parentQuestId, blockId, configId uint32, objectId int64) uint32 {
|
||||
func (s *Scene) CreateEntityNpc(pos, rot *model.Vector, npcId, roomId, parentQuestId, blockId, configId uint32, objectId uint64) uint32 {
|
||||
_, exist := s.objectIdEntityMap[objectId]
|
||||
if exist {
|
||||
return 0
|
||||
}
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_ID_TYPE_NPC)
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_TYPE_NPC)
|
||||
entity := &Entity{
|
||||
id: entityId,
|
||||
scene: s,
|
||||
@@ -248,11 +248,11 @@ func (s *Scene) CreateEntityNpc(pos, rot *model.Vector, npcId, roomId, parentQue
|
||||
lastMoveSceneTimeMs: 0,
|
||||
lastMoveReliableSeq: 0,
|
||||
fightProp: map[uint32]float32{
|
||||
uint32(constant.FIGHT_PROP_CUR_HP): math.MaxFloat32,
|
||||
uint32(constant.FIGHT_PROP_MAX_HP): math.MaxFloat32,
|
||||
uint32(constant.FIGHT_PROP_BASE_HP): float32(1),
|
||||
constant.FIGHT_PROP_CUR_HP: math.MaxFloat32,
|
||||
constant.FIGHT_PROP_MAX_HP: math.MaxFloat32,
|
||||
constant.FIGHT_PROP_BASE_HP: float32(1),
|
||||
},
|
||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_NPC),
|
||||
entityType: constant.ENTITY_TYPE_NPC,
|
||||
npcEntity: &NpcEntity{
|
||||
NpcId: npcId,
|
||||
RoomId: roomId,
|
||||
@@ -266,12 +266,12 @@ func (s *Scene) CreateEntityNpc(pos, rot *model.Vector, npcId, roomId, parentQue
|
||||
return entity.id
|
||||
}
|
||||
|
||||
func (s *Scene) CreateEntityGadgetNormal(pos, rot *model.Vector, gadgetId uint32, configId uint32, objectId int64) uint32 {
|
||||
func (s *Scene) CreateEntityGadgetNormal(pos, rot *model.Vector, gadgetId uint32, configId uint32, objectId uint64) uint32 {
|
||||
_, exist := s.objectIdEntityMap[objectId]
|
||||
if exist {
|
||||
return 0
|
||||
}
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_ID_TYPE_GADGET)
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_TYPE_GADGET)
|
||||
entity := &Entity{
|
||||
id: entityId,
|
||||
scene: s,
|
||||
@@ -282,11 +282,11 @@ func (s *Scene) CreateEntityGadgetNormal(pos, rot *model.Vector, gadgetId uint32
|
||||
lastMoveSceneTimeMs: 0,
|
||||
lastMoveReliableSeq: 0,
|
||||
fightProp: map[uint32]float32{
|
||||
uint32(constant.FIGHT_PROP_CUR_HP): math.MaxFloat32,
|
||||
uint32(constant.FIGHT_PROP_MAX_HP): math.MaxFloat32,
|
||||
uint32(constant.FIGHT_PROP_BASE_HP): float32(1),
|
||||
constant.FIGHT_PROP_CUR_HP: math.MaxFloat32,
|
||||
constant.FIGHT_PROP_MAX_HP: math.MaxFloat32,
|
||||
constant.FIGHT_PROP_BASE_HP: float32(1),
|
||||
},
|
||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_GADGET),
|
||||
entityType: constant.ENTITY_TYPE_GADGET,
|
||||
gadgetEntity: &GadgetEntity{
|
||||
gadgetId: gadgetId,
|
||||
gadgetType: GADGET_TYPE_NORMAL,
|
||||
@@ -298,12 +298,12 @@ func (s *Scene) CreateEntityGadgetNormal(pos, rot *model.Vector, gadgetId uint32
|
||||
return entity.id
|
||||
}
|
||||
|
||||
func (s *Scene) CreateEntityGadgetGather(pos, rot *model.Vector, gadgetId uint32, gatherId uint32, configId uint32, objectId int64) uint32 {
|
||||
func (s *Scene) CreateEntityGadgetGather(pos, rot *model.Vector, gadgetId uint32, gatherId uint32, configId uint32, objectId uint64) uint32 {
|
||||
_, exist := s.objectIdEntityMap[objectId]
|
||||
if exist {
|
||||
return 0
|
||||
}
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_ID_TYPE_GADGET)
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_TYPE_GADGET)
|
||||
entity := &Entity{
|
||||
id: entityId,
|
||||
scene: s,
|
||||
@@ -314,11 +314,11 @@ func (s *Scene) CreateEntityGadgetGather(pos, rot *model.Vector, gadgetId uint32
|
||||
lastMoveSceneTimeMs: 0,
|
||||
lastMoveReliableSeq: 0,
|
||||
fightProp: map[uint32]float32{
|
||||
uint32(constant.FIGHT_PROP_CUR_HP): math.MaxFloat32,
|
||||
uint32(constant.FIGHT_PROP_MAX_HP): math.MaxFloat32,
|
||||
uint32(constant.FIGHT_PROP_BASE_HP): float32(1),
|
||||
constant.FIGHT_PROP_CUR_HP: math.MaxFloat32,
|
||||
constant.FIGHT_PROP_MAX_HP: math.MaxFloat32,
|
||||
constant.FIGHT_PROP_BASE_HP: float32(1),
|
||||
},
|
||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_GADGET),
|
||||
entityType: constant.ENTITY_TYPE_GADGET,
|
||||
gadgetEntity: &GadgetEntity{
|
||||
gadgetId: gadgetId,
|
||||
gadgetType: GADGET_TYPE_GATHER,
|
||||
@@ -344,11 +344,11 @@ func (s *Scene) CreateEntityGadgetClient(pos, rot *model.Vector, entityId uint32
|
||||
lastMoveSceneTimeMs: 0,
|
||||
lastMoveReliableSeq: 0,
|
||||
fightProp: map[uint32]float32{
|
||||
uint32(constant.FIGHT_PROP_CUR_HP): math.MaxFloat32,
|
||||
uint32(constant.FIGHT_PROP_MAX_HP): math.MaxFloat32,
|
||||
uint32(constant.FIGHT_PROP_BASE_HP): float32(1),
|
||||
constant.FIGHT_PROP_CUR_HP: math.MaxFloat32,
|
||||
constant.FIGHT_PROP_MAX_HP: math.MaxFloat32,
|
||||
constant.FIGHT_PROP_BASE_HP: float32(1),
|
||||
},
|
||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_GADGET),
|
||||
entityType: constant.ENTITY_TYPE_GADGET,
|
||||
gadgetEntity: &GadgetEntity{
|
||||
gadgetType: GADGET_TYPE_CLIENT,
|
||||
gadgetClientEntity: &GadgetClientEntity{
|
||||
@@ -370,7 +370,7 @@ func (s *Scene) CreateEntityGadgetVehicle(uid uint32, pos, rot *model.Vector, ve
|
||||
logger.Error("player is nil, uid: %v", uid)
|
||||
return 0
|
||||
}
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_ID_TYPE_GADGET)
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_TYPE_GADGET)
|
||||
entity := &Entity{
|
||||
id: entityId,
|
||||
scene: s,
|
||||
@@ -382,11 +382,11 @@ func (s *Scene) CreateEntityGadgetVehicle(uid uint32, pos, rot *model.Vector, ve
|
||||
lastMoveReliableSeq: 0,
|
||||
fightProp: map[uint32]float32{
|
||||
// TODO 以后使用配置表
|
||||
uint32(constant.FIGHT_PROP_CUR_HP): 114514,
|
||||
uint32(constant.FIGHT_PROP_MAX_HP): 114514,
|
||||
uint32(constant.FIGHT_PROP_BASE_HP): float32(1),
|
||||
constant.FIGHT_PROP_CUR_HP: 114514,
|
||||
constant.FIGHT_PROP_MAX_HP: 114514,
|
||||
constant.FIGHT_PROP_BASE_HP: float32(1),
|
||||
},
|
||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_GADGET),
|
||||
entityType: constant.ENTITY_TYPE_GADGET,
|
||||
gadgetEntity: &GadgetEntity{
|
||||
gadgetType: GADGET_TYPE_VEHICLE,
|
||||
gadgetVehicleEntity: &GadgetVehicleEntity{
|
||||
@@ -402,7 +402,7 @@ func (s *Scene) CreateEntityGadgetVehicle(uid uint32, pos, rot *model.Vector, ve
|
||||
return entity.id
|
||||
}
|
||||
|
||||
func (s *Scene) CreateEntity(entity *Entity, objectId int64) {
|
||||
func (s *Scene) CreateEntity(entity *Entity, objectId uint64) {
|
||||
if len(s.entityMap) >= ENTITY_MAX_SEND_NUM && !ENTITY_NUM_UNLIMIT {
|
||||
logger.Error("above max scene entity num limit: %v, id: %v, pos: %v", ENTITY_MAX_SEND_NUM, entity.id, entity.pos)
|
||||
return
|
||||
@@ -434,29 +434,29 @@ func (s *Scene) GetEntity(entityId uint32) *Entity {
|
||||
return s.entityMap[entityId]
|
||||
}
|
||||
|
||||
func (s *Scene) GetEntityByObjectId(objectId int64) *Entity {
|
||||
func (s *Scene) GetEntityByObjectId(objectId uint64) *Entity {
|
||||
return s.objectIdEntityMap[objectId]
|
||||
}
|
||||
|
||||
// Entity 场景实体数据结构
|
||||
type Entity struct {
|
||||
id uint32
|
||||
scene *Scene
|
||||
lifeState uint16
|
||||
pos *model.Vector
|
||||
rot *model.Vector
|
||||
moveState uint16
|
||||
id uint32 // 实体id
|
||||
scene *Scene // 实体归属上级场景的访问指针
|
||||
lifeState uint16 // 存活状态
|
||||
pos *model.Vector // 位置
|
||||
rot *model.Vector // 朝向
|
||||
moveState uint16 // 运动状态
|
||||
lastMoveSceneTimeMs uint32
|
||||
lastMoveReliableSeq uint32
|
||||
fightProp map[uint32]float32
|
||||
entityType uint32
|
||||
level uint8
|
||||
fightProp map[uint32]float32 // 战斗属性
|
||||
level uint8 // 等级
|
||||
entityType uint8 // 实体类型
|
||||
avatarEntity *AvatarEntity
|
||||
monsterEntity *MonsterEntity
|
||||
npcEntity *NpcEntity
|
||||
gadgetEntity *GadgetEntity
|
||||
configId uint32
|
||||
objectId int64
|
||||
configId uint32 // 配置表相关
|
||||
objectId uint64
|
||||
}
|
||||
|
||||
func (e *Entity) GetId() uint32 {
|
||||
@@ -503,14 +503,14 @@ func (e *Entity) GetFightProp() map[uint32]float32 {
|
||||
return e.fightProp
|
||||
}
|
||||
|
||||
func (e *Entity) GetEntityType() uint32 {
|
||||
return e.entityType
|
||||
}
|
||||
|
||||
func (e *Entity) GetLevel() uint8 {
|
||||
return e.level
|
||||
}
|
||||
|
||||
func (e *Entity) GetEntityType() uint8 {
|
||||
return e.entityType
|
||||
}
|
||||
|
||||
func (e *Entity) GetAvatarEntity() *AvatarEntity {
|
||||
return e.avatarEntity
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ type Avatar struct {
|
||||
Promote uint8 // 突破等阶
|
||||
Satiation uint32 // 饱食度
|
||||
SatiationPenalty uint32 // 饱食度溢出
|
||||
CurrHP float64 // 当前生命值
|
||||
CurrEnergy float64 // 当前元素能量值
|
||||
CurrHP float32 // 当前生命值
|
||||
CurrEnergy float32 // 当前元素能量值
|
||||
FetterList []uint32 // 资料解锁条目
|
||||
SkillLevelMap map[uint32]uint32 // 技能等级数据
|
||||
SkillDepotId uint32 // 技能库id
|
||||
@@ -75,22 +75,22 @@ func (a *DbAvatar) InitAvatarFightProp(avatar *Avatar) {
|
||||
return
|
||||
}
|
||||
avatar.FightPropMap = make(map[uint32]float32)
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_NONE)] = 0.0
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_NONE] = 0.0
|
||||
// 白字攻防血
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_BASE_ATTACK)] = float32(avatarDataConfig.GetBaseAttackByLevel(avatar.Level))
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_BASE_DEFENSE)] = float32(avatarDataConfig.GetBaseDefenseByLevel(avatar.Level))
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_BASE_HP)] = float32(avatarDataConfig.GetBaseHpByLevel(avatar.Level))
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_BASE_ATTACK] = avatarDataConfig.GetBaseAttackByLevel(avatar.Level)
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_BASE_DEFENSE] = avatarDataConfig.GetBaseDefenseByLevel(avatar.Level)
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_BASE_HP] = avatarDataConfig.GetBaseHpByLevel(avatar.Level)
|
||||
// 白字+绿字攻防血
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_CUR_ATTACK)] = float32(avatarDataConfig.GetBaseAttackByLevel(avatar.Level))
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_CUR_DEFENSE)] = float32(avatarDataConfig.GetBaseDefenseByLevel(avatar.Level))
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_MAX_HP)] = float32(avatarDataConfig.GetBaseHpByLevel(avatar.Level))
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CUR_ATTACK] = avatarDataConfig.GetBaseAttackByLevel(avatar.Level)
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CUR_DEFENSE] = avatarDataConfig.GetBaseDefenseByLevel(avatar.Level)
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_MAX_HP] = avatarDataConfig.GetBaseHpByLevel(avatar.Level)
|
||||
// 当前血量
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_CUR_HP)] = float32(avatar.CurrHP)
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CUR_HP] = avatar.CurrHP
|
||||
// 双暴
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_CRITICAL)] = float32(avatarDataConfig.Critical)
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_CRITICAL_HURT)] = float32(avatarDataConfig.CriticalHurt)
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CRITICAL] = avatarDataConfig.Critical
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CRITICAL_HURT] = avatarDataConfig.CriticalHurt
|
||||
// 元素充能
|
||||
avatar.FightPropMap[uint32(constant.FIGHT_PROP_CHARGE_EFFICIENCY)] = 1.0
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CHARGE_EFFICIENCY] = 1.0
|
||||
a.SetCurrEnergy(avatar, avatar.CurrEnergy, true)
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ func (a *DbAvatar) AddAvatar(player *Player, avatarId uint32) {
|
||||
a.AvatarMap[avatarId] = avatar
|
||||
}
|
||||
|
||||
func (a *DbAvatar) SetCurrEnergy(avatar *Avatar, value float64, max bool) {
|
||||
func (a *DbAvatar) SetCurrEnergy(avatar *Avatar, value float32, max bool) {
|
||||
var avatarSkillDataConfig *gdconf.AvatarSkillData = nil
|
||||
if avatar.AvatarId == 10000005 || avatar.AvatarId == 10000007 {
|
||||
avatarSkillDepotDataConfig := gdconf.GetAvatarSkillDepotDataById(int32(avatar.SkillDepotId))
|
||||
@@ -185,7 +185,7 @@ func (a *DbAvatar) SetCurrEnergy(avatar *Avatar, value float64, max bool) {
|
||||
if max {
|
||||
avatar.FightPropMap[uint32(elementType.CurrEnergyProp)] = float32(avatarSkillDataConfig.CostElemVal)
|
||||
} else {
|
||||
avatar.FightPropMap[uint32(elementType.CurrEnergyProp)] = float32(value)
|
||||
avatar.FightPropMap[uint32(elementType.CurrEnergyProp)] = value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ type DbQuest struct {
|
||||
// Quest 任务
|
||||
type Quest struct {
|
||||
QuestId uint32 // 任务id
|
||||
State uint32 // 任务状态
|
||||
State uint8 // 任务状态
|
||||
AcceptTime uint32 // 接取时间
|
||||
StartTime uint32 // 开始执行时间
|
||||
FinishProgressList []uint32 // 任务进度
|
||||
@@ -55,7 +55,7 @@ func (q *DbQuest) AddQuest(questId uint32) {
|
||||
}
|
||||
q.QuestMap[questId] = &Quest{
|
||||
QuestId: uint32(questDataConfig.QuestId),
|
||||
State: constant.QUEST_STATE_TYPE_ACCEPT,
|
||||
State: constant.QUEST_STATE_UNSTARTED,
|
||||
AcceptTime: uint32(time.Now().Unix()),
|
||||
StartTime: 0,
|
||||
FinishProgressList: nil,
|
||||
@@ -69,7 +69,7 @@ func (q *DbQuest) ExecQuest(questId uint32) {
|
||||
logger.Error("get quest is nil, questId: %v", questId)
|
||||
return
|
||||
}
|
||||
if quest.State != constant.QUEST_STATE_TYPE_ACCEPT {
|
||||
if quest.State != constant.QUEST_STATE_UNSTARTED {
|
||||
logger.Error("invalid quest state, questId: %v, state: %v", questId, quest.State)
|
||||
return
|
||||
}
|
||||
@@ -78,7 +78,7 @@ func (q *DbQuest) ExecQuest(questId uint32) {
|
||||
logger.Error("get quest data config is nil, questId: %v", questId)
|
||||
return
|
||||
}
|
||||
quest.State = constant.QUEST_STATE_TYPE_EXEC
|
||||
quest.State = constant.QUEST_STATE_UNFINISHED
|
||||
quest.StartTime = uint32(time.Now().Unix())
|
||||
quest.FinishProgressList = make([]uint32, len(questDataConfig.FinishCondList))
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func (q *DbQuest) AddQuestProgress(questId uint32, index int, progress uint32) {
|
||||
logger.Error("get quest is nil, questId: %v", questId)
|
||||
return
|
||||
}
|
||||
if quest.State != constant.QUEST_STATE_TYPE_EXEC {
|
||||
if quest.State != constant.QUEST_STATE_UNFINISHED {
|
||||
logger.Error("invalid quest state, questId: %v, state: %v", questId, quest.State)
|
||||
return
|
||||
}
|
||||
@@ -115,7 +115,7 @@ func (q *DbQuest) AddQuestProgress(questId uint32, index int, progress uint32) {
|
||||
}
|
||||
quest.FinishProgressList[index] += progress
|
||||
if quest.FinishProgressList[index] >= uint32(questDataConfig.FinishCondList[index].Count) {
|
||||
quest.State = constant.QUEST_STATE_TYPE_FINISH
|
||||
quest.State = constant.QUEST_STATE_FINISHED
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user