冰霜蜘蛛BOSS掉落物品之VC扩展源码


int RaklionItem (DWORD iAdd,DWORD map,DWORD x,DWORD y,DWORD iItem,DWORD iLevel,DWORD iDur,DWORD iSkill,DWORD ilv,DWORD iot,DWORD cahid,DWORD Ex,DWORD Ot)
{
 int iRet=0;
//返回 (ItemSerialCreateSend (地址, 地图, X, Y, 物品, 等级, 耐久, 技能, 幸运, 追加, 角色句组, 卓越, 套装))
 int RamdomPercent = rand() % 100 + 1;
 if(RamdomPercent <= 50)
 {
  if ( m_iItemCountN != 0)
  {
   int i = rand() % m_iItemCountN + 1;
   int ItemType = m_NChest[i].iItemType;
   int ItemIndex = m_NChest[i].iItemIndex;
   int ItemLevel = m_NChest[i].iItemLevel;
   int ItemDur = m_NChest[i].iItemDur;
   int ItemLuck = m_NChest[i].iItemLuck;
   int ItemSkill = m_NChest[i].iItemSkill;
   int ItemOpt = m_NChest[i].iItemOpt;
   int ItemExc = m_NChest[i].iItemExc;
   int ItemAncient = m_NChest[i].iItemAncient;
   DWORD Item=ItemType*512+ItemIndex;
   LogAdd(2,"RaklionItemDrop %d/%d [%d] cont:%d",ItemType,ItemIndex,Item,i);
   iRet=ItemSerialCreateSend(iAdd,map,x,y,Item,ItemLevel,ItemDur,ItemSkill,ItemLuck,ItemOpt,cahid,ItemExc,ItemAncient);
  }
 }
 else
 {
  iRet=ItemSerialCreateSend(iAdd,map,x,y,iItem,iLevel,iDur,iSkill,ilv,iot,cahid,Ex,Ot);
 }
 return iRet;
}
void ItemDropInit()
{
 for(int i=0;i<255;i++)
 {
  m_NChest[i].iItemType = 0;
  m_NChest[i].iItemIndex = 0;
  m_NChest[i].iItemLevel = 0;
  m_NChest[i].iItemDur = 0;
  m_NChest[i].iItemLuck = 0;
  m_NChest[i].iItemSkill = 0;
  m_NChest[i].iItemOpt = 0;
  m_NChest[i].iItemExc = 0;
  m_NChest[i].iItemAncient = 0;
 }
}
void LoadRaklionItem (char *filename)
{
 ItemDropInit();
 if((SMDFile = fopen(filename, "r")) == NULL)
 {
  MessageBoxA(0,"RaklionItem::LoadFile() error","CRITICAL ERROR",0);
  ExitProcess(1);
  return;
 }
 SMDToken Token;
 int iIndex;
 int iItemType = 0;
 int iItemIndex = 0;
 int iItemLevel = 0;
 int iItemDur = 0;
 int iItemLuck = 0;
 int iItemSkill = 0;
 int iItemOpt = 0;
 int iItemExc = 0;
 int iItemAncient = 0;
 int iItemCount = 0;
 int n = 0;
 int g = 0;
 while(true)
 {
  Token = GetToken();
  if(Token == END)
   break;
  if(Token == NUMBER)
  {
   iIndex = TokenNumber;
   if(iIndex == 0)
   {
    while(true)
    {
     Token = GetToken();
     if ( Token == 0 )
     {
      if(strcmp("end",TokenString) == 0)
       break;
     }
     m_NChest[n].iItemType = TokenNumber;
     Token = GetToken();
     m_NChest[n].iItemIndex = TokenNumber;
     Token = GetToken();
     m_NChest[n].iItemLevel = TokenNumber;
     Token = GetToken();
     m_NChest[n].iItemDur = TokenNumber;
     Token = GetToken();
     m_NChest[n].iItemLuck = TokenNumber;
     Token = GetToken();
     m_NChest[n].iItemSkill = TokenNumber;
     Token = GetToken();
     m_NChest[n].iItemOpt = TokenNumber;
     Token = GetToken();
     m_NChest[n].iItemExc = TokenNumber;
     Token = GetToken();
     m_NChest[n].iItemAncient = TokenNumber;
     LogAdd(1,"LoadRaklionItem [%d,%d] %d,%d,%d,%d,%d,%d,%d [%d]",m_NChest[n].iItemType,m_NChest[n].iItemIndex,m_NChest[n].iItemLevel,m_NChest[n].iItemDur,m_NChest[n].iItemLuck,m_NChest[n].iItemSkill,m_NChest[n].iItemOpt,m_NChest[n].iItemExc,m_NChest[n].iItemAncient,m_iItemCountN);
     n++;
     m_iItemCountN++;
  
     if ( m_iItemCountN > 254 )
     {
      break;
     }
    }
   }
   else if(iIndex == 1)
   {
   }
  }
 }
 fclose(SMDFile);
  return;
}
本文出自 7j45 > 奇迹一条龙