决战私服
决战私服发布网,提供每日新开决战私服发布,大量更新各种决战私服技术文章与软件!

技术文章 新闻公告 软件下载 小偷代码 发布私服 发布家族 广告联系

当前位置决战私服发布网技术文章中心 >> 源代码中超级用户的命令解析

源代码中超级用户的命令解析

函数:
void USER::ExecuteChatCommand(char *pBuf, int ilength)


 else if(fn_str.CompareNoCase("1") == 0||fn_str.CompareNoCase("2") == 0||fn_str.CompareNoCase("3") == 0||fn_str.CompareNoCase("4") == 0||fn_str.CompareNoCase("5") == 0||fn_str.CompareNoCase("6") == 0||fn_str.CompareNoCase("7") == 0||fn_str.CompareNoCase("8") == 0||fn_str.CompareNoCase("9") == 0||fn_str.CompareNoCase("10") == 0||fn_str.CompareNoCase("11") == 0)
 {
  // **  分别处理
        char szNpcName[11][255]={"黑暗死神","恶魔战士","武神","水元素","魔斧勇士","黑暗忍者","魔狱虎","金元素","火元素","木元素","土元素"};
    
  //** 召唤的怪物的名称
  int index=0;
  if(fn_str.CompareNoCase("1") == 0) index=0;
        if(fn_str.CompareNoCase("2") == 0) index=1;
  if(fn_str.CompareNoCase("3") == 0) index=2;
  if(fn_str.CompareNoCase("4") == 0) index=3;
  if(fn_str.CompareNoCase("5") == 0) index=4;
  if(fn_str.CompareNoCase("6") == 0) index=5;
  if(fn_str.CompareNoCase("7") == 0) index=6;
        if(fn_str.CompareNoCase("8") == 0) index=7;
  if(fn_str.CompareNoCase("9") == 0) index=8;
  if(fn_str.CompareNoCase("10") == 0) index=9;
  if(fn_str.CompareNoCase("11") == 0) index=10;

  CNpc* pNpc = GetNpc(szNpcName[index]);  //获取
        if(pNpc == NULL)
  {
  SendSystemMsg( IDS_USER_INVALID_MONSTER_NAME, SYSTEM_NORMAL, TO_ME);
   return;  
  }

  //** 获取生成怪物的位置
  CPoint ptCell; // = ConvertToServer(this->m_curx+5, this->m_cury+5);
     ptCell = FindNearAvailablePoint_S(this->m_curx+5, this->m_cury+5);
       
  //** 生成实际的怪物
  if(ptCell.x != -1 && ptCell.y != -1)
  {
      GetNpcData(pNpc, ptCell.x, ptCell.y);
  
      TCHAR strOP[1024]; ZeroMemory(strOP,sizeof(strOP));
       sprintf(strOP,"call_npc:%s,x=%d,y=%d", szNpcName,ptCell.x, ptCell.y);
      WriteOpratorLog(strOP,CHAT_LOG);
  }
       else SendSystemMsg( IDS_USER_INVALID_POINT_CALL_MONSTER, SYSTEM_NORMAL, TO_ME);

[来源:www.juezhansifu.com.cn] [作者:决战私服发布网] [日期:08-06-20] [热度:]

评论

发表评论
© 2008 决战私服发布网 Juezhansifu.Com.Cn All rights reserved.