reasapakisa 發表於 2008-7-14 21:47:13

【 原 創 】Item Information腳本指令

本帖最後由 哆啦ˇ 於 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) - [頭下]

[取得頭上的裝備編號可以用以下兩種方式]
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>) - 取得指定位置的裝備名稱

mes getequipname(EQI_HEAD_TOP);

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

getitemname(<item id>) - 取得指定編號的道具名稱

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 - 有)

mes getequipisequiped(EQI_HEAD_TOP);

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

getequipisenableref(<equipment slot>) - 取得指定位置是否可以精練(0 - 不可�1 - 可)

mes getequipisenableref(EQI_HEAD_TOP);

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

getequiprefinerycnt(<equipment slot>) - 取得指定位置的精練值

mes getequipisenableref(EQI_HEAD_TOP);

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

getequipweaponlv(<equipment slot>) - 取得左手或右手武器等級

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>) - 取得指定位置裝備插了幾張卡片

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 - 不可)

if(cardscnt(1201) == 0){mes getitemname(1201)+"能裝載卡片";}

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

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

mes getequipcardid(EQI_HAND_L,0);//取得左手武器第一洞裝載什麼卡
mes getequipcardid(EQI_HAND_R,1);//取得右手武器第二洞裝載什麼卡

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

getitemslots (<item id>) - 取得指定編號道具有幾個洞

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

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

娜貝拉 發表於 2008-7-14 23:29:30

哇塞= =
好多喔   我覺得你很適合當版主耶Q.Q
超版就是需要你這種人才   (不過超版目前還不需要人手吧)
你學作NPC幾年了還是幾月= =?
我怎麼看都無薩薩~"~

goddameit 發表於 2008-7-15 00:01:31

回覆 2樓的 a19911991 的帖子

你 把 DOC 吃 完 就 變 厲 害 了

goddameit 發表於 2008-7-15 00:02:31

多 數 內 容 如 果 能 翻 譯 更 清 楚 會 更 好

娜貝拉 發表於 2008-7-15 08:31:57

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

[ 本帖最後由 a19911991 於 2008-7-15 08:35 AM 編輯 ]

reasapakisa 發表於 2008-7-15 14:10:03

JA++的NPC可以移動,也可以被傳送。
使用NpcWalkTo指令的話,NPC外型不能用MOB,不然不能移動。
UnitWalk應該是可以。


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

娜貝拉 發表於 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是小敵版主做的。。。
http://i112.photobucket.com/albums/n181/a19911991/screenAthena000.jpg

[ 本帖最後由 a19911991 於 2008-7-15 03:19 PM 編輯 ]

reasapakisa 發表於 2008-7-15 16:51:15


移動NPC指令
1. NpcWalkTo
2. UnitWalk
[共同]無法移動使用mob_id當外型的NPC。

sashomaru 發表於 2008-12-10 22:23:40

感謝大大的指教呀
這應該是從精鍊npc腳本分析出來的吧
辛苦了

克雅 發表於 2009-3-10 16:37:09

謝謝分享好的教學
這裡有滿多跟物品相關的劇本指令
拿來多多活用 好加強自已私服的特色

gn12990 發表於 2009-11-25 12:10:40

這是很好的教學好好學習一下謝謝大大分享這些指令

tomatotoro 發表於 2010-1-27 13:47:11

多謝大大分享小弟我先收下了

a25670260 發表於 2016-12-26 13:01:16

謝謝大大分享這些指令
很多需要用的到指令在這裡都找的到
應該花了你不少時間
辛苦了^^

seenmylove 發表於 2020-7-21 08:11:31

這真是我的救星
現在正在著手類似的腳本撰寫
很需要這類的函數做為參考
感謝分享
頁: [1]
查看完整版本: 【 原 創 】Item Information腳本指令