OK論壇

 找回密碼
 註冊
查看: 11801|回復: 13

[函數] 【 原 創 】Item Information腳本指令

[複製鏈接]
  • TA的每日心情
    開心
    2022-3-25 10:24 AM
  • 簽到天數: 259 天

    連續簽到: 1 天

    [LV.8]以壇為家I

    發表於 2008-7-14 21:47:13 | 顯示全部樓層 |閱讀模式
    本帖最後由 哆啦ˇ 於 2009-11-18 07:16 PM 編輯

    多數內容我不太明白,
    但是主要的功能都有說明。
    取得指定裝備洞數、精練值、插什麼卡等等。
    可以作為拍賣之用(如果不想用EA已有的拍賣系統的)。
    請各位不吝嗇補充。

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getequipid(<equipment slot>) - 取得身上裝備的編號
    EQI_HEAD_TOP (1)  - [頭上]
    EQI_ARMOR (2)     - [身體]
    EQI_HAND_L (3)    - [左手]
    EQI_HAND_R (4)    - [右手]
    EQI_GARMENT (5)   - [斗篷]
    EQI_SHOES (6)     - [鞋子]
    EQI_ACC_L (7)     - [飾品左]
    EQI_ACC_R (8)     - [飾品右]
    EQI_HEAD_MID (9)  - [頭中]
    EQI_HEAD_LOW (10) - [頭下]
    [getequipid - 範例]
    [取得頭上的裝備編號可以用以下兩種方式]
    1. getequipid(EQI_HEAD_TOP)
    2. getequipid(1)
    [語法應用範例]
    if(getequipid(EQI_HEAD_TOP) == 2235){mes "你頭上帶著王冠";}
    mes "你頭上戴著"+getitemname(getequipid(EQI_HEAD_TOP));//沒有則顯示null

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getequipname(<equpment slot>) - 取得指定位置的裝備名稱
    [getequipname - 範例]
    mes getequipname(EQI_HEAD_TOP);

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getitemname(<item id>) - 取得指定編號的道具名稱
    [getitemname - 範例]
    mes getequipname(2235);//王冠

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    [待修訂]getbrokenid(<number>) - 是否擁有損壞道具
    This function will search the invoking character's inventory for any broken
    items, and will return their item ID numbers. Since the character may have
    several broken items, 0 given as an argument will return the first one found, 1
    will return the second one, etc. Will return 0 if no such item is found.
        // 檢查是否有任何東西壞掉:
            if (getbrokenid(0)==0){mes "你又沒有裝備壞掉,別打擾我。";close;}
      
        // 有東西壞囉,將查到的第一件壞物名稱顯示出來:
            mes "我看到你的 "+getitemname(getbrokenid(0))+" 壞掉囉!";

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getequipisequiped(<equipment slot>) - 取得指定位置是否穿上裝備(0 - 沒有�1 - 有)
    [getequipisequiped - 範例]
    mes getequipisequiped(EQI_HEAD_TOP);

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getequipisenableref(<equipment slot>) - 取得指定位置是否可以精練(0 - 不可�1 - 可)
    [getequipisenableref - 範例]
    mes getequipisenableref(EQI_HEAD_TOP);

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getequiprefinerycnt(<equipment slot>) - 取得指定位置的精練值
    [getequiprefinerycnt - 範例]
    mes getequipisenableref(EQI_HEAD_TOP);

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getequipweaponlv(<equipment slot>) - 取得左手或右手武器等級
    [getequipweaponlv - 範例]
    mes getequipweaponlv(EQI_HAND_L);
    mes getequipweaponlv(EQI_HAND_R);

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//
    getequippercentrefinery(<equipment slot>) - 取得裝備的精練安定值
    請見db/refine_db.txt

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    [待修訂]getareadropitem("<map name>",<x1>,<y1>,<x2>,<y2>,<item>) - 取得地面道具編號
    This function will count all the items with the specified ID number lying on the
    ground on the specified map within the x1/y1-x2/y2 square on it and return that
    number.
    This is the only function around where a parameter may be either a string or a
    number! If it's a number, it means that only the items with that item ID number
    will be counted. If it is a string, it is assumed to mean the 'english name'
    field from the item database. If you give it an empty string, or something that
    isn't found from the item database, it will count items number '512' (apples).

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getequipcardcnt(<equipment slot>) - 取得指定位置裝備插了幾張卡片
    [getequipcardcnt - 範例]
    mes getequipcardcnt(EQI_HEAD_TOP);

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    [待修訂]getinventorylist;
    This command sets a bunch of arrays with a complete list of whatever the
    invoking character has in their inventory, including all the data needed to
    recreate these items perfectly if they are destroyed. Here's what you get:
    @inventorylist_id[]        - array of item ids.
    @inventorylist_amount[]    - their corresponding item amounts.
    @inventorylist_equip[]     - whether the item is equipped or not.
    @inventorylist_refine[]    - for how much it is refined.
    @inventorylist_identify[]  - whether it is identified.
    @inventorylist_attribute[] - whether it is broken.
    @inventorylist_card1[]     - These four arrays contain card data for the items.
    @inventorylist_card2[]       These data slots are also used to store names
    @inventorylist_card3[]       inscribed on the items, so you can explicitly check
    @inventorylist_card4[]       if the character owns an item made by a specific
                                 craftsman.
    @inventorylist_count       - the number of items in these lists.
    This could be handy to save/restore a character's inventory, since no other
    command returns such a complete set of data, and could also be the only way to
    correctly handle an NPC trader for carded and named items who could resell them
    - since NPC objects cannot own items, so they have to store item data in
    variables and recreate the items.
    Notice that the variables this command generates are all local and numeric.

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    cardscnt() - 取得指定裝備裝是否能裝載卡片(0 - 可以�1 - 不可)
    [cardscnt - 範例]
    if(cardscnt(1201) == 0){mes getitemname(1201)+"能裝載卡片";}

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getrefine() - 取得右手武器的精練值
    [getrefine - 範例]
    mes "+"+getrefine()+getitemname(getequipid(EQI_HAND_R));

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    [待修訂]getnameditem(<item id>,"<name to inscribe>");
    [待修訂]getnameditem("<item name>","<name to inscribe>");

    This function is equivalent to using 'getitem', however, it will not just give
    the character an item object, but will also inscribe it with a specified
    character's name. You may not inscribe items with arbitrary strings, only with
    names of characters that actually exist. While this isn't said anywhere
    specifically, apparently, named items may not have cards in them, slots or no -
    these data slots are taken by the character ID who's name is inscribed. Only one
    remains free and it's not quite clear if a card may be there.
    This function will return 1 if an item was successfully created and 0 if it
    wasn't for whatever reason. Like 'getitem', this function will also accept an
    'english name' from the item database as an item name and will return 0 if no
    such item exists.

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getequipcardid (<equipment slot>,<card slot>) - 取得指定裝備的第幾洞插什麼卡片
    第1洞(Card1): 0
    第2洞(Card2): 1
    第3洞(Card3): 2
    第4洞(Card4): 3
    [getequipcardid - 範例]
    mes getequipcardid(EQI_HAND_L,0);//取得左手武器第一洞裝載什麼卡
    mes getequipcardid(EQI_HAND_R,1);//取得右手武器第二洞裝載什麼卡

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    getitemslots (<item id>) - 取得指定編號道具有幾個洞
    [getitemslots - 範例]
    mes getitemslots(2235);

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    [待修訂]getiteminfo(<item ID>,<type>)
    This function will look up the item with the specified ID number in the database
    and return the info set by TYPE argument.
    It will return -1 if there is no such item.
    Check sample in nps\sample\getiteminfo.txt
    0 - 買入價格
    1 - 賣出價格
    2 - 道具種類
    3 - maxchance (Max drop chance of this item e.g. 1 = 0.01% , etc..
    if = 0, then monsters don't drop it at all (rare or a quest item)
    if = 10000, then this item is sold in NPC shops only
    4 - 使用性別
    5 - equip
    6 - 重量
    7 - 攻擊力
    8 - 防禦力
    9 - range
    10 - slot
    11 - look
    12 - elv
    13 - wlv

    //--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//

    評分

    參與人數 1積分 +30 現金 +30 積極性 +30 收起 理由
    goddameit + 30 + 30 + 30 我很贊同

    查看全部評分

  • TA的每日心情
    無聊
    2010-10-28 01:01 PM
  • 簽到天數: 88 天

    連續簽到: 0 天

    [LV.6]常住居民II

    發表於 2008-7-14 23:29:30 | 顯示全部樓層
    哇塞= =
    好多喔   我覺得你很適合當版主耶Q.Q
    超版就是需要你這種人才   (不過超版目前還不需要人手吧)
    你學作NPC  幾年了還是幾月= =?
    我怎麼看都無薩薩~"~
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    開心
    2019-8-18 04:57 PM
  • 簽到天數: 2148 天

    連續簽到: 1 天

    [LV.Master]伴壇終老

    發表於 2008-7-15 00:01:31 | 顯示全部樓層

    回覆 2樓的 a19911991 的帖子

    你 把 DOC 吃 完 就 變 厲 害 了
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    開心
    2019-8-18 04:57 PM
  • 簽到天數: 2148 天

    連續簽到: 1 天

    [LV.Master]伴壇終老

    發表於 2008-7-15 00:02:31 | 顯示全部樓層
    多 數 內 容 如 果 能 翻 譯 更 清 楚 會 更 好
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    無聊
    2010-10-28 01:01 PM
  • 簽到天數: 88 天

    連續簽到: 0 天

    [LV.6]常住居民II

    發表於 2008-7-15 08:31:57 | 顯示全部樓層
    真的嗎  把DOC吃掉  會變厲害   會變的跟你一樣厲害  會寫作NPC嗎Q.Q
    的確  版主說的對翻譯沒那麼清楚   不過還是謝謝
    順便問一下超版跟這裡的大大
    味什麼JA不能寫像會走路會++輔助NPC
    或是這位大大發明的  NPC跟在屁股後面    像玩家的NPC?
    是因為JA語法關西嗎?  還是?.......沒人研究- -?                                                (DOC是什麼- -? 在教學區哪裡???  置頂那三個嗎?)

    [ 本帖最後由 a19911991 於 2008-7-15 08:35 AM 編輯 ]
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    開心
    2022-3-25 10:24 AM
  • 簽到天數: 259 天

    連續簽到: 1 天

    [LV.8]以壇為家I

     樓主| 發表於 2008-7-15 14:10:03 | 顯示全部樓層
    JA++的NPC可以移動,也可以被傳送。
    使用NpcWalkTo指令的話,NPC外型不能用MOB,不然不能移動。
    UnitWalk應該是可以。


    DOC = 博士的簡稱。
    但在不同情況之下也可以作金頭腦或百科全書。
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    無聊
    2010-10-28 01:01 PM
  • 簽到天數: 88 天

    連續簽到: 0 天

    [LV.6]常住居民II

    發表於 2008-7-15 15:05:52 | 顯示全部樓層
    懂了@@
    謝謝你><
    我還在學習階段  所以還需要你們的幫忙Q.Q



    我剛剛測試一下  JA沒有defpattern語法耶  有沒有可替代語法?
    我把EA版某個NPC成功叫出到ja裡面了  但是無法跟npc對話@@
    順便問一下npcwalkto 91+rand(10),91+rand(10);<<<
    amatsu.gat,197,137,5 script 小妹 1643,{   要怎麼跟他對應上? 
    小敵版主她的教學有點不清楚  我看不懂  他們2個要怎麼對啊? 才能讓npc動?
    下面那隻小妹npc是小敵版主做的。。。


    [ 本帖最後由 a19911991 於 2008-7-15 03:19 PM 編輯 ]
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    開心
    2022-3-25 10:24 AM
  • 簽到天數: 259 天

    連續簽到: 1 天

    [LV.8]以壇為家I

     樓主| 發表於 2008-7-15 16:51:15 | 顯示全部樓層
    [ja++]
    移動NPC指令
    1. NpcWalkTo
    2. UnitWalk
    [共同]無法移動使用mob_id當外型的NPC。
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    難過
    2015-1-11 04:15 PM
  • 簽到天數: 63 天

    連續簽到: 1 天

    [LV.6]常住居民II

    發表於 2008-12-10 22:23:40 | 顯示全部樓層
    感謝大大的指教呀
    這應該是從精鍊npc腳本分析出來的吧
    辛苦了
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    慵懶
    2017-11-26 04:19 PM
  • 簽到天數: 227 天

    連續簽到: 1 天

    [LV.7]常住居民III

    發表於 2009-3-10 16:37:09 | 顯示全部樓層
    謝謝分享好的教學
    這裡有滿多跟物品相關的劇本指令
    拿來多多活用 好加強自已私服的特色
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    擦汗
    2023-8-29 01:17 AM
  • 簽到天數: 55 天

    連續簽到: 3 天

    [LV.5]常住居民I

    發表於 2009-11-25 12:10:40 | 顯示全部樓層
    這是很好的教學好好學習一下謝謝大大分享這些指令
    回復 支持 反對

    使用道具 舉報

    頭像被屏蔽

    該用戶從未簽到

    發表於 2010-1-27 13:47:11 | 顯示全部樓層
    多謝大大分享小弟我先收下了
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    無聊
    2019-4-28 08:32 PM
  • 簽到天數: 68 天

    連續簽到: 1 天

    [LV.6]常住居民II

    發表於 2016-12-26 13:01:16 | 顯示全部樓層
    謝謝大大分享這些指令
    很多需要用的到指令在這裡都找的到
    應該花了你不少時間
    辛苦了^^
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    無聊
    昨天 06:33 AM
  • 簽到天數: 497 天

    連續簽到: 28 天

    [LV.9]以壇為家II

    發表於 2020-7-21 08:11:31 | 顯示全部樓層
    這真是我的救星
    現在正在著手類似的腳本撰寫
    很需要這類的函數做為參考
    感謝分享
    回復 支持 反對

    使用道具 舉報

    您需要登錄後才可以回帖 登錄 | 註冊

    本版積分規則

    Archiver|手機版|小黑屋|OK討論區

    GMT+8, 2024-4-30 12:38 AM , Processed in 0.059240 second(s), 20 queries , Gzip On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回復 返回頂部 返回列表