public bool Action_Get_Eudemon_Pro(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); int index = Convert.ToInt32(option[0]); uint eudemon_id = 0; if (index == 0) { eudemon_id = play.GetUseItemEudemonId(); } RoleData_Eudemon eudemon = play.GetEudemonSystem().FindEudemon(eudemon_id); if (eudemon == null ) return false; String sPro = option[1]; String op = option[2]; int value = Convert.ToInt32(option[3]); switch (sPro) { case "quality": { switch (op) { case ">": { return eudemon.quality > value; } case ">=": { return eudemon.quality >= value; } case "=": { return eudemon.quality == value; } case "<": { return eudemon.quality < value; } case "<=": { return eudemon.quality <= value; } } return false; } case "wuxing": { switch (op) { case "=": { return eudemon.wuxing == value; } case "!=": { return eudemon.wuxing != value; } } return false; } case "level": { switch (op) { case ">": { return eudemon.level > value; } case ">=": { return eudemon.level >= value; } case "=": { return eudemon.level == value; } case "<": { return eudemon.level < value; } case "<=": { return eudemon.level <= value; } } break; } } return false; }
public bool Action_Fuben_Create(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); uint mapid = Convert.ToUInt32(option[0]); byte type = Convert.ToByte(option[1]); short x = Convert.ToInt16(option[2]); short y = Convert.ToInt16(option[3]); GameMap fb_map = MapManager.Instance().AddFubenMap(mapid); if (fb_map == null) { return false; } if(type == 1)//单人副本 { play.ChangeFubenMap(fb_map, x, y); } else if (type == 2)//组队副本 { } return true; }
private void Action_Map_EnterMap(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); if (option.Length < 2) { Log.Instance().WriteLog("脚本参数错误,id:" + info.id.ToString() + " param:" + info.param); return; } uint mapid = Convert.ToUInt32(option[0]); short x = Convert.ToInt16(option[1]); short y = Convert.ToInt16(option[2]); byte dir = Convert.ToByte(option[3]); play.FlyMap(mapid, x, y, dir); }
private void Action_Eudemon_CreateEx(ActionInfo info, PlayerObject play) { String[] split = info.param.Split(' '); if (split.Length < 1) { Log.Instance().WriteLog("Action_Eudemon_CreateEx 参数错误" + info.param + "id" + info.id.ToString()); return; } uint itemid = Convert.ToUInt32(split[0]); if (ConfigManager.Instance().GetItemTypeInfo(itemid) == null) { Log.Instance().WriteLog("Action_Eudemon_CreateEx 物品id不存在"+itemid.ToString()); return; } byte level = 0; if (split.Length >= 2) level = Convert.ToByte(split[1]); int quality = 0; if (split.Length >= 3) quality = Convert.ToInt32(split[2]); byte wuxing = 0; if (split.Length >= 4) wuxing = Convert.ToByte(split[3]); GameStruct.RoleItemInfo item = play.GetItemSystem().AwardItem(itemid, NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK); if (level != 0 || quality != 0 || wuxing != 0) { item.typeid = IDManager.CreateTypeId(OBJECTTYPE.EUDEMON); RoleData_Eudemon eudemon = new RoleData_Eudemon(); eudemon.typeid = item.typeid; eudemon.level = level; eudemon.quality = quality; eudemon.wuxing = wuxing; play.GetEudemonSystem().AddTempEudemon(eudemon); } }
private bool Action_Check_Bag_Size(ActionInfo info, PlayerObject play) { String[] split = info.param.Split(' '); String pack = split[0]; int nAddSize = Convert.ToInt32(split[1]); switch (pack.ToLower()) { case "backpack": //人物背包 { return play.GetItemSystem().GetBagCount() + nAddSize > PlayerItem.MAXBAG_COUNT; } } return false; }
private bool Action_CheckLevel(ActionInfo info, PlayerObject play) { String[] str = info.param.Split(' '); if (str.Length == 2) { byte level = Convert.ToByte(str[1]); switch (str[0]) { case "<": { return play.GetBaseAttr().level < level; } case "=": { return play.GetBaseAttr().level == level; } case ">": { return play.GetBaseAttr().level > level; } } } return false; }
public uint LoadScripteFile(String path, bool reload = false) { String line = ""; uint nRetId = 0; try { if (path == "null") return 0; if (!File.Exists(path)) { Log.Instance().WriteLog("载入脚本文件失败:" + path); return 0; } FileStream f = new FileStream(path, FileMode.Open); StreamReader read = new StreamReader(f, System.Text.ASCIIEncoding.Default); while (true) { line = read.ReadLine(); if (line == null) { break; } if (line.Length <= 0) continue; if (line[0] == '/' && line[1] == '/') continue;//注释 String[] param = line.Split('\t'); if (param.Length != 6) { //添加特殊脚本命令- call 可特殊指向其他脚本id 2015.9.21 if (param.Length == 2 && param[0] == "call") { nRetId = Convert.ToUInt32(param[1]); f.Dispose(); return nRetId; } Log.Instance().WriteLog("载入脚本文件错误:" + path + " 数据:" + line); f.Dispose(); return 1; } GameStruct.ActionInfo info = new GameStruct.ActionInfo(); info.id = Convert.ToUInt32(param[0]); info.id_next = Convert.ToUInt32(param[1]); info.id_nextfail = Convert.ToUInt32(param[2]); info.type = Convert.ToUInt32(param[3]); info.data = Convert.ToUInt32(param[4]); info.param = param[5]; if (!reload) { if (mDicScripte.ContainsKey(info.id)) { Log.Instance().WriteLog("重复id,读出文件:" + path); Log.Instance().WriteLog(info.id.ToString() + " " + info.id_next.ToString() + " " + info.id_nextfail.ToString() + " " + info.type.ToString() + " " + info.data.ToString() + " " + info.param.ToString()); Log.Instance().WriteLog(mDicScripte[info.id].id.ToString() + " " + mDicScripte[info.id].id_next.ToString() + " " + mDicScripte[info.id].id_nextfail.ToString() + " " + mDicScripte[info.id].type.ToString() + " " + mDicScripte[info.id].data.ToString() + " " + mDicScripte[info.id].param.ToString()); } } //返回起始id if (nRetId == 0) { nRetId = info.id; } mDicScripte[info.id] = info; } f.Dispose(); } catch (System.Exception ex) { Log.Instance().WriteLog(path); Log.Instance().WriteLog(line); } return nRetId; }
private void Action_MenuText(ActionInfo info, PlayerObject play) { NetMsg.MsgNpcReply msg = new NetMsg.MsgNpcReply(); msg.Create(null, play.GetGamePackKeyEx()); msg.interactType = 257; msg.optionid = 255; msg.text = Sprintf_string(info.param, play); play.SendData(msg.GetBuffer()); }
private void Action_MessageBox(ActionInfo info, PlayerObject play) { String str = Sprintf_string(info.param, play); play.MsgBox(str); }
private void Action_MenuImage(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); NetMsg.MsgNpcReply msg = new NetMsg.MsgNpcReply(); msg.Create(null, play.GetGamePackKeyEx()); ushort id = Convert.ToUInt16(option[2]); play.SendData(msg.NpcImage(id)); }
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()); }
private void Action_MenuEdit(ActionInfo info, PlayerObject play) { NetMsg.MsgNpcReply msg = new NetMsg.MsgNpcReply(); msg.Create(null, play.GetGamePackKeyEx()); msg.interactType = 259; String[] option = info.param.Split(' '); if (option.Length != 3) { Log.Instance().WriteLog("Action_MenuEdit参数数量不对." + info.param); } ushort nAcceptLen = Convert.ToUInt16(option[0]); uint idTask = Convert.ToUInt32(option[1]); play.SetTaskID(idTask); String sText = option[2]; msg.param2 = nAcceptLen; msg.text = sText; play.SendData(msg.GetBuffer()); //byte[] data1 = { 29, 0, 240, 7, 0, 0, 0, 0, 15, 0, 0, 3, 1, 12, 190, 252, 205, 197, 207, 235, 189, 208, 161, 173, 161, 173, 0, 0, 0 }; //play.GetGamePackKeyEx().EncodePacket(ref data1, data1.Length); //play.SendData(data1); }
private bool Action_Map_ReCall(ActionInfo info, PlayerObject play) { play.ReCallMap(); return true; }
private bool Action_Map_Random(ActionInfo info, PlayerObject play) { play.ScroolRandom();//随机传送 return true; }
private void Action_TimeOut_Delete(ActionInfo info, PlayerObject play) { int time_id = Convert.ToInt32(info.param); ScriptTimerManager.Instance().DeletePlayerTimeOut(time_id, play.GetBaseAttr().player_id); }
private void Action_OpenDialog(ActionInfo info, PlayerObject play) { int dwData = Convert.ToInt32(info.data); play.OpenDialog(dwData); }
public void Action_Set_Eudemon_Pro(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); int index = Convert.ToInt32(option[0]); uint eudemon_id = 0; if (index == 0) { eudemon_id = play.GetUseItemEudemonId(); } RoleData_Eudemon eudemon = play.GetEudemonSystem().FindEudemon(eudemon_id); EudemonObject eudemon_obj = play.GetEudemonSystem().GetEudmeonObject(eudemon_id); if (eudemon == null || eudemon_obj == null) return; String sPro = option[1]; String op = option[2]; int value = Convert.ToInt32(option[3]); switch (sPro) { case "quality": { switch (op) { case "+": { eudemon.quality += value; break; } case "-": { eudemon.quality -= value; break; } case "=": { eudemon.quality = value; break; } } break; } case "wuxing": { switch (op) { case "=": { eudemon.wuxing = value; break; } } break; } } if (eudemon != null) { eudemon_obj.SetEudemonInfo(eudemon); play.GetEudemonSystem().SendEudemonInfo(eudemon, true, true); } }
private bool Action_Random_Compare(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); int nValue = Convert.ToInt32(option[1]); int nRandom = play.GetCurrentRandom(); switch (option[0]) { case ">": { return nValue > nRandom; } case "=": { return nValue == nRandom; } case "<": { return nValue < nRandom; } case ">=": { return nValue >= nRandom; } case "<=": { return nValue <= nRandom; } } return false; }
//检测玩家是否有该技能 public bool Action_CheckMagic(ActionInfo info, PlayerObject play) { uint magicid = Convert.ToUInt32(info.param); return play.GetMagicSystem().isMagic(magicid); }
private void Action_Random_Init(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); int min = Convert.ToInt32(option[0]); int max = Convert.ToInt32(option[1]); play.SetCurrentRandom(IRandom.Random(min, max)); }
//增加玩家技能 private void Action_AddMagic(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); uint magicid = Convert.ToUInt32(option[0]); byte level = 0; if (option.Length >= 2) level = Convert.ToByte(option[1]); uint exp = 0; if (option.Length >= 3) exp = Convert.ToUInt32(option[2]); play.GetMagicSystem().AddMagicInfo(magicid, level, exp); }
private void Action_Recall_Eudemon(ActionInfo info, PlayerObject play) { int type = Convert.ToInt32(info.param); switch (type) { case 0: //出征与合体的幻兽 { play.GetEudemonSystem().Eudemon_ReCallAll(false); play.GetEudemonSystem().Eudemon_BreakUpAll(); break; } case 1: //出征的幻兽 { play.GetEudemonSystem().Eudemon_ReCallAll(false); break; } case 2://合体的幻兽 { play.GetEudemonSystem().Eudemon_BreakUpAll(); break; } } }
private bool Action_CheckProfession(ActionInfo info, PlayerObject play) { byte nProfession = Convert.ToByte(info.param); if (play.GetBaseAttr().profession == nProfession) { return true; } return false; }
//设置玩家属性 private void Action_Set_Role_Pro(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); //if (option.Length != 2) //{ // Log.Instance().WriteLog("参数错误:Action_Set_Role_Pro"+info.param); // return; //} String op = option[0]; switch (op) { case "level": //等级 { byte level = Convert.ToByte(option[2]); switch (option[1]) { case "+": { play.ChangeAttribute(UserAttribute.LEVEL, level); break; } case "-": { play.ChangeAttribute(UserAttribute.LEVEL, -level); break; } case "=": { play.GetBaseAttr().level = level; play.ChangeAttribute(UserAttribute.LEVEL, 0); break; } } break; } case "godlevel"://神等级 { byte godlevel = Convert.ToByte(option[2]); switch (option[1]) { case "+": { play.GetBaseAttr().godlevel += godlevel; break; } case "-": { play.GetBaseAttr().godlevel -= godlevel; break; } case "=": { play.GetBaseAttr().godlevel = godlevel; break; } } break; } case "hair": //发型 { play.ChangeAttribute(UserAttribute.HAIR, Convert.ToInt32(option[1])); break; } case "gold": //金币 { int nGold = Convert.ToInt32(option[2]); switch (option[1]) { case "+": { play.ChangeAttribute(UserAttribute.GOLD, nGold); break; } case "-": { play.ChangeAttribute(UserAttribute.GOLD, -nGold); break; } case "=": { play.GetBaseAttr().gold = nGold; play.ChangeAttribute(UserAttribute.GOLD, 0); break; } } break; } case "gamegold": //魔石 { int nGameGold = Convert.ToInt32(option[2]); switch (option[1]) { case "+": { play.ChangeAttribute(UserAttribute.GAMEGOLD, nGameGold); break; } case "-": { play.ChangeAttribute(UserAttribute.GAMEGOLD, -nGameGold); break; } case "=": { play.GetBaseAttr().gamegold = nGameGold; play.ChangeAttribute(UserAttribute.GAMEGOLD, 0); break; } } break; } case "job": //职业 { byte bJob = Convert.ToByte(option[2]); break; } case "pk": { switch (option[1]) { case "=": { play.GetBaseAttr().pk = Convert.ToInt16(option[2]); break; } case "+": { play.GetBaseAttr().pk += Convert.ToInt16(option[2]); break; } case "-": { play.GetBaseAttr().pk -= Convert.ToInt16(option[2]); break; } } play.ChangeAttribute(UserAttribute.PK, 0, false); break; } case "maxeudemon": { switch (option[1]) { case "=": { play.GetBaseAttr().maxeudemon = Convert.ToByte(option[2]); break; } case "+": { play.GetBaseAttr().maxeudemon += Convert.ToByte(option[2]); break; } case "-": { play.GetBaseAttr().maxeudemon -= Convert.ToByte(option[2]); break; } } play.ChangeAttribute(UserAttribute.MAXEUDEMON, 0,false); break; } } }
private bool Action_Equip_Operation(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); String command = option[0].ToLower(); RoleItemInfo role_item = null; switch (command) { case "checkequip": //检测装备位置是否存在 { byte postion = Convert.ToByte(option[1]); role_item = play.GetItemSystem().GetEquipByPostion(postion); return role_item == null ? false : true; } case "setequippro": //设置装备属性 { byte postion = Convert.ToByte(option[1]); role_item = play.GetItemSystem().GetEquipByPostion(postion); if (role_item == null) return false; String op = option[2]; bool ret = true; switch (op) { case "shui_attack": { String opex = option[3]; byte v = Convert.ToByte(option[4]); switch (opex) { case "=": { role_item.shui_attack = v; break; } case "-": { role_item.shui_attack -= v; break; } case "+": { role_item.shui_attack += v; break; } } break; } case "di_attack": { String opex = option[3]; byte v = Convert.ToByte(option[4]); switch (opex) { case "=": { role_item.di_attack = v; break; } case "-": { role_item.di_attack -= v; break; } case "+": { role_item.di_attack += v; break; } } break; } case "huo_attack": { String opex = option[3]; byte v = Convert.ToByte(option[4]); switch (opex) { case "=":{ role_item.huo_attack = v; break; } case "-": { role_item.huo_attack -= v; break; } case "+": { role_item.huo_attack += v; break; } } break; } case "feng_attack": { String opex = option[3]; byte v = Convert.ToByte(option[4]); switch (opex) { case "=": { role_item.feng_attack = v; break; } case "-": { role_item.feng_attack -= v; break; } case "+": { role_item.feng_attack += v; break; } } break; } case "hole": //装备打洞 0为第一个洞 1为第二个洞 2为第三个洞 { String opex = option[3]; byte v = Convert.ToByte(option[4]); switch (opex) { case "=": { role_item.OpenGem(v); break; } } break; } default: { ret = false; break; } } play.GetItemSystem().UpdateItemInfo(role_item.id); play.CalcAttribute();//重新计算属性 return ret; } case "checkequippro": //获取装备属性 { byte postion = Convert.ToByte(option[1]); role_item = play.GetItemSystem().GetEquipByPostion(postion); if (role_item == null) return false; String op = option[2]; String opex = option[3]; int v = Convert.ToInt32(option[4]); switch (op) { case "shui_attack": { switch (opex) { case "=": { return role_item.shui_attack == v; } case ">": { return role_item.shui_attack > v;} case ">=": {return role_item.shui_attack >= v;} case "<": {return role_item.shui_attack < v; } case "<=": { return role_item.shui_attack <= v;} default: { break; } } break; } case "di_attack": { switch (opex) { case "=": { return role_item.di_attack == v; } case ">": {return role_item.di_attack > v; } case ">=": { return role_item.di_attack >= v; } case "<": { return role_item.di_attack < v; } case "<=": { return role_item.di_attack <= v;} default: { break; } } break; } case "huo_attack": { switch (opex) { case "=": { return role_item.huo_attack == v; } case ">": { return role_item.huo_attack > v; } case ">=": { return role_item.huo_attack >= v; } case "<": { return role_item.huo_attack < v; } case "<=": { return role_item.huo_attack <= v; } default: { break; } } break; } case "feng_attack": { switch (opex) { case "=": { return role_item.feng_attack == v; } case ">": { return role_item.feng_attack > v; } case ">=": { return role_item.feng_attack >= v; } case "<": { return role_item.feng_attack < v; } case "<=":{ return role_item.feng_attack <= v; } default: { break; } } break; } case "hole": //装备打洞数量 { switch (opex) { case "=": { return role_item.GetGemCount() == v; } } break; } default: { break; } } break; } } return false; }
private bool Action_TimeOut_Check(ActionInfo info, PlayerObject play) { int time_id = Convert.ToInt32(info.param); return ScriptTimerManager.Instance().CheckPlayerTimeOut(time_id, play.GetBaseAttr().player_id); }
private void Action_Eudemon_Create(ActionInfo info, PlayerObject play) { String[] split = info.param.Split(' '); if (split.Length < 1) { Log.Instance().WriteLog("Action_Eudemon_Create 参数错误" + info.param + "id" + info.id.ToString()); return; } uint itemid = Convert.ToUInt32(split[0]); int count = 1; if (split.Length >= 2) { count = Convert.ToInt32(split[1]); } //幻兽背包已满 if (play.GetItemSystem().GetEudemonCount()+ count > PlayerEudemon.MAX_EUDEMON_COUNT) { play.ChatNotice("幻兽背包已满!!"); return; } GameStruct.ItemTypeInfo baseitem = ConfigManager.Instance().GetItemTypeInfo(itemid); if (baseitem == null) { Log.Instance().WriteLog("创建幻兽出错,找不到该幻兽id" + itemid.ToString()); return; } for (int i = 0; i < count; i++) { play.GetItemSystem().AwardItem(itemid, NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK); } // GameStruct.RoleItemInfo iteminfo = null; //if (itemid == 0) //{ // iteminfo = play.GetItemSystem().FindItem(play.GetItemSystem().GetScriptItemId()); // if (iteminfo == null) return; //} //else //没有道具的情况下增加幻兽,要先增加道具-- //{ //} // iteminfo.postion = NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK; // play.GetItemSystem().UpdateItemInfo(iteminfo.id); //增加幻兽 // play.GetEudemonSystem().AddEudemon(iteminfo); }
private bool Action_TimeOut_Create(ActionInfo info, PlayerObject play) { String[] option = info.param.Split(' '); int time_id = Convert.ToInt32(option[0]); int time = Convert.ToInt32(option[1]); uint callback_id = Convert.ToUInt32(option[2]); return ScriptTimerManager.Instance().AddPlayerTimeOut(time_id, play.GetBaseAttr().player_id, time, callback_id); }
private void Action_Fuck_Nian(ActionInfo info, PlayerObject play) { int nLayer = Convert.ToInt32(info.param); int[,] dropitem = null; //1维数为道具id 2维数为概率 switch (nLayer) { //十一层 case 11: { dropitem = new int[5, 5]; dropitem[0, 0] = 180000; dropitem[0, 1] = 1; dropitem[1, 0] = 743388; dropitem[1, 1] = 9; dropitem[2, 0] = 743382; dropitem[2, 1] = 90; dropitem[3, 0] = 743381; dropitem[3, 1] = 250; dropitem[4, 0] = 743380; dropitem[4, 1] = 650; break; } case 12://十二层 { dropitem = new int[5, 5]; dropitem[0, 0] = 180020; dropitem[0, 1] = 1; dropitem[1,0] = 743492; dropitem[1, 1] = 9; dropitem[2, 0] = 743385; dropitem[2, 1] = 90; dropitem[3, 0] = 743384; dropitem[3, 1] = 250; dropitem[4, 0] = 743383; dropitem[4, 1] = 650; break; } case 13://十三层 { dropitem = new int[6, 6]; dropitem[0, 0] = 180040; dropitem[0, 1] = 1; dropitem[1, 0] = 743495; dropitem[1, 1] = 9; dropitem[2, 0] = 743389; dropitem[2, 1] = 90; dropitem[3, 0] = 743386; dropitem[3, 1] = 100; dropitem[4, 0] = 743385; dropitem[4, 1] = 150; dropitem[5, 0] = 743384; dropitem[5, 1] = 650; break; } case 14://十四层 { dropitem = new int[5, 5]; dropitem[0, 0] = 180060; dropitem[0, 1] = 1; dropitem[1, 0] = 743497; dropitem[1, 1] = 9; dropitem[2, 0] = 743389; dropitem[2, 1] = 90; dropitem[3, 0] = 743386; dropitem[3, 1] = 250; dropitem[4, 0] = 743385; dropitem[4, 1] = 650; break; } case 15: //十五层 { dropitem = new int[5, 5]; dropitem[0, 0] = 180080; dropitem[0, 1] = 1; dropitem[1, 0] = 743500; dropitem[1, 1] = 9; dropitem[2, 0] = 743491; dropitem[2, 1] = 90; dropitem[3, 0] = 743390; dropitem[3, 1] = 250; dropitem[4, 0] = 743387; dropitem[4, 1] = 650; break; } case 16: //十六层 { dropitem = new int[5, 5]; dropitem[0, 0] = 180100; dropitem[0, 1] = 1; dropitem[1, 0] = 743501; dropitem[1, 1] = 9; dropitem[2, 0] = 743493; dropitem[2, 1] = 90; dropitem[3, 0] = 743491; dropitem[3, 1] = 250; dropitem[4, 0] = 743390; dropitem[4, 1] = 650; break; } case 17: //十七层 { dropitem = new int[5, 5]; dropitem[0, 0] = 180120; dropitem[0, 1] = 1; dropitem[1, 0] = 743502; dropitem[1, 1] = 9; dropitem[2, 0] = 743496; dropitem[2, 1] = 90; dropitem[3, 0] = 743493; dropitem[3, 1] = 250; dropitem[4, 0] = 743491; dropitem[4, 1] = 650; break; } case 18://十八层 { dropitem = new int[5, 5]; dropitem[0, 0] = 180140; dropitem[0, 1] = 1; dropitem[1, 0] = 743503; dropitem[1, 1] = 9; dropitem[2, 0] = 743499; dropitem[2, 1] = 90; dropitem[3, 0] = 743497; dropitem[3, 1] = 250; dropitem[4, 0] = 743494; dropitem[4, 1] = 650; break; } } //传送到雷鸣交易行 play.ChangeMap(1000, 296, 520); if (dropitem != null) { int rand = IRandom.Random(1, 1000); for (int i = 0; i < 10; i++) { rand = IRandom.Random(1, 1000); } int add_rand = 0; for (int i = 0; i < dropitem.Length; i++) { add_rand += dropitem[i, 1]; if (rand <= add_rand) { GameStruct.ItemTypeInfo typeinfo = ConfigManager.Instance().GetItemTypeInfo((uint)dropitem[i, 0]); if (typeinfo == null) continue; play.GetItemSystem().AwardItem((uint)dropitem[i, 0], NetMsg.MsgItemInfo.ITEMPOSITION_BACKPACK); play.MsgBox("小婊砸你被打出来了!"); break; } } } }
private void Action_Map_Change(ActionInfo info, PlayerObject play) { String[] str = info.param.Split(' '); if (str.Length == 3) { uint mapid = Convert.ToUInt32(str[0]); short x = Convert.ToInt16(str[1]); short y = Convert.ToInt16(str[2]); if (play.GetGameMap().GetMapInfo().id == mapid) { play.ScroolRandom(x, y); } else { play.ChangeMap(mapid, x, y); } } else { Log.Instance().WriteLog("Action_Map_Change 参数错误:" + info.param); } }