Alopex 發表於 2009-10-14 21:43:43

progressbar


BUILDIN_FUNC(progressbar)
{
#if PACKETVER >= 20080318 //判斷巨集PACKETVER是否大於或等於20080318(
struct map_session_data * sd = script_rid2sd(st);//宣告指標結構
const char * color;//宣告常數color
unsigned int second;
if( !st || !sd ) //判斷st或sd是否為空
return 0;
st->state = STOP;//st結構內的資料設定
color = script_getstr(st,2); //取得參數1
second = script_getnum(st,3);//取得參數2
sd->progressbar.npc_id = st->oid;//sd結構內的資料設定
sd->progressbar.timeout = gettick() + second*1000;//progressbar結束時間設定
clif_progressbar(sd, strtol(color, (char **)NULL, 0), second);//執行函數,讓客戶端出現進度表
#endif
    return 0;
}

Alopex 發表於 2009-10-14 22:40:00

函數clif_progressbarvoid clif_progressbar(struct map_session_data * sd, unsigned long color, unsigned int second)
{
        int fd = sd->fd;

        WFIFOHEAD(fd,packet_len(0x2f0));
        WFIFOW(fd,0) = 0x2f0;
        WFIFOL(fd,2) = color;
        WFIFOL(fd,6) = second;
        WFIFOSET(fd,packet_len(0x2f0));
}

xu3qo6m4 發表於 2009-10-27 14:27:27

不太懂這個的用途 可以稍微詳細說明一下嗎?

Alopex 發表於 2009-10-28 20:28:25

這是原本內建的

只是希望有人能討論.

為私服而開 發表於 2009-10-28 22:39:25

還不完善就是
頁: [1]
查看完整版本: progressbar