新框架加入佣兵后,打不了几仗就挂端了,报错为:Error: c0000005,如下图:
以下是佣兵代码,麻烦大佬帮看看是哪里出问题,该如何修改,谢谢!
local yb = ModuleBase:createModule('yb')
wanjia = {}--玩家表
for bbb = 0,800 do
wanjia[bbb] = {}
wanjia[bbb][0] = 0--ai统计
for ccc = 1,100 do
wanjia[bbb][ccc] = -1
end
end
local ybtable = {"弓箭手星织","弓箭手七冰","格斗八重切","格斗红莲","主教奈麻","战斧重音","战斧凛音","剑士绵津见","骑士伊吹"}--佣兵表
local ybctrl = {"开除所有佣兵","治疗佣兵和佣兵宠物","W站位(队长站后排)","一字站位","宠物待命","开除指定佣兵","佣兵打卡开启(打卡重置卡时)","召回佣兵","大地鼠出战","噩梦鼠出战","火焰鼠出战","宝石鼠出战","僵尸出战","丧尸出战","食尸鬼出战","腐尸出战"}--佣兵遥控器
local partyname = {}--开除指定佣兵
function yb:petlevelup(player)
if Char.IsDummy(player) then
local pet = Char.GetPet(player,0)
local MF = Char.GetData(pet,%对象_魔法%)
local TL = Char.GetData(pet,%对象_体力%)
if MF > TL then
Char.SetData(pet, CONST.CHAR_魔法, 100 + MF);
Pet.UpPet(player,pet);
else
Char.SetData(pet, CONST.CHAR_体力, 100 + TL);
Pet.UpPet(player,pet);
end
end
end
function yb:yblevelup(player)
if Char.IsDummy(player) then
local MF = Char.GetData(player,%对象_魔法%)
local TL = Char.GetData(player,%对象_体力%)
local LL = Char.GetData(player,%对象_力量%)
local SD = Char.GetData(player,%对象_速度%)
if Char.GetData(player, %对象_名字%)=="主教奈麻" then
Char.SetData(player, CONST.CHAR_体力, 200+TL);
Char.SetData(player, CONST.CHAR_速度, 100+SD);
Char.SetData(player, CONST.CHAR_魔法, 100+MF);
NLG.UpChar(player);
else
Char.SetData(player, CONST.CHAR_力量, 200+LL);
Char.SetData(player, CONST.CHAR_速度, 200+SD);
NLG.UpChar(player);
end
end
end
function yb:ybwarp(player, Ori_MapId, Ori_FloorId, Ori_X, Ori_Y, Target_MapId, Target_FloorId, Target_X, Target_Y)--传送后若ai掉队则加回队伍来
for csdd = 1,9 do
if Char.PartyNum(wanjia[player][csdd]) == -1 then
Char.Warp(wanjia[player][csdd], Target_MapId, Target_FloorId, Target_X, Target_Y)
Char.JoinParty(wanjia[player][csdd],player);
end
end
end
function yb:yboffline(player)--玩家下线清空自己召唤的ai
for xxqk = 1,9 do
if wanjia[player][xxqk] > 0 then
Char.DelDummy(wanjia[player][xxqk])
wanjia[player][0] = 0
end
end
wanjia[player][0] = 0
end
local function calcWarp()--计算页数和最后一页数量
local totalpage = math.modf(#ybtable / 8) + 1
local remainder = math.fmod(#ybtable, 8)
return totalpage, remainder
end
local function calcWarp1()--计算页数和最后一页数量
local totalpage1 = math.modf(#ybctrl / 8) + 1
local remainder1 = math.fmod(#ybctrl, 8)
return totalpage1, remainder1
end
--- 加载模块钩子
function yb:onLoad()
self:logInfo('load')
self:logDebugF('npcIndex: %s, playerIndex: %s, text: %s, msg: %s', npc, player, text, msg)
self:regCallback("AfterWarpEvent", Func.bind(self.ybwarp, self))
self:regCallback("LogoutEvent", Func.bind(self.yboffline, self))
self:regCallback("PetLevelUpEvent", Func.bind(self.petlevelup, self))
self:regCallback("LevelUpEvent", Func.bind(self.yblevelup, self))
local warpNPC = self:NPC_createNormal('佣兵统领', 105502, { x = 236, y = 83, mapType = 0, map = 1000, direction = 4 });
local ctrlNPC = self:NPC_createNormal('佣兵遥控器', 105502, { x = 4, y = 4, mapType = 0, map = 666, direction = 4 });
local testNPC = self:NPC_createNormal('佣兵遥控器', 105502, { x = 4, y = 6, mapType = 0, map = 666, direction = 4 });
self:NPC_regWindowTalkedEvent(warpNPC, function(npc, player, _seqno, _select, _data)
local suiji = math.random(100,100)--90~100的随机数--然后ai参考人物生成浮动bp
local rlv = Char.GetData(player,%对象_等级%)
local rlv = rlv /100 * suiji
local rx = Char.GetData(player,%对象_体力%)
local rx = rx / 100 * suiji
local rm = Char.GetData(player,%对象_魔法%)
local rm = rm / 100 * suiji
local rg = Char.GetData(player,%对象_力量%)
local rg = rg / 100 * suiji
local rf = Char.GetData(player,%对象_强度%)
local rf = rf / 100 * suiji
local rs = Char.GetData(player,%对象_速度%)
local rs = rs / 100 * suiji
local rzy = rlv*200+1300--主要属性
local rcy = rzy-rs--次要属性
local rzycj = (rzy + 100)/2
local rcycj = rzy - rzycj
local agong = {2000,2010,2022,2035,2049,2055,2063,2071,2082,2095}--1-10级A弓
local azhang = {2400,2413,2435,2447,2449,2461,2473,2488,2492,2493}--1-10级A杖
local bzhang = {2402,2418,2434,2446,2450,2462,2478,2486,2495,2497}--1-10级B杖
local afu = {805,812,820,830,841,854,863,878,883,890}--1-10级A斧
local ajian = {8,16,22,37,42,56,67,70,87,94}--1-10级A剑
local aqiang = {1608,1619,1629,1635,1643,1657,1663,1678,1684,1698}--1-10级A枪
local amao = {4004,4011,4022,4032,4040,4054,4064,4070,4082,4091}--1-10级A帽
local ayi = {4803,4812,4823,4834,4845,4855,4867,4871,4882,4892}--1-10级A衣
local axie = {6001,6010,6022,6033,6042,6054,6064,6072,6080,6090}--1-10级A鞋
local akui = {3601,3611,3622,3632,3642,3654,3662,3670,3683,3693}--1-10级A盔
local akai = {4400,4410,4420,4430,4442,4459,4464,4470,4484,4490}--1-10级A铠
local axue = {5600,5614,5620,5630,5640,5653,5664,5671,5680,5690}--1-10级A靴
local adun = {6401,6410,6427,6437,6447,6458,6461,6470,6480,6490}--1-10级A盾
local apao = {5206,5212,5224,5233,5242,5250,5261,5272,5281,5290}--1-10级A袍
local petjn = {{1430,1530,1630,1730,1330},{1432,1532,1632,1732,1332},{1434,1534,1634,1734,1334},{1436,1536,1636,1736,1336},{1438,1538,1638,1738,1338},}--宠物抗性技能
local zblv = math.floor(rlv/10) + 1--佣兵装备等级
local jnlv = math.floor(rlv/20) + 1--宠物技能等级
local sjlv = 0
local column = tonumber(_data)
local page = tonumber(_seqno)
local warpPage = page;
local winMsg = "1\\n请选择想并肩作战的佣兵\\n"
local winButton = CONST.BUTTON_关闭;
local totalPage, remainder = calcWarp()
--上页16 下页32 关闭/取消2
if _select > 0 then
if _select == CONST.BUTTON_下一页 then
warpPage = warpPage + 1
if (warpPage == totalPage) or ((warpPage == (totalPage - 1) and remainder == 0)) then
winButton = CONST.BUTTON_上取消
else
winButton = CONST.BUTTON_上下取消
end
elseif _select == CONST.BUTTON_上一页 then
warpPage = warpPage - 1
if warpPage == 1 then
winButton = CONST.BUTTON_下取消
else
winButton = CONST.BUTTON_上下取消
end
elseif _select == 2 then
warpPage = 1
return
end
local count = 8 * (warpPage - 1)
if warpPage == totalPage then
for i = 1 + count, remainder + count do
winMsg = winMsg .. ybtable[i] .. "\\n"
end
else
for i = 1 + count, 8 + count do
winMsg = winMsg .. ybtable[i] .. "\\n"
end
end
NLG.ShowWindowTalked(player, npc, CONST.窗口_选择框, winButton, warpPage, winMsg);
else
local count = 8 * (warpPage - 1) + column
if count == 1 then
if wanjia[player][0] > 3 then
NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
elseif wanjia[player][1] <= 0 then
local charIndex1 = Char.CreateDummy()--生成ai佣兵
wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
wanjia[player][1] = charIndex1
Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
Char.SetData(charIndex1, CONST.CHAR_名字, '弓箭手星织');
Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
Char.SetData(charIndex1, CONST.CHAR_形象, 100302);
Char.SetData(charIndex1, CONST.CHAR_原形, 100302);
Char.SetData(charIndex1, CONST.CHAR_原始图档, 100302);
if rlv >= 80 then
Char.SetData(charIndex1, CONST.CHAR_体力, rzy);
Char.SetData(charIndex1, CONST.CHAR_力量, rcy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
else
Char.SetData(charIndex1, CONST.CHAR_体力, rcy);
Char.SetData(charIndex1, CONST.CHAR_力量, rzy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
end
NLG.UpChar(charIndex1);
Char.SetData(charIndex1, CONST.CHAR_职业, 44);
Char.SetData(charIndex1, CONST.CHAR_职类ID, 40);
Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
if rlv >= 100 then
sjlv = 10
else
sjlv = zblv
end
Char.GiveItem(charIndex1, agong[sjlv], 1);
Char.GiveItem(charIndex1, amao[sjlv], 1);
Char.GiveItem(charIndex1, ayi[sjlv], 1);
Char.GiveItem(charIndex1, axie[sjlv], 1);
Item.SetData(Char.GetItemIndex(charIndex1, 8), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 9), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 10), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 11), %道具_已鉴定%, 1)
Item.UpItem(charIndex1, -1);
NLG.UpChar(charIndex1);
Char.GiveItem(charIndex1, 900191, 1);
Char.GiveItem(charIndex1, 900329, 1);
Char.GiveItem(charIndex1, 900333, 1);
Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
Char.MoveItem(charIndex1, 9, CONST.EQUIP_头, -1);
Char.MoveItem(charIndex1, 10, CONST.EQUIP_身, -1);
Char.MoveItem(charIndex1, 11, CONST.EQUIP_腿, -1);
Char.MoveItem(charIndex1, 12, CONST.EQUIP_水晶, -1);
Char.MoveItem(charIndex1, 13, CONST.EQUIP_首饰1, -1);
Char.MoveItem(charIndex1, 14, CONST.EQUIP_首饰2, -1);
Char.GiveItem(charIndex1, 18196, 1);
Char.GiveItem(charIndex1, 18315, 19);
Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
Char.AddSkill(charIndex1, 71);
Char.AddSkill(charIndex1, 13);
Char.AddSkill(charIndex1, 15);
Char.AddSkill(charIndex1, 17);
Char.SetSkillLevel(charIndex1,0,2);
Char.SetSkillLevel(charIndex1,1,2);
Char.SetSkillLevel(charIndex1,2,2);
Char.SetSkillLevel(charIndex1,3,2);
Char.GivePet(charIndex1, 900004);
local charIndex2 = Char.GetPet(charIndex1,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex2,%对象_经验%,hdjy);
Pet.UpPet(charIndex1,charIndex2);
local petFP = Char.GetData(charIndex2,%对象_魔法%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex2, CONST.CHAR_升级点, 0);
Char.SetData(charIndex2, CONST.CHAR_魔法, petFPP);
Pet.UpPet(charIndex1,charIndex2);
Char.SetData(charIndex2, CONST.CHAR_血, Char.GetData(charIndex2, CONST.CHAR_最大血));
Char.SetData(charIndex2, CONST.CHAR_魔, Char.GetData(charIndex2, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex2, petjn[sjlv][1]);
Pet.AddSkill(charIndex2, petjn[sjlv][2]);
Pet.AddSkill(charIndex2, petjn[sjlv][3]);
Pet.AddSkill(charIndex2, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
NLG.UpChar(charIndex1);
Pet.UpPet(charIndex1,charIndex2);
Item.UpItem(charIndex1, -1);
NLG.SystemMessage(player, '召唤佣兵: 弓箭手' )
Char.JoinParty(charIndex1, player);
else
NLG.SystemMessage(player, '只能召唤1位弓箭手。' )
end
elseif count == 2 then
if wanjia[player][0] > 3 then
NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
elseif wanjia[player][2] <= 0 then
local charIndex1 = Char.CreateDummy()--生成ai佣兵
wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
wanjia[player][2] = charIndex1
Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
Char.SetData(charIndex1, CONST.CHAR_名字, '弓箭手七冰');
Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
Char.SetData(charIndex1, CONST.CHAR_形象, 100370);
Char.SetData(charIndex1, CONST.CHAR_原形, 100370);
Char.SetData(charIndex1, CONST.CHAR_原始图档, 100370);
if rlv >= 80 then
Char.SetData(charIndex1, CONST.CHAR_体力, rzy);
Char.SetData(charIndex1, CONST.CHAR_力量, rcy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
else
Char.SetData(charIndex1, CONST.CHAR_体力, rcy);
Char.SetData(charIndex1, CONST.CHAR_力量, rzy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
end
NLG.UpChar(charIndex1);
Char.SetData(charIndex1, CONST.CHAR_职业, 44);
Char.SetData(charIndex1, CONST.CHAR_职类ID, 40);
Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
if rlv >= 100 then
sjlv = 10
else
sjlv = zblv
end
Char.GiveItem(charIndex1, agong[sjlv], 1);
Char.GiveItem(charIndex1, amao[sjlv], 1);
Char.GiveItem(charIndex1, ayi[sjlv], 1);
Char.GiveItem(charIndex1, axie[sjlv], 1);
Item.SetData(Char.GetItemIndex(charIndex1, 8), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 9), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 10), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 11), %道具_已鉴定%, 1)
Item.UpItem(charIndex1, -1);
NLG.UpChar(charIndex1);
Char.GiveItem(charIndex1, 900192, 1);
Char.GiveItem(charIndex1, 900329, 1);
Char.GiveItem(charIndex1, 900333, 1);
Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
Char.MoveItem(charIndex1, 9, CONST.EQUIP_头, -1);
Char.MoveItem(charIndex1, 10, CONST.EQUIP_身, -1);
Char.MoveItem(charIndex1, 11, CONST.EQUIP_腿, -1);
Char.MoveItem(charIndex1, 12, CONST.EQUIP_水晶, -1);
Char.MoveItem(charIndex1, 13, CONST.EQUIP_首饰1, -1);
Char.MoveItem(charIndex1, 14, CONST.EQUIP_首饰2, -1);
Char.GiveItem(charIndex1, 18196, 1);
Char.GiveItem(charIndex1, 18315, 19);
Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
Char.AddSkill(charIndex1, 71);
Char.AddSkill(charIndex1, 13);
Char.AddSkill(charIndex1, 15);
Char.AddSkill(charIndex1, 17);
Char.SetSkillLevel(charIndex1,0,2);
Char.SetSkillLevel(charIndex1,1,2);
Char.SetSkillLevel(charIndex1,2,2);
Char.SetSkillLevel(charIndex1,3,2);
Char.GivePet(charIndex1, 900005);
local charIndex2 = Char.GetPet(charIndex1,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex2,%对象_经验%,hdjy);
Pet.UpPet(charIndex1,charIndex2);
local petFP = Char.GetData(charIndex2,%对象_魔法%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex2, CONST.CHAR_魔法, petFPP);
Char.SetData(charIndex2, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex1,charIndex2);
Char.SetData(charIndex2, CONST.CHAR_血, Char.GetData(charIndex2, CONST.CHAR_最大血));
Char.SetData(charIndex2, CONST.CHAR_魔, Char.GetData(charIndex2, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex2, petjn[sjlv][1]);
Pet.AddSkill(charIndex2, petjn[sjlv][2]);
Pet.AddSkill(charIndex2, petjn[sjlv][3]);
Pet.AddSkill(charIndex2, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
NLG.UpChar(charIndex1);
Pet.UpPet(charIndex1,charIndex2);
Item.UpItem(charIndex1, -1);
NLG.SystemMessage(player, '召唤佣兵: 弓箭手' )
Char.JoinParty(charIndex1, player);
else
NLG.SystemMessage(player, '只能召唤1位弓箭手。' )
end
elseif count == 3 then
if wanjia[player][0] > 3 then
NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
elseif wanjia[player][3] <= 0 then
local charIndex1 = Char.CreateDummy()--生成ai佣兵
wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
wanjia[player][3] = charIndex1
Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
Char.SetData(charIndex1, CONST.CHAR_名字, '格斗八重切');
Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
Char.SetData(charIndex1, CONST.CHAR_形象, 100102);
Char.SetData(charIndex1, CONST.CHAR_原形, 100102);
Char.SetData(charIndex1, CONST.CHAR_原始图档, 100102);
Char.SetData(charIndex1, CONST.CHAR_体力, rcy);
Char.SetData(charIndex1, CONST.CHAR_力量, rzy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
NLG.UpChar(charIndex1);
Char.SetData(charIndex1, CONST.CHAR_职业, 144);
Char.SetData(charIndex1, CONST.CHAR_职类ID, 140);
Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
if rlv >= 100 then
sjlv = 10
else
sjlv = zblv
end
Char.GiveItem(charIndex1, amao[sjlv], 1);
Char.GiveItem(charIndex1, ayi[sjlv], 1);
Char.GiveItem(charIndex1, axie[sjlv], 1);
Item.SetData(Char.GetItemIndex(charIndex1, 8), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 9), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 10), %道具_已鉴定%, 1)
Item.UpItem(charIndex1, -1);
NLG.UpChar(charIndex1);
Char.GiveItem(charIndex1, 900193, 1);
Char.GiveItem(charIndex1, 900329, 1);
Char.GiveItem(charIndex1, 900333, 1);
Char.MoveItem(charIndex1, 8, CONST.EQUIP_头, -1);
Char.MoveItem(charIndex1, 9, CONST.EQUIP_身, -1);
Char.MoveItem(charIndex1, 10, CONST.EQUIP_腿, -1);
Char.MoveItem(charIndex1, 11, CONST.EQUIP_水晶, -1);
Char.MoveItem(charIndex1, 12, CONST.EQUIP_首饰1, -1);
Char.MoveItem(charIndex1, 13, CONST.EQUIP_首饰2, -1);
Char.GiveItem(charIndex1, 18196, 1);
Char.GiveItem(charIndex1, 18315, 19);
Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
Char.AddSkill(charIndex1, 71);
Char.AddSkill(charIndex1, 13);
Char.AddSkill(charIndex1, 15);
Char.AddSkill(charIndex1, 17);
Char.SetSkillLevel(charIndex1,0,2);
Char.SetSkillLevel(charIndex1,1,2);
Char.SetSkillLevel(charIndex1,2,2);
Char.SetSkillLevel(charIndex1,3,2);
Char.GivePet(charIndex1, 900005);
local charIndex2 = Char.GetPet(charIndex1,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex2,%对象_经验%,hdjy);
Pet.UpPet(charIndex1,charIndex2);
local petFP = Char.GetData(charIndex2,%对象_魔法%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex2, CONST.CHAR_魔法, petFPP);
Char.SetData(charIndex2, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex1,charIndex2);
Char.SetData(charIndex2, CONST.CHAR_血, Char.GetData(charIndex2, CONST.CHAR_最大血));
Char.SetData(charIndex2, CONST.CHAR_魔, Char.GetData(charIndex2, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex2, petjn[sjlv][1]);
Pet.AddSkill(charIndex2, petjn[sjlv][2]);
Pet.AddSkill(charIndex2, petjn[sjlv][3]);
Pet.AddSkill(charIndex2, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
NLG.UpChar(charIndex1);
Pet.UpPet(charIndex1,charIndex2);
Item.UpItem(charIndex1, -1);
NLG.SystemMessage(player, '召唤佣兵: 格斗' )
Char.JoinParty(charIndex1, player);
else
NLG.SystemMessage(player, '只能召唤1位格斗。' )
end
elseif count == 4 then
if wanjia[player][0] > 3 then
NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
elseif wanjia[player][4] <= 0 then
local charIndex1 = Char.CreateDummy()--生成ai佣兵
wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
wanjia[player][4] = charIndex1
Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
Char.SetData(charIndex1, CONST.CHAR_名字, '格斗红莲');
Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
Char.SetData(charIndex1, CONST.CHAR_形象, 100320);
Char.SetData(charIndex1, CONST.CHAR_原形, 100320);
Char.SetData(charIndex1, CONST.CHAR_原始图档, 100320);
print('charIndex1', charIndex1)
Char.SetData(charIndex1, CONST.CHAR_体力, rcy);
Char.SetData(charIndex1, CONST.CHAR_力量, rzy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
NLG.UpChar(charIndex1);
Char.SetData(charIndex1, CONST.CHAR_职业, 144);
Char.SetData(charIndex1, CONST.CHAR_职类ID, 140);
Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
if rlv >= 100 then
sjlv = 10
else
sjlv = zblv
end
Char.GiveItem(charIndex1, amao[sjlv], 1);
Char.GiveItem(charIndex1, ayi[sjlv], 1);
Char.GiveItem(charIndex1, axie[sjlv], 1);
Item.SetData(Char.GetItemIndex(charIndex1, 8), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 9), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 10), %道具_已鉴定%, 1)
Item.UpItem(charIndex1, -1);
NLG.UpChar(charIndex1);
Char.GiveItem(charIndex1, 900194, 1);
Char.GiveItem(charIndex1, 900329, 1);
Char.GiveItem(charIndex1, 900333, 1);
Char.MoveItem(charIndex1, 8, CONST.EQUIP_头, -1);
Char.MoveItem(charIndex1, 9, CONST.EQUIP_身, -1);
Char.MoveItem(charIndex1, 10, CONST.EQUIP_腿, -1);
Char.MoveItem(charIndex1, 11, CONST.EQUIP_水晶, -1);
Char.MoveItem(charIndex1, 12, CONST.EQUIP_首饰1, -1);
Char.MoveItem(charIndex1, 13, CONST.EQUIP_首饰2, -1);
Char.GiveItem(charIndex1, 18196, 1);
Char.GiveItem(charIndex1, 18315, 19);
Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
Char.AddSkill(charIndex1, 71);
Char.AddSkill(charIndex1, 13);
Char.AddSkill(charIndex1, 15);
Char.AddSkill(charIndex1, 17);
Char.SetSkillLevel(charIndex1,0,2);
Char.SetSkillLevel(charIndex1,1,2);
Char.SetSkillLevel(charIndex1,2,2);
Char.SetSkillLevel(charIndex1,3,2);
Char.GivePet(charIndex1, 900006);
local charIndex2 = Char.GetPet(charIndex1,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex2,%对象_经验%,hdjy);
Pet.UpPet(charIndex1,charIndex2);
local petFP = Char.GetData(charIndex2,%对象_魔法%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex2, CONST.CHAR_魔法, petFPP);
Char.SetData(charIndex2, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex1,charIndex2);
Char.SetData(charIndex2, CONST.CHAR_血, Char.GetData(charIndex2, CONST.CHAR_最大血));
Char.SetData(charIndex2, CONST.CHAR_魔, Char.GetData(charIndex2, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex2, petjn[sjlv][1]);
Pet.AddSkill(charIndex2, petjn[sjlv][2]);
Pet.AddSkill(charIndex2, petjn[sjlv][3]);
Pet.AddSkill(charIndex2, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
NLG.UpChar(charIndex1);
Pet.UpPet(charIndex1,charIndex2);
Item.UpItem(charIndex1, -1);
NLG.SystemMessage(player, '召唤佣兵: 格斗' )
Char.JoinParty(charIndex1, player);
else
NLG.SystemMessage(player, '只能召唤1位格斗。' )
end
elseif count == 5 then
if wanjia[player][0] > 3 then
NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
elseif wanjia[player][5] <= 0 then
local charIndex1 = Char.CreateDummy()--生成ai佣兵
wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
wanjia[player][5] = charIndex1
Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
Char.SetData(charIndex1, CONST.CHAR_名字, '主教奈麻');
Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
Char.SetData(charIndex1, CONST.CHAR_形象, 100333);
Char.SetData(charIndex1, CONST.CHAR_原形, 100333);
Char.SetData(charIndex1, CONST.CHAR_原始图档, 100333);
if rlv >= 83 then
Char.SetData(charIndex1, CONST.CHAR_体力, rzy);
Char.SetData(charIndex1, CONST.CHAR_力量, 0);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, rcy);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
else
Char.SetData(charIndex1, CONST.CHAR_体力, rzy);
Char.SetData(charIndex1, CONST.CHAR_力量, 0);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rzycj);
Char.SetData(charIndex1, CONST.CHAR_魔法, rcycj);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
end
NLG.UpChar(charIndex1);
Char.SetData(charIndex1, CONST.CHAR_职业, 64);
Char.SetData(charIndex1, CONST.CHAR_职类ID, 60);
Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
if rlv >= 100 then
sjlv = 10
else
sjlv = zblv
end
Char.GiveItem(charIndex1, bzhang[sjlv], 1);
Char.GiveItem(charIndex1, amao[sjlv], 1);
Char.GiveItem(charIndex1, apao[sjlv], 1);
Char.GiveItem(charIndex1, axie[sjlv], 1);
Item.SetData(Char.GetItemIndex(charIndex1, 8), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 9), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 10), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 11), %道具_已鉴定%, 1)
Item.UpItem(charIndex1, -1);
NLG.UpChar(charIndex1);
Char.GiveItem(charIndex1, 900192, 1);
Char.GiveItem(charIndex1, 900330, 1);
Char.GiveItem(charIndex1, 900331, 1);
Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
Char.MoveItem(charIndex1, 9, CONST.EQUIP_头, -1);
Char.MoveItem(charIndex1, 10, CONST.EQUIP_身, -1);
Char.MoveItem(charIndex1, 11, CONST.EQUIP_腿, -1);
Char.MoveItem(charIndex1, 12, CONST.EQUIP_水晶, -1);
Char.MoveItem(charIndex1, 13, CONST.EQUIP_首饰1, -1);
Char.MoveItem(charIndex1, 14, CONST.EQUIP_首饰2, -1);
Char.GiveItem(charIndex1, 18196, 1);
Char.GiveItem(charIndex1, 18315, 19);
Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
Char.AddSkill(charIndex1, 71);
Char.AddSkill(charIndex1, 13);
Char.AddSkill(charIndex1, 15);
Char.AddSkill(charIndex1, 17);
Char.SetSkillLevel(charIndex1,0,2);
Char.SetSkillLevel(charIndex1,1,2);
Char.SetSkillLevel(charIndex1,2,2);
Char.SetSkillLevel(charIndex1,3,2);
Char.GivePet(charIndex1, 900004);
local charIndex2 = Char.GetPet(charIndex1,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex2,%对象_经验%,hdjy);
Pet.UpPet(charIndex1,charIndex2);
local petFP = Char.GetData(charIndex2,%对象_体力%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex2, CONST.CHAR_体力, petFPP);
Char.SetData(charIndex2, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex1,charIndex2);
Char.SetData(charIndex2, CONST.CHAR_血, Char.GetData(charIndex2, CONST.CHAR_最大血));
Char.SetData(charIndex2, CONST.CHAR_魔, Char.GetData(charIndex2, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex2, petjn[sjlv][1]);
Pet.AddSkill(charIndex2, petjn[sjlv][2]);
Pet.AddSkill(charIndex2, petjn[sjlv][5]);
Pet.AddSkill(charIndex2, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
NLG.UpChar(charIndex1);
Pet.UpPet(charIndex1,charIndex2);
Item.UpItem(charIndex1, -1);
NLG.SystemMessage(player, '召唤佣兵: 传教' )
Char.JoinParty(charIndex1, player);
else
NLG.SystemMessage(player, '只能召唤1位传教。' )
end
elseif count == 6 then
if wanjia[player][0] > 3 then
NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
elseif wanjia[player][6] <= 0 then
local charIndex1 = Char.CreateDummy()--生成ai佣兵
wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
wanjia[player][6] = charIndex1
Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
Char.SetData(charIndex1, CONST.CHAR_名字, '战斧重音');
Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
Char.SetData(charIndex1, CONST.CHAR_形象, 100270);
Char.SetData(charIndex1, CONST.CHAR_原形, 100270);
Char.SetData(charIndex1, CONST.CHAR_原始图档, 100270);
if rlv >= 80 then
Char.SetData(charIndex1, CONST.CHAR_体力, rzy);
Char.SetData(charIndex1, CONST.CHAR_力量, rcy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
else
Char.SetData(charIndex1, CONST.CHAR_体力, rcy);
Char.SetData(charIndex1, CONST.CHAR_力量, rzy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
end
NLG.UpChar(charIndex1);
Char.SetData(charIndex1, CONST.CHAR_职业, 24);
Char.SetData(charIndex1, CONST.CHAR_职类ID, 20);
Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
if rlv >= 100 then
sjlv = 10
else
sjlv = zblv
end
Char.GiveItem(charIndex1, afu[sjlv], 1);
Char.GiveItem(charIndex1, akui[sjlv], 1);
Char.GiveItem(charIndex1, akai[sjlv], 1);
Char.GiveItem(charIndex1, axue[sjlv], 1);
Item.SetData(Char.GetItemIndex(charIndex1, 8), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 9), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 10), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 11), %道具_已鉴定%, 1)
Item.UpItem(charIndex1, -1);
NLG.UpChar(charIndex1);
Char.GiveItem(charIndex1, 900191, 1);
Char.GiveItem(charIndex1, 900329, 1);
Char.GiveItem(charIndex1, 900333, 1);
Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
Char.MoveItem(charIndex1, 9, CONST.EQUIP_头, -1);
Char.MoveItem(charIndex1, 10, CONST.EQUIP_身, -1);
Char.MoveItem(charIndex1, 11, CONST.EQUIP_腿, -1);
Char.MoveItem(charIndex1, 12, CONST.EQUIP_水晶, -1);
Char.MoveItem(charIndex1, 13, CONST.EQUIP_首饰1, -1);
Char.MoveItem(charIndex1, 14, CONST.EQUIP_首饰2, -1);
Char.GiveItem(charIndex1, 18196, 1);
Char.GiveItem(charIndex1, 18315, 19);
Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
Char.AddSkill(charIndex1, 71);
Char.AddSkill(charIndex1, 13);
Char.AddSkill(charIndex1, 15);
Char.AddSkill(charIndex1, 17);
Char.SetSkillLevel(charIndex1,0,2);
Char.SetSkillLevel(charIndex1,1,2);
Char.SetSkillLevel(charIndex1,2,2);
Char.SetSkillLevel(charIndex1,3,2);
Char.GivePet(charIndex1, 900005);
local charIndex2 = Char.GetPet(charIndex1,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex2,%对象_经验%,hdjy);
Pet.UpPet(charIndex1,charIndex2);
local petFP = Char.GetData(charIndex2,%对象_体力%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex2, CONST.CHAR_体力, petFPP);
Char.SetData(charIndex2, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex1,charIndex2);
Char.SetData(charIndex2, CONST.CHAR_血, Char.GetData(charIndex2, CONST.CHAR_最大血));
Char.SetData(charIndex2, CONST.CHAR_魔, Char.GetData(charIndex2, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex2, petjn[sjlv][1]);
Pet.AddSkill(charIndex2, petjn[sjlv][2]);
Pet.AddSkill(charIndex2, petjn[sjlv][5]);
Pet.AddSkill(charIndex2, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
NLG.UpChar(charIndex1);
Pet.UpPet(charIndex1,charIndex2);
Item.UpItem(charIndex1, -1);
NLG.SystemMessage(player, '召唤佣兵: 战斧' )
Char.JoinParty(charIndex1, player);
else
NLG.SystemMessage(player, '只能召唤1位战斧。' )
end
elseif count == 7 then
if wanjia[player][0] > 3 then
NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
elseif wanjia[player][7] <= 0 then
local charIndex1 = Char.CreateDummy()--生成ai佣兵
wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
wanjia[player][7] = charIndex1
Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
Char.SetData(charIndex1, CONST.CHAR_名字, '战斧凛音');
Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
Char.SetData(charIndex1, CONST.CHAR_形象, 100295);
Char.SetData(charIndex1, CONST.CHAR_原形, 100295);
Char.SetData(charIndex1, CONST.CHAR_原始图档, 100295);
if rlv >= 80 then
Char.SetData(charIndex1, CONST.CHAR_体力, rzy);
Char.SetData(charIndex1, CONST.CHAR_力量, rcy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
else
Char.SetData(charIndex1, CONST.CHAR_体力, rcy);
Char.SetData(charIndex1, CONST.CHAR_力量, rzy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
end
NLG.UpChar(charIndex1);
Char.SetData(charIndex1, CONST.CHAR_职业, 24);
Char.SetData(charIndex1, CONST.CHAR_职类ID, 20);
Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
if rlv >= 100 then
sjlv = 10
else
sjlv = zblv
end
Char.GiveItem(charIndex1, afu[sjlv], 1);
Char.GiveItem(charIndex1, akui[sjlv], 1);
Char.GiveItem(charIndex1, akai[sjlv], 1);
Char.GiveItem(charIndex1, axue[sjlv], 1);
Item.SetData(Char.GetItemIndex(charIndex1, 8), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 9), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 10), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 11), %道具_已鉴定%, 1)
Item.UpItem(charIndex1, -1);
NLG.UpChar(charIndex1);
Char.GiveItem(charIndex1, 900192, 1);
Char.GiveItem(charIndex1, 900329, 1);
Char.GiveItem(charIndex1, 900333, 1);
Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
Char.MoveItem(charIndex1, 9, CONST.EQUIP_头, -1);
Char.MoveItem(charIndex1, 10, CONST.EQUIP_身, -1);
Char.MoveItem(charIndex1, 11, CONST.EQUIP_腿, -1);
Char.MoveItem(charIndex1, 12, CONST.EQUIP_水晶, -1);
Char.MoveItem(charIndex1, 13, CONST.EQUIP_首饰1, -1);
Char.MoveItem(charIndex1, 14, CONST.EQUIP_首饰2, -1);
Char.GiveItem(charIndex1, 18196, 1);
Char.GiveItem(charIndex1, 18315, 19);
Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
Char.AddSkill(charIndex1, 71);
Char.AddSkill(charIndex1, 13);
Char.AddSkill(charIndex1, 15);
Char.AddSkill(charIndex1, 17);
Char.SetSkillLevel(charIndex1,0,2);
Char.SetSkillLevel(charIndex1,1,2);
Char.SetSkillLevel(charIndex1,2,2);
Char.SetSkillLevel(charIndex1,3,2);
Char.GivePet(charIndex1, 900007);
local charIndex2 = Char.GetPet(charIndex1,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex2,%对象_经验%,hdjy);
Pet.UpPet(charIndex1,charIndex2);
local petFP = Char.GetData(charIndex2,%对象_体力%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex2, CONST.CHAR_体力, petFPP);
Char.SetData(charIndex2, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex1,charIndex2);
Char.SetData(charIndex2, CONST.CHAR_血, Char.GetData(charIndex2, CONST.CHAR_最大血));
Char.SetData(charIndex2, CONST.CHAR_魔, Char.GetData(charIndex2, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex2, petjn[sjlv][1]);
Pet.AddSkill(charIndex2, petjn[sjlv][2]);
Pet.AddSkill(charIndex2, petjn[sjlv][5]);
Pet.AddSkill(charIndex2, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
NLG.UpChar(charIndex1);
Pet.UpPet(charIndex1,charIndex2);
Item.UpItem(charIndex1, -1);
NLG.SystemMessage(player, '召唤佣兵: 战斧' )
Char.JoinParty(charIndex1, player);
else
NLG.SystemMessage(player, '只能召唤1位战斧。' )
end
elseif count == 8 then
if wanjia[player][0] > 3 then
NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
elseif wanjia[player][8] <= 0 then
local charIndex1 = Char.CreateDummy()--生成ai佣兵
wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
wanjia[player][8] = charIndex1
Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
Char.SetData(charIndex1, CONST.CHAR_名字, '剑士绵津见');
Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
Char.SetData(charIndex1, CONST.CHAR_形象, 100045);
Char.SetData(charIndex1, CONST.CHAR_原形, 100045);
Char.SetData(charIndex1, CONST.CHAR_原始图档, 100045);
if rlv >= 80 then
Char.SetData(charIndex1, CONST.CHAR_体力, rzy);
Char.SetData(charIndex1, CONST.CHAR_力量, rcy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
else
Char.SetData(charIndex1, CONST.CHAR_体力, rcy);
Char.SetData(charIndex1, CONST.CHAR_力量, rzy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
end
NLG.UpChar(charIndex1);
Char.SetData(charIndex1, CONST.CHAR_职业, 14);
Char.SetData(charIndex1, CONST.CHAR_职类ID, 10);
Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
if rlv >= 100 then
sjlv = 10
else
sjlv = zblv
end
Char.GiveItem(charIndex1, ajian[sjlv], 1);
Char.GiveItem(charIndex1, adun[sjlv], 1);
Char.GiveItem(charIndex1, akui[sjlv], 1);
Char.GiveItem(charIndex1, akai[sjlv], 1);
Char.GiveItem(charIndex1, axue[sjlv], 1);
Item.SetData(Char.GetItemIndex(charIndex1, 8), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 9), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 10), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 11), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 12), %道具_已鉴定%, 1)
Item.UpItem(charIndex1, -1);
NLG.UpChar(charIndex1);
Char.GiveItem(charIndex1, 900193, 1);
Char.GiveItem(charIndex1, 900329, 1);
Char.GiveItem(charIndex1, 900333, 1);
Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
Char.MoveItem(charIndex1, 9, CONST.EQUIP_右手, -1);
Char.MoveItem(charIndex1, 10, CONST.EQUIP_头, -1);
Char.MoveItem(charIndex1, 11, CONST.EQUIP_身, -1);
Char.MoveItem(charIndex1, 12, CONST.EQUIP_腿, -1);
Char.MoveItem(charIndex1, 13, CONST.EQUIP_水晶, -1);
Char.MoveItem(charIndex1, 14, CONST.EQUIP_首饰1, -1);
Char.MoveItem(charIndex1, 15, CONST.EQUIP_首饰2, -1);
Char.GiveItem(charIndex1, 18196, 1);
Char.GiveItem(charIndex1, 18315, 19);
Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
Char.AddSkill(charIndex1, 71);
Char.AddSkill(charIndex1, 13);
Char.AddSkill(charIndex1, 15);
Char.AddSkill(charIndex1, 17);
Char.SetSkillLevel(charIndex1,0,2);
Char.SetSkillLevel(charIndex1,1,2);
Char.SetSkillLevel(charIndex1,2,2);
Char.SetSkillLevel(charIndex1,3,2);
Char.GivePet(charIndex1, 900006);
local charIndex2 = Char.GetPet(charIndex1,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex2,%对象_经验%,hdjy);
Pet.UpPet(charIndex1,charIndex2);
local petFP = Char.GetData(charIndex2,%对象_体力%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex2, CONST.CHAR_体力, petFPP);
Char.SetData(charIndex2, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex1,charIndex2);
Char.SetData(charIndex2, CONST.CHAR_血, Char.GetData(charIndex2, CONST.CHAR_最大血));
Char.SetData(charIndex2, CONST.CHAR_魔, Char.GetData(charIndex2, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex2, petjn[sjlv][1]);
Pet.AddSkill(charIndex2, petjn[sjlv][2]);
Pet.AddSkill(charIndex2, petjn[sjlv][5]);
Pet.AddSkill(charIndex2, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
NLG.UpChar(charIndex1);
Pet.UpPet(charIndex1,charIndex2);
Item.UpItem(charIndex1, -1);
NLG.SystemMessage(player, '召唤佣兵: 剑士' )
Char.JoinParty(charIndex1, player);
else
NLG.SystemMessage(player, '只能召唤1位剑士。' )
end
elseif count == 9 then
if wanjia[player][0] > 3 then
NLG.SystemMessage(player, '您已经召唤了4位小伙伴了,不能再召唤了。' )
elseif wanjia[player][9] <= 0 then
local charIndex1 = Char.CreateDummy()--生成ai佣兵
wanjia[player][0] = wanjia[player][0] + 1--统计ai佣兵数量
wanjia[player][9] = charIndex1
Char.SetData(charIndex1, CONST.CHAR_X, Char.GetData(player, CONST.CHAR_X));
Char.SetData(charIndex1, CONST.CHAR_Y, Char.GetData(player, CONST.CHAR_Y));
Char.SetData(charIndex1, CONST.CHAR_地图, Char.GetData(player, CONST.CHAR_地图));
Char.SetData(charIndex1, CONST.CHAR_名字, '骑士伊吹');
Char.SetData(charIndex1, CONST.CHAR_地图类型, Char.GetData(player, CONST.CHAR_地图类型));
Char.SetData(charIndex1, CONST.CHAR_形象, 100070);
Char.SetData(charIndex1, CONST.CHAR_原形, 100070);
Char.SetData(charIndex1, CONST.CHAR_原始图档, 100070);
if rlv >= 80 then
Char.SetData(charIndex1, CONST.CHAR_体力, rzy);
Char.SetData(charIndex1, CONST.CHAR_力量, rcy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
else
Char.SetData(charIndex1, CONST.CHAR_体力, rcy);
Char.SetData(charIndex1, CONST.CHAR_力量, rzy);
Char.SetData(charIndex1, CONST.CHAR_强度, 0);
Char.SetData(charIndex1, CONST.CHAR_速度, rs);
Char.SetData(charIndex1, CONST.CHAR_魔法, 0);
Char.SetData(charIndex1, CONST.CHAR_等级, rlv);
end
NLG.UpChar(charIndex1);
Char.SetData(charIndex1, CONST.CHAR_职业, 34);
Char.SetData(charIndex1, CONST.CHAR_职类ID, 30);
Char.SetData(charIndex1, CONST.CHAR_职阶, 3);
if rlv >= 100 then
sjlv = 10
else
sjlv = zblv
end
Char.GiveItem(charIndex1, aqiang[sjlv], 1);
Char.GiveItem(charIndex1, adun[sjlv], 1);
Char.GiveItem(charIndex1, akui[sjlv], 1);
Char.GiveItem(charIndex1, akai[sjlv], 1);
Char.GiveItem(charIndex1, axue[sjlv], 1);
Item.SetData(Char.GetItemIndex(charIndex1, 8), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 9), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 10), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 11), %道具_已鉴定%, 1)
Item.SetData(Char.GetItemIndex(charIndex1, 12), %道具_已鉴定%, 1)
Item.UpItem(charIndex1, -1);
NLG.UpChar(charIndex1);
Char.GiveItem(charIndex1, 900194, 1);
Char.GiveItem(charIndex1, 900329, 1);
Char.GiveItem(charIndex1, 900333, 1);
Char.MoveItem(charIndex1, 8, CONST.EQUIP_左手, -1);
Char.MoveItem(charIndex1, 9, CONST.EQUIP_右手, -1);
Char.MoveItem(charIndex1, 10, CONST.EQUIP_头, -1);
Char.MoveItem(charIndex1, 11, CONST.EQUIP_身, -1);
Char.MoveItem(charIndex1, 12, CONST.EQUIP_腿, -1);
Char.MoveItem(charIndex1, 13, CONST.EQUIP_水晶, -1);
Char.MoveItem(charIndex1, 14, CONST.EQUIP_首饰1, -1);
Char.MoveItem(charIndex1, 15, CONST.EQUIP_首饰2, -1);
Char.GiveItem(charIndex1, 18196, 1);
Char.GiveItem(charIndex1, 18315, 19);
Char.SetData(charIndex1, CONST.CHAR_血, Char.GetData(charIndex1, CONST.CHAR_最大血));
Char.SetData(charIndex1, CONST.CHAR_魔, Char.GetData(charIndex1, CONST.CHAR_最大魔));
Char.AddSkill(charIndex1, 71);
Char.AddSkill(charIndex1, 13);
Char.AddSkill(charIndex1, 15);
Char.AddSkill(charIndex1, 17);
Char.SetSkillLevel(charIndex1,0,2);
Char.SetSkillLevel(charIndex1,1,2);
Char.SetSkillLevel(charIndex1,2,2);
Char.SetSkillLevel(charIndex1,3,2);
Char.GivePet(charIndex1, 900006);
local charIndex2 = Char.GetPet(charIndex1,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex2,%对象_经验%,hdjy);
Pet.UpPet(charIndex1,charIndex2);
local petFP = Char.GetData(charIndex2,%对象_体力%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex2, CONST.CHAR_体力, petFPP);
Char.SetData(charIndex2, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex1,charIndex2);
Char.SetData(charIndex2, CONST.CHAR_血, Char.GetData(charIndex2, CONST.CHAR_最大血));
Char.SetData(charIndex2, CONST.CHAR_魔, Char.GetData(charIndex2, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex2, petjn[sjlv][1]);
Pet.AddSkill(charIndex2, petjn[sjlv][2]);
Pet.AddSkill(charIndex2, petjn[sjlv][5]);
Pet.AddSkill(charIndex2, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex1, 0, CONST.PET_STATE_战斗);
NLG.UpChar(charIndex1);
Pet.UpPet(charIndex1,charIndex2);
Item.UpItem(charIndex1, -1);
NLG.SystemMessage(player, '召唤佣兵: 骑士' )
Char.JoinParty(charIndex1, player);
else
NLG.SystemMessage(player, '只能召唤1位骑士。' )
end
end
end
end)
self:NPC_regTalkedEvent(warpNPC, function(npc, player)
if (NLG.CanTalk(npc, player) == true) then
local msg = "1\\n请选择想并肩作战的佣兵\\n"
for i = 1, 8 do
msg = msg .. ybtable[i] .. "\\n"
end
NLG.ShowWindowTalked(player, npc, CONST.窗口_选择框, CONST.BUTTON_下取消, 1, msg);
end
return
end)
self:regCallback('CharActionEvent', function(player, actionID)
if actionID == %动作_招手% then
local msg = "1\\n请对佣兵下达指令\\n"
for i = 1, 8 do
msg = msg .. ybctrl[i] .. "\\n"
end
NLG.ShowWindowTalked(player, ctrlNPC, CONST.窗口_选择框, CONST.BUTTON_下取消, 1, msg);
end
end)
self:NPC_regWindowTalkedEvent(ctrlNPC, function(npc, player, _seqno, _select, _data)
local suiji = math.random(100,100)--90~100的随机数--然后ai参考人物生成浮动bp
local rlv = Char.GetData(player,%对象_等级%)
local rlv = rlv /100 * suiji
local petjn = {{1430,1530,1630,1730},{1432,1532,1632,1732},{1434,1534,1634,1734},{1436,1536,1636,1736},{1438,1538,1638,1738},}--宠物抗性技能
local jnlv = math.floor(rlv/20) + 1--宠物技能等级
local sjlv = 0
local column = tonumber(_data)
local page = tonumber(_seqno)
local warpPage = page;
local winMsg = "1\\n请对佣兵下达指令\\n"
local winButton = CONST.BUTTON_关闭;
local totalPage1, remainder1 = calcWarp1()
--上页16 下页32 关闭/取消2
if _select > 0 then
if _select == CONST.BUTTON_下一页 then
warpPage = warpPage + 1
if (warpPage == totalPage1) or ((warpPage == (totalPage1 - 1) and remainder1 == 0)) then
winButton = CONST.BUTTON_上取消
else
winButton = CONST.BUTTON_上下取消
end
elseif _select == CONST.BUTTON_上一页 then
warpPage = warpPage - 1
if warpPage == 1 then
winButton = CONST.BUTTON_下取消
else
winButton = CONST.BUTTON_上下取消
end
elseif _select == 2 then
warpPage = 1
return
end
local count = 8 * (warpPage - 1)
if warpPage == totalPage1 then
for i = 1 + count, remainder1 + count do
winMsg = winMsg .. ybctrl[i] .. "\\n"
end
else
for i = 1 + count, 8 + count do
winMsg = winMsg .. ybctrl[i] .. "\\n"
end
end
NLG.ShowWindowTalked(player, npc, CONST.窗口_选择框, winButton, warpPage, winMsg);
else
local count = 8 * (warpPage - 1) + column
if count == 1 then
for xxqk = 1,9 do
if wanjia[player][xxqk] > 0 then
Char.DelDummy(wanjia[player][xxqk])
wanjia[player][xxqk] = -1
wanjia[player][0] = 0
end
end
wanjia[player][0] = 0
elseif count == 2 then
local ssyb3 = false
local money = Char.GetData(player,%对象_金币%)
if money < 1000 then
NLG.SystemMessage(player,"魔币不足1000,无法对佣兵进行治疗!");
else
for ssyb = 1,4 do
local ssyb1 = Char.GetPartyMember(player,ssyb)
local ssyb2 = Char.GetPet(ssyb1,0)
if ssyb1 >= 0 then
if Char.IsDummy(ssyb1) then
if Char.GetData(ssyb1,%对象_受伤%)>=1 or Char.GetData(ssyb2,%对象_受伤%)>=1 then
Char.SetData(ssyb1,%对象_受伤%,0);
Char.SetData(ssyb2,%对象_受伤%,0);
NLG.UpChar(ssyb1);
Pet.UpPet(ssyb1, ssyb2);
ssyb3 = true;
end
end
end
end
if ssyb3 then
Char.SetData(player,%对象_金币%,money-1000);
NLG.SystemMessage(player,"佣兵和佣兵宠物已恢复健康。");
else
NLG.SystemMessage(player,"佣兵和佣兵宠物不需要治疗。");
end
end
Item.UpItem(player, -1);
elseif count == 3 then
Char.SetData(Char.GetPartyMember(player,1),%对象_位置%,1);
Char.SetData(Char.GetPartyMember(player,2),%对象_位置%,1);
NLG.SystemMessage(player,"W站位开启。")
elseif count == 4 then
Char.SetData(Char.GetPartyMember(player,1),%对象_位置%,0);
Char.SetData(Char.GetPartyMember(player,2),%对象_位置%,0);
NLG.SystemMessage(player,"一字站位开启。")
elseif count == 5 then
Char.SetPetDepartureState(Char.GetPartyMember(player,1), 0, CONST.PET_STATE_待命);
Char.SetPetDepartureState(Char.GetPartyMember(player,2), 0, CONST.PET_STATE_待命);
Char.SetPetDepartureState(Char.GetPartyMember(player,3), 0, CONST.PET_STATE_待命);
Char.SetPetDepartureState(Char.GetPartyMember(player,4), 0, CONST.PET_STATE_待命);
NLG.SystemMessage(player,"佣兵宠物已待命。")
elseif count == 6 then
partyname = {}
local ybpn = 0
for AInum = 1,4 do
local ybIndex = Char.GetPartyMember(player,AInum)
if ybIndex > 0 and Char.IsDummy(ybIndex) then
table.insert(partyname,""..Char.GetData(ybIndex,%对象_名字%).."")
ybpn = ybpn + 1
end
end
local msg = "1\\n请选择你想开除的佣兵\\n"
for i = 1, ybpn do
msg = msg .. ""..partyname[i].."" .. "\\n"
end
NLG.ShowWindowTalked(player, testNPC, CONST.窗口_选择框, CONST.BUTTON_关闭, 1, msg);
elseif count == 7 then
for i=1,4 do
if Char.IsDummy(Char.GetPartyMember(player,i)) then
Char.SetData(Char.GetPartyMember(player,i), CONST.CHAR_卡时, 99 * 3600);
Char.FeverStart(Char.GetPartyMember(player,i));
NLG.UpChar(Char.GetPartyMember(player,i))
end
end
NLG.SystemMessage(player, '佣兵打卡开启!卡时还有九小时' )
elseif count == 8 then
local Target_MapId=Char.GetData(player, CONST.CHAR_地图类型)
local Target_FloorId=Char.GetData(player, CONST.CHAR_地图)
local Target_X=Char.GetData(player, CONST.CHAR_X)
local Target_Y=Char.GetData(player, CONST.CHAR_Y)
for csdd = 1,9 do
if Char.PartyNum(wanjia[player][csdd]) == -1 then
Char.Warp(wanjia[player][csdd], Target_MapId, Target_FloorId, Target_X, Target_Y)
Char.JoinParty(wanjia[player][csdd],player);
end
end
NLG.SystemMessage(player, '佣兵已召回!' )
elseif count == 9 then
for tuximo = 1,9 do
local charIndex3 = wanjia[player][tuximo]
if charIndex3 > 0 then
Char.DelSlotPet(charIndex3,0);
Char.GivePet(charIndex3, 900000);
local charIndex4 = Char.GetPet(charIndex3,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex4,%对象_经验%,hdjy);
Pet.UpPet(charIndex3,charIndex4);
local petFP = Char.GetData(charIndex4,%对象_魔法%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex4, CONST.CHAR_魔法, petFPP);
Char.SetData(charIndex4, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex3,charIndex4);
Char.SetData(charIndex4, CONST.CHAR_血, Char.GetData(charIndex4, CONST.CHAR_最大血));
Char.SetData(charIndex4, CONST.CHAR_魔, Char.GetData(charIndex4, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex4, petjn[sjlv][1]);
Pet.AddSkill(charIndex4, petjn[sjlv][2]);
Pet.AddSkill(charIndex4, petjn[sjlv][3]);
Pet.AddSkill(charIndex4, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex3, 0, CONST.PET_STATE_战斗);
Char.DelItem(charIndex3,18315,1);
Char.GiveItem(charIndex3, 900191, 1);
Char.MoveItem(charIndex3, 9, CONST.EQUIP_水晶, -1);
Char.DelItem(charIndex3,Char.GetItemIndex(charIndex3,9),1);
Char.GiveItem(charIndex3, 18315, 1);
Pet.UpPet(charIndex3,charIndex4);
Item.UpItem(charIndex3, -1);
NLG.Say(player,-1,"已更换大地鼠,装备土系水晶。",5,3)
print("宠物"..Char.GetData(charIndex4, CONST.CHAR_升级点).."升级啦!");
end
end
elseif count == 10 then
for tuximo = 1,9 do
local charIndex3 = wanjia[player][tuximo]
if charIndex3 > 0 then
Char.DelSlotPet(charIndex3,0);
Char.GivePet(charIndex3, 900001);
local charIndex4 = Char.GetPet(charIndex3,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex4,%对象_经验%,hdjy);
Pet.UpPet(charIndex3,charIndex4);
local petFP = Char.GetData(charIndex4,%对象_魔法%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex4, CONST.CHAR_魔法, petFPP);
Char.SetData(charIndex4, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex3,charIndex4);
Char.SetData(charIndex4, CONST.CHAR_血, Char.GetData(charIndex4, CONST.CHAR_最大血));
Char.SetData(charIndex4, CONST.CHAR_魔, Char.GetData(charIndex4, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex4, petjn[sjlv][1]);
Pet.AddSkill(charIndex4, petjn[sjlv][2]);
Pet.AddSkill(charIndex4, petjn[sjlv][3]);
Pet.AddSkill(charIndex4, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex3, 0, CONST.PET_STATE_战斗);
Char.DelItem(charIndex3,18315,1);
Char.GiveItem(charIndex3, 900192, 1);
Char.MoveItem(charIndex3, 9, CONST.EQUIP_水晶, -1);
Char.DelItem(charIndex3,Char.GetItemIndex(charIndex3,9),1);
Char.GiveItem(charIndex3, 18315, 1);
Pet.UpPet(charIndex3,charIndex4);
Item.UpItem(charIndex3, -1);
NLG.Say(player,-1,"已更换噩梦鼠,装备水系水晶。",3,3)
end
end
elseif count == 11 then
for tuximo = 1,9 do
local charIndex3 = wanjia[player][tuximo]
if charIndex3 > 0 then
Char.DelSlotPet(charIndex3,0);
Char.GivePet(charIndex3, 900002);
local charIndex4 = Char.GetPet(charIndex3,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex4,%对象_经验%,hdjy);
Pet.UpPet(charIndex3,charIndex4);
local petFP = Char.GetData(charIndex4,%对象_魔法%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex4, CONST.CHAR_魔法, petFPP);
Char.SetData(charIndex4, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex3,charIndex4);
Char.SetData(charIndex4, CONST.CHAR_血, Char.GetData(charIndex4, CONST.CHAR_最大血));
Char.SetData(charIndex4, CONST.CHAR_魔, Char.GetData(charIndex4, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex4, petjn[sjlv][1]);
Pet.AddSkill(charIndex4, petjn[sjlv][2]);
Pet.AddSkill(charIndex4, petjn[sjlv][3]);
Pet.AddSkill(charIndex4, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex3, 0, CONST.PET_STATE_战斗);
Char.DelItem(charIndex3,18315,1);
Char.GiveItem(charIndex3, 900193, 1);
Char.MoveItem(charIndex3, 9, CONST.EQUIP_水晶, -1);
Char.DelItem(charIndex3,Char.GetItemIndex(charIndex3,9),1);
Char.GiveItem(charIndex3, 18315, 1);
Pet.UpPet(charIndex3,charIndex4);
Item.UpItem(charIndex3, -1);
NLG.Say(player,-1,"已更换火焰鼠,装备火系水晶。",6,3)
end
end
elseif count == 12 then
for tuximo = 1,9 do
local charIndex3 = wanjia[player][tuximo]
if charIndex3 > 0 then
Char.DelSlotPet(charIndex3,0);
Char.GivePet(charIndex3, 900003);
local charIndex4 = Char.GetPet(charIndex3,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex4,%对象_经验%,hdjy);
Pet.UpPet(charIndex3,charIndex4);
local petFP = Char.GetData(charIndex4,%对象_魔法%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex4, CONST.CHAR_魔法, petFPP);
Char.SetData(charIndex4, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex3,charIndex4);
Char.SetData(charIndex4, CONST.CHAR_血, Char.GetData(charIndex4, CONST.CHAR_最大血));
Char.SetData(charIndex4, CONST.CHAR_魔, Char.GetData(charIndex4, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex4, petjn[sjlv][1]);
Pet.AddSkill(charIndex4, petjn[sjlv][2]);
Pet.AddSkill(charIndex4, petjn[sjlv][3]);
Pet.AddSkill(charIndex4, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex3, 0, CONST.PET_STATE_战斗);
Char.DelItem(charIndex3,18315,1);
Char.GiveItem(charIndex3, 900194, 1);
Char.MoveItem(charIndex3, 9, CONST.EQUIP_水晶, -1);
Char.DelItem(charIndex3,Char.GetItemIndex(charIndex3,9),1);
Char.GiveItem(charIndex3, 18315, 1);
Pet.UpPet(charIndex3,charIndex4);
Item.UpItem(charIndex3, -1);
NLG.Say(player,-1,"已更换宝石鼠,装备风系水晶。",4,3)
end
end
elseif count == 13 then
for tuximo = 1,9 do
local charIndex3 = wanjia[player][tuximo]
if charIndex3 > 0 then
Char.DelSlotPet(charIndex3,0);
Char.GivePet(charIndex3, 900004);
local charIndex4 = Char.GetPet(charIndex3,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex4,%对象_经验%,hdjy);
Pet.UpPet(charIndex3,charIndex4);
local petFP = Char.GetData(charIndex4,%对象_体力%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex4, CONST.CHAR_体力, petFPP);
Char.SetData(charIndex4, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex3,charIndex4);
Char.SetData(charIndex4, CONST.CHAR_血, Char.GetData(charIndex4, CONST.CHAR_最大血));
Char.SetData(charIndex4, CONST.CHAR_魔, Char.GetData(charIndex4, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex4, petjn[sjlv][1]);
Pet.AddSkill(charIndex4, petjn[sjlv][2]);
Pet.AddSkill(charIndex4, petjn[sjlv][5]);
Pet.AddSkill(charIndex4, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex3, 0, CONST.PET_STATE_战斗);
Char.DelItem(charIndex3,18315,1);
Char.GiveItem(charIndex3, 900191, 1);
Char.MoveItem(charIndex3, 9, CONST.EQUIP_水晶, -1);
Char.DelItem(charIndex3,Char.GetItemIndex(charIndex3,9),1);
Char.GiveItem(charIndex3, 18315, 1);
Pet.UpPet(charIndex3,charIndex4);
Item.UpItem(charIndex3, -1);
NLG.Say(player,-1,"已更换僵尸,装备土系水晶。",5,3)
end
end
elseif count == 14 then
for tuximo = 1,9 do
local charIndex3 = wanjia[player][tuximo]
if charIndex3 > 0 then
Char.DelSlotPet(charIndex3,0);
Char.GivePet(charIndex3, 900005);
local charIndex4 = Char.GetPet(charIndex3,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex4,%对象_经验%,hdjy);
Pet.UpPet(charIndex3,charIndex4);
local petFP = Char.GetData(charIndex4,%对象_体力%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex4, CONST.CHAR_体力, petFPP);
Char.SetData(charIndex4, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex3,charIndex4);
Char.SetData(charIndex4, CONST.CHAR_血, Char.GetData(charIndex4, CONST.CHAR_最大血));
Char.SetData(charIndex4, CONST.CHAR_魔, Char.GetData(charIndex4, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex4, petjn[sjlv][1]);
Pet.AddSkill(charIndex4, petjn[sjlv][2]);
Pet.AddSkill(charIndex4, petjn[sjlv][5]);
Pet.AddSkill(charIndex4, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex3, 0, CONST.PET_STATE_战斗);
Char.DelItem(charIndex3,18315,1);
Char.GiveItem(charIndex3, 900192, 1);
Char.MoveItem(charIndex3, 9, CONST.EQUIP_水晶, -1);
Char.DelItem(charIndex3,Char.GetItemIndex(charIndex3,9),1);
Char.GiveItem(charIndex3, 18315, 1);
Pet.UpPet(charIndex3,charIndex4);
Item.UpItem(charIndex3, -1);
NLG.Say(player,-1,"已更换丧尸,装备水系水晶。",3,3)
end
end
elseif count == 15 then
for tuximo = 1,9 do
local charIndex3 = wanjia[player][tuximo]
if charIndex3 > 0 then
Char.DelSlotPet(charIndex3,0);
Char.GivePet(charIndex3, 900006);
local charIndex4 = Char.GetPet(charIndex3,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex4,%对象_经验%,hdjy);
Pet.UpPet(charIndex3,charIndex4);
local petFP = Char.GetData(charIndex4,%对象_体力%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex4, CONST.CHAR_体力, petFPP);
Char.SetData(charIndex4, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex3,charIndex4);
Char.SetData(charIndex4, CONST.CHAR_血, Char.GetData(charIndex4, CONST.CHAR_最大血));
Char.SetData(charIndex4, CONST.CHAR_魔, Char.GetData(charIndex4, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex4, petjn[sjlv][1]);
Pet.AddSkill(charIndex4, petjn[sjlv][2]);
Pet.AddSkill(charIndex4, petjn[sjlv][5]);
Pet.AddSkill(charIndex4, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex3, 0, CONST.PET_STATE_战斗);
Char.DelItem(charIndex3,18315,1);
Char.GiveItem(charIndex3, 900193, 1);
Char.MoveItem(charIndex3, 9, CONST.EQUIP_水晶, -1);
Char.DelItem(charIndex3,Char.GetItemIndex(charIndex3,9),1);
Char.GiveItem(charIndex3, 18315, 1);
Pet.UpPet(charIndex3,charIndex4);
Item.UpItem(charIndex3, -1);
NLG.Say(player,-1,"已更换食尸鬼,装备火系水晶。",6,3)
end
end
elseif count == 16 then
for tuximo = 1,9 do
local charIndex3 = wanjia[player][tuximo]
if charIndex3 > 0 then
Char.DelSlotPet(charIndex3,0);
Char.GivePet(charIndex3, 900007);
local charIndex4 = Char.GetPet(charIndex3,0)
if rlv > 1 then
local hdjy = rlv^4
Char.SetData(charIndex4,%对象_经验%,hdjy);
Pet.UpPet(charIndex3,charIndex4);
local petFP = Char.GetData(charIndex4,%对象_体力%)
local petFPP = (rlv - 1)*100 + petFP
Char.SetData(charIndex4, CONST.CHAR_体力, petFPP);
Char.SetData(charIndex4, CONST.CHAR_升级点, 0);
Pet.UpPet(charIndex3,charIndex4);
Char.SetData(charIndex4, CONST.CHAR_血, Char.GetData(charIndex4, CONST.CHAR_最大血));
Char.SetData(charIndex4, CONST.CHAR_魔, Char.GetData(charIndex4, CONST.CHAR_最大魔));
end
if rlv >= 100 then
sjlv = 5
else
sjlv = jnlv
end
Pet.AddSkill(charIndex4, petjn[sjlv][1]);
Pet.AddSkill(charIndex4, petjn[sjlv][2]);
Pet.AddSkill(charIndex4, petjn[sjlv][5]);
Pet.AddSkill(charIndex4, petjn[sjlv][4]);
Char.SetPetDepartureState(charIndex3, 0, CONST.PET_STATE_战斗);
Char.DelItem(charIndex3,18315,1);
Char.GiveItem(charIndex3, 900194, 1);
Char.MoveItem(charIndex3, 9, CONST.EQUIP_水晶, -1);
Char.DelItem(charIndex3,Char.GetItemIndex(charIndex3,9),1);
Char.GiveItem(charIndex3, 18315, 1);
Pet.UpPet(charIndex3,charIndex4);
Item.UpItem(charIndex3, -1);
NLG.Say(player,-1,"已更换腐尸,装备风系水晶。",4,3)
end
end
end
end
end)
self:NPC_regWindowTalkedEvent(testNPC, function(npc, player, _seqno, _select, _data)
local column = tonumber(_data)
local ybweizhi = 0
for i = 1,9 do
if partyname[column] == ybtable[i] then
ybweizhi = i
end
end
Char.DelDummy(wanjia[player][ybweizhi])
wanjia[player][ybweizhi] = -1
wanjia[player][0] = wanjia[player][0] - 1
end)
end
function yb:onUnload()
self:logInfo('unload')
end
return yb;
复制代码