為私服而開 發表於 2009-10-24 21:36:19

[原創]MyeAthena源碼教學貼: announce腳本指令強化

嚴禁轉貼!


說明: 控制announce所顯示的文字大小BUILDIN_FUNC(announce)
{
    const char *str, *color=NULL;
    int flag, size=12;
    str=script_getstr(st,2);
    flag=script_getnum(st,3);
    if (script_hasdata(st,4))
      color=script_getstr(st,4);

+    if (script_hasdata(st,5))
+      size=script_getnum(st,5);

+    // While flag is 0x0f, the size setting won't do.
    if(flag&0x0f){
      struct block_list *bl=(flag&0x08)? map_id2bl(st->oid) :
            (struct block_list *)script_rid2sd(st);
      if( bl == NULL )
            return 0;
      if (color)
-            clif_announce(bl,str,(int)strlen(str)+1, strtol(color, (char **)NULL, 0),flag);
+      {
+            if (size != 12)
+                clif_announce_ex(bl,str,(int)strlen(str)+1, strtol(color, (char **)NULL, 0),flag,size);
+            else
+                clif_announce(bl,str,(int)strlen(str)+1, strtol(color, (char **)NULL, 0),flag);
+      }
      else
            clif_GMmessage(bl,str,(int)strlen(str)+1,flag);
    }else {
      if (color)
            intif_announce(str,(int)strlen(str)+1, strtol(color, (char **)NULL, 0), flag);
      else
            intif_GMmessage(str,(int)strlen(str)+1,flag);
    }
    return 0;
}

Alopex 發表於 2009-10-28 20:33:18

-..........-

本身EA的clif_announce函數跟上不符合@@"

clif.h
宣告int clif_announce(struct block_list *bl, const char* mes, int len, unsigned long color, int flag, int size);clif.c
int clif_announce(struct block_list* bl, const char* mes, int len, unsigned long color, int flag ,int size)
{
        return clif_announce_ex(bl, mes, len, color, flag, size);
}

為私服而開 發表於 2009-10-28 22:38:36

他分開來寫應該是有他的道理在吧:55:

Alopex 發表於 2009-10-29 18:08:14

3# 為私服而開





.....
結果是我看錯了=/////=
clif_announce_ex有傳入size

clif_announce則沒有.

Alopex 發表於 2009-10-29 18:08:52

沒有設定大小就直接預設為12
@@"

為私服而開 發表於 2009-10-29 19:52:35

#5
有什麼問題嗎?

Alopex 發表於 2009-11-1 15:12:24

沒有,就純粹我看錯....


他分開寫成clif_announce_ex和clif_announce的用處應該就是.........

沒有傳入大小值,就愈設為12

sinya 發表於 2011-5-10 13:14:42


有什麼問題嗎?
為私服而開 發表於 2009-10-29 07:52 PM


    有,看不懂 :mD148

   有變字型的修改嗎 我要用別的字體 比較好看
頁: [1]
查看完整版本: [原創]MyeAthena源碼教學貼: announce腳本指令強化