From 6f88f2409f1853ae205573257865462540f935fc Mon Sep 17 00:00:00 2001 From: L0ne_W0lf Date: Wed, 31 Mar 2010 18:57:22 +0000 Subject: Moved /npc/sample/ to /doc/sample. These are examples, not actual npcs. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14277 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 2 + doc/sample/PCLoginEvent.txt | 53 ++++ doc/sample/bank_test.txt | 58 +++++ doc/sample/basejob_baseclass_upper.txt | 7 + doc/sample/delitem2.txt | 29 +++ doc/sample/getequipcardid.txt | 34 +++ doc/sample/getiteminfo.txt | 16 ++ doc/sample/getmonsterinfo.txt | 18 ++ doc/sample/gstorage_test.txt | 70 +++++ doc/sample/localized_npc.txt | 151 +++++++++++ doc/sample/npc_dynamic_shop.txt | 85 ++++++ doc/sample/npc_equip_sample.txt | 16 ++ doc/sample/npc_extend_shop.txt | 60 +++++ doc/sample/npc_live_dialogues.txt | 51 ++++ doc/sample/npc_pcre.txt | 392 ++++++++++++++++++++++++++++ doc/sample/npc_sample.txt | 456 +++++++++++++++++++++++++++++++++ doc/sample/npc_shop_test.txt | 32 +++ doc/sample/npc_test_arena.txt | 104 ++++++++ doc/sample/npc_test_array.txt | 35 +++ doc/sample/npc_test_chat.txt | 28 ++ doc/sample/npc_test_duplicate.txt | 30 +++ doc/sample/npc_test_ev.txt | 146 +++++++++++ doc/sample/npc_test_func.txt | 26 ++ doc/sample/npc_test_npctimer.txt | 33 +++ doc/sample/npc_test_npctimer2.txt | 16 ++ doc/sample/npc_test_setitemx.txt | 69 +++++ doc/sample/npc_test_setmapflag.txt | 24 ++ doc/sample/npc_test_skill.txt | 19 ++ doc/sample/npc_test_str.txt | 17 ++ doc/sample/npc_testchkoption.txt | 15 ++ doc/sample/npc_time_sample.txt | 18 ++ npc/sample/PCLoginEvent.txt | 53 ---- npc/sample/bank_test.txt | 58 ----- npc/sample/basejob_baseclass_upper.txt | 7 - npc/sample/delitem2.txt | 29 --- npc/sample/getequipcardid.txt | 34 --- npc/sample/getiteminfo.txt | 16 -- npc/sample/getmonsterinfo.txt | 18 -- npc/sample/gstorage_test.txt | 70 ----- npc/sample/localized_npc.txt | 151 ----------- npc/sample/npc_dynamic_shop.txt | 85 ------ npc/sample/npc_equip_sample.txt | 16 -- npc/sample/npc_extend_shop.txt | 60 ----- npc/sample/npc_live_dialogues.txt | 51 ---- npc/sample/npc_pcre.txt | 392 ---------------------------- npc/sample/npc_sample.txt | 456 --------------------------------- npc/sample/npc_shop_test.txt | 32 --- npc/sample/npc_test_arena.txt | 104 -------- npc/sample/npc_test_array.txt | 35 --- npc/sample/npc_test_chat.txt | 28 -- npc/sample/npc_test_duplicate.txt | 30 --- npc/sample/npc_test_ev.txt | 146 ----------- npc/sample/npc_test_func.txt | 26 -- npc/sample/npc_test_npctimer.txt | 33 --- npc/sample/npc_test_npctimer2.txt | 16 -- npc/sample/npc_test_setitemx.txt | 69 ----- npc/sample/npc_test_setmapflag.txt | 24 -- npc/sample/npc_test_skill.txt | 19 -- npc/sample/npc_test_str.txt | 17 -- npc/sample/npc_testchkoption.txt | 15 -- npc/sample/npc_time_sample.txt | 18 -- 61 files changed, 2110 insertions(+), 2108 deletions(-) create mode 100644 doc/sample/PCLoginEvent.txt create mode 100644 doc/sample/bank_test.txt create mode 100644 doc/sample/basejob_baseclass_upper.txt create mode 100644 doc/sample/delitem2.txt create mode 100644 doc/sample/getequipcardid.txt create mode 100644 doc/sample/getiteminfo.txt create mode 100644 doc/sample/getmonsterinfo.txt create mode 100644 doc/sample/gstorage_test.txt create mode 100644 doc/sample/localized_npc.txt create mode 100644 doc/sample/npc_dynamic_shop.txt create mode 100644 doc/sample/npc_equip_sample.txt create mode 100644 doc/sample/npc_extend_shop.txt create mode 100644 doc/sample/npc_live_dialogues.txt create mode 100644 doc/sample/npc_pcre.txt create mode 100644 doc/sample/npc_sample.txt create mode 100644 doc/sample/npc_shop_test.txt create mode 100644 doc/sample/npc_test_arena.txt create mode 100644 doc/sample/npc_test_array.txt create mode 100644 doc/sample/npc_test_chat.txt create mode 100644 doc/sample/npc_test_duplicate.txt create mode 100644 doc/sample/npc_test_ev.txt create mode 100644 doc/sample/npc_test_func.txt create mode 100644 doc/sample/npc_test_npctimer.txt create mode 100644 doc/sample/npc_test_npctimer2.txt create mode 100644 doc/sample/npc_test_setitemx.txt create mode 100644 doc/sample/npc_test_setmapflag.txt create mode 100644 doc/sample/npc_test_skill.txt create mode 100644 doc/sample/npc_test_str.txt create mode 100644 doc/sample/npc_testchkoption.txt create mode 100644 doc/sample/npc_time_sample.txt delete mode 100644 npc/sample/PCLoginEvent.txt delete mode 100644 npc/sample/bank_test.txt delete mode 100644 npc/sample/basejob_baseclass_upper.txt delete mode 100644 npc/sample/delitem2.txt delete mode 100644 npc/sample/getequipcardid.txt delete mode 100644 npc/sample/getiteminfo.txt delete mode 100644 npc/sample/getmonsterinfo.txt delete mode 100644 npc/sample/gstorage_test.txt delete mode 100644 npc/sample/localized_npc.txt delete mode 100644 npc/sample/npc_dynamic_shop.txt delete mode 100644 npc/sample/npc_equip_sample.txt delete mode 100644 npc/sample/npc_extend_shop.txt delete mode 100644 npc/sample/npc_live_dialogues.txt delete mode 100644 npc/sample/npc_pcre.txt delete mode 100644 npc/sample/npc_sample.txt delete mode 100644 npc/sample/npc_shop_test.txt delete mode 100644 npc/sample/npc_test_arena.txt delete mode 100644 npc/sample/npc_test_array.txt delete mode 100644 npc/sample/npc_test_chat.txt delete mode 100644 npc/sample/npc_test_duplicate.txt delete mode 100644 npc/sample/npc_test_ev.txt delete mode 100644 npc/sample/npc_test_func.txt delete mode 100644 npc/sample/npc_test_npctimer.txt delete mode 100644 npc/sample/npc_test_npctimer2.txt delete mode 100644 npc/sample/npc_test_setitemx.txt delete mode 100644 npc/sample/npc_test_setmapflag.txt delete mode 100644 npc/sample/npc_test_skill.txt delete mode 100644 npc/sample/npc_test_str.txt delete mode 100644 npc/sample/npc_testchkoption.txt delete mode 100644 npc/sample/npc_time_sample.txt diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 747dc37f9..843c25a8f 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,8 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2010/03/31 + * Rev. 14277 Moved /npc/sample/ to /doc/sample. These are examples, not actual npcs. [L0ne_W0lf] 2010/03/23 * Rev. 14270 Implemented NPC_TALK (Credit to SnakeDrak and Daegaladh) [L0ne_W0lf] - Also added in the ability to use '@npctalkc' as a GM command. diff --git a/doc/sample/PCLoginEvent.txt b/doc/sample/PCLoginEvent.txt new file mode 100644 index 000000000..b7020b719 --- /dev/null +++ b/doc/sample/PCLoginEvent.txt @@ -0,0 +1,53 @@ +// eAthena Special NPC + +// PCLoginEvent NPC (davidsiaw) +//============================================================================== +// How it works: +// When a player logs in, the NPC will run as if he just clicked it. Which means +// if the script is like this: +// +// [code] +// prontera,0,0,0 script OnPCLoginEvent -1,{ +// mes "lmao"; +// close; +// } +// [/code] +// +// every player who logs in will receive a message 'lmao' in their face as soon +// as they can see the map. +//----------------------------------------------------------------------------- +// Note: +// 1) This NPC will only run if its name is 'PCLoginEvent' +// 2) I made it invisible because you don't need to see it. Its an abstract NPC +// 3) If you don't want it, simply delete it +// 4) If you have more than one PCLoginEvent NPC, strange things will happen. +// 5) You can put this script in ANY file. +// 6) I put an end; there because that just makes it do nothing. +// 7) Modify this script to your liking and give your players a surprise +// 8) Remember: IT RUNS LIKE A NORMAL NPC. BUT THE ONLY WAY TO 'CLICK' IT IS BY +// LOGGING ON +// 9) There are 2 ways to use this - check the examples below! + +// +// The 1st type -- with 'event_script_type' set to 0 +// +prontera,0,0,0 script OnPCLoginEvent -1,{ + end; +} + +// +// The 2nd type -- with 'event_script_type' set to 1 +// +prontera,155,175,0 script An NPC 46,{ + close; +OnPCLoginEvent: + // this part will run + close; +} + +prontera,156,176,0 script Another NPC 46,{ + close; +OnPCLoginEvent: + // this part runs AS WELL + close; +} \ No newline at end of file diff --git a/doc/sample/bank_test.txt b/doc/sample/bank_test.txt new file mode 100644 index 000000000..4baac7b4e --- /dev/null +++ b/doc/sample/bank_test.txt @@ -0,0 +1,58 @@ +// Bank Test +prontera,162,188,1 script Bank Test 112,{ + cutin "kafra_06",2; + + mes "[Bank Test]"; + mes "Welcome to Prontera's Bank Test."; + mes "You can only deposit a minimal of"; + mes "1000z. What do you want to do?"; + next; + menu "Deposit",BANK_IN,"Withdraw",BANK_OUT,"Exit",B_EXIT2; +BANK_IN: + mes "[Bank Test]"; + mes "You must deposit the same of less"; + mes "amount of zeny that you carry."; + mes "How much do you want to deposit?"; + next; + input @kafrabank; + + if(@kafrabank<1000) goto B_EXIT2; + set @kafrabank2,@kafrabank*1/100; + if(@kafrabank+@kafrabank2>Zeny) goto BANK_F; + set Zeny,Zeny-@kafrabank-@kafrabank2; + set #kafrabank,#kafrabank+@kafrabank; + mes "You now have: ^135445" + @kafrabank2 + "z^000000"; + + goto B_EXIT; +BANK_OUT: + if(#kafrabank==0) goto BANK_F2; + mes "[Bank Test]"; + mes "You can only withdraw equally or below this quantity:"; + mes "^135445" + #kafrabank + "^000000z"; + mes "How much do you want to withdraw?"; + next; + input @kafrabank; + + if(@kafrabank<1) goto B_EXIT2; + if(@kafrabank>#kafrabank) goto BANK_F; + set #kafrabank,#kafrabank-@kafrabank; + set Zeny,Zeny+@kafrabank; + + goto B_EXIT; + +BANK_F: + mes "[Bank Test]"; + mes "You can't withdraw more than ^135445"+ #kafrabank + "^000000z."; + goto B_EXIT2; +BANK_F2: + mes "[Bank Test]"; + mes "Your account is empty, you may not withdraw at this time."; + goto B_EXIT2; + +B_EXIT: + mes "Thanks for using depositing"; +B_EXIT2: + mes "Good bye!"; + cutin "kafra_06",255; + close; +} \ No newline at end of file diff --git a/doc/sample/basejob_baseclass_upper.txt b/doc/sample/basejob_baseclass_upper.txt new file mode 100644 index 000000000..913707404 --- /dev/null +++ b/doc/sample/basejob_baseclass_upper.txt @@ -0,0 +1,7 @@ +prontera,155,177,1 script Tell Me 725,{ + mes "[Tell Me]"; + mes "Class: " + Class; + mes "BaseClass: " + BaseClass; + mes "BaseJob: " + BaseJob; + mes "Upper: " + Uppser; +} \ No newline at end of file diff --git a/doc/sample/delitem2.txt b/doc/sample/delitem2.txt new file mode 100644 index 000000000..ef781e81f --- /dev/null +++ b/doc/sample/delitem2.txt @@ -0,0 +1,29 @@ +prontera,160,182,5 script Deleter2 51,{ + mes "Input item ID"; + next; + input @nameid; + mes "Amount?"; + next; + input @amount; + mes "Identified?"; + next; + input @iden; + mes "How many times refined?"; + next; + input @ref; + mes "Attribute?"; + next; + input @attr; + mes "4 cards (one after another):"; + next; + input @c1; + input @c2; + input @c3; + input @c4; + mes "Your command is:"; + mes "delitem2 "+@nameid+","+@amount+","+@iden+","+@ref+","+@attr+","+@c1+","+@c2+","+@c3+","+@c4; + next; + delitem2 @nameid,@amount,@iden,@ref,@attr,@c1,@c2,@c3,@c4; + mes "And here is the moment when Your item should disappear :P"; + close; +} \ No newline at end of file diff --git a/doc/sample/getequipcardid.txt b/doc/sample/getequipcardid.txt new file mode 100644 index 000000000..b1fe55505 --- /dev/null +++ b/doc/sample/getequipcardid.txt @@ -0,0 +1,34 @@ +//===== eAthena Script ======================================= +//===== By: ================================================== +//= Lupus +//= Shows your HAT's slots IDs +//= Use it for some checks... e.g. +//= is your EQUPPED weapon has FIRE property? +//= is your EQUPPED item produced? +//============================================================ + +prontera,155,177,4 script Check My Hat 810,{ + mes "Checking your head..."; + set @ref,0; + + if (getequipisequiped(1)) goto L_CHECK1; + mes "Nothing?"; + emotion e_hmm; + close; + +L_CHECK1: + set @id,getequipid(1); + if(getequipisidentify(1)) goto L_CHECK2; + mes "How can you wear not identified hats?"; + npctalk "You're a cheater!"; + emotion e_wah; + close; + +L_CHECK2: + set @ref,getequiprefinerycnt(1); + mes "Your hat is... "+getitemname(@id)+"..."; + if(@ref)mes "It has been refined "+@ref+" times."; + mes "Card Slot 0:"+getequipcardid(1,0)+" 1:"+getequipcardid(1,1); + mes "Card Slot 2:"+getequipcardid(1,2)+" 3:"+getequipcardid(1,3); + close; +} \ No newline at end of file diff --git a/doc/sample/getiteminfo.txt b/doc/sample/getiteminfo.txt new file mode 100644 index 000000000..e98212739 --- /dev/null +++ b/doc/sample/getiteminfo.txt @@ -0,0 +1,16 @@ +//by Lupus + +prontera,156,179,6 script test_getiteminfo 117,{ + mes "Please enter an item ID (501 ... 14000)"; + input @value; +//WOW! this line uses INTERNAL function of your client to show item name by its ID! +// ^nItemID^XXXX -> Item Name + mes "Item ID: "+@value+" ^nItemID^"+@value; + mes "Current Item info:"; + set @id,0; +L_LOOP: + mes " getiteminfo("+@value+","+@id+") = "+getiteminfo(@value,@id); + set @id,@id+1; + if(@id<14) goto L_LOOP; + close; +} \ No newline at end of file diff --git a/doc/sample/getmonsterinfo.txt b/doc/sample/getmonsterinfo.txt new file mode 100644 index 000000000..fd30c66df --- /dev/null +++ b/doc/sample/getmonsterinfo.txt @@ -0,0 +1,18 @@ +//by Lupus + +prontera,156,179,6 script test_getmonsterinfo 117,{ + mes "Please enter a monster ID (1001 ... 2000)"; + input @value; + if(getmonsterinfo(@value,MOB_LV)<0 || getmonsterinfo(@value,MOB_NAME)=="Dummy") { + mes "Wrong MOB ID."; + close; + } + mes "Monster ID: "+@value+" '"+getmonsterinfo(@value,MOB_NAME)+"'"; + mes "Current Monster info:"; + set @id,0; +L_LOOP: + mes " getmonsterinfo("+@value+","+@id+") = "+getmonsterinfo(@value,@id); + set @id,@id+1; + if(@id<22) goto L_LOOP; + close; +} \ No newline at end of file diff --git a/doc/sample/gstorage_test.txt b/doc/sample/gstorage_test.txt new file mode 100644 index 000000000..6c97fa2bc --- /dev/null +++ b/doc/sample/gstorage_test.txt @@ -0,0 +1,70 @@ +/* Guild Warehouse Service Test-Script +prontera,165,188,4 script Guild Warehouse 112,{ + cutin "kafra_06",2; + + mes "[Guild Warehouse Coupler]"; + mes "This is the guild warehouse coupler service."; + mes "You will not receive zeny for this is a test."; + next; + menu "Access Guild Warehouse", GS_OPEN, "Exit", GS_EXIT3; + +GS_OPEN: + set @flag,guildopenstorage(0); + if(@flag == 1) goto GS_EXIT1; + if(@flag == 2) goto GS_EXIT2; + goto GS_EXIT4; + +GS_EXIT1: + mes "[Guild Warehouse]"; + mes "The guild warehouse is being used right now."; + mes "Please wait a while, then come back."; + goto GS_EXIT4; + +GS_EXIT2: + mes "[Guild Warehouse]"; + mes "You can't use this service if you're not in a guild!"; + goto GS_EXIT4; + +GS_EXIT3: + mes "[Guild Warehouser]"; + mes "Come back whenever you want."; + +GS_EXIT4: + cutin "kafra_06",255; + close; +} +*/ + +// カプラギルド倉庫サービス テストスクリプト +prontera,165,188,4 script ギルド倉庫カプラ 112,{ + cutin "kafra_06",2; + + mes"[ギルド倉庫カプラ]"; + mes "カプラギルド倉庫サービスです。"; + mes "毎度ご利用ありがとうございます♪"; + mes "テスト用なので金は貰いません。"; + next; + menu "ギルド倉庫を利用する",GS_OPEN,"やっぱやめる",GS_EXIT3; + +GS_OPEN: + set @flag,guildopenstorage(0); + if(@flag == 1) goto GS_EXIT1; + if(@flag == 2) goto GS_EXIT2; + goto GS_EXIT4; + +GS_EXIT1: + mes "ギルドメンバーが倉庫を使用中です。"; + mes "しばらく待ってから利用してください。"; + goto GS_EXIT4; + +GS_EXIT2: + mes "ギルドに所属してない方は利用することができません。"; + goto GS_EXIT4; + +GS_EXIT3: + mes "またのご利用をお待ちしています♪"; + +GS_EXIT4: + cutin "kafra_06",255; + close; +} \ No newline at end of file diff --git a/doc/sample/localized_npc.txt b/doc/sample/localized_npc.txt new file mode 100644 index 000000000..3a721d108 --- /dev/null +++ b/doc/sample/localized_npc.txt @@ -0,0 +1,151 @@ +//===== eAthena Script ======================================= +//= Sample localized NPC +//===== By: ================================================== +//= eAthena Dev Team +//===== Current Version: ===================================== +//= v1.0 +//===== Compatible With: ===================================== +//= eAthena with setd, getd +//===== Description: ========================================= +//= Example of a localized NPC. +//= +//= There are many ways to do it, this is just one option. +//= The player has a global account variable ##_langid_ that +//= identifies the it's language. +//= +//= The default language should always have langid 0. +//= When a message isn't found for the player's langid +//= (strlen = 0), the message from langid 0 is used instead. +//= +//= Each message is identified by a string that must only +//= contain valid variable name characters. +//= +//= void setlang(int langid) +//= - sets the player's language +//= int getlang(void) +//= - returns the player's language +//= void setmes2(string name,int langid,string text) +//= - sets the localized text for name +//= string getmes2(string name,int langid) +//= - returns the localized text of name +//= void mes2(string name) +//= - displays the localized text of name +//= +//===== Additional Comments: ================================= +//= To use this globally, just put the functions in Global_Functions.txt +//============================================================ + +////////////////////////////////////////////////////////////// +/// Sets the language of the player account. +/// @param langid Languange identifier (0 for default) +function script setlang { + set ##_langid_, getarg(0); + return; +} + +////////////////////////////////////////////////////////////// +/// Returns the language identifier of the player +function script getlang { + return ##_langid_; +} + +////////////////////////////////////////////////////////////// +/// Sets a localized text entry. +/// Does not need a RID attached. +/// @param name Message identifier +/// @param langid Language identifier (0 for default) +/// @param text Text message +function script setmes2 { + set $@mes2_name$, getarg(0); + set $@mes2_langid, getarg(1); + set $@mes2_text$, getarg(2); + set $@mes2_var$, "$@__"+ $@mes2_name$ +"_"+ $@mes2_langid +"$"; + + //debugmes "setmes2 \""+ $@mes2_var$ +"\", \""+ $@mes2_text$ +"\";"; + + // set the localized text + setd $@mes2_var$, $@mes2_text$; + return; +} + +////////////////////////////////////////////////////////////// +/// Sets a localized text entry. +/// Does not need a RID attached. +/// @param name Message identifier +/// @param langid Language identifier (0 for default) +/// @return Text message +function script getmes2 { + set $@mes2_name$, getarg(0); + set $@mes2_langid, getarg(1); + set $@mes2_var$, "$@__"+ $@mes2_name$ +"_"+ $@mes2_langid +"$"; + set $@mes2_text$, getd($@mes2_var$); + + //debugmes "getmes2(\""+ $@mes2_var$ +"\")=\""+ $@mes2_text$ +"\""; + + return $@mes2_text$; +} + +////////////////////////////////////////////////////////////// +/// mes for localized text. +/// index should be a unique string, made up only of characters +/// that are valis as a variable name +/// @param index Message identifier +function script mes2 { + set @mes2_index$, getarg(0); + + if( getstrlen(@mes2_index$) == 0 ) + return; // invalid index + + // print localized text + set @mes2_text$, callfunc("getmes2",@mes2_index$,##_langid_); + if( getstrlen(@mes2_text$) == 0 ) + { + if( ##_langid_ != 0 ) + {// revert to default language + set @mes2_text$, callfunc("getmes2",@mes2_index$,0); + if( getstrlen(@mes2_text$) != 0 ) + mes @mes2_text$; // default text + } + } else + mes @mes2_text$; // localized text + return; +} + +////////////////////////////////////////////////////////////// +/// Sample localized NPC +prontera,155,183,4 script LocalizedNPC 705,{ + // Get text for specific languages + set @menu1$, callfunc("getmes2","LNPC_lang",0); + set @menu2$, callfunc("getmes2","LNPC_lang",1); + do { + // get text that fallbacks to language 0 + callfunc "mes2", "LNPC_name"; + // localized mes + callfunc "mes2", "LNPC_lang"; + callfunc "mes2", "LNPC_text"; + next; + + switch(select(@menu1$,@menu2$,"Cancel")) + { + case 1: + case 2: + // Set player language + callfunc "setlang",@menu-1; + break; + } + } while( @menu != 3 ); + close; + end; + +OnInterIfInitOnce: + // Load the localized text. + // This can be anywhere, as long as it's executed before the coresponding getmes2/mes2 calls + // 0 - English (default) + // 1 - Portuguese + callfunc "setmes2", "LNPC_name", 0, "[LocalizedNPC]"; + callfunc "setmes2", "LNPC_lang", 0, "EN"; + callfunc "setmes2", "LNPC_lang", 1, "PT"; + callfunc "setmes2", "LNPC_text", 0, "Something in english"; + callfunc "setmes2", "LNPC_text", 1, "Algo em portugu黌"; + end; +} \ No newline at end of file diff --git a/doc/sample/npc_dynamic_shop.txt b/doc/sample/npc_dynamic_shop.txt new file mode 100644 index 000000000..1a1f174c9 --- /dev/null +++ b/doc/sample/npc_dynamic_shop.txt @@ -0,0 +1,85 @@ +- shop dyn_shop1 -1,501:50 + +prontera,181,200,4 script Dynamic Shop 123,{ +callshop "dyn_shop1",0; +npcshopattach "dyn_shop1"; +end; + +OnSellItem: +for(set @i, 0; @i < getarraysize(@sold_nameid); set @i, @i + 1){ + if(countitem(@sold_nameid[@i]) < @sold_quantity[@i] && @sold_quantity[@i] <= 0){ + mes "omgh4x!"; + close; + } + if(@sold_nameid[@i] == 501){ + set $@rpotsleft, $@rpotsleft + @sold_quantity[@i]; + set Zeny, Zeny + @sold_quantity[@i]*20; + delitem 501, @sold_quantity[@i]; + } else { + if(@sold_nameid[@i] == 502){ + set $@opotsleft, $@opotsleft + @sold_quantity[@i]; + set Zeny, Zeny + @sold_quantity[@i]*100; + delitem 502, @sold_quantity[@i]; + } else { + mes "Sorry, I don't need your items."; + } + } +} +deletearray @sold_quantity, getarraysize(@sold_quantity); +deletearray @sold_nameid, getarraysize(@sold_nameid); +mes "Deal completed."; +close; + +OnBuyItem: +for(set @i, 0; @i < getarraysize(@bought_nameid); set @i, @i + 1){ + if(@bought_quantity[@i] <= 0){ + mes "omgh4x!"; + end; + } + if(@bought_nameid[@i] == 501){ + if(@bought_quantity[@i] > $@rpotsleft){ + if($@rpotsleft > 0){ + set @bought_quantity[@i], $@rpotsleft; + } else { + mes "We are out of red potions!"; + close; + } + } + if(Zeny >= 40*@bought_quantity[@i]){ + set Zeny, Zeny - 40*@bought_quantity[@i]; + getitem 501, @bought_quantity[@i]; + set $@rpotsleft, $@rpotsleft - @bought_quantity[@i]; + } else { + mes "You have insufficient cash."; + close; + } + } else { + if(@bought_quantity[@i] > $@opotsleft){ + if($@opotsleft > 0){ + set @bought_quantity[@i], $@opotsleft; + } else { + mes "We are out of orange potions!"; + close; + } + } + if(Zeny >= 200*@bought_quantity[@i]){ + set Zeny, Zeny - 200*@bought_quantity[@i]; + getitem 502, @bought_quantity[@i]; + set $@opotsleft, $@opotsleft - @bought_quantity[@i]; + } else { + mes "You have insufficient cash."; + close; + } + } +} +deletearray @bought_quantity, getarraysize(@bought_quantity); +deletearray @bought_nameid, getarraysize(@bought_nameid); +mes "Trade done."; +close; + +OnInit: +npcshopitem "dyn_shop1", 501,40,502,200; +set $@rpotsleft, 10; +set $@opotsleft, 10; +end; +} \ No newline at end of file diff --git a/doc/sample/npc_equip_sample.txt b/doc/sample/npc_equip_sample.txt new file mode 100644 index 000000000..6cd6f5e69 --- /dev/null +++ b/doc/sample/npc_equip_sample.txt @@ -0,0 +1,16 @@ + +prontera,161,181,6 script GetEquipID Sample 105,{ + mes "[GetEquipID Sample]"; + mes " GetEquipID(01) : " + getequipid(1); + mes " GetEquipID(02) : " + getequipid(2); + mes " GetEquipID(03) : " + getequipid(3); + mes " GetEquipID(04) : " + getequipid(4); + mes " GetEquipID(05) : " + getequipid(5); + mes " GetEquipID(06) : " + getequipid(6); + mes " GetEquipID(07) : " + getequipid(7); + mes " GetEquipID(08) : " + getequipid(8); + mes " GetEquipID(09) : " + getequipid(9); + mes " GetEquipID(10) : " + getequipid(10); + close; + end; +} diff --git a/doc/sample/npc_extend_shop.txt b/doc/sample/npc_extend_shop.txt new file mode 100644 index 000000000..833db80dc --- /dev/null +++ b/doc/sample/npc_extend_shop.txt @@ -0,0 +1,60 @@ +//SuperNovice +prontera,182,213,3 shop Super Novice Shop 716,1243:-1,2112:-1,2340:-1,2352:-1,2414:-1,2510:-1,2628:-1,5055:-1 + +//Whips +prontera,149,139,5 shop Whips Merchant 58,1951:-1,1953:-1,1955:-1,1957:-1,1959:-1,1961:-1,1962:-1,1963:-1,1964:-1 + +//Headgears +prontera,162,175,3 shop Headgears Merchant 1 73,2209:-1,2210:-1,2211:-1,2221:-1,2223:-1,2217:-1,2227:-1,2231:-1,2225:-1,2229:-1 + +//Headgears +prontera,162,172,3 shop Headgears Merchant 2 73,2203:-1,2212:-1,2218:-1,2239:-1,2241:-1,2242:-1,2243:-1,2263:-1,2265:-1,2276:-1,2288:-1,2291:-1,2297:-1 + +//Armor +prontera,162,169,3 shop Armours Merchant 73,2311:-1,2313:-1,2315:-1,2317:-1,2318:-1,2320:-1,2322:-1,2324:-1,2326:-1,2327:-1,2329:-1,2331:-1,2334:-1,2336:-1,2337:-1,2342:-1 + +//Shields +prontera,162,166,3 shop Shields Merchant 73,2102:-1,2104:-1,2106:-1,2108:-1,2109:-1,2110:-1,2111:-1 + +//Boots +prontera,162,163,3 shop Boots Merchant 73,2402:-1,2404:-1,2406:-1,2407:-1,2412:-1,2413:-1 + +//Robes +prontera,162,160,3 shop Robes Merchant 73,2502:-1,2504:-1,2506:-1,2507:-1,2508:-1,2509:-1 + +//Accessory +prontera,162,157,3 shop Accessory Merchant 73,2601:-1,2602:-1,2603:-1,2604:-1,2605:-1,2607:-1,2608:-1,2615:-1,2616:-1,2618:-1,2619:-1 + +//Arrows +prontera,162,154,3 shop Arrows Merchant 73,1750:-1,1751:-1,1752:-1,1753:-1,1754:-1,1755:-1,1756:-1,1757:-1,1758:-1,1759:-1,1760:-1,1761:-1,1762:-1,1763:-1,1764:-1,1765:-1,1766:-1,1767:-1,1768:-1,1769:-1 + +//Alchemist +prontera,162,151,3 shop Alchemist Shop 73.7127:-1,7128:-1,7129:-1,7130:-1,7131:-1,7132:-1,7133:-1,7144:-1,7134:-1,1093:-1 + +//Taming Merchant +prontera,162,148,3 shop Taming Merchant 73,619:-1,620:-1,621:-1,623:-1,624:-1,625:-1,626:-1,627:-1,628:-1,629:-1,630:-1,631:-1,632:-1,633:-1,634:-1,635:-1,636:-1,637:-1,638:-1,639:-1,640:-1,641:-1,642:-1,659:-1 + +//Pet Equipment +prontera,162,145,3 shop Pet Equipment 73,10001:-1,10002:-1,10003:-1,10004:-1,10005:-1,10006:-1,10007:-1,10008:-1,10009:-1,10010:-1,10011:-1,10012:-1,10013:-1,10014:-1,10015:-1,10016:-1,10017:-1,10018:-1,10019:-1,10020:-1 + + +//Weapon Cards +prontera,148,234,5 shop Weapon Card's Merchant 80,4004:100000,4018:100000,4025:100000,4026:100000,4019:100000,4029:100000,4043:100000,4017:100000,4020:100000,4024:100000,4037:100000,4055:100000,4057:100000,4076:100000,4096:100000,4104:100000,4030:100000,4049:100000,4062:100000,4069:100000,4085:100000,4007:100000,4060:100000,4063:100000,4068:100000,4080:100000,4094:100000,4111:100000,4118:100000,4082:20700,4092:100000,4126:100000,4072:100000,4115:100000,4035:100000,4086:100000,4106:100000,4117:100000,4125:100000 + +//Headgear Cards +prontera,148,231,5 shop Headgear Card's Merchant 80,4010:100000,4039:100000,4046:100000,4052:100000,4087:100000,4110:100000,4112:100000,4122:100000,4127:100000 + +//Armor Cards +prontera,146,229,5 shop Armor Card's Merchant 80,4003:100000,4008:100000,4011:100000,4014:100000,4016:100000,4021:100000,4023:100000,4031:100000,4078:100000,4089:100000,4098:100000,4099:100000,4101:100000,4114:100000,4119:100000,4141:100000,4061:100000,4105:100000 + +//Shield Cards +prontera,144,227,5 shop Shield Card's Merchant 80,4013:100000,4032:100000,4058:100000,4059:100000,4066:100000,4074:100000,4083:100000,4120:100000,4124:100000,4136:100000,4138:100000,4045:100000,4067:100000,4075:100000,4090:100000 + +//Robe Cards +prontera,142,225,5 shop Robe Card's Merchant 80,4056:100000,4071:100000,4081:100000,4095:100000,4108:100000,4109:100000,4113:100000,4116:100000,4133:100000,4015:100000,4088:100000,4102:100000,4129:100000 + +//Shoe Cards +prontera,140,223,5 shop Shoes Card's Merchant 80,4009:100000,4038:100000,4050:100000,4070:100000,4097:100000,4100:100000,4107:100000 + +//Accessory Cards +prontera,138,221,5 shop Accessory Card's Merchant 80,4022:100500,4027:100500,4028:100500,4034:100500,4051:100500,4064:100500,4091:100500,4079:100500,4033:100500,4040:100500,4044:100500,4048:100500,4053:100500,4073:100500,4077:100500,4084:100500,4093:100500,4103:100500,4139:100500 \ No newline at end of file diff --git a/doc/sample/npc_live_dialogues.txt b/doc/sample/npc_live_dialogues.txt new file mode 100644 index 000000000..a82c14e89 --- /dev/null +++ b/doc/sample/npc_live_dialogues.txt @@ -0,0 +1,51 @@ +//by Lupus. +// *** Usage of Global_Functions.txt (you can translate Global_Functions.txt function messages) +// Here's a polite wolf NPC ^_- Luppy +// learn how to make your NPC more alive. +// PS don't use it as a normal NPC in your server. It's exploitable 8) + +prontera,167,177,5 script Luppy 1107,{ + mes "[Luppy]"; + + //say random greeting from Global_Functions.txt + mes callfunc("F_Hi"); + + //say a compliment according to player's gender + //1st string is for FEMALE, 2nd for MALE + mes callfunc("F_Sex","What a beautiful lady!","What a handsome man!"); + + //add some random greeting and goodbye into the menu + menu callfunc("F_Hi"),-, callfunc("F_Bye"),M_BYE; + + mes "[Luppy]"; + //give a random prize from set list of items + if(@gotstuff){ + //again, say stuff according to player's gender + mes "I like "+callfunc("F_Sex","smiling ladies!","bloody pirates!"); + + //show one of 3 emotion from the list (we added ,1 to show emotion over PLAYER's head) + emotion callfunc("F_RandMes",3,e_scissors,e_kis,e_pat),1; + close; + } + + //we set a temp var to give present just once. Player can get more by RE-entering the server + set @gotstuff,1; + + //get item Id from the list of presents: Apple, Mastela Fruit, Yggdrasil Seed or Orange Juice + set @itemIDfromList, callfunc("F_RandMes",4,512,522,608,620); + + //again, say stuff according to player's gender + mes "Hey, "+callfunc("F_Sex","sister!","brother!")+" I have "+getitemname(@itemIDfromList)+" for you!"; + + //get the item from the list + getitem @itemIDfromList,1; + close; + +M_BYE: + mes "[Luppy]"; + //add some random goodbye from Global_Functions.txt + mes callfunc("F_Bye"); + close; +} + +//Please, be more creative. Or else this li'l wolfy would eat you up! \ No newline at end of file diff --git a/doc/sample/npc_pcre.txt b/doc/sample/npc_pcre.txt new file mode 100644 index 000000000..906e076e3 --- /dev/null +++ b/doc/sample/npc_pcre.txt @@ -0,0 +1,392 @@ +prontera,152,181,5 script MouseJstr 763,{ + +// hello +Lquote0: + npctalk "How do you do. Please state your problem."; + end; + +// computer +Lquote1: + switch(rand(4)) { + case 0: npctalk "Do computers worry you?"; break; + case 1: npctalk "What do you think about machines?"; break; + case 2: npctalk "Why do you mention computers?"; break; + case 3: npctalk "What do you think machines have to do with your problem?"; break; + } + end; + +// name +Lquote2: + npctalk "I am not interested in names"; + end; + +// sorry +Lquote3: + switch(rand(3)) { + case 0: npctalk "Please don't apologize"; break; + case 1: npctalk "Apologies are not necessary"; break; + case 2: npctalk "What feelings do you have when you apologize"; break; + } + end; + +// I remember $@p2$ +Lquote4: + switch(rand(6)) { + case 0: npctalk "Do you often think of "+$@p2$+"?"; break; + case 1: npctalk "Does thinking of "+$@p2$+" bring anything else to mind?"; break; + case 2: npctalk "What else do you remember?"; break; + case 3: npctalk "Why do you recall "+$@p2$+" right now?"; break; + case 4: npctalk "What in the present situation reminds you of "+$@p2$+"?"; break; + case 5: npctalk "What is the connection between me and "+$@p2$+"?"; break; + } + end; + +// do you remember +Lquote5: + switch (rand(4)) { + case 0: npctalk "Did you think I would forget "+$@p2$+" ?"; break; + case 1: npctalk "Why do you think I should recall "+$@p2$+" now"; break; + case 2: npctalk "What about "+$@p2$+""; break; + case 3: npctalk "You mentioned "+$@p2$+""; break; + } + end; + +// if +Lquote6: + switch(rand(4)) { + case 0: npctalk "Do you really think its likely that "+$@p2$+""; break; + case 1: npctalk "Do you wish that "+$@p2$+"?"; break; + case 2: npctalk "What do you think about "+$@p2$+"?"; break; + case 3: npctalk "Really-- if "+$@p2$+"?"; break; + } + end; + +// i dreamt +Lquote7: + switch(rand(3)) { + case 0: npctalk "Really-- "+$@p2$+""; break; + case 1: npctalk "Have you ever fantasized "+$@p2$+" while you were awake?"; break; + case 2: npctalk "Have you dreamt "+$@p2$+" before?"; break; + } + end; + +// dream about +Lquote8: + npctalk "How do you feel about "+$@p2$+" in reality?"; + end; + +// dream +Lquote9: + switch(rand(4)) { + case 0: npctalk "What does this dream suggest to you?"; break; + case 1: npctalk "Do you dream often?"; break; + case 2: npctalk "What persons appear in your dreams?"; break; + case 3: npctalk "Don't you believe that dream has to do with your problem?"; break; + } + end; + +// my mother +Lquote10: + switch(rand(2)) { + case 0: npctalk "Who else in your family "+$@p2$+""; break; + case 1: npctalk "Tell me more about your family"; break; + } + end; + +// my father +Lquote11: + switch(rand(3)) { + case 0: npctalk "Your father"; break; + case 1: npctalk "Does he influence you strongly?"; break; + case 2: npctalk "What else comes to mind when you think of your father?"; break; + } + end; + +// I want +Lquote12: + switch(rand(3)) { + case 0: npctalk "What would it mean if you got "+$@p2$+""; break; + case 1: npctalk "Why do you want "+$@p2$+""; break; + case 2: npctalk "Suppose you got "+$@p2$+" soon"; break; + } + end; + +// I am glad +Lquote13: + switch(rand(3)) { + case 0: npctalk "How have I helped you to be "+$@p2$+""; break; + case 1: npctalk "What makes you happy just now"; break; + case 2: npctalk "Can you explain why you are suddenly "+$@p2$+""; break; + } + end; + +// I am sad +Lquote14: + switch(rand(2)) { + case 0: npctalk "I am sorry to hear you are depressed"; break; + case 1: npctalk "I'm sure its not pleasant to be sad"; break; + } + end; + +// $@p2 are like "+$@p3$+" +Lquote15: + npctalk "What resemblance do you see between "+$@p2$+" and "+$@p3$+""; + end; + +// "+$@p2$+" is like "+$@p3$+" +Lquote16: + switch(rand(4)) { + case 0: npctalk "In what way is it that "+$@p2$+" is like "+$@p3$+""; break; + case 1: npctalk "What resemblance do you see?"; break; + case 2: npctalk "Could there really be some connection?"; break; + case 3: npctalk "How?"; break; + } + end; + +// alike +Lquote17: + switch(rand(2)) { + case 0: npctalk "In what way?"; break; + case 1: npctalk "What similarities are there?"; break; + } + end; + +// same +Lquote18: + npctalk "What other connections do you see?"; + end; + +// I was "+$@p2$+" +Lquote19: + switch(rand(3)) { + case 0: npctalk "Were you really?"; break; + case 1: npctalk "Perhaps I already knew you were "+$@p2$+""; break; + case 2: npctalk "Why do you tell me you were "+$@p2$+" now?"; break; + } + end; + +// was I +Lquote20: + switch(rand(3)) { + case 0: npctalk "What if you were "+$@p2$+" ?"; break; + case 1: npctalk "Do you thin you were "+$@p2$+""; break; + case 2: npctalk "What would it mean if you were "+$@p2$+""; break; + } + end; + +// I am +Lquote21: + switch(rand(2)) { + case 0: npctalk "In what way are you "+$@p2$+""; break; + case 1: npctalk "Do you want to be "+$@p2$+" ?"; break; + } + end; + +// am I +Lquote22: + switch(rand(4)) { + case 0: npctalk "Do you believe you are "+$@p2$+""; break; + case 1: npctalk "Would you want to be "+$@p2$+""; break; + case 2: npctalk "You wish I would tell you you are "+$@p2$+""; break; + case 3: npctalk "What would it mean if you were "+$@p2$+""; break; + } + end; + +// am +Lquote23: + switch(rand(2)) { + case 0: npctalk "Why do you say AM?"; break; + case 1: npctalk "I don't understand that"; break; + } + end; + +// are you +Lquote24: + switch(rand(3)) { + case 0: npctalk "Why are you interested in whether I am "+$@p2$+" or not?"; break; + case 1: npctalk "Would you prefer if I weren't "+$@p2$+""; break; + case 2: npctalk "Perhaps I am "+$@p2$+" in your fantasies"; break; + } + end; + +// you are +Lquote25: + npctalk "What makes you think I am "+$@p2$+" ?"; + end; + +// because +Lquote26: + switch(rand(3)) { + case 0: npctalk "Is that the real reason?"; break; + case 1: npctalk "What other reasons might there be?"; break; + case 2: npctalk "Does that reason seem to explain anything else?"; break; + } + end; + +// were you +Lquote27: + switch(rand(3)) { + case 0: npctalk "Perhaps I was "+$@p2$+""; break; + case 1: npctalk "What do you think?"; break; + case 2: npctalk "What if I had been "+$@p2$+""; break; + } + end; + +// I can't +Lquote28: + switch(rand(2)) { + case 0: npctalk "Maybe you could "+$@p3$+" now"; break; + case 1: npctalk "What if you could "+$@p3$+" ?"; break; + } + end; + +// I feel +Lquote29: + npctalk "Do you often feel "+$@p2$+" ?"; + end; + +// I felt +Lquote30: + npctalk "What other feelings do you have?"; + end; + +// $@p1$ I $@p2$ you $@p3$ +Lquote31: + npctalk "Perhaps in your fantasy we "+$@p3$+" each other?"; + end; + +// why don't you +Lquote32: + switch(rand(3)) { + case 0: npctalk "Should you "+$@p3$+" yourself?"; break; + case 1: npctalk "Do you believe I don't "+$@p3$+""; break; + case 2: npctalk "Perhaps I will "+$@p3$+" in good time"; break; + } + end; + +// yes +Lquote33: + switch(rand(3)) { + case 0: npctalk "You seem quite positive"; break; + case 1: npctalk "You are sure?"; break; + case 2: npctalk "I understand"; break; + } + end; + +// no +Lquote34: + switch(rand(3)) { + case 0: npctalk "Why not?"; break; + case 1: npctalk "You are being a bit negative"; break; + case 2: npctalk "Are you saying NO just to be negative?"; break; + } + end; + +// someone +Lquote35: + npctalk "Can you be more specific?"; + end; + +// everyone +Lquote36: + switch(rand(4)) { + case 0: npctalk "surely not everyone"; break; + case 1: npctalk "Can you think of anyone in particular?"; break; + case 2: npctalk "Who for example?"; break; + case 3: npctalk "You are thinking of a special person?"; break; + } + end; + +// always +Lquote37: + switch(rand(4)) { + case 0: npctalk "Can you think of a specific example?"; break; + case 1: npctalk "When?"; break; + case 2: npctalk "What incident are you thinking of?"; break; + case 3: npctalk "Really-- always?"; break; + } + end; + +// what +Lquote38: + switch(rand(5)) { + case 0: npctalk "Why do you ask?"; break; + case 1: npctalk "Does that question interest you?"; break; + case 2: npctalk "What is it you really want to know?"; break; + case 3: npctalk "What do you think?"; break; + case 4: npctalk "What comes to your mind when you ask that?"; break; + } + end; + +// perhaps +Lquote39: + npctalk "You do not seem quite certain"; + end; + +// are +Lquote40: + switch(rand(2)) { + case 0: npctalk "Did you think they might not be "+$@p2$+""; break; + case 1: npctalk "Possibly they are "+$@p2$; break; + } + end; + +// default +Lquote41: + switch(rand(6)) { + case 0: npctalk "Very interesting"; break; + case 1: npctalk "I am not sure I understand you fully"; break; + case 2: npctalk "What does that suggest to you?"; break; + case 3: npctalk "Please continue"; break; + case 4: npctalk "Go on"; break; + case 5: npctalk "Do you feel strongly about discussing such things?"; break; + } + end; + +OnInit: + defpattern 1, "([^:]+):.*\\shello.*", "Lquote0"; + defpattern 1, "([^:]+):.*\\scomputer.*", "Lquote1"; + defpattern 1, "([^:]+):.*\\sname.*", "Lquote2"; + defpattern 1, "([^:]+):.*\\ssorry.*", "Lquote3"; + defpattern 1, "([^:]+):.*\\si\\s+remember\\s+(.*)", "Lquote4"; + defpattern 1, "([^:]+):.*\\sdo\\s+you\\s+remember\\s+(.*)", "Lquote5"; + defpattern 1, "([^:]+):.*\\sif\\s+(.*)", "Lquote6"; + defpattern 1, "([^:]+):.*\\si\\s+dreamt\\s+(.*)", "Lquote7"; + defpattern 1, "([^:]+):.*\\sdream\\s+about\\s+(.*)", "Lquote8"; + defpattern 1, "([^:]+):.*\\sdream\\s+(.*)", "Lquote9"; + defpattern 1, "([^:]+):.*\\smy\\s+mother\\s+(.*)", "Lquote10"; + defpattern 1, "([^:]+):.*\\smy\\s+father\\s+(.*)", "Lquote11"; + defpattern 1, "([^:]+):.*\\si\\s+want\\s+(.*)", "Lquote12"; + defpattern 1, "([^:]+):.*\\si\\s+am\\s+glad\\s+(.*)", "Lquote13"; + defpattern 1, "([^:]+):\\s+(.*)\\s+i\\s+am\\s+sad\\s+(.*)", "Lquote14"; + defpattern 1, "([^:]+):\\s+(.*)\\s+are\\s+like\\s+(.*)", "Lquote15"; + defpattern 1, "([^:]+):\\s+(.*)\\s+is\\s+like\\s+(.*)", "Lquote16"; + defpattern 1, "([^:]+):.*\\salike\\s+(.*)", "Lquote17"; + defpattern 1, "([^:]+):.*\\ssame\\s+(.*)", "Lquote18"; + defpattern 1, "([^:]+):.*\\si\\s+was\\s+(.*)", "Lquote19"; + defpattern 1, "([^:]+):.*\\swas\\s+i\\s+(.*)", "Lquote20"; + defpattern 1, "([^:]+):.*\\si\\s+am\\s+(.*)", "Lquote21"; + defpattern 1, "([^:]+):.*\\sam\\s+i\\s+(.*)", "Lquote22"; + defpattern 1, "([^:]+):.*\\sam\\s+(.*)", "Lquote23"; + defpattern 1, "([^:]+):.*\\sare\\s+you\\s+(.*)", "Lquote24"; + defpattern 1, "([^:]+):.*\\syou\\s+are\\s+(.*)", "Lquote25"; + defpattern 1, "([^:]+):.*\\sbecause\\s+(.*)", "Lquote26"; + defpattern 1, "([^:]+):.*\\swere\\s+you\\s+(.*)", "Lquote27"; + defpattern 1, "([^:]+):.*\\si\\s+(cant|can't|cannot)\\s+(.*)", "Lquote28"; + defpattern 1, "([^:]+):.*\\si\\s+feel\\s+(.*)", "Lquote29"; + defpattern 1, "([^:]+):.*\\si\\s+felt\\s+(.*)", "Lquote30"; + defpattern 1, "([^:]+):.*\\si\\s+(.*)\\s+you\\s+(.*)", "Lquote31"; + defpattern 1, "([^:]+):.*\\swhy\\s+(don't|dont)\\s+you\\s+(.*)", "Lquote32"; + defpattern 1, "([^:]+):.*\\syes\\s+(.*)", "Lquote33"; + defpattern 1, "([^:]+):.*\\sno\\s+(.*)", "Lquote34"; + defpattern 1, "([^:]+):.*\\ssomeone\\s+(.*)", "Lquote35"; + defpattern 1, "([^:]+):.*\\severyone\\s+(.*)", "Lquote36"; + defpattern 1, "([^:]+):.*\\salways\\s+(.*)", "Lquote37"; + defpattern 1, "([^:]+):.*\\swhat\\s+(.*)", "Lquote38"; + defpattern 1, "([^:]+):.*\\sperhaps\\s+(.*)", "Lquote39"; + defpattern 1, "([^:]+):.*\\sare\\s+(.*)", "Lquote40"; + defpattern 1, "([^:]+):(.*)", "Lquote41"; + + activatepset 1; + end; +} diff --git a/doc/sample/npc_sample.txt b/doc/sample/npc_sample.txt new file mode 100644 index 000000000..9dce66094 --- /dev/null +++ b/doc/sample/npc_sample.txt @@ -0,0 +1,456 @@ +// +// Athena Sample Script +// (c) 2003 Athena Project. +// +// $Id: npc_sample.txt,v 1.1.1.1 2004/09/10 17:26:47 MagicalTux Exp $ + +// このファイルは、Athenaで使用されるスクリプトの解説と使用例のサンプルと +// なっています。 + +// ============= +// *基本的な書式 +// ============= +// \t\t\t +// \tはTABをあらわします。 +// command は "warp" / "monster" / "shop" / "script" のいずれかになります。 +// 各行において"//"以降はコメントとして無視されます。 +// 以下、個々について解説をしていきます。 +// +// 書式中とかかれている部分はnという文字ではなく、任意の文字列/値を示します。 +// また、[n]は必要に応じて指定する任意の文字列/値となっています。 + +// ======== +// *command +// ======== +// +// --------------- +// *通常warp(warp) +// --------------- +// 書式 : ,, warp ,,[],, +// +// - マップデータファイル名。拡張子は必須です。 +// , - ワープポイントの中心座標(x,y) +// - npc名。一文字以上の任意の文字で指定します。ユニークな名前である必要はありません。 +// 実際には表示されません。 +// , - 動作範囲(x,y) を中心に(dx+1,dy+1)の範囲にPCが来ると発動します +// ,, - +// 移動先のマップデータファイル名,座標(x,y) +// destination_gatnameについては拡張子""はあっても無くても構いません。 +// 移動先のmapデータファイルが存在しない(あるいはmap_configで指定されていない)場合は発動しません。 +// 移動先の座標が進入禁止区域であった場合は、ランダムな座標にワープします。 +// また、同一座標に複数のwarpが置かれていた場合、先に記述されているものが有効になります +// これは、confファイル内で指定される、npc*.txtファイルをまたいでwarpを記述するときも同じことがいえます。 +// 例: +prontera,156,185,4 warp sample1 0,0,prontera,156,225 +prontera,156,185,4 warp sample1a 0,0,prontera,156,230 +// sample1の方が先に記述されているので、156,225に移動します +prontera,156,220,4 warp sample1-1 0,0,prontera,156,180 + +// -------------------- +// *モンスター(monster) +// -------------------- +// 書式:,,[,,] monster ,[,,] +// - マップデータファイル名。拡張子は必須です。 +// , - 初期配置座標(x,y) 0,0であればランダムな位置に配置されます。 +// [,,] - 特定範囲内に配置する時に指定します。 +// - マウスカーソルを合わせたときに表示される名前。名前は一文字以上指定してください +// - キャラクター種。詳細についてはお察しください(db/mob_db.txtが参考になると思いますが...) +// - 配置数 +// [,,] - 同一pc_idをもつモンスターの生成時間についての定義 +// 前回出現時間+出現遅延1,倒された時間+出現遅延2,倒された時間+5秒 で算出される値のうち、最も大きい物を +// 出現時間とします +// 例: +prontera,0,0 monster ポリン 1002,5 + +// --------- +// *店(shop) +// --------- +// 書式:,,, shop ,:[,:[,.....:]] +// - マップデータファイル名。拡張子は必須です。 +// , - NPCの配置座標(x,y) +// - npcの向いている方向。0を北(y座標方向+)として、反時計回り45度きざみになっています +// - マウスカーソルを合わせたときに表示される名前。名前は一文字以上指定してください +// - キャラクター種。詳細についてはお察しください +// : - item_id_Nの商品を価格price_Nとして販売物ウインドウに表示します。 +// item_idについてはdb/item_db.txtを参照してください。 +// 例: +prontera,136,203,6 shop 道具商人 73,501:5,502:20,503:55,504:120,506:20,645:80,656:150,601:30,602:30,611:20,610:400 + +// -====================- +// *NPCスクリプト(script) +// -====================- +// 書式: +// ,,, script [,,],{