//宝石镶嵌 public void GemSet(PlayerObject play, uint srcid, uint destid, byte index) { GameStruct.RoleItemInfo item = play.GetItemSystem().FindItem(destid); GameStruct.RoleItemInfo srcitem = play.GetItemSystem().FindItem(srcid); if (item == null || srcitem == null) { return; } if (!srcitem.IsGem()) { return; } if (item.GetGemCount() < index) { return; } if (item.GetGemType(index) != 255) { return; //已有宝石-- 要先拆除再镶嵌 } play.GetItemSystem().DeleteItemByID(srcid); item.SetGemType(index, srcitem.GetGemType()); play.GetItemSystem().UpdateItemInfo(destid); }
public MsgPtichItemInfo(RoleItemInfo item,uint _ptich_obj_id,int _price,byte sell_byte,bool isRemote = false/*是否是远程摊位*/) { mMsgLen = 88; mParam = PacketProtoco.S_PTICH_ITEMINFO; //幻兽起始id if (item.typeid >= 2000000000) { postion = NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK; id = item.typeid; max_dura = cur_dura = 0; } else { id = item.id; postion = NetMsg.MsgItemInfo.ITEMPOSITION_BACKPACK; max_dura = cur_dura = (short)item.amount;//游戏当前损耗度无用 } forgetname = item.forgename; ptich_obj_id = _ptich_obj_id; price = _price; base_item_id = item.itemid; // { 98, 0, 84, 4, 110, 134, 61, 138, 67, 162, 1, 0, 14, 0, 0, 0, 118, 91, 16, 0, 0, 0, 0, 0, 3, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 9, 198, 230, 210, 236, 202, 222, 79, 208, 205, 0, 0, 0 }; gem1 = item.GetGemType(0); gem2 = item.GetGemType(1); gem3 = item.GetGemType(2); strong_lv = item.GetStrongLevel(); soul_lv = (short)item.war_ghost_exp; di_attack = item.di_attack; shui_attack = item.shui_attack; huo_attack = item.huo_attack; feng_attack = item.feng_attack; if (isRemote) { if (sell_byte == NetMsg.MsgOperateItem.PTICH_SELL_ITEM_GAMEGOLD) { tag = 5; } else { tag = 4; } } else { if (sell_byte == NetMsg.MsgOperateItem.PTICH_SELL_ITEM_GAMEGOLD) { tag = 3; } else tag = 1; } }