몬스터 아이템 드랍
This commit is contained in:
parent
33d563de7c
commit
9a1bd93bdb
|
|
@ -41,7 +41,6 @@ messageinfo 엄청 느린 버그
|
|||
- 일꾼 이속, RND_SKILL
|
||||
|
||||
화살의 경우 화살 궤적 추가하자
|
||||
몬스터 아이템 드랍 (랜덤백 id와 등급 2개 필요)
|
||||
|
||||
미믹 던전
|
||||
- 결과 화면 (승리 보상 지급)
|
||||
|
|
@ -66,5 +65,8 @@ messageinfo 엄청 느린 버그
|
|||
- 몬스터 패트롤 거리 조절
|
||||
- 점수와 골드 (기본 1점, 10골드만 주는 중(밸런스 필요))
|
||||
|
||||
1챕터 맵 배치
|
||||
- 포탈, 필드보스, 부활의 성소 등
|
||||
|
||||
|
||||
몬스터 아이템 드랍
|
||||
- 랜덤 백 id 하나면 id 갯수만큼 드랍 확률 적용하고, 높은 등급나올 수도 있는 건가?
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
[{"n_WorkerID": "70001", "s_Prefab": "Goblin_Baby", "s_Icon": "icon_worker1", "f_Scale": "1", "f_UIScale": "1.5", "f_MoveSpeed": "3", "f_SeekTimeDelay": "1"}]
|
||||
[{"n_WorkerID": "70001", "s_Prefab": "Goblin_Baby", "f_Scale": "1", "f_UIScale": "1.5", "f_MoveSpeed": "3", "f_SeekTimeDelay": "1"}]
|
||||
Binary file not shown.
|
|
@ -0,0 +1,148 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &6068735123187107113
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3100476459826330930}
|
||||
- component: {fileID: 4893893054232870055}
|
||||
- component: {fileID: 2492904952054004448}
|
||||
m_Layer: 0
|
||||
m_Name: DropItem_Item
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3100476459826330930
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6068735123187107113}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 5367334993181921363}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &4893893054232870055
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6068735123187107113}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3713b4348c869eb4ba95dc0b49edcdd2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
ColliderLayer: Actor
|
||||
m_Pierce: 0
|
||||
str_HitEffect:
|
||||
m_ShowTimeOverEffect: 0
|
||||
m_Collider: {fileID: 2492904952054004448}
|
||||
--- !u!65 &2492904952054004448
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6068735123187107113}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 1
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.5, y: 2, z: 0.5}
|
||||
m_Center: {x: -0.005823165, y: 0, z: 0.0038821101}
|
||||
--- !u!1001 &5853832853306692536
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 3100476459826330930}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8057988818156997068, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: FX_LootDrop_Purple
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 2d21eea2e44817f4193c95c7f16d60b6, type: 3}
|
||||
--- !u!4 &5367334993181921363 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1963683006014718955, guid: 2d21eea2e44817f4193c95c7f16d60b6,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 5853832853306692536}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8fc1d14296856dc46997ccfd369f83db
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -393,11 +393,26 @@ public class MobActor : Actor
|
|||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
if (n_Reincarnation <= 0)
|
||||
{
|
||||
// 골드 드랍
|
||||
DropItemInfo.Ins.Drop_DropItem(2, m_MonsterAppearData.n_DropGold, Get_position());
|
||||
|
||||
// 경험치
|
||||
var pcstat = MyValue.MyPC.Get_StatInfo();
|
||||
var exp = m_MonsterAppearData.n_DropExp;
|
||||
exp += (uint)(exp * (pcstat.Get_Stat(eStat.EXP_Multiplier) + pcstat.Get_Stat(eStat.Battle_EXP_Multiplier)));
|
||||
sdata.PC.Add_Exp(exp);
|
||||
|
||||
// 아이템 드랍
|
||||
var rndBag = table_randombag.Ins.Get_DataList(m_MonsterAppearData.n_DropReward);
|
||||
for (int i = 0; i < rndBag.Count; i++)
|
||||
{
|
||||
if (DSUtil.RandomTrue(rndBag[i].f_DropRate))
|
||||
{
|
||||
DropItemInfo.Ins.Drop_DropItem(rndBag[i].n_ItemId, rndBag[i].n_DropCount, Get_position());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sdata.Add_CollectionMobKill(m_MonsterTableData.n_MonsterID);
|
||||
}
|
||||
base.Set_Die();
|
||||
|
|
|
|||
|
|
@ -8,39 +8,53 @@ public class DropItemInfo : MonoBehaviourSingletonTemplate<DropItemInfo>
|
|||
Dictionary<int, AsyncOperationHandle<GameObject>> dic_Handle = new Dictionary<int, AsyncOperationHandle<GameObject>>();
|
||||
Dictionary<int, string> dic_addrPath = new Dictionary<int, string>
|
||||
{
|
||||
{ -1, "Assets/Res_Addr/Obj/DropItem_Item.prefab" },
|
||||
{ 2, "Assets/Res_Addr/Obj/DropItem_Coin.prefab" },
|
||||
};
|
||||
List<DropItem> list_dropitems = new List<DropItem>();
|
||||
|
||||
private void Start()
|
||||
{
|
||||
AddrResourceMgr.Ins.LoadObject<GameObject>(dic_addrPath[2], handle =>
|
||||
Make_DropItem(-1, 2);
|
||||
Make_DropItem(2, 30);
|
||||
}
|
||||
|
||||
void Make_DropItem(int key, int count)
|
||||
{
|
||||
AddrResourceMgr.Ins.LoadObject<GameObject>(dic_addrPath[key], handle =>
|
||||
{
|
||||
if (handle.IsDone && handle.Status == AsyncOperationStatus.Succeeded)
|
||||
{
|
||||
dic_Handle.Add(2, handle);
|
||||
dic_dropitem.Add(2, new List<DropItem> { DSUtil.Get_Clone<DropItem>(dic_Handle[2].Result, transform) });
|
||||
for (int i = 0; i < 29; i++)
|
||||
Make_DropItem(2);
|
||||
dic_Handle.Add(key, handle);
|
||||
dic_dropitem.Add(key, new List<DropItem> { DSUtil.Get_Clone<DropItem>(dic_Handle[key].Result, transform) });
|
||||
for (int i = 0; i < count - 1; i++)
|
||||
Get_DropItem(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
DropItem Make_DropItem(int id)
|
||||
DropItem Get_DropItem(int key)
|
||||
{
|
||||
var dropitem = DSUtil.Get_Clone<DropItem>(dic_Handle[id].Result, transform);
|
||||
var dropitem = DSUtil.Get_Clone<DropItem>(dic_Handle[key].Result, transform);
|
||||
dropitem.gameObject.SetActive(false);
|
||||
dic_dropitem[id].Add(dropitem);
|
||||
dic_dropitem[key].Add(dropitem);
|
||||
return dropitem;
|
||||
}
|
||||
|
||||
public void Drop_DropItem(int itemid, int amount, Vector3 startpos)
|
||||
{
|
||||
if (dic_dropitem.ContainsKey(itemid))
|
||||
int index = -1;
|
||||
var item = table_itemlist.Ins.Get_Data(itemid);
|
||||
switch (item.n_ItemID)
|
||||
{
|
||||
for (int i = 0; i < dic_dropitem[itemid].Count; i++)
|
||||
case 2: index = item.n_ItemID; break;
|
||||
}
|
||||
|
||||
if (dic_dropitem.ContainsKey(index))
|
||||
{
|
||||
for (int i = 0; i < dic_dropitem[index].Count; i++)
|
||||
{
|
||||
var temp = dic_dropitem[itemid][i];
|
||||
var temp = dic_dropitem[index][i];
|
||||
if (!temp.gameObject.activeInHierarchy)
|
||||
{
|
||||
temp.Set(itemid, amount, startpos);
|
||||
|
|
@ -50,7 +64,7 @@ public class DropItemInfo : MonoBehaviourSingletonTemplate<DropItemInfo>
|
|||
}
|
||||
else
|
||||
{
|
||||
var dropitem = Make_DropItem(itemid);
|
||||
var dropitem = Get_DropItem(index);
|
||||
dropitem.Set(itemid, amount, startpos);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ public class table_randombag : table_missionbase
|
|||
List<RandomBagTableData> tableDatas;
|
||||
Dictionary<(int, int), List<float>> dic_RateData = new Dictionary<(int, int), List<float>>();
|
||||
Dictionary<(int, int), List<ItemSimpleData>> dic_ItemData = new Dictionary<(int, int), List<ItemSimpleData>>();
|
||||
Dictionary<int, List<RandomBagTableData>> dic_ItemList = new Dictionary<int, List<RandomBagTableData>>();
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
|
|
@ -69,6 +70,10 @@ public class table_randombag : table_missionbase
|
|||
if (!dic_ItemData.ContainsKey((temp.n_DropIndex, temp.n_ItemGrade)))
|
||||
dic_ItemData.Add((temp.n_DropIndex, temp.n_ItemGrade), new List<ItemSimpleData>());
|
||||
dic_ItemData[(temp.n_DropIndex, temp.n_ItemGrade)].Add(new ItemSimpleData { itemid = temp.n_ItemId, amount = temp.n_DropCount });
|
||||
|
||||
if (!dic_ItemList.ContainsKey(temp.n_DropIndex))
|
||||
dic_ItemList.Add(temp.n_DropIndex, new List<RandomBagTableData>());
|
||||
dic_ItemList[temp.n_DropIndex].Add(temp);
|
||||
}
|
||||
|
||||
base.Start();
|
||||
|
|
@ -82,4 +87,5 @@ public class table_randombag : table_missionbase
|
|||
public List<float> Get_Rate(int index, int grade) { return dic_RateData[(index, grade)]; }
|
||||
public RandomBagTableData Get_Data(int itemid) { return Get_DataList().Find(f => f.n_ItemId == itemid); }
|
||||
public List<RandomBagTableData> Get_DataList() { return tableDatas; }
|
||||
public List<RandomBagTableData> Get_DataList(int id) { return dic_ItemList[id]; }
|
||||
}
|
||||
Loading…
Reference in New Issue