--洛阳NPC
--彭怀玉
--普通
x000110_g_scriptId = 000110
--**********************************
--事件交互入口
--**********************************
function x000110_OnDefaultEvent( sceneId, selfId, targetId )
BeginEvent( sceneId )
AddText( sceneId, " 你可以把几颗相同的宝石合成为一颗高一级的宝石、把几个低级的材料合成为一个高一级的材料,也可以给装备打个孔用来镶嵌宝石,也可以把宝石摘除。" )
AddNumText( sceneId, x000110_g_scriptId, "宝石转换(属性、抗性、冥石)", 6, 887 )
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
end
--**********************************
--事件列表选中一项
--**********************************
function x000110_OnEventRequest( sceneId, selfId, targetId, eventId )
if GetNumText() == 887 then
BeginEvent(sceneId)
AddText( sceneId, " " )
AddText( sceneId, " #cFF0000注意:#Y宝石转换#G时:最低只支持5级宝石转换" )
AddText( sceneId, " #cFF0000注意:#Y冥石转换#G时:最低只支持5.5级宝石转换" )
AddText( sceneId, " #cFF0000注意:#G每次使用#Y宝石转换#G前:#r #H请把宝石放入#Y背包第一格" )
AddText( sceneId, " #cFF0000注意:#G每次使用#Y宝石转换#r #cFF00005级扣除5000元宝#r 6级扣除6000元宝#r 7级扣除7000元宝" )
AddNumText( sceneId, x000110_g_scriptId, "转换为冰属性/冰抗性", 6, 900)
AddNumText( sceneId, x000110_g_scriptId, "转换为火属性/火抗性", 6, 901)
AddNumText( sceneId, x000110_g_scriptId, "转换为玄属性/玄抗性", 6, 902)
AddNumText( sceneId, x000110_g_scriptId, "转换为毒属性/毒抗性", 6, 903)
AddNumText( sceneId, x000110_g_scriptId, "#Y转换为[#G冰冥晶石#Y]", 6, 904)
AddNumText( sceneId, x000110_g_scriptId, "#Y转换为[#G火冥晶石#Y]", 6, 905)
AddNumText( sceneId, x000110_g_scriptId, "#Y转换为[#G玄冥晶石#Y]", 6, 906)
AddNumText( sceneId, x000110_g_scriptId, "#Y转换为[#G毒冥晶石#Y]", 6, 907)
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
end
if GetNumText()==900 then
x000110_ZH( sceneId, selfId,1 )
end
if GetNumText() == 901 then
x000110_ZH( sceneId, selfId,2 )
end
if GetNumText() == 902 then
x000110_ZH( sceneId, selfId,3 )
end
if GetNumText() == 903 then
x000110_ZH( sceneId, selfId,4 )
end
if GetNumText() == 904 then
x000110_ZH( sceneId, selfId,5 )
end
if GetNumText() == 905 then
x000110_ZH( sceneId, selfId,6 )
end
if GetNumText() == 906 then
x000110_ZH( sceneId, selfId,7 )
end
if GetNumText() == 907 then
x000110_ZH( sceneId, selfId,8 )
end
end
function x000110_ZH( sceneId, selfId,isTips )
local wu = {50502005,50502006,50502007,50502008}
local liu = {50602005,50602006,50602007,50602008}
local qi= {50702005,50702006,50702007,50702008}
local ba= {50802005,50802006,50802007,50802008}
local jiu= {50902005,50902006,50902007,50902008}
local wukang ={50512005,50512006,50512007,50512008}
local liukang ={50612005,50612006,50612007,50612008}
local qikang ={50712005,50712006,50712007,50712008}
local bakang ={50812005,50812006,50812007,50812008}
local jiukang ={50912005,50912006,50912007,50912008}
local wuming ={50521104,50521204,50521304,50521404}
local liuming ={50621104,50621204,50621304,50621404}
local qiming ={50721104,50721204,50721304,50721404}
local baming ={50821104,50821204,50821304,50821404}
local jiuming ={50921104,50921204,50921304,50921404}
if LuaFnGetItemTableIndexByIndex( sceneId, selfId, 30 ) < 50101001 then
x000110_NotifyTip( sceneId, selfId, "材料栏第一格子根本不是宝石")
return
end
if isTips == 1 then--冰
local CaiLiao = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 30 )
local index = GetItemQuality( CaiLiao )
local gemtype =LuaFnGetItemType( CaiLiao )
if index <5 then
x000110_NotifyTip( sceneId, selfId, "最低可支持转换5级宝石")
return
end
if gemtype ~= 12 and gemtype ~= 2 then
x000110_NotifyTip( sceneId, selfId, "只支持属性和抗性转换")
return
end
if index == 5 and gemtype == 2 then
gem = wu[2]
end
if index == 6 and gemtype == 2 then
gem = liu[2]
end
if index == 7 and gemtype == 2 then
gem = qi[2]
end
if index == 8 and gemtype == 2 then
gem = ba[2]
end
if index == 9 and gemtype == 2 then
gem = jiu[2]
end
if index == 5 and gemtype == 12 then
gem = wukang[2]
end
if index == 6 and gemtype == 12 then
gem = liukang[2]
end
if index == 7 and gemtype == 12 then
gem = qikang[2]
end
if index == 7 and gemtype == 12 then
gem = bakang[2]
end
if index == 8 and gemtype == 12 then
gem = jiukang[2]
end
local zengdian = zengdian(sceneId,selfId,targetId,2,index*1000)
if zengdian~= 0 then--冰
x000110_NotifyTip( sceneId, selfId, "绑定元宝不足,需要"..index * 100 .. "绑定元宝")
return
end
LuaFnDelAvailableItem(sceneId,selfId,CaiLiao,1)
BeginAddItem( sceneId )--给升级后物品
AddItem( sceneId, gem, 1 )
local ret = EndAddItem( sceneId, selfId )
if ret <= 0 then
return
end
AddItemListToHuman(sceneId,selfId)
x000110_NotifyTip( sceneId, selfId, "恭喜您,转换成功...")
return
end
if isTips == 2 then--火
local CaiLiao = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 30 )
local index = GetItemQuality( CaiLiao )
local gemtype =LuaFnGetItemType( CaiLiao )
if index <5 then
x000110_NotifyTip( sceneId, selfId, "最低可支持转换5级宝石")
return
end
if gemtype ~= 12 and gemtype ~= 2 then
x000110_NotifyTip( sceneId, selfId, "只支持属性和抗性转换")
return
end
if index == 5 and gemtype == 2 then
gem = wu[3]
end
if index == 6 and gemtype == 2 then
gem = liu[3]
end
if index == 7 and gemtype == 2 then
gem = qi[3]
end
if index == 8 and gemtype == 2 then
gem = ba[3]
end
if index == 9 and gemtype == 2 then
gem = jiu[3]
end
if index == 5 and gemtype == 12 then
gem = wukang[3]
end
if index == 6 and gemtype == 12 then
gem = liukang[3]
end
if index == 7 and gemtype == 12 then
gem = qikang[3]
end
if index == 8 and gemtype == 12 then
gem = bakang[3]
end
if index == 9 and gemtype == 12 then
gem = jiukang[3]
end
local zengdian = zengdian(sceneId,selfId,targetId,2,index*1000)
if zengdian~= 0 then--冰
x000110_NotifyTip( sceneId, selfId, "绑定元宝不足,需要"..index * 100 .. "绑定元宝")
return
end
LuaFnDelAvailableItem(sceneId,selfId,CaiLiao,1)
BeginAddItem( sceneId )--给升级后物品
AddItem( sceneId, gem, 1 )
local ret = EndAddItem( sceneId, selfId )
if ret <= 0 then
return
end
AddItemListToHuman(sceneId,selfId)
x000110_NotifyTip( sceneId, selfId, "恭喜您,转换成功...")
return
end
if isTips == 3 then--玄
local CaiLiao = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 30 )
local index = GetItemQuality( CaiLiao )
local gemtype =LuaFnGetItemType( CaiLiao )
if index <5 then
x000110_NotifyTip( sceneId, selfId, "最低可支持转换5级宝石")
return
end
if gemtype ~= 12 and gemtype ~= 2 then
x000110_NotifyTip( sceneId, selfId, "只支持属性和抗性转换")
return
end
if index == 5 and gemtype == 2 then
gem = wu[1]
end
if index == 6 and gemtype == 2 then
gem = liu[1]
end
if index == 7 and gemtype == 2 then
gem = qi[1]
end
if index == 8 and gemtype == 2 then
gem = ba[1]
end
if index == 9 and gemtype == 2 then
gem = jiu[1]
end
if index == 5 and gemtype == 12 then
gem = wukang[1]
end
if index == 6 and gemtype == 12 then
gem = liukang[1]
end
if index == 7 and gemtype == 12 then
gem = qikang[1]
end
if index == 8 and gemtype == 12 then
gem = bakang[1]
end
if index == 9 and gemtype == 12 then
gem = jiukang[1]
end
local zengdian = zengdian(sceneId,selfId,targetId,2,index*1000)
if zengdian~= 0 then--冰
x000110_NotifyTip( sceneId, selfId, "绑定元宝不足,需要"..index * 100 .. "绑定元宝")
return
end
LuaFnDelAvailableItem(sceneId,selfId,CaiLiao,1)
BeginAddItem( sceneId )--给升级后物品
AddItem( sceneId, gem, 1 )
local ret = EndAddItem( sceneId, selfId )
if ret <= 0 then
return
end
AddItemListToHuman(sceneId,selfId)
x000110_NotifyTip( sceneId, selfId, "恭喜您,转换成功...")
return
end
if isTips == 4 then--毒
local CaiLiao = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 30 )
local index = GetItemQuality( CaiLiao )
local gemtype =LuaFnGetItemType( CaiLiao )
if index <5 then
x000110_NotifyTip( sceneId, selfId, "最低可支持转换5级宝石")
return
end
if gemtype ~= 12 and gemtype ~= 2 then
x000110_NotifyTip( sceneId, selfId, "只支持属性和抗性转换")
return
end
if index == 5 and gemtype == 2 then
gem = wu[4]
end
if index == 6 and gemtype == 2 then
gem = liu[4]
end
if index == 7 and gemtype == 2 then
gem = qi[4]
end
if index == 8 and gemtype == 2 then
gem = ba[4]
end
if index == 9 and gemtype == 2 then
gem = jiu[4]
end
if index == 5 and gemtype == 12 then
gem = wukang[4]
end
if index == 6 and gemtype == 12 then
gem = liukang[4]
end
if index == 7 and gemtype == 12 then
gem = qikang[4]
end
if index == 8 and gemtype == 12 then
gem = bakang[4]
end
if index == 9 and gemtype == 12 then
gem = jiukang[4]
end
local zengdian = zengdian(sceneId,selfId,targetId,2,index*1000)
if zengdian~= 0 then--冰
x000110_NotifyTip( sceneId, selfId, "绑定元宝不足,需要"..index * 100 .. "绑定元宝")
return
end
LuaFnDelAvailableItem(sceneId,selfId,CaiLiao,1)
BeginAddItem( sceneId )--给升级后物品
AddItem( sceneId, gem, 1 )
local ret = EndAddItem( sceneId, selfId )
if ret <= 0 then
return
end
AddItemListToHuman(sceneId,selfId)
x000110_NotifyTip( sceneId, selfId, "恭喜您,转换成功...")
return
end
--***************************************************************
--冥石转换功能
--***************************************************************
if isTips == 5 then--冰
local CaiLiao = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 30 )
local index = GetItemQuality( CaiLiao )
local gemtype =LuaFnGetItemType( CaiLiao )
if CaiLiao ~= 50921404 and CaiLiao ~= 50921304 and CaiLiao ~= 50921204 and CaiLiao ~= 50921104 and CaiLiao ~= 50821404 and CaiLiao ~= 50821304 and CaiLiao ~= 50821204 and CaiLiao ~= 50821104 and CaiLiao ~= 50721404 and CaiLiao ~= 50721304 and CaiLiao ~= 50721204 and CaiLiao ~= 50721104 and CaiLiao ~= 50621404 and CaiLiao ~= 50621304 and CaiLiao ~= 50621204 and CaiLiao ~= 50621104 and CaiLiao ~= 50521104 and CaiLiao ~= 50521204 and CaiLiao ~= 50521304 and CaiLiao ~= 50521404 then --判断冥石
x000110_NotifyTip( sceneId, selfId, "您的宝石非7.7&6.6&5.5")
return
end
if index <5 then
x000110_NotifyTip( sceneId, selfId, "最低可支持转换5级宝石")
return
end
if gemtype ~= 21 then
x000110_NotifyTip( sceneId, selfId, "只支持冥晶石转换")
return
end
if index == 5 and gemtype == 21 then
gem = wuming[2]
end
if index == 6 and gemtype == 21 then
gem = liuming[2]
end
if index == 7 and gemtype == 21 then
gem = qiming[2]
end
if index == 8 and gemtype == 21 then
gem = baming[2]
end
if index == 9 and gemtype == 21 then
gem = jiuming[2]
end
local zengdian = zengdian(sceneId,selfId,targetId,2,index*1000)
if zengdian~= 0 then--冰
x000110_NotifyTip( sceneId, selfId, "绑定元宝不足,需要"..index * 100 .. "绑定元宝")
return
end
LuaFnDelAvailableItem(sceneId,selfId,CaiLiao,1)
BeginAddItem( sceneId )--给升级后物品
AddItem( sceneId, gem, 1 )
local ret = EndAddItem( sceneId, selfId )
if ret <= 0 then
return
end
AddItemListToHuman(sceneId,selfId)
x000110_NotifyTip( sceneId, selfId, "恭喜您,转换成功...")
return
end
if isTips == 6 then--火
local CaiLiao = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 30 )
local index = GetItemQuality( CaiLiao )
local gemtype =LuaFnGetItemType( CaiLiao )
if CaiLiao ~= 50921404 and CaiLiao ~= 50921304 and CaiLiao ~= 50921204 and CaiLiao ~= 50921104 and CaiLiao ~= 50821404 and CaiLiao ~= 50821304 and CaiLiao ~= 50821204 and CaiLiao ~= 50821104 and CaiLiao ~= 50721404 and CaiLiao ~= 50721304 and CaiLiao ~= 50721204 and CaiLiao ~= 50721104 and CaiLiao ~= 50621404 and CaiLiao ~= 50621304 and CaiLiao ~= 50621204 and CaiLiao ~= 50621104 and CaiLiao ~= 50521104 and CaiLiao ~= 50521204 and CaiLiao ~= 50521304 and CaiLiao ~= 50521404 then --判断冥石
x000110_NotifyTip( sceneId, selfId, "您的宝石非7.7&6.6&5.5")
return
end
if index <5 then
x000110_NotifyTip( sceneId, selfId, "最低可支持转换5级宝石")
return
end
if gemtype ~= 21 then
x000110_NotifyTip( sceneId, selfId, "只支持冥晶石转换")
return
end
if index == 5 and gemtype == 21 then
gem = wuming[3]
end
if index == 6 and gemtype == 21 then
gem = liuming[3]
end
if index == 7 and gemtype == 21 then
gem = qiming[3]
end
if index == 8 and gemtype == 21 then
gem = baming[3]
end
if index == 9 and gemtype == 21 then
gem = jiuming[3]
end
local zengdian = zengdian(sceneId,selfId,targetId,2,index*1000)
if zengdian~= 0 then--冰
x000110_NotifyTip( sceneId, selfId, "绑定元宝不足,需要"..index * 100 .. "绑定元宝")
return
end
LuaFnDelAvailableItem(sceneId,selfId,CaiLiao,1)
BeginAddItem( sceneId )--给升级后物品
AddItem( sceneId, gem, 1 )
local ret = EndAddItem( sceneId, selfId )
if ret <= 0 then
return
end
AddItemListToHuman(sceneId,selfId)
x000110_NotifyTip( sceneId, selfId, "恭喜您,转换成功...")
return
end
if isTips == 7 then--玄
local CaiLiao = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 30 )
local index = GetItemQuality( CaiLiao )
local gemtype =LuaFnGetItemType( CaiLiao )
if CaiLiao ~= 50921404 and CaiLiao ~= 50921304 and CaiLiao ~= 50921204 and CaiLiao ~= 50921104 and CaiLiao ~= 50821404 and CaiLiao ~= 50821304 and CaiLiao ~= 50821204 and CaiLiao ~= 50821104 and CaiLiao ~= 50721404 and CaiLiao ~= 50721304 and CaiLiao ~= 50721204 and CaiLiao ~= 50721104 and CaiLiao ~= 50621404 and CaiLiao ~= 50621304 and CaiLiao ~= 50621204 and CaiLiao ~= 50621104 and CaiLiao ~= 50521104 and CaiLiao ~= 50521204 and CaiLiao ~= 50521304 and CaiLiao ~= 50521404 then --判断冥石
x000110_NotifyTip( sceneId, selfId, "您的宝石非7.7&6.6&5.5")
return
end
if index <5 then
x000110_NotifyTip( sceneId, selfId, "最低可支持转换5级宝石")
return
end
if gemtype ~= 21 then
x000110_NotifyTip( sceneId, selfId, "目前只支持属性和抗性转换")
return
end
if index == 5 and gemtype == 21 then
gem = wuming[1]
end
if index == 6 and gemtype == 21 then
gem = liuming[1]
end
if index == 7 and gemtype == 21 then
gem = qiming[1]
end
if index == 8 and gemtype == 21 then
gem = baming[1]
end
if index == 9 and gemtype == 21 then
gem = jiuming[1]
end
local zengdian = zengdian(sceneId,selfId,targetId,2,index*1000)
if zengdian~= 0 then--冰
x000110_NotifyTip( sceneId, selfId, "绑定元宝不足,需要"..index * 100 .. "绑定元宝")
return
end
LuaFnDelAvailableItem(sceneId,selfId,CaiLiao,1)
BeginAddItem( sceneId )--给升级后物品
AddItem( sceneId, gem, 1 )
local ret = EndAddItem( sceneId, selfId )
if ret <= 0 then
return
end
AddItemListToHuman(sceneId,selfId)
x000110_NotifyTip( sceneId, selfId, "恭喜您,转换成功...")
return
end
if isTips == 8 then--毒
local CaiLiao = LuaFnGetItemTableIndexByIndex( sceneId, selfId, 30 )
local index = GetItemQuality( CaiLiao )
local gemtype =LuaFnGetItemType( CaiLiao )
if CaiLiao ~= 50921404 and CaiLiao ~= 50921304 and CaiLiao ~= 50921204 and CaiLiao ~= 50921104 and CaiLiao ~= 50821404 and CaiLiao ~= 50821304 and CaiLiao ~= 50821204 and CaiLiao ~= 50821104 and CaiLiao ~= 50721404 and CaiLiao ~= 50721304 and CaiLiao ~= 50721204 and CaiLiao ~= 50721104 and CaiLiao ~= 50621404 and CaiLiao ~= 50621304 and CaiLiao ~= 50621204 and CaiLiao ~= 50621104 and CaiLiao ~= 50521104 and CaiLiao ~= 50521204 and CaiLiao ~= 50521304 and CaiLiao ~= 50521404 then --判断冥石
x000110_NotifyTip( sceneId, selfId, "您的宝石非7.7&6.6&5.5")
return
end
if index <=4 then
x000110_NotifyTip( sceneId, selfId, "最低可支持转换六级宝石")
return
end
if gemtype ~= 21 then
x000110_NotifyTip( sceneId, selfId, "只支持冥晶石转换")
return
end
if index == 5 and gemtype == 21 then
gem = wuming[4]
end
if index == 6 and gemtype == 21 then
gem = liuming[4]
end
if index == 7 and gemtype == 21 then
gem = qiming[4]
end
if index == 8 and gemtype == 21 then
gem = baming[4]
end
if index == 9 and gemtype == 21 then
gem = jiuming[4]
end
local zengdian = zengdian(sceneId,selfId,targetId,2,index*1000)
if zengdian~= 0 then--冰
x000110_NotifyTip( sceneId, selfId, "绑定元宝不足,需要"..index * 100 .. "绑定元宝")
return
end
LuaFnDelAvailableItem(sceneId,selfId,CaiLiao,1)
BeginAddItem( sceneId )--给升级后物品
AddItem( sceneId, gem, 1 )
local ret = EndAddItem( sceneId, selfId )
if ret <= 0 then
return
end
AddItemListToHuman(sceneId,selfId)
x000110_NotifyTip( sceneId, selfId, "恭喜您,转换成功...")
return
end
end
--**********************************
--醒目提示
--**********************************
function x000110_NotifyTip( sceneId, selfId, Msg )
BeginEvent( sceneId )
AddText( sceneId, Msg )
EndEvent( sceneId )
DispatchMissionTips( sceneId, selfId )
end