-- --金星兑换商
-- function NPC7010163_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex)
-- if TalkIndex == -1 then
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200136) --金星兑换商:\n 八星石*1 = 紫星符*1\n 九星石*1 = 紫星符*2\n 十星石*4 = 紫星符*10\n 闪光金粉*75 + 紫星符*5 = 金星符*1
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 5)
-- msg.AddMsgEvent(MsgID, 1, 200125) --提交八星石
-- msg.AddMsgEvent(MsgID, 21, 6)
-- msg.AddMsgEvent(MsgID, 1, 200126) --提交九星石
-- msg.AddMsgEvent(MsgID, 21, 7)
-- msg.AddMsgEvent(MsgID, 1, 200127) --提交十星石
-- msg.AddMsgEvent(MsgID, 21, 8)
-- msg.AddMsgEvent(MsgID, 1, 200128) --兑换金星符
-- msg.AddMsgEvent(MsgID, 21, 9)
-- msg.AddMsgEvent(MsgID, 1, 200129) --兑换金星符
-- msg.AddMsgEvent(MsgID, 21, 10)
-- msg.AddMsgEvent(MsgID, 1, 200130) --兑换金星符
-- msg.AddMsgEvent(MsgID, 21, 11)
-- msg.AddMsgEvent(MsgID, 1, 200131) --兑换金星符
-- msg.AddMsgEvent(MsgID, 21, 12)
-- msg.AddMsgEvent(MsgID, 1, 200132) --兑换金星符
-- msg.AddMsgEvent(MsgID, 21, 13)
-- msg.AddMsgEvent(MsgID, 1, 200133) --兑换金星符
-- msg.AddMsgEvent(MsgID, 21, 14)
-- msg.AddMsgEvent(MsgID, 1, 200134) --兑换金星符
-- msg.AddMsgEvent(MsgID, 21, 15)
-- msg.AddMsgEvent(MsgID, 1, 200135) --兑换金星符
-- msg.AddMsgEvent(MsgID, 21, 16)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- elseif TalkIndex == 4 then
-- if role.GetRoleItemNum(RoleID, 3020071) >= 1 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 3020071, 1, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4820180, 7, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 5 then
-- if role.GetRoleItemNum(RoleID, 4820263) >= 1 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820263, 1, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4820180, 1, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 6 then
-- if role.GetRoleItemNum(RoleID, 4820265) >= 1 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820265, 1, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4820180, 2, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 7 then
-- if role.GetRoleItemNum(RoleID, 4820267) >= 1 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820267, 1, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4820180, 4, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 8 then
-- if role.GetRoleItemNum(RoleID, 4810154) >= 75 and role.GetRoleItemNum(RoleID, 4820180) >= 5 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4810154, 75, 420)
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820180, 5, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4810109, 1, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 9 then
-- if role.GetRoleItemNum(RoleID, 3020001) >= 3000 and role.GetRoleItemNum(RoleID, 4810140) >= 1200 and role.GetRoleItemNum(RoleID, 4810109) >= 3 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 3020001, 3000, 420)
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4810140, 1200, 420)
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4810109, 3, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 1240110, 1, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 10 then
-- if role.GetRoleItemNum(RoleID, 4810154) >= 75 and role.GetRoleItemNum(RoleID, 4820180) >= 5 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4810154, 75, 420)
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820180, 5, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4810109, 1, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 11 then
-- if role.GetRoleItemNum(RoleID, 4810154) >= 75 and role.GetRoleItemNum(RoleID, 4820180) >= 5 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4810154, 75, 420)
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820180, 5, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4810109, 1, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 12 then
-- if role.GetRoleItemNum(RoleID, 4810154) >= 75 and role.GetRoleItemNum(RoleID, 4820180) >= 5 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4810154, 75, 420)
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820180, 5, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4810109, 1, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 13 then
-- if role.GetRoleItemNum(RoleID, 4810154) >= 75 and role.GetRoleItemNum(RoleID, 4820180) >= 5 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4810154, 75, 420)
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820180, 5, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4810109, 1, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 14 then
-- if role.GetRoleItemNum(RoleID, 4810154) >= 75 and role.GetRoleItemNum(RoleID, 4820180) >= 5 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4810154, 75, 420)
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820180, 5, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4810109, 1, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 15 then
-- if role.GetRoleItemNum(RoleID, 4810154) >= 75 and role.GetRoleItemNum(RoleID, 4820180) >= 5 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4810154, 75, 420)
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820180, 5, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4810109, 1, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- elseif TalkIndex == 16 then
-- if role.GetRoleItemNum(RoleID, 4810154) >= 75 and role.GetRoleItemNum(RoleID, 4820180) >= 5 then
-- local FreeSize = role.GetBagFreeSize(RoleID)
-- if FreeSize > 0 then
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4810154, 75, 420)
-- role.RemoveFromRole(MapID, InstanceID, RoleID, 4820180, 5, 420)
-- role.AddRoleItem(MapID, InstanceID, RoleID, 4810109, 1, -1, 8, 420)
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200115) --背包空间不足
-- msg.AddMsgEvent(MsgID, 24, TargetID)
-- msg.AddMsgEvent(MsgID, 21, 30)
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- else
-- local MsgID = msg.BeginMsgEvent()
-- msg.AddMsgEvent(MsgID, 20, 200116) --金星符兑换商:\n 对不起,你背包中材料不够,不能兑换
-- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid
-- msg.AddMsgEvent(MsgID, 21, 30) --取消按钮
-- msg.AddMsgEvent(MsgID, 1, 100002) --“取消”
-- msg.DispatchRoleMsgEvent(RoleID, MsgID)
-- end
-- end
-- end
-- aux.RegisterCreatureEvent(7010163, 7, "NPC7010163_OnTalk")