Esempio n. 1
0
 public static string GetNPCNameForID(string id)
 {
     DataRow[] rows = NPCTable.Select(COL_NPC_OBJECTNAME + "='" + id + "'");
     if (rows.Length > 0)
     {
         return(Convert.ToString(rows[0][COL_NPC_NAME]));
     }
     else
     {
         return(id);
     }
 }
    Dictionary <string, object> _NPC_CreateNPC(Dictionary <string, object> dictInfo)
    {
        //---------------------------------------------------------
        // 先寫一筆 Log
        int LogID = ReportDBLog("_NPC_CreateNPC", JsonConvert.SerializeObject(dictInfo));
        Dictionary <string, object> dictResult = null;

        // 先解析資料
        dictResult = new Dictionary <string, object>();
        //---------------------------------------------------------
        // 取得所需資料
        if (dictInfo.ContainsKey("PlayerID") == false)
        {
            return(ReportTheResultDict(dictResult, ErrorID.NPC_Create_Args_Error, LogID));
        }
        int PlayerID = System.Convert.ToInt32(dictInfo["PlayerID"]);

        if (dictInfo.ContainsKey("NPCID") == false)
        {
            return(ReportTheResultDict(dictResult, ErrorID.NPC_Create_Args_Error, LogID));
        }
        int NPCID = System.Convert.ToInt32(dictInfo["NPCID"]);
        //---------------------------------------------------------
        // 非所需要參數
        int LV = 1;

        if (dictInfo.ContainsKey("LV") == true)
        {
            LV = System.Convert.ToInt32(dictInfo["LV"]);
        }
        //---------------------------------------------------------
        // 檢查資料正確性
        if (NPCTable.instance().HasKey(NPCID) == false)
        {
            return(ReportTheResultDict(dictResult, ErrorID.NPC_ID_Error, LogID));
        }

        //---------------------------------------------------------
        // 產生結果
        string strCommand = string.Format("insert into a_npc (NPCID, PlayerID, LV) values ({0}, {1}, {2})" + UseDB.GETID, NPCID, PlayerID, LV);
        List <List <object> > listDBResult = UseDB.GameDB.DoQueryCommand(strCommand);
        int NPCDBID = System.Convert.ToInt32(listDBResult[0][0]);
        Dictionary <string, object> dictNPC = _GetNPCAttrFromDB(NPCDBID);

        //---------------------------------------------------------
        // 更新 Client
        ClientAction.AddClientAction(dictResult, ClientActionID.NPC_Update, dictNPC);

        // 回報結果
        return(ReportTheResultDict(dictResult, ErrorID.Success, LogID));
    }
Esempio n. 3
0
 // 테이블
 public static NPCData GetData(this eNPC a_eNPC)
 {
     return(NPCTable.GetData(a_eNPC));
 }
Esempio n. 4
0
 //Generates the NPC's talent trait
 private void talentButton_Click(object sender, EventArgs e)
 {
     talentLabel.Text = NPCTable.getTalent();
 }
Esempio n. 5
0
 //Generates the NPC's appearance trait
 private void flawButton_Click(object sender, EventArgs e)
 {
     flawLabel.Text = NPCTable.getFlawSecret();
 }
Esempio n. 6
0
 //Generates the NPC's interaction style trait
 private void interactionButton_Click(object sender, EventArgs e)
 {
     interactionLabel.Text = NPCTable.getInteractionStyle();
 }
Esempio n. 7
0
 //Generates the NPC's mannerism trait
 private void mannerismButton_Click(object sender, EventArgs e)
 {
     mannerismLabel.Text = NPCTable.getMannerism();
 }
Esempio n. 8
0
 //Generates the NPC's appearance trait
 private void appearanceButton_Click(object sender, EventArgs e)
 {
     appearanceLabel.Text = NPCTable.getAppearance();
 }