Merge remote-tracking branch 'origin/develop' into feature/save-skill-combo
# Conflicts: # Assets/PerfectWorld/Resources/UI/DialogScriptTableObject.asset # Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs
This commit is contained in:
@@ -131,6 +131,7 @@ public partial class CECGameRun
|
||||
|
||||
private void LoadPrefabs()
|
||||
{
|
||||
BMLogger.LogError("CECGameRun::LoadPrefabs, Loading prefabs from Resources. Consider using Addressables for better performance and memory management.");
|
||||
_playerPrefab = Resources.Load<GameObject>(AddressResourceConfig.PlayerPrefab);
|
||||
_monsterPrefab = Resources.Load<GameObject>(AddressResourceConfig.MonsterPrefab);
|
||||
_npcServerPrefab = Resources.Load<GameObject>(AddressResourceConfig.NpcServerPrefab);
|
||||
|
||||
@@ -52,7 +52,11 @@ namespace BrewMonster
|
||||
foreach (var it in items)
|
||||
{
|
||||
if (it != null && it.Slot >= 0 && it.Slot < size)
|
||||
{
|
||||
if (it.Content != null && it.Content.Length > 0)
|
||||
it.SetItemInfo(it.Content, it.Content.Length);
|
||||
inv.SetItem(it.Slot, it);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ using System.Runtime.InteropServices;
|
||||
using BrewMonster.Assets.PerfectWorld.Scripts.Players;
|
||||
using UnityEngine;
|
||||
using static BrewMonster.Scripts.Pet.CECPetData;
|
||||
using BrewMonster.Scripts.Managers;
|
||||
using static PerfectWorld.Scripts.Managers.EC_IvtrEquip;
|
||||
using PerfectWorld.Scripts.Managers;
|
||||
|
||||
namespace BrewMonster
|
||||
{
|
||||
@@ -64,425 +67,21 @@ namespace BrewMonster
|
||||
}
|
||||
}
|
||||
|
||||
void OnMsgHstPetOpt(ECMSG Msg)
|
||||
{
|
||||
CECGameRun pGameRun = EC_Game.GetGameRun();
|
||||
int header = Convert.ToInt32(Msg.dwParam2);
|
||||
switch (header)
|
||||
{
|
||||
case CommandID.GAIN_PET:
|
||||
{
|
||||
cmd_gain_pet pCmd = GPDataTypeHelper.FromBytes<cmd_gain_pet>((byte[])Msg.dwParam1);
|
||||
m_pPetCorral.AddPet(pCmd.slot_index, pCmd.data);
|
||||
|
||||
// Print a notify
|
||||
CECPetData pPet = m_pPetCorral.GetPetData(pCmd.slot_index);
|
||||
if (pPet != null)
|
||||
{
|
||||
if (pPet.IsFollowPet() || pPet.IsCombatPet() || pPet.IsEvolutionPet())
|
||||
{
|
||||
// TO DO: fix later
|
||||
//pGameRun.AddFixedMessage(FIXMSG_PET_HATCH, pPet.GetName());
|
||||
}
|
||||
else if (pPet.IsSummonPet())
|
||||
{
|
||||
// TO DO: fix later
|
||||
//pGameRun.AddFixedMessage(FIXMSG_SUMMON_PET_APPEAR, pPet.GetName());
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case CommandID.FREE_PET:
|
||||
{
|
||||
cmd_free_pet pCmd = GPDataTypeHelper.FromBytes<cmd_free_pet>((byte[])Msg.dwParam1);
|
||||
|
||||
// Print a notify
|
||||
CECPetData pPet = m_pPetCorral.GetPetData(pCmd.slot_index);
|
||||
if (pPet != null)
|
||||
{
|
||||
if (pPet.IsFollowPet() || pPet.IsCombatPet() || pPet.IsEvolutionPet())
|
||||
{
|
||||
// TO DO: fix later
|
||||
//pGameRun.AddFixedMessage(FIXMSG_PET_FREE, pPet.GetName());
|
||||
}
|
||||
else if (pPet.IsSummonPet())
|
||||
{
|
||||
// TO DO: fix later
|
||||
//pGameRun.AddFixedMessage(FIXMSG_SUMMON_PET_DISAPPEAR, pPet.GetName());
|
||||
}
|
||||
}
|
||||
|
||||
// Remove pet from corral
|
||||
m_pPetCorral.FreePet(pCmd.slot_index, pCmd.pet_id);
|
||||
// Update pet shortcuts
|
||||
UpdateFreedPetSC(pCmd.slot_index);
|
||||
|
||||
break;
|
||||
}
|
||||
case CommandID.SUMMON_PET:
|
||||
{
|
||||
cmd_summon_pet pCmd = GPDataTypeHelper.FromBytes<cmd_summon_pet>((byte[])Msg.dwParam1);
|
||||
CECPetData pPet = m_pPetCorral.GetPetData(pCmd.slot_index);
|
||||
//ASSERT(pPet && pPet.GetTemplateID() == pCmd.pet_tid);
|
||||
m_pPetCorral.SetActivePetIndex(pCmd.slot_index);
|
||||
m_pPetCorral.SetActivePetNPCID(pCmd.pet_pid);
|
||||
m_pPetCorral.SetActivePetLifetime(pCmd.life_time);
|
||||
|
||||
if (EC_Game.GetConfigs().GetGameSettings().bPetAutoSkill)
|
||||
{
|
||||
for (int i = 0; i < pPet.GetSkillNum(SKILLTYPE.EM_SKILL_DEFAULT); i++)
|
||||
{
|
||||
PETSKILL? pSkill = pPet.GetSkill(SKILLTYPE.EM_SKILL_DEFAULT, i);
|
||||
if (pSkill != null && EC_Game.IsPetAutoSkill(pSkill.Value.idSkill))
|
||||
pPet.AddAutoSkill(pSkill.Value.idSkill);
|
||||
}
|
||||
}
|
||||
|
||||
// TO DO: fix later
|
||||
//OnPetSays(pCmd.pet_tid, pCmd.pet_pid, CECPetWords::TW_SUMMON);
|
||||
//if (pPet.IsCombatPet() || pPet.IsSummonPet() || pPet.IsEvolutionPet())
|
||||
// CDlgQuickBarPet::ResetAutoCastSkill();
|
||||
break;
|
||||
}
|
||||
case CommandID.RECALL_PET:
|
||||
{
|
||||
cmd_recall_pet pCmd = GPDataTypeHelper.FromBytes<cmd_recall_pet>((byte[])Msg.dwParam1);
|
||||
//ASSERT(pCmd.slot_index == m_pPetCorral.GetActivePetIndex());
|
||||
|
||||
int tid = pCmd.pet_id;
|
||||
int nid = m_pPetCorral.GetActivePetNPCID();
|
||||
|
||||
// �����л�˵
|
||||
switch (pCmd.reason)
|
||||
{
|
||||
case (char)PET_RECALL_REASON.PET_RECALL_DEFAULT:
|
||||
//OnPetSays(tid, nid, CECPetWords::TW_RECALL);
|
||||
break;
|
||||
|
||||
case (char)PET_RECALL_REASON.PET_RECALL_DEATH:
|
||||
//OnPetSays(tid, nid, CECPetWords::TW_DEAD);
|
||||
break;
|
||||
|
||||
case (char)PET_RECALL_REASON.PET_RECALL_LIFE_EXHAUST:
|
||||
//OnPetSays(tid, nid, CECPetWords::TW_DISAPPEAR);
|
||||
break;
|
||||
|
||||
case (char)PET_RECALL_REASON.PET_RECALL_SACRIFICE:
|
||||
//OnPetSays(tid, nid, CECPetWords::TW_SACRIFICE);
|
||||
break;
|
||||
}
|
||||
|
||||
CECPetData pPet = m_pPetCorral.GetActivePet();
|
||||
if (pPet != null)
|
||||
pPet.OnPetDead();
|
||||
|
||||
m_pPetCorral.SetActivePetIndex(-1);
|
||||
m_pPetCorral.SetActivePetNPCID(0);
|
||||
m_bPetInSanctuary = false;
|
||||
break;
|
||||
}
|
||||
case CommandID.PLAYER_START_PET_OP:
|
||||
{
|
||||
cmd_player_start_pet_op pCmd =
|
||||
GPDataTypeHelper.FromBytes<cmd_player_start_pet_op>((byte[])Msg.dwParam1);
|
||||
int iDoWhat;
|
||||
if (pCmd.op == 0)
|
||||
iDoWhat = (int)CECHPWorkConcentrate.eDO_PET.DO_SUMMONPET;
|
||||
else if (pCmd.op == 1)
|
||||
iDoWhat = (int)CECHPWorkConcentrate.eDO_PET.DO_RECALLPET;
|
||||
else if (pCmd.op == 2)
|
||||
iDoWhat = (int)CECHPWorkConcentrate.eDO_PET.DO_BANISHPET;
|
||||
else if (pCmd.op == 3)
|
||||
iDoWhat = (int)CECHPWorkConcentrate.eDO_PET.DO_RESTOREPET;
|
||||
else
|
||||
iDoWhat = (int)CECHPWorkConcentrate.eDO_PET.DO_UNKNOWN;
|
||||
|
||||
m_PetOptCnt.SetPeriod(pCmd.delay * 50);
|
||||
m_PetOptCnt.Reset();
|
||||
|
||||
CECHPWorkConcentrate pWork =
|
||||
(CECHPWorkConcentrate)m_pWorkMan.CreateWork(CECHPWork.Host_work_ID.WORK_CONCENTRATE);
|
||||
pWork.SetDoWhat(iDoWhat);
|
||||
m_pWorkMan.StartWork_p1(pWork);
|
||||
break;
|
||||
}
|
||||
case CommandID.PLAYER_STOP_PET_OP:
|
||||
{
|
||||
if (IsOperatingPet() != 0)
|
||||
m_pWorkMan.FinishRunningWork(CECHPWork.Host_work_ID.WORK_CONCENTRATE);
|
||||
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_RECEIVE_EXP:
|
||||
{
|
||||
cmd_pet_receive_exp pCmd = GPDataTypeHelper.FromBytes<cmd_pet_receive_exp>((byte[])Msg.dwParam1);
|
||||
CECPetData pPet = m_pPetCorral.GetPetData(pCmd.slot_index);
|
||||
if (pPet != null)
|
||||
{
|
||||
//ASSERT(pPet.GetTemplateID() == pCmd.pet_id);
|
||||
pPet.AddExp(pCmd.exp);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_LEVELUP:
|
||||
{
|
||||
cmd_pet_levelup pCmd = GPDataTypeHelper.FromBytes<cmd_pet_levelup>((byte[])Msg.dwParam1);
|
||||
CECPetData pPet = m_pPetCorral.GetPetData(pCmd.slot_index);
|
||||
if (pPet != null)
|
||||
{
|
||||
//ASSERT(pPet.GetTemplateID() == pCmd.pet_id);
|
||||
pPet.LevelUp(pCmd.level, pCmd.exp);
|
||||
}
|
||||
|
||||
//pGameRun.AddFixedMessage(FIXMSG_PET_LEVELUP, pCmd.level);
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_ROOM:
|
||||
{
|
||||
cmd_pet_room pCmd = GPDataTypeHelper.FromBytes<cmd_pet_room>((byte[])Msg.dwParam1);
|
||||
m_pPetCorral.UpdatePets(pCmd, (byte[])Msg.dwParam1);
|
||||
|
||||
CECGameUIMan pGameUI = EC_Game.GetGameRun().GetUIManager().GetInGameUIMan();
|
||||
|
||||
//if (pGameUI.GetDialog("Win_Teach").IsShow())
|
||||
// {
|
||||
// //pGameUI.UpdateTeach();
|
||||
// }
|
||||
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_ROOM_CAPACITY:
|
||||
{
|
||||
cmd_pet_room_capacity pCmd =
|
||||
GPDataTypeHelper.FromBytes<cmd_pet_room_capacity>((byte[])Msg.dwParam1);
|
||||
m_pPetCorral.MagnifyPetSlots((int)pCmd.capacity);
|
||||
|
||||
if (m_pPetCorral.HasInit())
|
||||
{
|
||||
//pGameRun.AddFixedMessage(FIXMSG_PET_ROOM_SIZE, pCmd.capacity);
|
||||
}
|
||||
else
|
||||
m_pPetCorral.SetHasInit(true);
|
||||
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_HONOR_POINT:
|
||||
{
|
||||
cmd_pet_honor_point pCmd = GPDataTypeHelper.FromBytes<cmd_pet_honor_point>((byte[])Msg.dwParam1);
|
||||
CECPetData pPet = m_pPetCorral.GetPetData(pCmd.index);
|
||||
if (pPet != null)
|
||||
pPet.SetIntimacy(pCmd.cur_honor_point);
|
||||
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_HUNGER_GAUGE:
|
||||
{
|
||||
cmd_pet_hunger_gauge pCmd = GPDataTypeHelper.FromBytes<cmd_pet_hunger_gauge>((byte[])Msg.dwParam1);
|
||||
CECPetData pPet = m_pPetCorral.GetPetData(pCmd.index);
|
||||
if (pPet != null)
|
||||
pPet.SetHunger(pCmd.cur_hunge_gauge);
|
||||
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_DEAD:
|
||||
{
|
||||
cmd_pet_dead pCmd = GPDataTypeHelper.FromBytes<cmd_pet_dead>((byte[])Msg.dwParam1);
|
||||
CECPetData pPet = m_pPetCorral.GetPetData((int)pCmd.pet_index);
|
||||
if (pPet != null)
|
||||
{
|
||||
pPet.SetHPFactor(0.0f);
|
||||
pPet.SetHP(0);
|
||||
pPet.OnPetDead();
|
||||
}
|
||||
|
||||
//pGameRun.AddFixedMessage(FIXMSG_PET_DEAD);
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_REVIVE:
|
||||
{
|
||||
cmd_pet_revive pCmd = GPDataTypeHelper.FromBytes<cmd_pet_revive>((byte[])Msg.dwParam1);
|
||||
CECPetData pPet = m_pPetCorral.GetPetData((int)pCmd.pet_index);
|
||||
if (pPet != null)
|
||||
pPet.SetHPFactor(pCmd.hp_factor);
|
||||
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_HP_NOTIFY:
|
||||
{
|
||||
cmd_pet_hp_notify pCmd = GPDataTypeHelper.FromBytes<cmd_pet_hp_notify>((byte[])Msg.dwParam1);
|
||||
CECPetData pPet = m_pPetCorral.GetPetData((int)pCmd.pet_index);
|
||||
if (pPet != null)
|
||||
{
|
||||
int lastHP = pPet.GetHP();
|
||||
|
||||
pPet.SetHPFactor(pCmd.hp_factor);
|
||||
pPet.SetHP(pCmd.cur_hp);
|
||||
|
||||
pPet.SetMPFactor(pCmd.mp_factor);
|
||||
pPet.SetMP(pCmd.cur_mp);
|
||||
|
||||
// If HP is too low, popup a warning on pet's head
|
||||
int iLimit = (int)(pPet.CalcMaxHP() * 0.3f);
|
||||
if (pCmd.cur_hp < lastHP && lastHP != 0 && pCmd.cur_hp < iLimit)
|
||||
{
|
||||
CECNPC pNPC = EC_Game.GetGameRun().GetWorld().GetNPCMan()
|
||||
.GetNPC(m_pPetCorral.GetActivePetNPCID());
|
||||
if (pNPC && pNPC.GetMasterID() == GetCharacterID())
|
||||
{
|
||||
//pNPC.BubbleText(CECNPC::BUBBLE_HPWARN, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_AI_STATE:
|
||||
{
|
||||
cmd_pet_ai_state pCmd = GPDataTypeHelper.FromBytes<cmd_pet_ai_state>((byte[])Msg.dwParam1);
|
||||
|
||||
// �����л�˵
|
||||
CECPetData pPetData = m_pPetCorral.GetActivePet();
|
||||
if (pPetData != null)
|
||||
{
|
||||
int tid = pPetData.GetTemplateID();
|
||||
int nid = m_pPetCorral.GetActivePetNPCID();
|
||||
if (m_pPetCorral.GetMoveMode() != pCmd.move)
|
||||
{
|
||||
switch (pCmd.move)
|
||||
{
|
||||
case (byte)CECPetCorral.ePet_MovingMode.MOVE_FOLLOW:
|
||||
{
|
||||
//OnPetSays(tid, nid, CECPetWords::TW_FOLLOW);
|
||||
break;
|
||||
}
|
||||
case (byte)CECPetCorral.ePet_MovingMode.MOVE_STAND:
|
||||
{
|
||||
//OnPetSays(tid, nid, CECPetWords::TW_STOP);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pPetCorral.GetAttackMode() != pCmd.attack)
|
||||
{
|
||||
switch (pCmd.attack)
|
||||
{
|
||||
case (byte)CECPetCorral.ePet_AttackingMode.ATK_DEFENSE:
|
||||
//OnPetSays(tid, nid, CECPetWords::TW_DEFENSIVE);
|
||||
break;
|
||||
|
||||
case (byte)CECPetCorral.ePet_AttackingMode.ATK_POSITIVE:
|
||||
//OnPetSays(tid, nid, CECPetWords::TW_OFFENSIVE);
|
||||
break;
|
||||
|
||||
case (byte)CECPetCorral.ePet_AttackingMode.ATK_PASSIVE:
|
||||
//OnPetSays(tid, nid, CECPetWords::TW_PASSIVE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_pPetCorral.SetMoveMode(pCmd.move);
|
||||
m_pPetCorral.SetAttackMode(pCmd.attack);
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_SET_COOLDOWN:
|
||||
{
|
||||
cmd_pet_set_cooldown pCmd = GPDataTypeHelper.FromBytes<cmd_pet_set_cooldown>((byte[])Msg.dwParam1);
|
||||
CECPetData pPet = m_pPetCorral.GetPetData(pCmd.pet_index);
|
||||
if (pPet != null)
|
||||
pPet.SetSkillCoolTime(pCmd.cooldown_index, pCmd.cooldown_time);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case CommandID.SUMMON_PLANT_PET:
|
||||
{
|
||||
int size = Marshal.SizeOf<cmd_summon_plant_pet>();
|
||||
if (((byte[])Msg.dwParam1).Length >= size)
|
||||
{
|
||||
cmd_summon_plant_pet pCmd =
|
||||
GPDataTypeHelper.FromBytes<cmd_summon_plant_pet>((byte[])Msg.dwParam1);
|
||||
m_pPetCorral.PlantPetEnter(pCmd);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case CommandID.PLANT_PET_DISAPPEAR:
|
||||
{
|
||||
int size = Marshal.SizeOf<cmd_plant_pet_disapper>();
|
||||
if (((byte[])Msg.dwParam1).Length >= size)
|
||||
{
|
||||
cmd_plant_pet_disapper pCmd =
|
||||
GPDataTypeHelper.FromBytes<cmd_plant_pet_disapper>((byte[])Msg.dwParam1);
|
||||
m_pPetCorral.PlantPetDisappear(pCmd);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case CommandID.PLANT_PET_HP_NOTIFY:
|
||||
{
|
||||
int size = Marshal.SizeOf<cmd_plant_pet_hp_notify>();
|
||||
if (((byte[])Msg.dwParam1).Length >= size)
|
||||
{
|
||||
cmd_plant_pet_hp_notify pCmd =
|
||||
GPDataTypeHelper.FromBytes<cmd_plant_pet_hp_notify>((byte[])Msg.dwParam1);
|
||||
m_pPetCorral.PlantPetInfo(pCmd);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case CommandID.PET_PROPERTY:
|
||||
{
|
||||
cmd_pet_property pCmd = GPDataTypeHelper.FromBytes<cmd_pet_property>((byte[])Msg.dwParam1);
|
||||
CECPetData pPet = m_pPetCorral.GetPetData(pCmd.pet_index);
|
||||
if (pPet != null)
|
||||
{
|
||||
pPet.SetExtendProps(pCmd.prop);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case CommandID.PET_REBUILD_INHERIT_START:
|
||||
case CommandID.PET_REBUILD_INHERIT_INFO:
|
||||
case CommandID.PET_REBUILD_INHERIT_END:
|
||||
case CommandID.PET_EVOLUTION_DONE:
|
||||
case CommandID.PET_REBUILD_NATURE_START:
|
||||
case CommandID.PET_REBUILD_NATURE_INFO:
|
||||
case CommandID.PET_REBUILD_NATURE_END:
|
||||
{
|
||||
CECGameUIMan pGameUI = EC_Game.GetGameRun().GetUIManager().GetInGameUIMan();
|
||||
if (pGameUI != null)
|
||||
{
|
||||
//((CDlgPreviewPetRebuild*)pGameUI.GetDialog("Win_PreviewPet")).OnServerNotify(Msg.dwParam2, (void*)Msg.dwParam1);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Is host operating pet ?
|
||||
return value:
|
||||
return value:
|
||||
|
||||
0: host doesn't operating pet.
|
||||
1: host is summoning pet.
|
||||
2: host is recalling pet.
|
||||
3: host is banishing pet.
|
||||
*/
|
||||
0: host doesn't operating pet.
|
||||
1: host is summoning pet.
|
||||
2: host is recalling pet.
|
||||
3: host is banishing pet.
|
||||
*/
|
||||
public int IsOperatingPet()
|
||||
{
|
||||
CECHPWorkConcentrate pWork =
|
||||
(m_pWorkMan.GetRunningWork(CECHPWork.Host_work_ID.WORK_CONCENTRATE)) as CECHPWorkConcentrate;
|
||||
if (m_pWorkMan == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
CECHPWorkConcentrate pWork = (m_pWorkMan.GetRunningWork(CECHPWork.Host_work_ID.WORK_CONCENTRATE)) as CECHPWorkConcentrate;
|
||||
if (pWork != null)
|
||||
{
|
||||
if (pWork.GetDoWhat() == (int)CECHPWorkConcentrate.eDO_PET.DO_SUMMONPET)
|
||||
@@ -494,7 +93,6 @@ namespace BrewMonster
|
||||
else if (pWork.GetDoWhat() == (int)CECHPWorkConcentrate.eDO_PET.DO_RESTOREPET)
|
||||
return 4;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -505,6 +103,7 @@ namespace BrewMonster
|
||||
m_pActionSwitcher.PostMessge((int)EMsgActionSwitcher.MSG_MOUNTPET);
|
||||
|
||||
CECGameRun pGameRun = EC_Game.GetGameRun();
|
||||
CECUIManager pGameUI = pGameRun.GetUIManager();
|
||||
|
||||
CECPetData pPet = m_pPetCorral.GetPetData(iPetIdx);
|
||||
if (pPet == null)
|
||||
@@ -517,7 +116,8 @@ namespace BrewMonster
|
||||
if (pPet.IsDead())
|
||||
{
|
||||
//pGameRun.AddFixedMessage(FIXMSG_PET_DEAD);
|
||||
Debug.LogError("FIXMSG_PET_DEAD");
|
||||
//Debug.LogError("FIXMSG_PET_DEAD");
|
||||
pGameUI.ShowMessageBox("MessageBox", "PET_DEAD", MessageBoxType.YesButton);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -534,15 +134,12 @@ namespace BrewMonster
|
||||
int iLevelRequired = pPet.GetLevel() - 35 - m_ReincarnationCount * 5;
|
||||
if (m_BasicProps.iLevel < iLevelRequired)
|
||||
{
|
||||
CECGameUIMan pGameUI = EC_Game.GetGameRun().GetUIManager().GetInGameUIMan();
|
||||
if (pGameUI != null)
|
||||
{
|
||||
// TO DO: fix later
|
||||
//string strText = "";
|
||||
//strText.Format(pGameUI.GetStringFromTable(10787), iLevelRequired);
|
||||
//pGameUI.MessageBox("", strText, MB_OK, A3DCOLORRGBA(255, 255, 255, 160));
|
||||
string strText = "";
|
||||
strText = string.Format(pGameUI.GetInGameUIMan().GetStringFromTable(10787), iLevelRequired);
|
||||
pGameUI.ShowMessageBox("MessageBox", strText, MessageBoxType.YesButton);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -551,9 +148,72 @@ namespace BrewMonster
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Recall pet
|
||||
public bool RecallPet()
|
||||
{
|
||||
if (m_pActionSwitcher != null)
|
||||
m_pActionSwitcher.PostMessge((int)EMsgActionSwitcher.MSG_MOUNTPET);
|
||||
|
||||
// If host could't stop naturally, cancel recalling
|
||||
if (!NaturallyStopMoving())
|
||||
return false;
|
||||
|
||||
UnityGameSession.c2s_CmdPetRecall();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get pet operation time counter
|
||||
public CECCounter GetPetOptTime() { return m_PetOptCnt; }
|
||||
public CECPetCorral GetPetCorral()
|
||||
{
|
||||
return m_pPetCorral;
|
||||
}
|
||||
|
||||
// Hatch pet
|
||||
public bool HatchPet(int iIvtrIdx)
|
||||
{
|
||||
EC_IvtrItem pItem = m_pPack.GetItem(iIvtrIdx);
|
||||
if (pItem == null || pItem.GetClassID() != (int)EQUIP_CLASS_ID.ICID_PETEGG)
|
||||
return false;
|
||||
|
||||
CECGameRun pGameRun = EC_Game.GetGameRun();
|
||||
|
||||
EC_IvtrPetEgg pEgg = (EC_IvtrPetEgg)pItem;
|
||||
IVTR_ESSENCE_PETEGG e = pEgg.GetEssence();
|
||||
|
||||
// Check profession
|
||||
if ((e.req_class & (1 << m_iProfession)) == 0)
|
||||
{
|
||||
pGameRun.AddFixedMessage((int)FixedMsg.FIXMSG_WRONGPROF);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check level
|
||||
int iLevelReq = Math.Max((int)e.level, e.req_level);
|
||||
if (GetMaxLevelSofar() < iLevelReq)
|
||||
{
|
||||
pGameRun.AddFixedMessage((int)FixedMsg.FIXMSG_LEVELTOOLOW);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check money
|
||||
if (GetMoneyAmount() < pEgg.GetDBEssence().money_hatched)
|
||||
{
|
||||
pGameRun.AddFixedMessage((int)FixedMsg.FIXMSG_NEEDMONEY);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check whether pet corral is full
|
||||
if (m_pPetCorral.GetEmptySlotNum() == 0)
|
||||
{
|
||||
pGameRun.AddFixedMessage((int)FixedMsg.FIXMSG_PET_CORRALFULL);
|
||||
return false;
|
||||
}
|
||||
|
||||
UnityGameSession.c2s_CmdNPCSevHatchPet(iIvtrIdx, pItem.GetTemplateID());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,13 +102,6 @@ namespace BrewMonster
|
||||
// }
|
||||
}
|
||||
|
||||
void OnMsgHstSetPlayerLimit(ECMSG Msg)
|
||||
{
|
||||
cmd_set_player_limit pCmd = GPDataTypeHelper.FromBytes<cmd_set_player_limit>((byte[])Msg.dwParam1);
|
||||
if (pCmd.index >= 0 && pCmd.index < (int)PLAYER_LIMIT.PLAYER_LIMIT_MAX)
|
||||
m_playerLimits[pCmd.index] = (pCmd.b != 0);
|
||||
}
|
||||
|
||||
private void OnMsgHstPressCancel(ECMSG Msg)
|
||||
{
|
||||
CECHPWork pCurWork = null;
|
||||
|
||||
@@ -571,6 +571,7 @@ namespace BrewMonster
|
||||
case EC_MsgDef.MSG_HST_SELTARGET:
|
||||
OnMsgHstSelTarget(Msg); break;
|
||||
case EC_MsgDef.MSG_HST_USEITEM:
|
||||
OnMsgHstUseItem(Msg);
|
||||
break;
|
||||
case EC_MsgDef.MSG_HST_ATKRESULT: OnMsgHstAttackResult(Msg); break;
|
||||
case EC_MsgDef.MSG_HST_ATTACKED: OnMsgHstAttacked(Msg); break;
|
||||
@@ -584,7 +585,11 @@ namespace BrewMonster
|
||||
case EC_MsgDef.MSG_HST_STOPATTACK: OnMsgHstStopAttack(Msg); break;
|
||||
case EC_MsgDef.MSG_HST_SKILLRESULT: OnMsgHstSkillResult(Msg); break;
|
||||
case EC_MsgDef.MSG_PM_CASTSKILL: OnMsgPlayerCastSkill(Msg); break;
|
||||
case EC_MsgDef.MSG_HST_SETCOOLTIME: OnMsgHstSetCoolTime(Msg); break;
|
||||
case EC_MsgDef.MSG_PM_ENCHANTRESULT: OnMsgEnchantResult(Msg); break;
|
||||
case EC_MsgDef.MSG_HST_LEARNSKILL: OnMsgHstLearnSkill(Msg); break;
|
||||
case EC_MsgDef.MSG_HST_COMBO_SKILL_PREPARE: OnMsgComboSkillPrepare(Msg); break;
|
||||
case EC_MsgDef.MSG_HST_CONTINUECOMBOSKILL: OnMsgContinueComboSkill(Msg); break;
|
||||
|
||||
case EC_MsgDef.MSG_HST_OWNEXTPROP: OnMsgHstExtProp(Msg); break;
|
||||
case EC_MsgDef.MSG_PM_PLAYERDOEMOTE: OnMsgPlayerDoEmote(Msg); break;
|
||||
|
||||
@@ -486,7 +486,7 @@ public class CECUIManager : MonoSingleton<CECUIManager>
|
||||
{
|
||||
get
|
||||
{
|
||||
if(m_iconlistIvtr == null)
|
||||
if(m_iconlistIvtr == null || m_iconlistIvtr.Length == 0)
|
||||
{
|
||||
m_iconlistIvtr = Resources.LoadAll<Sprite>("UI/IconSprites/iconlist_ivtrm_multisprite");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user