//执行对应的选项脚本 //index npc对话框点击选项的索引 //play 玩家对象 //szStr 客户端上传的字符串内容 public void ExecuteOptionId(byte index, PlayerObject play, String szStr = "") { mszStr = szStr; if (play.GetMenuLink().ContainsKey(index)) { ExecuteAction(play.GetMenuLink()[index], play); } }
private void Action_MenuLink(ActionInfo info, PlayerObject play) { NetMsg.MsgNpcReply msg = new NetMsg.MsgNpcReply(); msg.Create(null, play.GetGamePackKeyEx()); msg.interactType = 258; msg.param = 111; msg.param2 = 112; msg.param3[1] = 113; msg.param3[2] = 114; msg.param3[0] = 115; if (info.id_next == 0) msg.optionid = 255; else msg.optionid = mnSelectIndex;/**选项索引**/ String[] option = info.param.Split(' '); play.GetMenuLink()[mnSelectIndex] = Convert.ToUInt32(option[1]); msg.text = option[0]; play.SendData(msg.GetBuffer()); }